summaryrefslogtreecommitdiff
path: root/scripts/build/binary_hdd
diff options
context:
space:
mode:
authorSimon McVittie <simon.mcvittie@collabora.co.uk>2014-04-27 12:35:58 +0200
committerDaniel Baumann <mail@daniel-baumann.ch>2014-04-27 12:37:37 +0200
commit5d6574552ff8fdf9623f4c0319097778f8523289 (patch)
tree3009b45ddc91f2ae55bb6ad99d69410471989a5f /scripts/build/binary_hdd
parent10a6e8e5792704ba4b04eada0966bdcb724e9fb5 (diff)
downloadvyos-live-build-5d6574552ff8fdf9623f4c0319097778f8523289.tar.gz
vyos-live-build-5d6574552ff8fdf9623f4c0319097778f8523289.zip
Add support for making ext[234] or btrfs hdd images bootable with extlinux (Closes: #745816)
extlinux configuration for the bootable image is installed to /boot/extlinux, matching the extlinux-install script in Debian. From the configuration point of view it's still called "syslinux", the same as the rest of the syslinux family (pxelinux, isolinux etc.)
Diffstat (limited to 'scripts/build/binary_hdd')
-rwxr-xr-xscripts/build/binary_hdd43
1 files changed, 34 insertions, 9 deletions
diff --git a/scripts/build/binary_hdd b/scripts/build/binary_hdd
index e335a81b7..1868d9d9b 100755
--- a/scripts/build/binary_hdd
+++ b/scripts/build/binary_hdd
@@ -77,7 +77,19 @@ case "${LB_BOOTLOADER}" in
;;
syslinux)
- Check_package chroot/usr/bin/syslinux syslinux
+ case ${LB_BINARY_FILESYSTEM} in
+ fat*|ntfs)
+ _BOOTLOADER=syslinux
+ ;;
+ ext[234]|btrfs)
+ _BOOTLOADER=extlinux
+ ;;
+ *)
+ Echo_error "syslinux/extlinux doesn't support ${LB_BINARY_FILESYSTEM}"
+ exit 1
+ ;;
+ esac
+ Check_package chroot/usr/bin/${_BOOTLOADER} ${_BOOTLOADER}
;;
esac
@@ -179,7 +191,7 @@ case "${LB_BUILD_WITH_CHROOT}" in
if [ "${LB_BOOTLOADER}" = "syslinux" ]
then
- dd if=chroot/usr/lib/syslinux/mbr.bin of=${FREELO} bs=440 count=1
+ dd if=chroot/usr/lib/${_BOOTLOADER}/mbr.bin of=${FREELO} bs=440 count=1
fi
;;
@@ -191,7 +203,7 @@ case "${LB_BUILD_WITH_CHROOT}" in
if [ "${LB_BOOTLOADER}" = "syslinux" ]
then
- dd if=/usr/lib/syslinux/mbr.bin of=${FREELO} bs=440 count=1
+ dd if=/usr/lib/${_BOOTLOADER}/mbr.bin of=${FREELO} bs=440 count=1
fi
;;
esac
@@ -247,6 +259,8 @@ case "${LB_BINARY_FILESYSTEM}" in
;;
esac
+Echo_message "Copying binary contents into image..."
+
mkdir -p chroot/binary.tmp
mount ${MOUNT_OPTIONS} ${FREELO} chroot/binary.tmp
cp -T ${CP_OPTIONS} binary/ chroot/binary.tmp
@@ -282,22 +296,33 @@ EOF
fi
}
-umount chroot/binary.tmp
-rmdir chroot/binary.tmp
+case "${_BOOTLOADER}" in
+ syslinux)
+ _SYSLINUX_INSTALLER="syslinux ${FREELO}"
+ ;;
+ extlinux)
+ _SYSLINUX_INSTALLER="extlinux --install /binary.tmp/boot/extlinux"
+ ;;
+ *)
+ _SYSLINUX_INSTALLER=""
+ ;;
+esac
-if [ "${LB_BOOTLOADER}" = "syslinux" ]
+if [ -n "${_SYSLINUX_INSTALLER}" ]
then
case "${LB_BUILD_WITH_CHROOT}" in
true)
- Chroot chroot "syslinux ${FREELO}"
+ Chroot chroot "${_SYSLINUX_INSTALLER}"
;;
-
false)
- syslinux ${FREELO}
+ ${_SYSLINUX_INSTALLER}
;;
esac
fi
+umount chroot/binary.tmp
+rmdir chroot/binary.tmp
+
Lodetach ${FREELO}
echo "!!! The above error/warning messages can be ignored !!!"