tazlito rev 38

Squashfs'd /usr support
author Pascal Bellard <pascal.bellard@slitaz.org>
date Wed Feb 20 13:51:01 2008 +0100 (2008-02-20)
parents ad220beb2777
children 9c563f497af9
files tazlito
line diff
     1.1 --- a/tazlito	Sat Feb 16 20:01:25 2008 +0100
     1.2 +++ b/tazlito	Wed Feb 20 13:51:01 2008 +0100
     1.3 @@ -300,7 +300,7 @@
     1.4  # Default answer for binary question (Y or N)
     1.5  DEFAULT_ANSWER="ASK"
     1.6  
     1.7 -# Compression utility (lzma or gzip)
     1.8 +# Compression utility (lzma, gzip or none)
     1.9  COMPRESSION="lzma"
    1.10  EOF
    1.11  }
    1.12 @@ -467,7 +467,23 @@
    1.13  		cd $TARGET/rootfs
    1.14  		echo -n "Extracting the rootfs... "
    1.15  		( zcat ../rootcd/boot/rootfs.gz 2>/dev/null || \
    1.16 -		  unlzma -c ../rootcd/boot/rootfs.?z ) | cpio -id
    1.17 +		  lzma d ../rootcd/boot/rootfs.?z -so 2>/dev/null || \
    1.18 +		  cat ../rootcd/boot/rootfs.gz ) | cpio -id
    1.19 +		# unpack /usr
    1.20 +		if [ -f .usr.sqfs ]; then
    1.21 +			echo -en "\nUnsquashfs'ing /usr... "
    1.22 +			/sbin/unsquashfs .usr.sqfs
    1.23 +			if [ -d squashfs-root/.moved ]; then
    1.24 +				( cd squashfs-root/.moved ; find * -print ) | \
    1.25 +				while read $file; do
    1.26 +					rm -f $file
    1.27 +					mv squashfs-root/.moved/$file $file
    1.28 +				done
    1.29 +				rmdir squashfs-root/.moved
    1.30 +			fi
    1.31 +			mv squashfs-root/* usr
    1.32 +			rmdir squashfs-root
    1.33 +		fi
    1.34  		# Umount and remove temp directory and cd to $TARGET to get stats.
    1.35  		umount $TMP_DIR && rm -rf $TMP_DIR
    1.36  		cd ..