tazlito rev 525

tazlito/loram: root may not be set (again)
author Pascal Bellard <pascal.bellard@slitaz.org>
date Tue Apr 28 07:52:16 2020 +0000 (2020-04-28)
parents 77c088ba9817
children 2a9ea816895f
files tazlito
line diff
     1.1 --- a/tazlito	Sun Apr 19 12:30:49 2020 +0000
     1.2 +++ b/tazlito	Tue Apr 28 07:52:16 2020 +0000
     1.3 @@ -1429,8 +1429,11 @@
     1.4  		fi
     1.5  		need_lib=true
     1.6  	fi
     1.7 -	for i in $($TMP_DIR/initfs/bin/busybox | awk \
     1.8 -	  '{ if (s) printf "%s",$0 } /Currently/ { s=1 }' | sed 's/,//g'); do
     1.9 +	bins="sh switch_root"
    1.10 +	[ "$(echo ls | chroot $TMP_DIR/initfs busybox sh 2> /dev/null)" ] ||
    1.11 +	bins="$($TMP_DIR/initfs/bin/busybox | awk \
    1.12 +	  '{ if (s) printf "%s",$0 } /Currently/ { s=1 }' | sed 's/,//g')"
    1.13 +	for i in $bins ; do
    1.14  		ln $TMP_DIR/initfs/bin/busybox $TMP_DIR/initfs/bin/$i
    1.15  	done
    1.16  	# bootfloppybox will need floppy.ko.?z, /dev/fd0, /dev/tty0
    1.17 @@ -1649,9 +1652,9 @@
    1.18  	mv $TMP_DIR/initfs.gz $TMP_DIR/loramiso/boot/rootfs.gz
    1.19  	unmeta_boot
    1.20  	VOLUM_NAME="SliTaz_LoRAM_CDROM"
    1.21 -	sed -i "s|root=|isofs= rodev=/dev/cdrom/fs &|;s/.ive/cdrom/" \
    1.22 +	busybox sed -i "s|root=|isofs= rodev=/dev/cdrom/fs &|;s/.ive/cdrom/" \
    1.23  		$TMP_DIR/loramiso/boot/isolinux/*.cfg
    1.24 -	sed -i '/LABEL slitaz/{NNNNp;s|z cdrom|& text|;s|L slitaz|&text|;s|autologin|screen=text &|;s|,[^ ]*||}' \
    1.25 +	busybox sed -i '/LABEL slitaz/{NNNNp;s|z cdrom|& text|;s|L slitaz|&text|;s|autologin|screen=text &|;s|,[^ ]*||}' \
    1.26  		$TMP_DIR/loramiso/boot/isolinux/*.cfg
    1.27  	create_iso $OUTPUT $TMP_DIR/loramiso
    1.28  }
    1.29 @@ -1700,11 +1703,11 @@
    1.30  			new="$new $s $2"
    1.31  			shift 2
    1.32  		done
    1.33 -		sed -i -e "/append [0-9]/s/append .*/append$new $1/" -e \
    1.34 +		busybox sed -i -e "/append [0-9]/s/append .*/append$new $1/" -e \
    1.35  			"/append ifmem [0-9]/s/append .*/append ifmem$new $1/" $cfg
    1.36 -		sed -i 's|\(initrd=\)\([^r]*\)\(rootfs\)|\1\2rootfs.gz,\2\3|' $cfg
    1.37 -		sed -i '/LABEL base/{NNNNp;s|base .ive|cdrom|;s|base|cdrom|;s|,[^ ]*||}' $cfg
    1.38 -		sed -i '/LABEL cdrom/{NNNNp;s|z cdrom|& text|;s|L cdrom|&text|;s|root=|screen=text &|;s|,[^ ]*||}' $cfg
    1.39 +		busybox sed -i 's|\(initrd=\)\([^r]*\)\(rootfs\)|\1\2rootfs.gz,\2\3|' $cfg
    1.40 +		busybox sed -i '/LABEL base/{NNNNp;s|base .ive|cdrom|;s|base|cdrom|;s|,[^ ]*||}' $cfg
    1.41 +		busybox sed -i '/LABEL cdrom/{NNNNp;s|z cdrom|& text|;s|L cdrom|&text|;s|video=|screen=text &|;s|,[^ ]*||}' $cfg
    1.42  	done
    1.43  }
    1.44