Subject: Bug#731709: grub-efi UEFI support based on debian-cd work complete (repos)

From: Michal Suchanek <[email-masked]>
Date: Wed, 27 Jan 2016 19:00:14 +0100

On 26 January 2016 at 23:20, adrian15 <[email-masked]> wrote:
> El 26/01/16 a las 10:18, Michal Suchanek escribió:

>>
>>>
>>> My use case is the following one. The final user requests:
>>>
>>> --bootloaders=grub-efi,syslinux
>>>
>>> so I show him:
>>>
>>> "Warning. You are using: syslinux as a non first bootloader. This might
>>> work
>>> but it is not advised."
>>>
>>> How do I know that I have to output this message?
>>
>>
>> for bootloader in $BOOTLOADERS ; do
>>
>>      # some bootloader foo
>>
>>      if echo $BIOS_BOOTLOADERS | grep "${bootloader}" >/dev/null; then
>> # a fixed list of bootloaders that load through legacy BIOS -
>> currently should be "syslinux grub-pc" although grub is not well
>> supported
>>          case $MEDIA_TYPE in # or whatever the variable
>>              iso*)
>>                  case "${BOOTLOADERS}" in
>>                      "${bootloader}"*);;
>>                      *) echo "Warning: it is recommended to specify
>> $bootloader first in bootloader list so it gets installed as first
>> el-torito boot entry."
>>                          ;;
>>                  esac ;;
>>          esac
>>      fi
>> done
>
> Here you are creating a new variable: $BIOS_BOOTLOADERS which will have to
> be updated manually each time a new bios bootloader binary_ file is added.

So what? Any other way to recognize a BIOS bootloader as such?

>
> The grep part should be improved to avoid problems (e.g. syslinux is inside
> syslinux-efi).

Except $BIOS_BOOTLOADERS does not include syslinux-efi so it does not happen ;-)

>
>>> Because I compare the internal variable:
>>>
>>> LB_FIRST_BOOTLOADER="grub-efi"
>>>
>>> with the bootloader name "syslinux" and I see they are not the same one.
>>>
>>> So, as you see I need to use:
>>>
>>> "non first bootloader" term
>>
>>
>> Why that has to be a term? Just say it should come first in the list
>> of bootloaders if specified at all.
>
>
> "It should come first". "It should not come first". Ok. I can do that and
> ditch the "non first bootloader" or "first bootloader" from my messages.
>
>>
>>> and
>>> LB_FIRST_BOOTLOADER variable.
>>
>>
>> what for?
>
>
> For two reasons:
>
> 1) Being able to use current live-build code which used LB_BOOTLOADER in the
> past.
>
> Check what it's in current alioth git (Seach for LB_PRIMARY_BOOTLOADER on
> there):
>
> https://anonscm.debian.org/cgit/debian-live/live-build.git/tree/scripts/build/binary_hdd?id=1ccb41623046f2a8f823d62a5f417cdae724c22b
>
> https://anonscm.debian.org/cgit/debian-live/live-build.git/tree/scripts/build/binary_iso?id=1ccb41623046f2a8f823d62a5f417cdae724c22b
>
> https://anonscm.debian.org/cgit/debian-live/live-build.git/tree/functions/defaults.sh?id=1ccb41623046f2a8f823d62a5f417cdae724c22b

Skimming through that code in every place LB_PRIMARY_BOOTLOADER is
used the code is broken.

If a bootloader is requested then you should install its files/check
that the filesystem is compatible/... regardless of the el-torito
record number it is installed in.

>
> 2) Not having to use awk each time I need to compare a first / default
> bootloader... when I can just use a variable with previous (once only)
> calculated value.

Which if used correctly would be used once or twice if at all.

Thanks

Michal