diff --git a/fill-disk.sh b/fill-disk.sh index fc3bb782e9d..65499c7df83 100755 --- a/fill-disk.sh +++ b/fill-disk.sh @@ -1,6 +1,6 @@ #! @bash@/bin/sh -e -export PATH=@bash@/bin:@coreutilsdiet@/bin:@coreutils@/bin:@findutils@/bin:@utillinux@/bin:@utillinux@/sbin:@e2fsprogs@/sbin:@grub@/sbin:@sysvinitPath@/sbin:@gnugrep@/bin:@which@/bin:@gnutar@/bin +export PATH=@bash@/bin:@coreutilsdiet@/bin:@coreutils@/bin:@findutils@/bin:@utillinux@/bin:@utillinux@/sbin:@e2fsprogs@/sbin:@grub@/sbin:@sysvinitPath@/sbin:@gnugrep@/bin:@which@/bin:@gnutar@/bin:@eject@/bin ## ## In the beginning we want to have a minimalistic environment, built with @@ -187,7 +187,7 @@ mknod -m 0600 $root/dev/tty1 c 4 1 mknod -m 0444 $root/dev/urandom c 1 9 rm -f $root/etc/mtab -#ln -s /proc/mounts $root/etc/mtab +ln -s /proc/mounts $root/etc/mtab ## Probe for CD device which contains our CD here and mount /nix and ## /nixpkgs from it inside the ramdisk. Anaconda uses kudzu for this. @@ -198,15 +198,15 @@ DEVICES="/dev/hd?" for i in ${DEVICES} do echo "Looking for CDROM in: $i" -if mount -t iso9660 $i /cdrom >/dev/null 2>&1 -then - if test -f /cdrom/NIXOS + if mount -t iso9660 $i /cdrom >/dev/null 2>&1 then - cddevice=$i - echo "Accessing NixOS CDROM at $i" - break + if test -f /cdrom/NIXOS + then + cddevice=$i + echo "Accessing NixOS CDROM at $i" + break + fi fi -fi done echo switch to /nix and /nixpkgs from CD @@ -327,6 +327,7 @@ ln -s @hotplug@/sbin/hotplug $root/sbin/hotplug ln -s @hotplug@/etc/hotplug $root/etc/hotplug ln -s @hotplug@/etc/hotplug.d $root/etc/hotplug.d ln -s $device $root/dev/root +ln -s @sysvinitPath@/sbin/init /sbin/init echo installing bootloader @@ -348,11 +349,12 @@ cp /tmp/install-log $root/root echo umounting filesystem umount $root +#umount /nix umount /cdrom +#echo ejecting $cddevice +#eject $cddevice echo install done -ln -s @sysvinitPath@/sbin/init /sbin/init - echo it\'s safe to turn off your machine while true; do diff --git a/make-disk.sh b/make-disk.sh index aad35e52d2e..7f6be2694e6 100755 --- a/make-disk.sh +++ b/make-disk.sh @@ -87,6 +87,7 @@ nano=$($NIX_CMD_PATH/nix-store -r $(echo '(import ./pkgs.nix).nano' | $NIX_CMD_P gnugrep=$($NIX_CMD_PATH/nix-store -r $(echo '(import ./pkgs.nix).gnugrep' | $NIX_CMD_PATH/nix-instantiate -)) which=$($NIX_CMD_PATH/nix-store -r $(echo '(import ./pkgs.nix).which' | $NIX_CMD_PATH/nix-instantiate -)) gnutar=$($NIX_CMD_PATH/nix-store -r $(echo '(import ./pkgs.nix).gnutar' | $NIX_CMD_PATH/nix-instantiate -)) +eject=$($NIX_CMD_PATH/nix-store -r $(echo '(import ./pkgs.nix).eject' | $NIX_CMD_PATH/nix-instantiate -)) #(while read storepath; do #cp -fa --parents ${storepath} ${archivesDir} @@ -168,6 +169,7 @@ sed -e "s^@sysvinitPath\@^$sysvinitPath^g" \ -e "s^@hotplug\@^$hotplug^g" \ -e "s^@gnugrep\@^$gnugrep^g" \ -e "s^@which\@^$which^g" \ + -e "s^@eject\@^$eject^g" \ -e "s^@gnutar\@^$gnutar^g" \ -e "s^@mingetty\@^$mingettyWrapper^g" \ < $fill_disk > $fill_disk.tmp @@ -223,9 +225,9 @@ cp -fau --parents ${coreUtilsDiet} ${initdir} cp -fau --parents ${e2fsProgs} ${initdir} cp -fau --parents ${modUtils} ${initdir} cp -fau --parents ${hotplug} ${initdir} -#cp -fau --parents ${which} ${initdir} +cp -fau --parents ${eject} ${initdir} -touch ${initdir}/NIXOS +touch ${archivesDir}/NIXOS (cd ${initdir}; find . |cpio -H newc -o) | gzip -9 > ${initrd} diff --git a/pkgs.nix b/pkgs.nix index fff17e9921d..78d6805dee8 100644 --- a/pkgs.nix +++ b/pkgs.nix @@ -5,7 +5,7 @@ rec { nettools nix subversion gcc wget which vim less screen openssh binutils strace shadowutils iputils gnumake curl gnused gnutar gnugrep gzip mingettyWrapper grubWrapper syslinux parted module_init_tools hotplug udev - dhcpWrapper man nano; + dhcpWrapper man nano eject; boot = (import ./boot) {inherit stdenv kernel bash coreutils findutilsWrapper utillinux sysvinit e2fsprogs nettools nix subversion gcc wget which vim @@ -15,7 +15,7 @@ rec { init = (import ./init) {inherit stdenv bash coreutilsDiet utillinux e2fsprogsDiet nix shadowutils mingettyWrapper grubWrapper parted module_init_tools hotplug - dhcpWrapper man nano;}; + dhcpWrapper man nano eject;}; - everything = [boot sysvinit kernel]; + everything = [boot sysvinit kernel eject]; }