Old BIOS: start partition at specific place

Some BIOSes dont't boot from partitions starting at sector 1024.
Some are even more peculiar and only start from sector 63.
This patch adds an option for the binary_hdd target to manually
configure the partition start.
This commit is contained in:
Maximilian Mehnert 2015-07-16 09:58:46 +02:00
parent 8a52e569f5
commit 46920d22bd
2 changed files with 23 additions and 3 deletions

View File

@ -172,7 +172,12 @@ esac
case "${LB_BUILD_WITH_CHROOT}" in
true)
Chroot chroot "parted -s ${FREELO} mklabel ${PARTITION_TABLE_TYPE}" || true
if [ "x${LB_HDD_PARTITION_START}" = "x" ]; then
Chroot chroot "parted -a optimal -s ${FREELO} mkpart primary ${PARTITION_TYPE} 0% 100%" || true
else
Echo_message "using partition start at ${LB_HDD_PARTITION_START}"
Chroot chroot "parted -s ${FREELO} mkpart primary ${PARTITION_TYPE} ${LB_HDD_PARTITION_START} 100%" || true
fi
Chroot chroot "parted -s ${FREELO} set 1 boot on" || true
Chroot chroot "parted -s ${FREELO} set 1 lba off" || true
@ -184,7 +189,12 @@ case "${LB_BUILD_WITH_CHROOT}" in
false)
parted -s ${FREELO} mklabel ${PARTITION_TABLE_TYPE} || true
if [ "x${LB_HDD_PARTITION_START}" = "x" ]; then
parted -a optimal -s ${FREELO} mkpart primary ${PARTITION_TYPE} 0% 100% || true
else
Echo_message "using partition start at ${LB_HDD_PARTITION_START}"
parted -s ${FREELO} mkpart primary ${PARTITION_TYPE} ${LB_HDD_PARTITION_START} 100% || true
fi
parted -s "${FREELO}" set 1 boot on || true
parted -s "${FREELO}" set 1 lba off || true

View File

@ -69,6 +69,7 @@ USAGE="${PROGRAM} [--apt apt|aptitude]\n\
\t [--isohybrid-options OPTION|\"OPTIONS\"]\n\
\t [--hdd-label LABEL]\n\
\t [--hdd-size MB]\n\
\t [--hdd-partition-start [parted unit, e.g. 63s]\n\
\t [--iso-application NAME]\n\
\t [--iso-preparer NAME]\n\
\t [--iso-publisher NAME]\n\
@ -139,7 +140,7 @@ Local_arguments ()
security:,updates:,backports:,binary-filesystem:,binary-images:,
apt-indices:,bootappend-install:,bootappend-live:,bootappend-live-failsafe:,bootloaders:,checksums:,compression:,config:,zsync:,build-with-chroot:,
debian-installer:,debian-installer-distribution:,debian-installer-preseedfile:,debian-installer-gui:,
grub-splash:,isohybrid-options:,hdd-label:,hdd-size:,iso-application:,iso-preparer:,iso-publisher:,
grub-splash:,isohybrid-options:,hdd-label:,hdd-size:,hdd-partition-start:,iso-application:,iso-preparer:,iso-publisher:,
iso-volume:,jffs2-eraseblock:,memtest:,net-root-filesystem:,net-root-mountoptions:,
net-root-path:,net-root-server:,net-cow-filesystem:,net-cow-mountoptions:,net-cow-path:,
net-cow-server:,net-tarball:,firmware-binary:,firmware-chroot:,swap-file-path:,swap-file-size:,
@ -566,6 +567,11 @@ Local_arguments ()
shift 2
;;
--hdd-partition-start)
LB_HDD_PARTITION_START="${2}"
shift 2
;;
--iso-application)
LB_ISO_APPLICATION="${2}"
shift 2
@ -1198,6 +1204,10 @@ LB_HDD_LABEL="${LB_HDD_LABEL}"
# (Default: ${LB_HDD_SIZE})
LB_HDD_SIZE="${LB_HDD_SIZE}"
# \$LB_HDD_PARTITION_START: set start of partition for the hdd target for BIOSes that expect a specific boot partition start (e.g. "63s"). If empty, use optimal layout.
# (Default: ${LB_HDD_PARTITION_START})
LB_HDD_PARTITION_START="${LB_HDD_PARTITION_START}"
# \$LB_ISO_APPLICATION: set iso author
# (Default: ${LB_ISO_APPLICATION})
LB_ISO_APPLICATION="${LB_ISO_APPLICATION}"