wok diff syslinux/stuff/iso2exe/init @ rev 17860

syslinux/taziso: create a fat32 in partition 1 or 2
author Pascal Bellard <pascal.bellard@slitaz.org>
date Wed Mar 25 12:48:09 2015 +0100 (2015-03-25)
parents 6a2e6eb35735
children a12fb1874d30
line diff
     1.1 --- a/syslinux/stuff/iso2exe/init	Sat Mar 21 11:15:53 2015 +0100
     1.2 +++ b/syslinux/stuff/iso2exe/init	Wed Mar 25 12:48:09 2015 +0100
     1.3 @@ -758,8 +758,10 @@
     1.4  	done ) > $device
     1.5  
     1.6  	# partition + fat32 format for the remaining space
     1.7 -	get 446 $device 2 12 | xargs echo | { read dx cx ol oh ll lh 
     1.8 -	if [ $dx -eq $((0x3F17)) ]; then
     1.9 +	for p in 0 16; do
    1.10 +		get $((450+$p)) $device 2 12 | xargs echo | {
    1.11 +		read dx cx ol oh ll lh
    1.12 +		[ $dx -eq $((0x3F17)) ] || continue
    1.13  		cx=$(($cx & 0xFF00))
    1.14  		ofs=$(($ll+($lh<<16)))
    1.15  		n=$(($(cat /sys/block/${device#/dev/}/size)-$ofs))
    1.16 @@ -768,15 +770,17 @@
    1.17  		m=$((($m & 0xFF00)+(($m>>16)<<6)))
    1.18  		words2bin 0 $((0x101+$cx)) 0x3F0B $((32+$m)) \
    1.19  			$ll $lh $(($n & 0xFFFF)) $(($n >> 16)) | \
    1.20 -			ddq bs=1 seek=446 of=$device
    1.21 +			ddq bs=1 seek=$((462-$p)) of=$device
    1.22  		if [ "$(which mkdosfs 2> /dev/null)" ]; then
    1.23  			losetup -o $((512*$ofs)) /dev/loop2 $device
    1.24  			mkdosfs -n "SLITAZ BOOT" /dev/loop2
    1.25  			words2bin $(($ofs & 0xFFFF)) $(($ofs >> 16)) | \
    1.26  				ddq bs=1 seek=28 of=/dev/loop2
    1.27 +			sync
    1.28  			losetup -d /dev/loop2
    1.29  		fi
    1.30 - 	fi ; }
    1.31 + 		}
    1.32 + 	done
    1.33  }
    1.34  
    1.35  usbkey()