build-support/vm: Use devtmpfs, not static device nodes

In 2017, there is no reason to create a static /dev.
This commit is contained in:
Tuomas Tynkkynen 2017-12-06 20:28:43 +02:00
parent 2d4fdc1b9e
commit 0d27df280f
2 changed files with 1 additions and 23 deletions

View File

@ -150,8 +150,6 @@ in pkgs.vmTools.runInLinuxVM (
} }
'' ''
${if partitioned then '' ${if partitioned then ''
. /sys/class/block/vda1/uevent
mknod /dev/vda1 b $MAJOR $MINOR
rootDisk=/dev/vda1 rootDisk=/dev/vda1
'' else '' '' else ''
rootDisk=/dev/vda rootDisk=/dev/vda

View File

@ -60,21 +60,6 @@ rec {
''; # */ ''; # */
createDeviceNodes = dev:
''
mknod -m 666 ${dev}/null c 1 3
mknod -m 666 ${dev}/zero c 1 5
mknod -m 666 ${dev}/full c 1 7
mknod -m 666 ${dev}/random c 1 8
mknod -m 666 ${dev}/urandom c 1 9
mknod -m 666 ${dev}/tty c 5 0
mknod -m 666 ${dev}/ttyS0 c 4 64
mknod ${dev}/rtc c 254 0
. /sys/class/block/${hd}/uevent
mknod ${dev}/${hd} b $MAJOR $MINOR
'';
stage1Init = writeScript "vm-run-stage1" '' stage1Init = writeScript "vm-run-stage1" ''
#! ${initrdUtils}/bin/ash -e #! ${initrdUtils}/bin/ash -e
@ -109,8 +94,7 @@ rec {
insmod $i insmod $i
done done
mount -t tmpfs none /dev mount -t devtmpfs devtmpfs /dev
${createDeviceNodes "/dev"}
ifconfig lo up ifconfig lo up
@ -302,7 +286,6 @@ rec {
touch /mnt/.debug touch /mnt/.debug
mkdir /mnt/proc /mnt/dev /mnt/sys mkdir /mnt/proc /mnt/dev /mnt/sys
${createDeviceNodes "/mnt/dev"}
''; '';
@ -353,7 +336,6 @@ rec {
${kmod}/bin/modprobe iso9660 ${kmod}/bin/modprobe iso9660
${kmod}/bin/modprobe ufs ${kmod}/bin/modprobe ufs
${kmod}/bin/modprobe cramfs ${kmod}/bin/modprobe cramfs
mknod /dev/loop0 b 7 0
mkdir -p $out mkdir -p $out
mkdir -p tmp mkdir -p tmp
@ -377,8 +359,6 @@ rec {
${kmod}/bin/modprobe mtdblock ${kmod}/bin/modprobe mtdblock
${kmod}/bin/modprobe jffs2 ${kmod}/bin/modprobe jffs2
${kmod}/bin/modprobe zlib ${kmod}/bin/modprobe zlib
mknod /dev/mtd0 c 90 0
mknod /dev/mtdblock0 b 31 0
mkdir -p $out mkdir -p $out
mkdir -p tmp mkdir -p tmp