wok-6.x rev 23988

syslinux: iso2exe/init scan all partitions
author Pascal Bellard <pascal.bellard@slitaz.org>
date Thu Dec 03 09:39:27 2020 +0000 (2020-12-03)
parents c2d686c8ab08
children afa00d471293
files linld/stuff/src/pipehole.awk syslinux/stuff/iso2exe/init syslinux/stuff/iso2exe/iso2exe.sh
line diff
     1.1 --- a/linld/stuff/src/pipehole.awk	Wed Dec 02 13:39:32 2020 +0000
     1.2 +++ b/linld/stuff/src/pipehole.awk	Thu Dec 03 09:39:27 2020 +0000
     1.3 @@ -203,6 +203,15 @@
     1.4  	}
     1.5  	 } # file == "load.cpp"
     1.6  	 if (file == "iso9660.cpp") {
     1.7 +	if (/p = x->buffer \+ 34/) isiso=13
     1.8 +	if (isiso == 13) { # ISO9660.LST
     1.9 +		if (/di,si/) $0="	xchg	ax,bx"
    1.10 +		if (/di,ax/) $0="	lea	di,[si+bx+70]"
    1.11 +		if (/di,70/) {
    1.12 +			isiso=0
    1.13 +			next
    1.14 +		}
    1.15 +	}
    1.16  	if (/register len/) isiso=12
    1.17  	if (isiso == 12) { # ISO9660.LST
    1.18  		sub(/mov	dx,ax/,"xchg	ax,bx")
     2.1 --- a/syslinux/stuff/iso2exe/init	Wed Dec 02 13:39:32 2020 +0000
     2.2 +++ b/syslinux/stuff/iso2exe/init	Thu Dec 03 09:39:27 2020 +0000
     2.3 @@ -36,16 +36,17 @@
     2.4  {
     2.5  	mkdir -p $media
     2.6  	for dev in /sys/block/*; do
     2.7 -		dev=$(ls -d $dev/$(basename $dev)*)
     2.8 -		[ "$dev" ] || continue
     2.9 -		mount /dev/$(basename $dev) $mnt
    2.10 -		if checkmagic $mnt/$ISO; then
    2.11 -			mount -o loop,ro $mnt/$ISO $media
    2.12 -			echo "Found $ISO on $(basename $dev)"
    2.13 -			ISO=$mnt/$ISO
    2.14 -			return 0
    2.15 -		fi
    2.16 -		umount $mnt
    2.17 +		for dev in $(ls -d $dev/$(basename $dev)*); do
    2.18 +			[ "$dev" ] || continue 2
    2.19 +			mount /dev/$(basename $dev) $mnt
    2.20 +			if checkmagic $mnt/$ISO; then
    2.21 +				echo "Found $ISO on $(basename $dev)"
    2.22 +				ISO=$mnt/$ISO
    2.23 +				mount -o loop,ro $ISO $media
    2.24 +				return 0
    2.25 +			fi
    2.26 +			umount $mnt
    2.27 +		done
    2.28  	done
    2.29  	return 1
    2.30  }
    2.31 @@ -66,11 +67,9 @@
    2.32  }
    2.33  
    2.34  tty0=tty0
    2.35 -
    2.36  bootlog()
    2.37  {
    2.38 -	dialog --clear --title " Linux boot messages " \
    2.39 -		--textbox /tmp/dmesg 24 78
    2.40 +	dialog --clear --title " Linux boot messages " --textbox /tmp/dmesg 24 78
    2.41  }
    2.42  
    2.43  gotposixovl()
    2.44 @@ -144,7 +143,7 @@
    2.45  {
    2.46  	n=0
    2.47  	$xdotwait "Extract filesystem..."
    2.48 -	for i in $(ls -r $media/boot/rootfs*); do
    2.49 +	for i in $(ls -r $media/boot/rootfs?*.*); do
    2.50  		[ $((n++)) -eq 0 ] || $uncpio $i
    2.51  	done
    2.52  	rm -f /tmp/wait
     3.1 --- a/syslinux/stuff/iso2exe/iso2exe.sh	Wed Dec 02 13:39:32 2020 +0000
     3.2 +++ b/syslinux/stuff/iso2exe/iso2exe.sh	Thu Dec 03 09:39:27 2020 +0000
     3.3 @@ -295,7 +295,7 @@
     3.4  	TMP=/tmp/iso2exe$$
     3.5  	mkdir -p $TMP/dev
     3.6  	cp -a /dev/tty /dev/tty0 $TMP/dev
     3.7 -	cat init > $TMP/init.exe
     3.8 +	sed 's|^[ |\t]*||' init > $TMP/init.exe
     3.9  	find $TMP -type f -print0 | xargs -0 chmod +x
    3.10  	find $TMP -print0 | xargs -0 touch -t 197001010100.00
    3.11  	( cd $TMP; find dev init.exe | cpio -o -H newc ) | compress > rootfs.gz