tazlito rev 474

loram: shrink rootfs.gz
author Pascal Bellard <pascal.bellard@slitaz.org>
date Mon Dec 25 17:16:32 2017 +0100 (17 months ago)
parents 61761275673e
children fb83501c662e
files tazlito
line diff
     1.1 --- a/tazlito	Mon Dec 25 13:03:49 2017 +0100
     1.2 +++ b/tazlito	Mon Dec 25 17:16:32 2017 +0100
     1.3 @@ -917,10 +917,6 @@
     1.4  	done || return 1
     1.5  	[ -s /init ] || install_package slitaz-boot-scripts
     1.6  	cp /init $TMP_DIR/initfs/
     1.7 -	# bootfloppybox will need floppy.ko.?z, /dev/fd0, /dev/tty0
     1.8 -	cp /lib/modules/$version/kernel/drivers/block/floppy.ko.?z \
     1.9 -		$TMP_DIR/initfs/lib/modules 2>/dev/null
    1.10 -	cp -a /dev/tty0 /dev/fd0 $TMP_DIR/initfs/dev 2>/dev/null
    1.11  	cp /lib/modules/$version/kernel/fs/$aufs/$aufs.ko.?z \
    1.12  		$TMP_DIR/initfs/lib/modules
    1.13  	if [ "$1" == 'cdrom' ]; then
    1.14 @@ -932,12 +928,9 @@
    1.15  		done
    1.16  		cp /lib/modules/$version/kernel/fs/squashfs/squashfs.ko.?z \
    1.17  			$TMP_DIR/initfs/lib/modules
    1.18 -		ls /sbin/unsquashfs /usr/lib/liblzma.so* $INSTALLED/squashfs/* | \
    1.19 -		cpio -o -H newc > $TMP_DIR/initfs/extractfs.cpio
    1.20 +		#ls /sbin/unsquashfs /usr/lib/liblzma.so* $INSTALLED/squashfs/* | \
    1.21 +		#cpio -o -H newc > $TMP_DIR/initfs/extractfs.cpio
    1.22  	fi
    1.23 -	for i in $(ls /dev/[hs]d[a-f]*); do
    1.24 -		cp -a $i $TMP_DIR/initfs/dev
    1.25 -	done
    1.26  	if [ "$1" == 'http' ]; then
    1.27  		mkdir $TMP_DIR/initfs/etc $TMP_DIR/fs
    1.28  		ln -s /proc/mounts $TMP_DIR/initfs/etc/mtab
    1.29 @@ -1011,11 +1004,18 @@
    1.30  	  '{ if (s) printf "%s",$0 } /Currently/ { s=1 }' | sed 's/,//g'); do
    1.31  		ln $TMP_DIR/initfs/bin/busybox $TMP_DIR/initfs/bin/$i
    1.32  	done
    1.33 -	for i in /dev/console /dev/loop* /dev/null /dev/tty /dev/zero \
    1.34 +	# bootfloppybox will need floppy.ko.?z, /dev/fd0, /dev/tty0
    1.35 +	cp /lib/modules/$version/kernel/drivers/block/floppy.ko.?z \
    1.36 +		$TMP_DIR/initfs/lib/modules 2>/dev/null
    1.37 +	for i in /dev/console /dev/null /dev/tty /dev/tty0 /dev/zero \
    1.38  		 /dev/kmem /dev/mem /dev/random /dev/urandom; do
    1.39  		cp -a $i $TMP_DIR/initfs/dev
    1.40  	done
    1.41 -	$need_lib && for i in /lib/ld-* /lib/lib[cm].so* /lib/lib[cm]-* ; do
    1.42 +	grep -q '/sys/block/./dev' $TMP_DIR/initfs/init ||
    1.43 +	for i in /dev/fd0 /dev/[hs]d[a-f]* /dev/loop* ; do
    1.44 +		cp -a $i $TMP_DIR/initfs/dev
    1.45 +	done
    1.46 +	$need_lib && for i in /lib/ld-* /lib/lib[cm][-\.]* ; do
    1.47  		cp -a $i $TMP_DIR/initfs/lib
    1.48  	done
    1.49  	[ "$1" == 'http' ] && cat > $TMP_DIR/initfs/init <<EOTEOT
    1.50 @@ -1134,7 +1134,6 @@
    1.51  	for i in $TMP_DIR/initfs/lib/modules/*z ; do
    1.52  		unxz $i || gunzip $i || lzma d $i ${i%.gz}
    1.53  		rm -f $i
    1.54 -		dogzip ${i%.gz}
    1.55  	done 2>/dev/null
    1.56  	(cd $TMP_DIR/initfs; find | busybox cpio -o -H newc 2>/dev/null) | \
    1.57  	lzma e $TMP_DIR/initfs.gz -si