# HG changeset patch # User Pascal Bellard # Date 1477030790 -7200 # Node ID 338b35b6174952c25ada9856ddb8bf42af207d9c # Parent 3202ae99962f4dce458bb67c8da5d5d7156eadda May use advdef diff -r 3202ae99962f -r 338b35b61749 tazlito --- a/tazlito Tue Oct 04 21:47:05 2016 +0100 +++ b/tazlito Fri Oct 21 08:19:50 2016 +0200 @@ -382,6 +382,12 @@ } +dogzip() { + gzip -9 > $1 + [ -x /usr/bin/advdef ] && advdef -qz4 $1 +} + + # Pack rootfs pack_rootfs() { @@ -393,7 +399,7 @@ ;; gzip) _ 'Creating %s with gzip compression...' 'initramfs' - gzip -9 > $2 + dogzip $2 ;; *) _ 'Creating %s with lzma compression...' 'initramfs' @@ -418,8 +424,7 @@ ;; gzip) _ 'Creating %s with gzip compression...' "$INITRAMFS" - cpio -o -H newc | gzip -9 > "/$INITRAMFS" - [ -x /usr/bin/advdef ] && advdef -z4 "/$INITRAMFS" + cpio -o -H newc | dogzip "/$INITRAMFS" ;; *) # align='y' @@ -610,7 +615,7 @@ rm "$1.$i" done # Info to be stored inside ISO - [ "$2" == info ] && echo -e $infos | cpio -o -H newc | gzip -9 > info + [ "$2" == info ] && echo -e $infos | cpio -o -H newc | dogzip info rm $1.list* # Renames @@ -634,7 +639,7 @@ # Pack flavor file from temp directory pack_flavor() { - (cd "$1"; ls | grep -v err | cpio -o -H newc) | gzip -9 > "$2.flavor" + (cd "$1"; ls | grep -v err | cpio -o -H newc) | dogzip "$2.flavor" } @@ -1086,7 +1091,7 @@ for i in $TMP_DIR/initfs/lib/modules/*z ; do unxz $i || gunzip $i || lzma d $i ${i%.gz} rm -f $i - gzip -9 ${i%.gz} + dogzip ${i%.gz} done 2>/dev/null (cd $TMP_DIR/initfs; find | busybox cpio -o -H newc 2>/dev/null) | \ lzma e $TMP_DIR/initfs.gz -si @@ -1872,7 +1877,7 @@ [ -s $i ] && cat $i >> $FLAVOR.mirrors done [ -s $FLAVOR.mirrors ] && $FILES="$FILES\n$FLAVOR.mirrors" - echo -e "$FLAVOR.desc\n$FILES" | cpio -o -H newc 2>/dev/null | gzip -9 > $FLAVOR.flavor + echo -e "$FLAVOR.desc\n$FILES" | cpio -o -H newc 2>/dev/null | dogzip $FLAVOR.flavor rm $(echo -e $FILES) status @@ -1991,7 +1996,7 @@ [ -d "$storage/$i" ] && cp -a "$storage/$i" "$tmp_dir" [ -n "$(ls $tmp_dir/$i)" ] && (cd "$tmp_dir/$i"; find . | cpio -o -H newc 2>/dev/null ) | \ - gzip -9 > "$tmp_dir/$flavor.$i" + dogzip "$tmp_dir/$flavor.$i" rm -rf "$tmp_dir/$i" done else @@ -1999,7 +2004,7 @@ for i in rootcd rootfs; do [ -d "$storage/$i" ] || continue (cd "$storage/$i"; - find . | cpio -o -H newc 2>/dev/null) | gzip -9 > "$tmp_dir/$flavor.$i" + find . | cpio -o -H newc 2>/dev/null) | dogzip "$tmp_dir/$flavor.$i" done fi @@ -2130,14 +2135,14 @@ for i in rootfs rootcd ; do [ -s $TMP_DIR/flavor/*.list$i ] && sed 's/.\{1,45\}//;/^\.$/d' $TMP_DIR/flavor/*.list$i | \ - ( cd $TMP_DIR/$i ; cpio -o -H newc ) | gzip -9 > $TMP_DIR/$FLAVOR.$i + ( cd $TMP_DIR/$i ; cpio -o -H newc ) | dogzip $TMP_DIR/$FLAVOR.$i done else find_flavor_rootfs $TMP_DIR/rootfs [ -d $TMP_DIR/rootfs/boot ] && mv $TMP_DIR/rootfs/boot $TMP_DIR/rootcd for i in rootfs rootcd ; do [ "$(ls $TMP_DIR/$i)" ] && - ( cd "$TMP_DIR/$i"; find * | cpio -o -H newc ) | gzip -9 > "$TMP_DIR/$FLAVOR.$i" + ( cd "$TMP_DIR/$i"; find * | cpio -o -H newc ) | dogzip "$TMP_DIR/$FLAVOR.$i" done unset VERSION MAINTAINER echo -en "Flavor short description \007: "; read -t 30 DESCRIPTION @@ -2167,7 +2172,7 @@ Check /home/slitaz/flavors/$(cat /etc/slitaz-release)/$FLAVOR/receipt too and \ repack the flavor (tazlito pack-flavor $FLAVOR)" fi - ( cd $TMP_DIR; ls $FLAVOR.* | cpio -o -H newc ) | gzip -9 > $FLAVOR.flavor + ( cd $TMP_DIR; ls $FLAVOR.* | cpio -o -H newc ) | dogzip $FLAVOR.flavor fi fi rm -rf $TMP_DIR