Page MenuHomeLubuntu Development

Set GRUB_DISTRIBUTOR correctly
Open, NormalPublic

Description

Actual behaviour on 18.04:
The value of the variable GRUB_DISTRIBUTOR in /etc/default/grub is set to `lsb_release -i -s 2> /dev/null || echo Debian`.
Every time an update-grub is executed, the value of the variable is taken from the command lsb_release (which is Ubuntu, but theoretically could change).

Actual behaviour on 18.10 and later:
The value of the variable GRUB_DISTRIBUTOR in /etc/default/grub is set during the installation by Calamares. Calamares gets the value from the bootloaderEntryName, which is set for example to Lubuntu 18.10.
Every time an update-grub is executed, the hardcoded value is used.
Source => https://phab.lubuntu.me/source/calamares-settings-ubuntu/browse/master/lubuntu/branding/lubuntu/branding.desc

Problem:
The value of GRUB_DISTRIBUTOR is hardcoded with a version. After a release-upgrade (e.g 18.10 => 19.04), the menu entry in Grub will still use the hardcoded value "Lubuntu 18.10", although the OS in use is Lubuntu 19.04.

Possible problem:
According to T62 there might be a "platform expectation" that the menu entry should be called "Ubuntu" and not "Lubuntu".

Possible solutions:
There are several possible solutions.

  1. Set the value of GRUB_DISTRIBUTOR to `lsb_release -i -s 2> /dev/null || echo Debian`.
  2. Hardcode the value to Ubuntu
  3. Hardcode the value to Lubuntu
  4. Find another, sophisticated solution

Affects:
The solution might affect T30

Todo:

  • Discuss and find the best solution
  • Implement the defined solution

Event Timeline

apt-ghetto triaged this task as Normal priority.
apt-ghetto added a parent task: T41: Lubuntu 19.10.
apt-ghetto updated the task description. (Show Details)Mon, Jul 1, 10:55 AM
wxl added subscribers: tsimonq2, wxl.Mon, Jul 1, 4:30 PM

According to T62 it sounds like @tsimonq2 is definitively saying we need to set this to Ubuntu, or not change the behavior from the way Ubuntu sets it, which is to say we need to go with option #1. This may require doing some shell work ahead of time to set bootloaderEntryName programmatically.

This really depends on the functionality of Secureboot. If Secureboot is fine with the human-readable name saying "Lubuntu" and the machine-readable name saying "ubuntu", then we're fine here.

wxl added a comment.Mon, Jul 1, 9:21 PM

Well if you look, Darin Miller tested Secureboot when we did 19.04, and we had Lubuntu in it then, no?

tsimonq2 added a comment.EditedMon, Jul 1, 9:24 PM

Yeah, as far as I can tell, we had "ubuntu" as the machine-readable bootloader ID and "Lubuntu" as the human-readable.

@apt-ghetto Do you want to test the above while running it through sed "s/Ubuntu/Lubuntu/"?

The efibootloaderId from https://phab.lubuntu.me/source/calamares-settings-ubuntu/browse/master/lubuntu/modules/bootloader.conf$33 is something else and is used only when installed in the UEFI mode.
This value is taken for the name of the bootloader entry in the NVRAM (where UEFI is looking for the bootloader to choose) and the name of the folder on the EFI-System-Partition (ESP). Most users don't see these entries very often, because they don't change the UEFI boot order settings often and don't search in the folders on the ESP.
I don't know, if Secure Boot takes into account the path on the ESP. I don't think so.
Changing the efibootloaderId to lubuntu could create another "problem", especially when other *buntus are installed. If there are updates for Grub, it will execute a grub-install. I don't know, where the value for the option --bootloader-id comes from during the installation of the new Grub package. Maybe we have then an older Grub in $ESP\EFI\lubuntu and a newer Grub in $ESP\EFI\ubuntu and for each bootloader two entries in the NVRAM (shimx64.efi and grubx64.efi).
The other flavours use, as far as I know, ubuntu and I think it is a good idea to have a common base, so I don't recommend to change the efibootloaderId.


The variable GRUB_DISTRIBUTOR on the other hand is used both in UEFI and BIOS mode. There are several scripts in /etc/grub.d/ where the value is used. For example:

/etc/grub.d/05_debian_theme
set_default_theme(){
        case $GRUB_DISTRIBUTOR in
                Tanglu|Ubuntu|Kubuntu)  # <======= Lubuntu doesn't match

This variable is used to create the boot entry in the Grub menu, which is visible to the user, if he has a dual/multi boot or if he has enabled the Grub menu. Changing it would require changes also in the scripts (which seems to be possible, see Kubuntu).

I guess, the result of T30 should be a separate package (something like grub-theme-lubuntu*.deb). Depending on this discussion, the theme will work only for Lubuntu (in case of "Lubuntu") or also for other users (in case of "Ubuntu") or the package contains also stuff explicitly for other flavours.