From db08678bd4a6d102eaf51092255059fea2603d66 Mon Sep 17 00:00:00 2001 From: Eelco Dolstra Date: Sat, 4 Nov 2006 00:18:22 +0000 Subject: [PATCH] * Create dummy mount points in the ISO image for /proc etc. svn path=/nixu/trunk/; revision=6946 --- test/boot-stage-1-init.sh | 4 ++-- test/boot-stage-2-init.sh | 10 +++++----- test/rescue-system.nix | 11 +++++++++++ 3 files changed, 18 insertions(+), 7 deletions(-) diff --git a/test/boot-stage-1-init.sh b/test/boot-stage-1-init.sh index 2100d864d043..091dc4310de3 100644 --- a/test/boot-stage-1-init.sh +++ b/test/boot-stage-1-init.sh @@ -18,9 +18,9 @@ done mkdir /etc # to shut up mount touch /etc/fstab # idem mkdir /proc -mount -t proc proc /proc +mount -t proc none /proc mkdir /sys -mount -t sysfs sys /sys +mount -t sysfs none /sys # Create device nodes in /dev. source @makeDevices@ diff --git a/test/boot-stage-2-init.sh b/test/boot-stage-2-init.sh index 4be4a29de2d1..a9e9c63708b2 100644 --- a/test/boot-stage-2-init.sh +++ b/test/boot-stage-2-init.sh @@ -17,12 +17,12 @@ for i in @path@; do done # Mount special file systems. -mkdir /etc # to shut up mount +mount -t tmpfs none /etc -n # to shut up mount touch /etc/fstab # idem -mkdir /proc -mount -t proc proc /proc -mkdir /sys -mount -t sysfs sys /sys +mount -t proc none /proc +mount -t sysfs none /sys +mount -t tmpfs none /dev +mount -t tmpfs none /tmp # Create device nodes in /dev. source @makeDevices@ diff --git a/test/rescue-system.nix b/test/rescue-system.nix index b20a662c5997..da1c25444010 100644 --- a/test/rescue-system.nix +++ b/test/rescue-system.nix @@ -64,6 +64,14 @@ rec { }; + # Since the CD is read-only, the mount points must be on disk. + cdMountPoints = pkgs.stdenv.mkDerivation { + name = "mount-points"; + builder = builtins.toFile "builder.sh" + "source $stdenv/setup; mkdir $out; cd $out; mkdir proc sys tmp etc dev"; + }; + + # Create an ISO image containing the isolinux boot loader, the # kernel, and initrd produced above. rescueCD = import ./make-iso9660-image.nix { @@ -83,6 +91,9 @@ rec { { source = initialRamdisk + "/initrd"; target = "isolinux/initrd"; } + { source = cdMountPoints; + target = "/"; + } ]; init = bootStage2;