Skip to content
Snippets Groups Projects
Forked from Debian Live Team / live-build
Source project has a limited visibility.
  • Matthijs Kooijman's avatar
    8139ec38
    Improve bootloader configuration checks · 8139ec38
    Matthijs Kooijman authored
    It was documented that `lb config` would catch invalid combinations of
    bootloader type and image type or filesystem, but in practice only a
    small subset of the erroronous cases were caught. This makes the
    checking more thorough.
    
    It also updates the checks in the various bootloader binary scripts, to
    be explicit about what image types *are* supported (raising an error on
    anything else) rather than throwing an error on an list of unsupported
    image types (that might become incomplete in the future).
    
    Finally, it makes checks against *all* supplied bootloaders, rather than
    just the first one as was previously done.
    
    I tested these to work as expected (only the config, not the full
    build):
    
    	lb config -b iso --bootloaders syslinux; rm -rf config
    	lb config -b iso --bootloaders syslinux,grub-efi; rm -rf config
    	lb config -b iso --bootloaders grub-pc,grub-efi; rm -rf config
    	lb config -b isohybrid --bootloaders syslinux; rm -rf config
    	lb config -b isohybrid --bootloaders syslinux,grub-efi; rm -rf config
    	lb config -b isohybrid --bootloaders grub-pc,grub-efi; rm -rf config
    	lb config -b hdd --bootloaders syslinux; rm -rf config
    	lb config -b hdd --bootloaders syslinux,syslinux-efi; rm -rf config
    	lb config -b hdd --bootloaders syslinux-efi; rm -rf config
    	lb config -b hdd --binary-filesystem ext2 --bootloaders syslinux; rm -rf config
    	lb config -b hdd --binary-filesystem ext2 --bootloaders syslinux,syslinux-efi; rm -rf config
    	lb config -b netboot --bootloaders syslinux; rm -rf config
    	lb config -b hdd --bootloaders syslinux; rm -rf config
    	lb config -b hdd --bootloaders syslinux,syslinux-efi; rm -rf config
    	lb config -b hdd --bootloaders syslinux-efi; rm -rf config
    
    And tested to fail (or warn) as expected at config time:
    
    	lb config -b iso --bootloaders syslinux,syslinux-efi; rm -rf config
    	lb config -b iso --bootloaders syslinux-efi; rm -rf config
    	lb config -b isohybrid --bootloaders syslinux,syslinux-efi; rm -rf config
    	lb config -b isohybrid --bootloaders syslinux-efi; rm -rf config
    	lb config -b hdd --bootloaders syslinux,grub-efi; rm -rf config
    	lb config -b hdd --bootloaders grub-pc,grub-efi; rm -rf config
    	lb config -b hdd --binary-filesystem other_fs --bootloaders syslinux; rm -rf config
    	lb config -b hdd --binary-filesystem other_fs --bootloaders syslinux,syslinux-efi; rm -rf config
    	lb config -b netboot --bootloaders syslinux,grub-efi; rm -rf config
    	lb config -b netboot --bootloaders syslinux,syslinux-efi; rm -rf config
    	lb config -b netboot --bootloaders syslinux-efi; rm -rf config
    	lb config -b netboot --bootloaders grub-pc,grub-efi; rm -rf config
    8139ec38
    History
    Improve bootloader configuration checks
    Matthijs Kooijman authored
    It was documented that `lb config` would catch invalid combinations of
    bootloader type and image type or filesystem, but in practice only a
    small subset of the erroronous cases were caught. This makes the
    checking more thorough.
    
    It also updates the checks in the various bootloader binary scripts, to
    be explicit about what image types *are* supported (raising an error on
    anything else) rather than throwing an error on an list of unsupported
    image types (that might become incomplete in the future).
    
    Finally, it makes checks against *all* supplied bootloaders, rather than
    just the first one as was previously done.
    
    I tested these to work as expected (only the config, not the full
    build):
    
    	lb config -b iso --bootloaders syslinux; rm -rf config
    	lb config -b iso --bootloaders syslinux,grub-efi; rm -rf config
    	lb config -b iso --bootloaders grub-pc,grub-efi; rm -rf config
    	lb config -b isohybrid --bootloaders syslinux; rm -rf config
    	lb config -b isohybrid --bootloaders syslinux,grub-efi; rm -rf config
    	lb config -b isohybrid --bootloaders grub-pc,grub-efi; rm -rf config
    	lb config -b hdd --bootloaders syslinux; rm -rf config
    	lb config -b hdd --bootloaders syslinux,syslinux-efi; rm -rf config
    	lb config -b hdd --bootloaders syslinux-efi; rm -rf config
    	lb config -b hdd --binary-filesystem ext2 --bootloaders syslinux; rm -rf config
    	lb config -b hdd --binary-filesystem ext2 --bootloaders syslinux,syslinux-efi; rm -rf config
    	lb config -b netboot --bootloaders syslinux; rm -rf config
    	lb config -b hdd --bootloaders syslinux; rm -rf config
    	lb config -b hdd --bootloaders syslinux,syslinux-efi; rm -rf config
    	lb config -b hdd --bootloaders syslinux-efi; rm -rf config
    
    And tested to fail (or warn) as expected at config time:
    
    	lb config -b iso --bootloaders syslinux,syslinux-efi; rm -rf config
    	lb config -b iso --bootloaders syslinux-efi; rm -rf config
    	lb config -b isohybrid --bootloaders syslinux,syslinux-efi; rm -rf config
    	lb config -b isohybrid --bootloaders syslinux-efi; rm -rf config
    	lb config -b hdd --bootloaders syslinux,grub-efi; rm -rf config
    	lb config -b hdd --bootloaders grub-pc,grub-efi; rm -rf config
    	lb config -b hdd --binary-filesystem other_fs --bootloaders syslinux; rm -rf config
    	lb config -b hdd --binary-filesystem other_fs --bootloaders syslinux,syslinux-efi; rm -rf config
    	lb config -b netboot --bootloaders syslinux,grub-efi; rm -rf config
    	lb config -b netboot --bootloaders syslinux,syslinux-efi; rm -rf config
    	lb config -b netboot --bootloaders syslinux-efi; rm -rf config
    	lb config -b netboot --bootloaders grub-pc,grub-efi; rm -rf config