diff --git a/functions/configuration.sh b/functions/configuration.sh index 5826ab2c3..be12f2173 100755 --- a/functions/configuration.sh +++ b/functions/configuration.sh @@ -617,6 +617,13 @@ Validate_config () fi fi + if In_list "grub-pc" ${LB_BOOTLOADERS} || In_list "grub-efi" ${LB_BOOTLOADERS} || In_list "grub-legacy" ${LB_BOOTLOADERS}; then + if In_list "${LIVE_IMAGE_TYPE}" hdd netboot; then + Echo_error "You have selected an invalid combination of bootloaders and live image type; the grub-* bootloaders are not compatible with hdd and netboot types." + exit 1 + fi + fi + if ! In_list "${LIVE_IMAGE_TYPE}" iso iso-hybrid hdd tar netboot; then Echo_error "You have specified an invalid value for --binary-image." exit 1 diff --git a/scripts/build/binary_grub-efi b/scripts/build/binary_grub-efi index 90e25e4fb..d1a9ff91d 100755 --- a/scripts/build/binary_grub-efi +++ b/scripts/build/binary_grub-efi @@ -21,6 +21,10 @@ USAGE="${PROGRAM} [--force]" # Processing arguments and configuration files Init_config_data "${@}" +if In_list "${LIVE_IMAGE_TYPE}" hdd netboot; then + exit 0 +fi + Check_Any_Bootloader_Role "grub-efi" Echo_message "Begin preparing Grub based EFI support..." @@ -38,15 +42,6 @@ Acquire_lockfile Check_architectures amd64 i386 arm64 armhf Check_crossarchitectures -# Setting destination directory -case "${LIVE_IMAGE_TYPE}" in - hdd|netboot) - Echo_warning "Bootloader in this image type not yet supported by live-build." - Echo_error "This would produce a not bootable image, aborting (FIXME)." - exit 1 - ;; -esac - # Checking depends case "${LB_ARCHITECTURES}" in amd64|i386) diff --git a/scripts/build/binary_grub-legacy b/scripts/build/binary_grub-legacy index 39e59d437..7891bba65 100755 --- a/scripts/build/binary_grub-legacy +++ b/scripts/build/binary_grub-legacy @@ -21,6 +21,10 @@ USAGE="${PROGRAM} [--force]" # Processing arguments and configuration files Init_config_data "${@}" +if In_list "${LIVE_IMAGE_TYPE}" hdd netboot; then + exit 0 +fi + Check_First_Bootloader_Role "grub-legacy" Echo_message "Begin installing grub-legacy..." @@ -103,27 +107,16 @@ case "${LB_INITRAMFS}" in esac # Setting destination directory -case "${LIVE_IMAGE_TYPE}" in - iso|iso-hybrid|tar) - case "${LB_INITRAMFS}" in - live-boot) - DESTDIR_LIVE="binary/live" - ;; - - *) - DESTDIR_LIVE="binary/boot" - ;; - esac - - DESTDIR_INSTALL="binary/install" +case "${LB_INITRAMFS}" in + live-boot) + DESTDIR_LIVE="binary/live" ;; - hdd|netboot) - Echo_warning "Bootloader in this image type not yet supported by live-build." - Echo_error "This would produce a not bootable image, aborting (FIXME)." - exit 1 + *) + DESTDIR_LIVE="binary/boot" ;; esac +DESTDIR_INSTALL="binary/install" # Creating directory mkdir -p "${DESTDIR_LIVE}" diff --git a/scripts/build/binary_grub-pc b/scripts/build/binary_grub-pc index 4549d3b41..85074a486 100755 --- a/scripts/build/binary_grub-pc +++ b/scripts/build/binary_grub-pc @@ -21,6 +21,10 @@ USAGE="${PROGRAM} [--force]" # Processing arguments and configuration files Init_config_data "${@}" +if In_list "${LIVE_IMAGE_TYPE}" hdd netboot; then + exit 0 +fi + Check_Any_Bootloader_Role "grub-pc" Echo_message "Begin installing grub-pc..." @@ -47,15 +51,6 @@ Restore_package_cache binary # Installing depends Install_package -# Setting destination directory -case "${LIVE_IMAGE_TYPE}" in - hdd|netboot) - Echo_warning "Bootloader in this image type not yet supported by live-build." - Echo_error "This would produce a not bootable image, aborting (FIXME)." - exit 1 - ;; -esac - # Copying templates mkdir -p binary/boot/grub/i386-pc