livecd: remaster/livecd_gen_iso - trap SIGINT to recover proper st...
havner
havner at pld-linux.org
Fri Jul 7 10:35:38 CEST 2006
Author: havner Date: Fri Jul 7 08:35:38 2006 GMT
Module: livecd Tag: HEAD
---- Log message:
- trap SIGINT to recover proper state of dirs in case of cancelation during
making cd
---- Files affected:
livecd/remaster:
livecd_gen_iso (1.16 -> 1.17)
---- Diffs:
================================================================
Index: livecd/remaster/livecd_gen_iso
diff -u livecd/remaster/livecd_gen_iso:1.16 livecd/remaster/livecd_gen_iso:1.17
--- livecd/remaster/livecd_gen_iso:1.16 Tue Jul 4 14:29:30 2006
+++ livecd/remaster/livecd_gen_iso Fri Jul 7 10:35:33 2006
@@ -9,6 +9,24 @@
check_config
check_deps busybox mksquashfs mkisofs
+fix_dirs() {
+rmdir $ROOTFS/bin
+rmdir $ROOTFS/sbin
+rmdir $ROOTFS/lib
+rmdir $ROOTFS/usr
+rmdir $ROOTFS/boot
+
+mv $SQUASHFS/bin-bind $ROOTFS/bin
+mv $SQUASHFS/sbin-bind $ROOTFS/sbin
+mv $SQUASHFS/lib-bind $ROOTFS/lib
+mv $SQUASHFS/usr-bind $ROOTFS/usr
+mv $SQUASHFS/boot-bind $ROOTFS/boot
+mv $SQUASHFS/* $ROOTFS/live/
+
+rmdir $SQUASHFS
+}
+
+
# preparation, external scripts
#echo "Running livecd_gen_initrd to prepare/fix livecd internal initrd."
@@ -25,6 +43,8 @@
chroot $ROOTFS /usr/local/bin/fix_live
echo done
+trap fix_dirs SIGINT
+
mkdir $SQUASHFS
mv $ROOTFS/bin $SQUASHFS/bin-bind
@@ -34,11 +54,11 @@
mv $ROOTFS/boot $SQUASHFS/boot-bind
mv $ROOTFS/live/* $SQUASHFS/
-mkdir $ROOTFS/bin
-mkdir $ROOTFS/sbin
-mkdir $ROOTFS/lib
-mkdir $ROOTFS/usr
-mkdir $ROOTFS/boot
+mkdir $ROOTFS/bin
+mkdir $ROOTFS/sbin
+mkdir $ROOTFS/lib
+mkdir $ROOTFS/usr
+mkdir $ROOTFS/boot
echo Generating initrd
rm -rf $CD/boot/initrd.gz
================================================================
---- CVS-web:
http://cvs.pld-linux.org/livecd/remaster/livecd_gen_iso?r1=1.16&r2=1.17&f=u
More information about the pld-cvs-commit
mailing list