error by bootloader runtime selection

60 views
Skip to first unread message

esad ergül

unread,
May 19, 2022, 7:37:29 AM5/19/22
to swupdate
Hi,

I would have liked to try the new feature Bootloader runtime selection. I got the following error messages that grub was not initialized as a bootloader. 

$ swupdate -v -B grub -i myproduct_1.0.swu
[ERROR] : SWUPDATE failed [0] ERROR : Bootloader interface 'grub' could not be initialized.
[INFO ] : SWUPDATE running :  [print_registered_bootloaders] : Registered bootloaders:
[INFO ] : SWUPDATE running :  [print_registered_bootloaders] :  none    loaded.


$ cat swupdate.cfg
globals :
{
        verbose = true;
        loglevel = 5;
        syslog = true;
        bootloader = "grub";
};
$ swupdate -f swupdate.cfg -i myproduct_1.0.swu
[ERROR] : SWUPDATE failed [0] ERROR : Bootloader interface 'grub' could not be initialized.
[INFO ] : SWUPDATE running :  [print_registered_bootloaders] : Registered bootloaders:
[INFO ] : SWUPDATE running :  [print_registered_bootloaders] :  none    loaded.


$ cat sw-description
software = {
        version = "0.1.0";

        bootenv: (
        {
                name = "bootpart";
                value = "0:2";
        }
        );

};

My system information is as follows:

$ uname -a
Linux debian 5.10.0-14-amd64 #1 SMP Debian 5.10.113-1 (2022-04-29) x86_64 GNU/Linux
$ lsb_release -a
No LSB modules are available.
Distributor ID: Debian
Description:    Debian GNU/Linux 11 (bullseye)
Release:        11
Codename:       bullseye
$ swupdate --version
SWUpdate v2022.05-6-geff9118

Can someone please point me to where the error may be?

Thanks
Esad

Christian Storm

unread,
May 19, 2022, 7:58:38 AM5/19/22
to swupdate
Hi,

> I would have liked to try the new feature Bootloader runtime selection. I
> got the following error messages that grub was not initialized as a
> bootloader.
>
> $ swupdate -v -B grub -i myproduct_1.0.swu
> [ERROR] : SWUPDATE failed [0] ERROR : Bootloader interface 'grub' could not
> be initialized.
> [INFO ] : SWUPDATE running : [print_registered_bootloaders] : Registered
> bootloaders:
> [INFO ] : SWUPDATE running : [print_registered_bootloaders] : none
> loaded.

You most probably only enabled the 'Environment in RAM' bootloader
(CONFIG_BOOTLOADER_NONE) and none else, in particular not GRUB
(CONFIG_BOOTLOADER_GRUB) as it doesn't show up in the list of registered
bootloaders. The set of supported bootloaders is defined at *compile-time*
while you can chose one of them at run-time as your (default) bootloader.
So, include GRUB in this set and try again.



Kind regards,
Christian

--
Dr. Christian Storm
Siemens AG, Technology, T CED SES-DE
Otto-Hahn-Ring 6, 81739 München, Germany

esad ergül

unread,
May 19, 2022, 9:49:50 AM5/19/22
to swupdate
Hi,

many thanks for the quick response. If I understand correctly, I can select a default bootloader at runtime if I have selected several default bootloaders in the configuration menu. 

Bootloader Interfaces -->  You can select multiple bootloader interfaces, This can only be configured compile-time.
Default Bootloader Interfaces -->  You can select a bootloader from the list as default, if it has already been enabled in Bootloader Interfaces. This can be configured both compile-time and runtime.
Update Status Storage -->   You can select it, if you want to save the update status on the persistent bootloader environment block. This can only be configured compile-time.
Bootloader Handler --> You have to enable it, if you want to change bootloader environment block during installation

I have to currently build swupdate debian package (2021-11) with build profiles (pkg.swupdate.grub) to configure swupdate for the grub bootloader. If the new version is made available as a Debian package, this means that grub can be configured directly at runtime.

Thanks
Esad

Christian Storm

unread,
May 23, 2022, 5:56:03 AM5/23/22
to swupdate
Hi,

> many thanks for the quick response. If I understand correctly, I can select
> a default bootloader at runtime if I have selected several default
> bootloaders in the configuration menu.

Yes, out of those compiled-in you can select one at run-time. There's
also a default run-time selection you can chose at compile-time so that
you don't have to specify it every time and it also serves backward
compatibility.

> Bootloader Interfaces --> You can select multiple bootloader interfaces,
> This can only be configured compile-time.

Yes.

> Default Bootloader Interfaces --> You can select a bootloader from the
> list as default, if it has already been enabled in Bootloader Interfaces.

Yes. This is the default one chosen at run-time, and this you can
override with other compiled-in ones via the switches.

> This can be configured both compile-time and runtime.

Chosen at compile-time, but you can override it at run-time.

> Update Status Storage --> You can select it, if you want to save the
> update status on the persistent bootloader environment block. This can only
> be configured compile-time.

Yes.

> Bootloader Handler --> You have to enable it, if you want to change
> bootloader environment block during installation

Well, yes and no. This handler is used for setting the bootloader
environment values from a sw-description, see the documentation on
sw-description. It uses SWUpdate's internal bootloader interface. You
don't need this handler if you don't plan to modify the bootloader
environment from an sw-description. The rest works via SWUpdate's
internal bootloader interface.

> I have to currently build swupdate debian package (2021-11) with build
> profiles (pkg.swupdate.grub) to configure swupdate for the grub bootloader.
> If the new version is made available as a Debian package, this means that
> grub can be configured directly at runtime.

If that's enabled at compile-time as one of the supported bootloaders to
choose from at run-time (default or not), then yes.
The Debian folks (as well as others) now need to decide which
bootloaders they want to support for run-time selection....
Reply all
Reply to author
Forward
0 new messages