wok rev 20310

syslinux/isohybrid.sh: resize EFI partition (again)
author Pascal Bellard <pascal.bellard@slitaz.org>
date Mon May 14 17:12:15 2018 +0200 (5 months ago)
parents a28f5ae5d7c1
children ed3fbdd82f11
files syslinux/stuff/tools/isohybrid.sh
line diff
     1.1 --- a/syslinux/stuff/tools/isohybrid.sh	Mon May 14 15:59:11 2018 +0200
     1.2 +++ b/syslinux/stuff/tools/isohybrid.sh	Mon May 14 17:12:15 2018 +0200
     1.3 @@ -190,16 +190,19 @@
     1.4  	store32 $e 0x10080
     1.5  	esect=$(( ($sectors + ((($cylinders -1) & 0x300) >>2)) <<16))
     1.6  	ecyl=$(( (($cylinders -1) & 0xff) <<24))
     1.7 -	store32 $(($e + 4)) $(($partype + (($heads - 1) <<8) +$esect +$ecyl))
     1.8 +	epart=$(((($heads - 1) <<8) +$esect +$ecyl))
     1.9 +	store32 $(($e + 4)) $(($partype + $epart))
    1.10  	store32 $(($e + 8)) $offset
    1.11 -	sectsize=$(($cylinders * $heads * $sectors))
    1.12 +	sectorcount=$(($cylinders * $heads * $sectors))
    1.13  	store32 $(($e + 12)) $sectsize
    1.14 -	efi_len=$(($sectsize - $efi_ofs))
    1.15 +	efi_len=$(($sectorcount - $efi_ofs))
    1.16  	if [ -n "$efi_ofs" ]; then
    1.17  		[ $(read16 0 1024) -eq 35615 -a $(read16 11 0) -ne 35615 ] &&
    1.18  		ddq bs=512 conv=notrunc skip=2 seek=44 count=20 if=$iso of=$iso
    1.19 -		store32 $((446+16)) $((0xFFFFFE00))
    1.20 -		store32 $((446+16+4)) $((0xFFFFFEEF))
    1.21 +		store32 $((446+16)) $(((($efi_ofs / $sectors / $heads) << 24) +
    1.22 +				(($efi_ofs % $sectors + 1) << 16) +
    1.23 +				(($efi_ofs / $sectors % $heads) << 8)))
    1.24 +		store32 $((446+16+4)) $((0xEF + $epart))
    1.25  		store32 $((446+16+8)) $efi_ofs
    1.26  		store32 $((446+16+12)) $efi_len
    1.27  		uudecode <<EOT | unlzma | ddq bs=512 seek=1 of=$iso conv=notrunc
    1.28 @@ -210,7 +213,7 @@
    1.29  T0p9AJtSH6X8SMic3vU3hYWwHsYnsmeoGmsy4EJba9Wf/0liMQA=
    1.30  ====
    1.31  EOT
    1.32 -		lastlba=$((($cylinders * $heads * $sectors) -1))
    1.33 +		lastlba=$(($sectorcount -1))
    1.34  		usablelba=34
    1.35  		store32 $((0x218)) 1
    1.36  		store32 $((0x220)) $lastlba