mirror of https://schlomp.space/tastytea/hashboot
fix MBR size calculation
parent
08ef673bbb
commit
2b5bd67c9f
6
hashboot
6
hashboot
|
@ -96,7 +96,11 @@ if [ "${sectorsize}" == "=" ] # Older versions of util-linux
|
||||||
then
|
then
|
||||||
sectorsize=$(LC_ALL=C fdisk -l ${MBR_DEVICE} | grep '^Units' | awk '{print $9}' )
|
sectorsize=$(LC_ALL=C fdisk -l ${MBR_DEVICE} | grep '^Units' | awk '{print $9}' )
|
||||||
fi
|
fi
|
||||||
startsector=$(LC_ALL=C fdisk -l ${MBR_DEVICE} | grep -A1 'Device' | tail -n1 | awk '{print $3}' )
|
startsector=$(LC_ALL=C fdisk -l ${MBR_DEVICE} | grep -A1 'Device' | tail -n1 | awk '{print $2}' )
|
||||||
|
if [ "${startsector}" == "*" ] # If partition is marked as boot, read next field
|
||||||
|
then
|
||||||
|
startsector=$(LC_ALL=C fdisk -l ${MBR_DEVICE} | grep -A1 'Device' | tail -n1 | awk '{print $3}' )
|
||||||
|
fi
|
||||||
|
|
||||||
MBR_SIZE=$(expr ${sectorsize} \* ${startsector} / 1024)
|
MBR_SIZE=$(expr ${sectorsize} \* ${startsector} / 1024)
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue