tazlito rev 43

Slitaz-loram-cdrom support
author Pascal Bellard <pascal.bellard@slitaz.org>
date Fri Feb 22 14:36:51 2008 +0100 (2008-02-22)
parents e496599d5485
children 424e790686a6
files tazlito
line diff
     1.1 --- a/tazlito	Thu Feb 21 20:29:42 2008 +0100
     1.2 +++ b/tazlito	Fri Feb 22 14:36:51 2008 +0100
     1.3 @@ -473,22 +473,30 @@
     1.4  		( zcat ../rootcd/boot/rootfs.gz 2>/dev/null || \
     1.5  		  lzma d ../rootcd/boot/rootfs.?z -so 2>/dev/null || \
     1.6  		  cat ../rootcd/boot/rootfs.gz ) | cpio -id
     1.7 +		# remove link to cdrom
     1.8 +		if [ -L usr ]; then
     1.9 +			rm usr
    1.10 +			mv ../rootcd/usr .
    1.11 +		fi
    1.12 +		[ -d cdrom ] && rmdir cdrom
    1.13  		# unpack /usr
    1.14 -		if [ -f .usr.sqfs ]; then
    1.15 +		$sqfs="../rootcd/usr.sqfs"
    1.16 +		[ -f $sqfs ] || sqfs=".usr.sqfs"
    1.17 +		if [ -f $sqfs ]; then
    1.18  			echo -en "\nUnsquashfs'ing /usr... "
    1.19 -			sbin/unsquashfs .usr.sqfs
    1.20 -			rm .usr.sqfs
    1.21 -			if [ -d squashfs-root/.moved ]; then
    1.22 -				( cd squashfs-root/.moved ; find * -print ) | \
    1.23 -				while read $file; do
    1.24 -					[ -L "$file" ] || continue
    1.25 -					rm -f "$file"
    1.26 -					mv "squashfs-root/.moved/$file" "$file"
    1.27 -				done
    1.28 -				rm -rf squashfs-root/.moved
    1.29 -			fi
    1.30 -			mv squashfs-root/* usr
    1.31 -			rmdir squashfs-root
    1.32 +			rmdir usr
    1.33 +			sbin/unsquashfs -d usr $sqfs
    1.34 +			rm $sqfs
    1.35 +		fi
    1.36 +		if [ -d usr/.moved ]; then
    1.37 +			echo -en "\nRestoring moved files from /usr... "
    1.38 +			( cd usr/.moved ; find * -print ) | \
    1.39 +			while read file; do
    1.40 +				[ -L "$file" ] || continue
    1.41 +				rm -f "$file"
    1.42 +				mv "usr/.moved/$file" "$file"
    1.43 +			done
    1.44 +			rm -rf usr/.moved
    1.45  		fi
    1.46  		# Umount and remove temp directory and cd to $TARGET to get stats.
    1.47  		umount $TMP_DIR && rm -rf $TMP_DIR