mirror of
https://github.com/NixOS/nixpkgs.git
synced 2024-12-18 19:54:05 +00:00
* Use a diet udev in boot stage 1 to create the device nodes in /dev.
svn path=/nixos/trunk/; revision=7608
This commit is contained in:
parent
95ee289c9f
commit
cb10364838
@ -51,10 +51,6 @@ for o in $(cat /proc/cmdline); do
|
||||
done
|
||||
|
||||
|
||||
# Create device nodes in /dev.
|
||||
source @makeDevices@
|
||||
|
||||
|
||||
# Load some kernel modules.
|
||||
export MODULE_DIR=@modulesDir@/lib/modules/
|
||||
for i in @modules@; do
|
||||
@ -62,6 +58,15 @@ for i in @modules@; do
|
||||
done
|
||||
|
||||
|
||||
# Create device nodes in /dev.
|
||||
mknod -m 0666 /dev/null c 1 3
|
||||
export UDEV_CONFIG_FILE=/udev.conf
|
||||
echo 'udev_rules="/no-rules"' > $UDEV_CONFIG_FILE
|
||||
udevd --daemon
|
||||
udevtrigger
|
||||
udevsettle
|
||||
|
||||
|
||||
# Try to find and mount the root device.
|
||||
mkdir /mnt
|
||||
mkdir /mnt/root
|
||||
|
@ -33,7 +33,6 @@ substituteAll {
|
||||
module_init_tools
|
||||
extraUtils
|
||||
];
|
||||
makeDevices = ./make-devices.sh;
|
||||
|
||||
# We only want the path of the stage 2 init, we don't want it as a
|
||||
# dependency (since then it the stage 2 init would end up in the
|
||||
|
@ -1,46 +0,0 @@
|
||||
mknod -m 0600 /dev/ttyS0 c 4 64
|
||||
mknod -m 0600 /dev/ttyS1 c 4 65
|
||||
mknod -m 0600 /dev/ttyS2 c 4 66
|
||||
mknod -m 0600 /dev/ttyS3 c 4 67
|
||||
|
||||
# base UNIX devices
|
||||
mknod -m 0600 /dev/mem c 1 1
|
||||
mknod -m 0666 /dev/null c 1 3
|
||||
mknod -m 0666 /dev/zero c 1 5
|
||||
|
||||
# tty
|
||||
mknod -m 0600 /dev/tty c 5 0
|
||||
if ! test -e /dev/console; then
|
||||
mknod -m 0600 /dev/console c 5 1
|
||||
fi
|
||||
|
||||
mknod -m 0660 /dev/hda b 3 0
|
||||
mknod -m 0660 /dev/hda1 b 3 1
|
||||
mknod -m 0660 /dev/hda2 b 3 2
|
||||
mknod -m 0660 /dev/hda3 b 3 3
|
||||
|
||||
mknod -m 0660 /dev/hdb b 3 64
|
||||
mknod -m 0660 /dev/hdb1 b 3 65
|
||||
mknod -m 0660 /dev/hdb2 b 3 66
|
||||
mknod -m 0660 /dev/hdb3 b 3 67
|
||||
|
||||
mknod -m 0660 /dev/hdc b 22 0
|
||||
mknod -m 0660 /dev/hdc1 b 22 1
|
||||
mknod -m 0660 /dev/hdc2 b 22 2
|
||||
mknod -m 0660 /dev/hdc3 b 22 3
|
||||
|
||||
mknod -m 0660 /dev/hdd b 22 64
|
||||
mknod -m 0660 /dev/hdd1 b 22 65
|
||||
mknod -m 0660 /dev/hdd2 b 22 66
|
||||
mknod -m 0660 /dev/hdd3 b 22 67
|
||||
|
||||
mknod -m 0660 /dev/sda b 8 0
|
||||
mknod -m 0660 /dev/sda1 b 8 1
|
||||
mknod -m 0660 /dev/sda2 b 8 2
|
||||
mknod -m 0660 /dev/sda3 b 8 3
|
||||
mknod -m 0660 /dev/sda4 b 8 4
|
||||
mknod -m 0660 /dev/sda5 b 8 5
|
||||
mknod -m 0660 /dev/sda6 b 8 6
|
||||
mknod -m 0660 /dev/sda7 b 8 7
|
||||
|
||||
mknod -m 0660 /dev/sr0 b 11 0
|
@ -48,14 +48,17 @@ rec {
|
||||
extraUtils = pkgs.runCommand "extra-utils"
|
||||
{ buildInputs = [pkgs.nukeReferences];
|
||||
inherit (pkgsStatic) utillinux;
|
||||
inherit (pkgsDiet) udev;
|
||||
inherit (pkgs) splashutils;
|
||||
e2fsprogs = pkgs.e2fsprogsDiet;
|
||||
allowedReferences = []; # prevent accidents like glibc being included in the initrd
|
||||
}
|
||||
"
|
||||
ensureDir $out/bin
|
||||
cp $utillinux/bin/mount $utillinux/bin/umount $utillinux/sbin/pivot_root $out/bin
|
||||
cp -p $e2fsprogs/sbin/fsck* $e2fsprogs/sbin/e2fsck $out/bin
|
||||
cp $splashutils/bin/splash_helper $out/bin
|
||||
cp $udev/sbin/udevd $udev/sbin/udevtrigger $udev/sbin/udevsettle $out/bin
|
||||
nuke-refs $out/bin/*
|
||||
";
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user