[Date Prev][Date Next] [Thread Prev][Thread Next] [Date Index] [Thread Index]

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



On 25 January 2016 at 21:33, adrian15 <adrian15sgd@gmail.com> wrote:
>
>
> El 25/01/16 a las 16:12, Michal Suchanek escribió:
>>
>> On 25 January 2016 at 03:05, adrian15 <adrian15sgd@gmail.com> wrote:
>>>
>>> El 24/01/16 a las 16:51, Michal Suchanek escribió:
>>
>>
>>> What you are describing here is what it's actually implemented in my
>>> patch
>>> (Well, actually the first patch version because the current one enforces
>>> bootloader roles).
>>
>>
>> Actually, no.
>>
>> Nowhere in the description is any bootloader designated primary or
>> secondary or first or second. On purpose.
>
> Neither it is on my patch (initial implementation). Yes, the term
> PRIMARY_BOOTLOADER is used there for reusing old code. But using:
>
> --bootloaders=syslinux,grub-efi
>
> did not enforce syslinux to be in the first place or grub-efi to be in the
> second place.
>
> That's the specific part I meant.
>
>>
>>> So what about primary and secondary terms? Or first or
>>> second terms?
>>
>>
>> Both are broken and confusing.
>
> Ok...
>>>
>>>
>>> These terms are used in two places:
>>> * Internal variables and functions to handle bootloaders
>>> * Information shown to the final user
>>>
>>> I'm most convinced to use the first and non-first notation. So that the
>>> old
>>> code that referred to LB_BOOTLOADER can just refer to:
>>> LB_FIRST_BOOTLOADER.
>>
>>
>> For what piece of code we have does it make sense to reference
>> LB_FIRST_BOOTLOADER when not also referencing LB_SECOND_BOOTLOADER?
>> Will that be extended to LB_THIRD_BOOTLOADER once x86 grows support
>> for coreboot or l-b grows support for some other platform with many
>> firmware variants?
>>
>> If you set bootloaders like
>>
>> LB_BOOTLOADERS="syslinux grub-efi"
>>
>> then you can just do
>>
>> for bootloader in $LB_BOOTLOADERS ; do some $bootloader foo
>
> Mostly what current path does but with commas instead.

IIRC multivalue options use mostly spaces for separator in l-b so far.

>>
>>
>> after you check that you have at most two bootloaders and if you have
>> more than one then only the latter one ends with -efi.
>
>
> This is not a good approach. You are requesting the bootloaders to end in
> "-efi". The current approach is to name them based on the Debian package
> name. These packages do not need to end in "-efi".

It so happens that bootloaders that support efi are packaged as
packages with -efi suffix (well, except elilo). Maybe there is some
intent there?

However, grub-pc is now split in grub-pc scripts that are meant to
install the bootloader in the system which you probably don't want and
grub-pc-bin which just includes the binaries. The situation is even
more complicated with the 32bit and 64bit efi packages. Also expect
that at some point the maintainers figure out some new completely
awesome way to split the bootloader into packages and then the package
sets will be different in stable/testing/oldstable.

So naming the l-b option *exactly* like the package is not that good idea.

>
> 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


>
> 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.

> and
> LB_FIRST_BOOTLOADER variable.

what for?

>
> So...
>
> 1) I don't mind renaming "non first bootloader" or LB_FIRST_BOOTLOADER to
> another terminology which makes more technical sense.
> 2) I prefer this approach over yours (Michal) because it's the own
> bootloader which decides if it is more suited for "first bootloader" or not.

How does it decide that? It can install equally well in 1st, 2nd or
10th el-torito record. The only reason we want BIOS record first is


1) some tools for butchering bootable CDs expect it to be first.

2) it's the traditional place for it (since it was the only record for
a long time) and some ancient BIOSes might potentially break if it's
not first because somebody missed there *can* be multiple entries when
coding them.


So it only has to do with the fact that syslinux is our only well
supported BIOS loader that syslinux should go first. If grub-pc was
installed as BIOS loader it should go first instead. And then you
would have to duplicate that check in grub-pc.

> Let's not repeat the current binary_iso design which has many references to
> the different available binary_bootloaders available.

What's wrong with referencing variables we have so that we  know
what's going on in l-b?

Thanks

Michal


Reply to: