wok-current 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 8926da504dfb
children c654a2bb95d0
files syslinux/stuff/iso2exe/init syslinux/stuff/iso2exe/taziso
line diff
     1.1 --- a/syslinux/stuff/iso2exe/init	Wed Mar 25 02:43:47 2015 -0400
     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()
     2.1 --- a/syslinux/stuff/iso2exe/taziso	Wed Mar 25 02:43:47 2015 -0400
     2.2 +++ b/syslinux/stuff/iso2exe/taziso	Wed Mar 25 12:48:09 2015 +0100
     2.3 @@ -806,8 +806,10 @@
     2.4  	done ) > $device
     2.5  
     2.6  	# partition + fat32 format for the remaining space
     2.7 -	get 446 $device 2 12 | xargs echo | { read dx cx ol oh ll lh 
     2.8 -	if [ $dx -eq $((0x3F17)) ]; then
     2.9 +	for p in 0 16; do
    2.10 +		get $((450+$p)) $device 2 12 | xargs echo | {
    2.11 +		read dx cx ol oh ll lh
    2.12 +		[ $dx -eq $((0x3F17)) ] || continue
    2.13  		cx=$(($cx & 0xFF00))
    2.14  		ofs=$(($ll+($lh<<16)))
    2.15  		n=$(($(cat /sys/block/${device#/dev/}/size)-$ofs))
    2.16 @@ -816,15 +818,17 @@
    2.17  		m=$((($m & 0xFF00)+(($m>>16)<<6)))
    2.18  		words2bin 0 $((0x101+$cx)) 0x3F0B $((32+$m)) \
    2.19  			$ll $lh $(($n & 0xFFFF)) $(($n >> 16)) | \
    2.20 -			ddq bs=1 seek=446 of=$device
    2.21 +			ddq bs=1 seek=$((462-$p)) of=$device
    2.22  		if [ "$(which mkdosfs 2> /dev/null)" ]; then
    2.23  			losetup -o $((512*$ofs)) /dev/loop2 $device
    2.24  			mkdosfs -n "SLITAZ BOOT" /dev/loop2
    2.25  			words2bin $(($ofs & 0xFFFF)) $(($ofs >> 16)) | \
    2.26  				ddq bs=1 seek=28 of=/dev/loop2
    2.27 +			sync
    2.28  			losetup -d /dev/loop2
    2.29  		fi
    2.30 - 	fi ; }
    2.31 + 		}
    2.32 + 	done
    2.33  }
    2.34  
    2.35  usbkey()