From 14b2ad157c07f805dd6ec92eef899cb30482b203 Mon Sep 17 00:00:00 2001 From: Armijn Hemel Date: Wed, 31 Aug 2005 12:02:28 +0000 Subject: [PATCH] add logging capabilities. Install log is now copied to /root/install-log. svn path=/nixu/trunk/; revision=3759 --- fill-disk.sh | 4 ++++ init.sh | 3 +++ make-disk.sh | 10 +++++++++- 3 files changed, 16 insertions(+), 1 deletion(-) create mode 100644 init.sh diff --git a/fill-disk.sh b/fill-disk.sh index 37600769e8f9..6ae875cab949 100755 --- a/fill-disk.sh +++ b/fill-disk.sh @@ -337,6 +337,10 @@ title NixOS kernel @kernel@/vmlinuz root=$device GRUBEND +echo copying install log + +cp /tmp/install-log $root/root + echo umounting filesystem umount $root diff --git a/init.sh b/init.sh new file mode 100644 index 000000000000..b7ab17f20af7 --- /dev/null +++ b/init.sh @@ -0,0 +1,3 @@ +#! @bash@/bin/sh -e + +exec ./fill-disk.sh | @coreutils@/bin/tee /tmp/install-log diff --git a/make-disk.sh b/make-disk.sh index 5cb46a2b2148..115cd722bfad 100755 --- a/make-disk.sh +++ b/make-disk.sh @@ -12,6 +12,7 @@ validatePaths=$archivesDir/validatepaths bootiso=/tmp/nixos.iso initrd=/tmp/initram.img initdir=${archivesDir}/initdir +initscript=$archivesDir/scripts/init.sh echo cleaning old build @@ -147,6 +148,10 @@ echo copying scripts mkdir ${archivesDir}/scripts cp -fa * ${archivesDir}/scripts +sed -e "s^@bash\@^$bash^g" \ + -e "s^@coreutils\@^$coreutilsdiet^g" \ + < $initscript > $initscript.tmp +mv $initscript.tmp $initscript sed -e "s^@sysvinitPath\@^$sysvinitPath^g" \ -e "s^@bootPath\@^$bootPath^g" \ -e "s^@NIX_CMD_PATH\@^$nix^g" \ @@ -183,9 +188,12 @@ cp -L $kernel/vmlinuz ${archivesDir}/isolinux echo creating ramdisk rm -f ${initrd} -cp ${archivesDir}/scripts/fill-disk.sh ${initdir}/init +#cp ${archivesDir}/scripts/fill-disk.sh ${initdir}/init +cp ${archivesDir}/scripts/fill-disk.sh ${initdir}/ +cp ${archivesDir}/scripts/init.sh ${initdir}/init ln -s ${bash}/bin/bash ${initdir}/bin/sh chmod u+x ${initdir}/init +chmod u+x ${initdir}/fill-disk.sh cp -fau --parents ${bashdeps} ${initdir} cp -fau --parents ${utilLinux} ${initdir} cp -fau --parents ${coreUtilsDiet} ${initdir}