livecd: remaster/livecd_gen_iso - cosmetics - fixed trap (POSIX) -...

havner havner at pld-linux.org
Tue Jul 11 14:48:23 CEST 2006


Author: havner                       Date: Tue Jul 11 12:48:23 2006 GMT
Module: livecd                        Tag: HEAD
---- Log message:
- cosmetics
- fixed trap (POSIX)
- check ret val of some commands

---- Files affected:
livecd/remaster:
   livecd_gen_iso (1.20 -> 1.21) 

---- Diffs:

================================================================
Index: livecd/remaster/livecd_gen_iso
diff -u livecd/remaster/livecd_gen_iso:1.20 livecd/remaster/livecd_gen_iso:1.21
--- livecd/remaster/livecd_gen_iso:1.20	Tue Jul 11 10:19:23 2006
+++ livecd/remaster/livecd_gen_iso	Tue Jul 11 14:48:18 2006
@@ -7,7 +7,7 @@
 
 check_root
 check_config
-check_deps busybox mksquashfs mkisofs
+check_deps_local busybox mkisofs mksquashfs
 
 fix_dirs() {
 rmdir $ROOTFS/bin 
@@ -39,13 +39,18 @@
 #	exit 1
 #fi
 
-echo -n "Running fix_live... "
-chroot $ROOTFS /usr/local/bin/fix_live
-echo done
+if [ -x $ROOTFS/usr/local/bin/fix_live ]; then
+	echo -n "Running fix_live... "
+	chroot $ROOTFS /usr/local/bin/fix_live
+	echo done
+fi
 
-trap fix_dirs SIGINT
+trap fix_dirs INT
 
-mkdir $SQUASHFS
+# try to fix directory structure
+if ! mkdir $SQUASHFS; then
+	fix_dirs
+fi
 
 mv $ROOTFS/bin $SQUASHFS/bin-bind
 mv $ROOTFS/sbin $SQUASHFS/sbin-bind
@@ -63,13 +68,15 @@
 echo -n "Generating initrd... "
 rm -rf $CD/boot/initrd.gz
 genromfs -f $CD/boot/initrd -d $INITRD -V "PLD initrd"
+[ "$?" != 0 ] && echo fail && exit 1
 busybox gzip $CD/boot/initrd
+[ "$?" != 0 ] && echo fail && exit 1
 # bootsplash
 if [ -r $ROOTFS/etc/sysconfig/bootsplash ] ; then
 	. $ROOTFS/etc/sysconfig/bootsplash
 fi
 if [ "$BOOT_SPLASH" = "yes" ]; then
-	if [ ! -x $ROOTFS/bin/splash.bin ]; then
+	if [ ! -x /bin/splash.bin ]; then
 		echo "Failed to execute /bin/splash.bin. Is bootsplash package installed?" 1>&2
 	elif [ -z "$THEME" ]; then
 		echo "Please configure your /etc/sysconfig/bootsplash first." 1>&2
@@ -78,7 +85,7 @@
 		if [ -n "$BOOT_SPLASH_RESOLUTIONS" ]; then
 			for res in $BOOT_SPLASH_RESOLUTIONS; do
 				if [ -f "$ROOTFS/etc/bootsplash/themes/$THEME/config/bootsplash-$res.cfg" ]; then
-					$ROOTFS/bin/splash.bin -s -f "$ROOTFS/etc/bootsplash/themes/$THEME/config/bootsplash-$res.cfg" >> $CD/boot/initrd && \
+					/bin/splash.bin -s -f "$ROOTFS/etc/bootsplash/themes/$THEME/config/bootsplash-$res.cfg" >> $CD/boot/initrd.gz && \
 					[ -n "$verbose" ] && echo "Added $res $THEME theme to initrd."
 				else
 					echo "/etc/bootsplash/themes/$THEME/config/bootsplash-$res.cfg doesn't exist, skipped" 1>&2
@@ -97,11 +104,13 @@
 rm -rf $CD/pldram
 cd $ROOTFS
 busybox tar -czf $CD/pldram *
+[ "$?" != 0 ] && echo fail && exit 1
 echo done
 
 echo "Generating squashfs... "
 rm -rf $CD/pldcd
 mksquashfs $SQUASHFS/ $CD/pldcd #-info
+[ "$?" != 0 ] && echo fail && exit 1
 chmod 644 $CD/pldcd
 cd $CD
 md5sum pldcd > $CD/pldcd.md5
@@ -122,7 +131,7 @@
 
 rmdir $SQUASHFS
 
-trap - SIGINT
+trap - INT
  
 echo "Generating pldcd.iso... "
 rm -f $MAINDIR/pldcd.iso
@@ -130,4 +139,5 @@
 mkisofs -J -R -V "PLD Live CD ${LIVECD_VERSION}" -o $ISODIR/pldcd.iso \
 -b boot/isolinux/isolinux.bin -c boot/isolinux/boot.cat \
 -no-emul-boot -boot-load-size 4 -boot-info-table .
+[ "$?" != 0 ] && echo fail && exit 1
 echo done
================================================================

---- CVS-web:
    http://cvs.pld-linux.org/livecd/remaster/livecd_gen_iso?r1=1.20&r2=1.21&f=u



More information about the pld-cvs-commit mailing list