~sjg1/curtin:boot2

Last commit made on 2025-02-20
Get this branch:
git clone -b boot2 https://git.launchpad.net/~sjg1/curtin
Only Simon Glass can upload to this branch. If you are Simon Glass please log in for upload directions.

Branch merges

Branch information

Name:
boot2
Repository:
lp:~sjg1/curtin

Recent commits

f5e93cf... by Simon Glass

Add initial support for extlinux bootloader

Add a basic implementation of this, mirroring the u-boot-update script.
For now, this lacks several features which require schema additions.

The main question here is how to find the correct root= argument for
Linux.

Signed-off-by: Simon Glass <email address hidden>

c91f951... by Simon Glass

Adjust get_kernel_list() ordering

For extlinux, the normal ordering is most recent kernel first.

Update get_kernel_list() to use packaging.version to sort kernels and
reverse the order.

Existing tests rely on the current ordering, so update them to handle
the new one.

Signed-off-by: Simon Glass <email address hidden>

87c9c90... by Simon Glass

Create a function to find kernels

Move this functionality into the paths modules so it can be used for the
extlinux support.

Signed-off-by: Simon Glass <email address hidden>

374655e... by Simon Glass <email address hidden>

Update tests to use the top-level boot key

Adjust the only affected file in examples/tests

Signed-off-by: Simon Glass <email address hidden>

8be682f... by Simon Glass

Introduce a new boot builtin hook

Introduce a new hook for builtin_curthooks to configure the system to
boot. This currently uses grub but will also support extlinux in future.

The configuration key is 'boot'. It can be thought of as a rename of the
existing top-level 'grub' key, except that it allows one or more
bootloaders to be installed, using a new 'bootloaders' key. So the old
configuration:

    grub:
        install_devices:
            - /dev/vdb'

should now be expressed as:

    boot:
        bootloaders:
            - grub
        install_devices:
            - /dev/vdb'

The 'bootloaders' key is required. It does not have a default. This is
to ensure that each use of Curtin is converted with due care to which
bootloaders should be supported.

If 'boot' is missing, then a top-level 'grub' key is converted into
'boot', with all properties remaining the same except for the automatic
addition of:

    bootloaders:
        - grub

This maintains backwards compatibility with the old schema.

It would be quite nice to use an enum for the bootloaders.

Signed-off-by: Simon Glass <email address hidden>

61c3d64... by Simon Glass

Move grub config above curthooks

In preparation for renaming this option to 'boot', move it up into its
new position. This will make it easier to review the change.

Signed-off-by: Simon Glass <email address hidden>

099421b... by Simon Glass

Move handling of grub_install_devices to setup_boot()

Apart from in tests, setup_boot() is the only caller of setup_grub(), so
handle the conversion setup_boot(), to avoid setup_grub() messing with
the config.

Signed-off-by: Simon Glass <email address hidden>

a7c3cd3... by Simon Glass

Add a new setup_boot() function

In preparation for supporting bootloaders other than grub, create a new
setup_boot() function and call that instead of setup_grub(). Move
calling uses_grub() into this function.

This will allow setting up another bootloader later.

Signed-off-by: Simon Glass <email address hidden>

704bb1a... by Simon Glass

Drop parser for install_grub

This is not used by the main program and it is probably not a good idea
to start using it. The functionality of this module is accessed by
calling the install_grub() function.

Remove this unused code.

Leave this in the commands/ subdir for now, but we could consider moving
it, e.g. into a new boot/ subdir.

Signed-off-by: Simon Glass <email address hidden>

5529602... by Simon Glass

Rename grubcfg to bootcfg

In preparation for renaming the top-level config from 'grub' to 'boot',
rename the variables and the configuration class.

Signed-off-by: Simon Glass <email address hidden>