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.)
This commit is contained in:
Simon McVittie 2014-04-27 12:35:58 +02:00 committed by Daniel Baumann
parent 10a6e8e579
commit 5d6574552f
4 changed files with 60 additions and 22 deletions

View File

@ -6,7 +6,7 @@ DEFAULT_SETTINGS="/etc/live/build.conf"
dpkg -l debootstrap cdebootstrap dpkg -l debootstrap cdebootstrap
# Checking suggests # Checking suggests
dpkg -l dosfstools xorriso loadlin memtest86+ memtest86 mtools parted squashfs-tools mtd-tools syslinux grub uuid-runtime win32-loader dpkg -l dosfstools xorriso loadlin memtest86+ memtest86 mtools parted squashfs-tools mtd-tools syslinux syslinux-common extlinux grub uuid-runtime win32-loader
if [ -e "${DEFAULT_SETTINGS}" ]; then if [ -e "${DEFAULT_SETTINGS}" ]; then
echo "Contents of ${DEFAULT_SETTINGS}:" echo "Contents of ${DEFAULT_SETTINGS}:"

View File

@ -1061,12 +1061,12 @@ Check_defaults ()
if [ "${LB_BOOTLOADER}" = "syslinux" ] if [ "${LB_BOOTLOADER}" = "syslinux" ]
then then
# syslinux + fat # syslinux + fat or ntfs, or extlinux + ext[234] or btrfs
case "${LB_BINARY_FILESYSTEM}" in case "${LB_BINARY_FILESYSTEM}" in
fat*|ntfs) fat*|ntfs|ext[234]|btrfs)
;; ;;
*) *)
Echo_warning "You have selected values of LB_BOOTLOADER and LB_BINARY_FILESYSTEM which are incompatible - syslinux only supports FAT and NTFS filesystems." Echo_warning "You have selected values of LB_BOOTLOADER and LB_BINARY_FILESYSTEM which are incompatible - the syslinux family only support FAT, NTFS, ext[234] or btrfs filesystems."
;; ;;
esac esac
fi fi

View File

@ -77,7 +77,19 @@ case "${LB_BOOTLOADER}" in
;; ;;
syslinux) 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 esac
@ -179,7 +191,7 @@ case "${LB_BUILD_WITH_CHROOT}" in
if [ "${LB_BOOTLOADER}" = "syslinux" ] if [ "${LB_BOOTLOADER}" = "syslinux" ]
then 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 fi
;; ;;
@ -191,7 +203,7 @@ case "${LB_BUILD_WITH_CHROOT}" in
if [ "${LB_BOOTLOADER}" = "syslinux" ] if [ "${LB_BOOTLOADER}" = "syslinux" ]
then 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 fi
;; ;;
esac esac
@ -247,6 +259,8 @@ case "${LB_BINARY_FILESYSTEM}" in
;; ;;
esac esac
Echo_message "Copying binary contents into image..."
mkdir -p chroot/binary.tmp mkdir -p chroot/binary.tmp
mount ${MOUNT_OPTIONS} ${FREELO} chroot/binary.tmp mount ${MOUNT_OPTIONS} ${FREELO} chroot/binary.tmp
cp -T ${CP_OPTIONS} binary/ chroot/binary.tmp cp -T ${CP_OPTIONS} binary/ chroot/binary.tmp
@ -282,22 +296,33 @@ EOF
fi fi
} }
umount chroot/binary.tmp case "${_BOOTLOADER}" in
rmdir chroot/binary.tmp 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 then
case "${LB_BUILD_WITH_CHROOT}" in case "${LB_BUILD_WITH_CHROOT}" in
true) true)
Chroot chroot "syslinux ${FREELO}" Chroot chroot "${_SYSLINUX_INSTALLER}"
;; ;;
false) false)
syslinux ${FREELO} ${_SYSLINUX_INSTALLER}
;; ;;
esac esac
fi fi
umount chroot/binary.tmp
rmdir chroot/binary.tmp
Lodetach ${FREELO} Lodetach ${FREELO}
echo "!!! The above error/warning messages can be ignored !!!" echo "!!! The above error/warning messages can be ignored !!!"

View File

@ -79,15 +79,28 @@ case "${LIVE_IMAGE_TYPE}" in
;; ;;
hdd*|*) hdd*|*)
_BOOTLOADER="syslinux" case ${LB_BINARY_FILESYSTEM} in
fat*|ntfs)
_BOOTLOADER=syslinux
case "${LB_MODE}" in case "${LB_MODE}" in
progress-linux) progress-linux)
_TARGET="binary/boot" _TARGET="binary/boot"
;;
*)
_TARGET="binary/syslinux"
;;
esac
;; ;;
ext[234]|btrfs)
_BOOTLOADER=extlinux
_TARGET="binary/boot/extlinux"
;;
*) *)
_TARGET="binary/syslinux" Echo_error "syslinux/extlinux doesn't support ${LB_BINARY_FILESYSTEM}"
exit 1
;; ;;
esac esac
;; ;;
@ -110,7 +123,7 @@ fi
# Checking depends # Checking depends
case "${LB_BUILD_WITH_CHROOT}" in case "${LB_BUILD_WITH_CHROOT}" in
true) true)
Check_package chroot/usr/bin/syslinux syslinux Check_package chroot/usr/bin/${_BOOTLOADER} ${_BOOTLOADER}
Check_package chroot/usr/lib/syslinux syslinux-common Check_package chroot/usr/lib/syslinux syslinux-common
if ls "${_SOURCE}"/*.svg* > /dev/null 2>&1 if ls "${_SOURCE}"/*.svg* > /dev/null 2>&1
@ -120,10 +133,10 @@ case "${LB_BUILD_WITH_CHROOT}" in
;; ;;
false) false)
if [ ! -e /usr/bin/syslinux ] if [ ! -e /usr/bin/${_BOOTLOADER} ]
then then
# syslinux # syslinux or extlinux
Echo_error "/usr/bin/syslinux - no such file." Echo_error "/usr/bin/${_BOOTLOADER} - no such file."
exit 1 exit 1
fi fi