summaryrefslogtreecommitdiff
path: root/scripts
diff options
context:
space:
mode:
authorMaximilian Mehnert <maximilian.mehnert@gmx.de>2015-07-16 09:58:46 +0200
committerMaximilian Mehnert <maximilian.mehnert@gmx.de>2015-09-23 10:48:46 +0200
commit46920d22bd3a31241baa504bc178343c760a4812 (patch)
tree997f8164b22e0fdfddbcda117c7a0d5b422458f1 /scripts
parent8a52e569f50138eb8fd3526fb62058d54c7c8522 (diff)
downloadvyos-live-build-46920d22bd3a31241baa504bc178343c760a4812.tar.gz
vyos-live-build-46920d22bd3a31241baa504bc178343c760a4812.zip
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.
Diffstat (limited to 'scripts')
-rwxr-xr-xscripts/build/binary_hdd14
-rwxr-xr-xscripts/build/config12
2 files changed, 23 insertions, 3 deletions
diff --git a/scripts/build/binary_hdd b/scripts/build/binary_hdd
index c958aff9a..0ffb20a7f 100755
--- a/scripts/build/binary_hdd
+++ b/scripts/build/binary_hdd
@@ -172,7 +172,12 @@ esac
case "${LB_BUILD_WITH_CHROOT}" in
true)
Chroot chroot "parted -s ${FREELO} mklabel ${PARTITION_TABLE_TYPE}" || true
- Chroot chroot "parted -a optimal -s ${FREELO} mkpart primary ${PARTITION_TYPE} 0% 100%" || 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
- parted -a optimal -s ${FREELO} mkpart primary ${PARTITION_TYPE} 0% 100% || 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
diff --git a/scripts/build/config b/scripts/build/config
index fbe986588..e5810b45d 100755
--- a/scripts/build/config
+++ b/scripts/build/config
@@ -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}"