Check-in [8cb34303da]
Not logged in

Many hyperlinks are disabled.
Use anonymous login to enable hyperlinks.

Overview

SHA1 Hash:8cb34303dadc935a918dede367cd2bed32faceeb
Date: 2012-05-12 09:04:45
User: BarryK
Comment:01micko: remasterpup2: support xz squashfs, ref forum viewtopic.php?p=623475#623475

Tags And Properties
Changes

Changes to woof-code/rootfs-skeleton/usr/sbin/remasterpup2

@@ -37,10 +37,11 @@
 #110505 support sudo for non-root user.
 #110722 tweak sort.
 #110808 PANZERKOPF: bug fix. 110822 reverted.
 #120323 replace 'xmessage' with 'pupmessage'.
 #120329 Xdialog bug --yesno supposed to "yes" "No" buttons, but they are "OK" "Cancel".
+#120512 01micko: support xz compression.
 
 [ "`whoami`" != "root" ] && exec sudo -A ${0} ${@} #110505
 
 Yes_lbl="Yes"
 No_lbl="No"
@@ -237,10 +238,25 @@
 BURNERDRV="`echo -n "$BURNERDRV" | cut -f 3 -d '/'`"
 }
 
 LANG=C #faster, plus Xdialog happier.
 KERNELVER="`uname -r`"
+
+#120512 01micko: set compression
+COMP=""
+mksquashfs -help &>/tmp/mk #refuses to grep from stdout
+grep 'xz' /tmp/mk &>/dev/null
+[ "$?" = "0" ] && COMP="-comp xz"
+ARCH="`uname -m`"
+[ "$(uname -m|grep ^i)" ] && ARCH="`uname -m|cut -c3,4`"
+case "$ARCH" in
+86)AOPT="-Xbcj x86" ;;
+*)AOPT="" ;; #todo add other arches
+esac
+rm /tmp/mk
+COPTIONS=""${COMP}" "${AOPT}""
+#end set compression
 
 #variables created at bootup by /initrd/usr/sbin/init...
 . /etc/rc.d/PUPSTATE
 [ "$PUP_LAYER" = "" ] && PUP_LAYER="/pup_ro2"
 
@@ -507,12 +523,12 @@
 if [ "$MKZDRV" = "yes" ]; then
   rm -f $WKGMNTPT/puppylivecdbuild/$ZDRVSFS
   mksquashfs /lib $WKGMNTPT/puppylivecdbuild/$ZDRVSFS -keep-as-directory -e /lib/[^m]* $ANOTHER_REMOVE
   ANOTHER_REMOVE="/lib/modules"
 fi
-# display terminal only for the first stage because it takes the most of time. 'squash' is a function, see above.
-squash / $WKGMNTPT/puppylivecdbuild/$PUPPYSFS -e /etc /proc /initrd /var /tmp /archive /mnt /root /puppylivecdbuild $ANOTHER_REMOVE $DIRHOME $DIRSYS $DIRLOST /$PUPPYSFS
+# display terminal only for the first stage because it takes the most of time. 'squash' is a function, see above. 120512 $COPTIONS added...
+squash / $WKGMNTPT/puppylivecdbuild/$PUPPYSFS ${COPTIONS} -e /etc /proc /initrd /var /tmp /archive /mnt /root /puppylivecdbuild $ANOTHER_REMOVE $DIRHOME $DIRSYS $DIRLOST /$PUPPYSFS
 sync
 
 #add pristine folders (out of current puppy.sfs)...
 mksquashfs /initrd${PUP_LAYER}/proc $WKGMNTPT/puppylivecdbuild/$PUPPYSFS -keep-as-directory
 sync
@@ -689,10 +705,12 @@
 
 eval m_23=\"$m_23\"
 Xdialog --wrap --left  --title "$m_01" --msgbox "$m_23" 0 0
 
 sync
+
+
 mksquashfs /tmp/etc $WKGMNTPT/puppylivecdbuild/$PUPPYSFS -keep-as-directory
 sync
 rm -rf /tmp/etc
 #######END WORKING ON /etc#######