tazlito rev 457

tazlito buid-loram http: add rolling support
author Pascal Bellard <pascal.bellard@slitaz.org>
date Thu Aug 17 16:11:23 2017 +0200 (2017-08-17)
parents bc72a0c472cc
children d67c38068716
files tazlito
line diff
     1.1 --- a/tazlito	Wed Aug 16 19:14:45 2017 +0200
     1.2 +++ b/tazlito	Thu Aug 17 16:11:23 2017 +0200
     1.3 @@ -983,6 +983,12 @@
     1.4  		sed -i 's/LD_T.*ot/newline/;s/".*ld-.*) /"/' $TMP_DIR/initfs/init
     1.5  	else
     1.6  		cp /bin/busybox $TMP_DIR/initfs/bin
     1.7 +		if ! cmp /bin/busybox /sbin/insmod > /dev/null ; then
     1.8 +			cp /sbin/insmod $TMP_DIR/initfs/bin
     1.9 +			cp -a /lib/libkmod.so.* $TMP_DIR/initfs/lib
    1.10 +			cp -a /usr/lib/liblzma.so.* $TMP_DIR/initfs/lib
    1.11 +			cp -a /usr/lib/libz.so.* $TMP_DIR/initfs/lib
    1.12 +		fi
    1.13  		need_lib=true
    1.14  	fi
    1.15  	for i in $($TMP_DIR/initfs/bin/busybox | awk \
    1.16 @@ -1026,11 +1032,13 @@
    1.17  
    1.18  mount -t sysfs sysfs /sys
    1.19  for i in /lib/modules/*.ko ; do
    1.20 +	echo -en "Probe \$i           \\r"
    1.21  	for j in \$(grep alias=pci: \$i | sed 's/alias//;s/\*/.*/g'); do
    1.22  		grep -q "\$j" /sys/bus/pci/devices/*/uevent || continue
    1.23  		for k in \$(cat \${i/ko/dep} 2> /dev/null); do
    1.24  			insmod /lib/modules/\$k.ko 2> /dev/null
    1.25  		done
    1.26 +		echo "Loading \$i"
    1.27  		insmod \$i 2> /dev/null
    1.28  		break
    1.29  	done
    1.30 @@ -1058,6 +1066,7 @@
    1.31  for i in $urliso ; do
    1.32  	[ -n "\$URLISO" ] && URLISO="\$URLISO,"
    1.33  	URLISO="\${URLISO}http://\$i/iso/\$(cat /etc/slitaz-release)/flavors/slitaz-loram-cdrom.iso,http://\$i/iso/\$(cat /etc/slitaz-release)/flavors/slitaz-\$(cat /etc/slitaz-release)-loram-cdrom.iso"
    1.34 +	URLISO="\$URLISO,http://\$i/iso/rolling/slitaz-rolling-loram-cdrom.iso,http://\$i/iso/rolling/slitaz-rolling-loram.iso"
    1.35  done
    1.36  getarg urliso URLISO
    1.37  DIR=fs
    1.38 @@ -1071,7 +1080,7 @@
    1.39  mkdir -p /mnt/.rw /mnt/.wd \$path \$path2
    1.40  while [ ! -d \$path/boot ]; do
    1.41  	for i in \$(echo \$URLISO | sed 's/,/ /g'); do
    1.42 -		httpfs \$i \$path2 && break
    1.43 +		httpfs \$i \$path2 && echo \$i && break
    1.44  	done
    1.45  	mount -o loop,ro -t iso9660 \$path2/*.iso \$path
    1.46  done
    1.47 @@ -1081,12 +1090,15 @@
    1.48  branch=:/mnt/.cdrom/\$DIR
    1.49  if [ ! -d /mnt/.cdrom/\$DIR/etc ]; then
    1.50  branch=
    1.51 -for i in \${path}rootfs* ; do
    1.52 +lp=1
    1.53 +insmod /lib/modules/squashfs.ko 2> /dev/null
    1.54 +for i in \${path}boot/rootfs?.* ; do
    1.55  	fs=\${i#*root}
    1.56  	branch=\$branch:/mnt/.\$fs
    1.57  	mkdir -p /mnt/.rw/mnt/.\$fs /mnt/.\$fs /mnt/.rw/mnt/.cdrom
    1.58 -	insmod /lib/modules/squashfs.ko 2> /dev/null
    1.59 -	mount -o loop,ro -t squashfs \${path}root\$fs /mnt/.\$fs
    1.60 +	losetup -o 124 /dev/loop\$lp \$i
    1.61 +	mount -o loop,ro -t squashfs /dev/loop\$lp /mnt/.\$fs
    1.62 +	lp=\$((\$lp+1))
    1.63  done
    1.64  else
    1.65  mkdir -p /mnt/.rw/mnt/.httpfs