Skip to content

kernel-install does not follow the BSP to determine $BOOT #26644

Closed

Description

@rfc1036

systemd version the issue has been seen with

252

Used distribution

Debian unstable

Linux kernel version used

6.1.0-3-amd64

CPU architectures issue was seen on

None

Component

kernel-install

Expected behaviour you didn't see

kernel-install add should create boot loader entries in $BOOT, as defined by the Boot Loader Specification.

Unexpected behaviour you saw

kernel-install add searches a static list of directories instead of properly determining where $BOOT is supposed to be and will create the entries in /efi/loader/ even if it does not already exist and there are working entries in /boot/loader/:

    BOOT_ROOT_SEARCH="/efi /boot /boot/efi"
...
for pref in $BOOT_ROOT_SEARCH; do

bootctl instead will keep updating /boot/loader/.

Steps to reproduce the problem

I think that this happens because I have a an ESP mounted on /efi and an XBOOTLDR (with GPT UUID BC13C2FF-59E6-4262-A352-B275FD6F7172) mounted on /boot.

Additional program output to the terminal or log subsystem illustrating the issue

root@bongo:~# /usr/bin/kernel-install inspect
KERNEL_INSTALL_MACHINE_ID: 0eea4445a08017fad49a4ffef6ef8600
KERNEL_INSTALL_ENTRY_TOKEN: 0eea4445a08017fad49a4ffef6ef8600
KERNEL_INSTALL_BOOT_ROOT: /efi
KERNEL_INSTALL_LAYOUT: bls
KERNEL_INSTALL_INITRD_GENERATOR: 
ENTRY_DIR_ABS: /efi/0eea4445a08017fad49a4ffef6ef8600/$KERNEL_VERSION
root@bongo:~#

Activity

  1. added
    bug 🐛
    on Mar 2, 2023
  2. rfc1036 commented on Mar 2, 2023

    @rfc1036
    ContributorAuthor

    I have figured out that kernel-install would use /efi/ because I had a /efi/0eea4445a08017fad49a4ffef6ef8600/ directory: deleting it made it use /boot/.

    But later I created /efi/loader/entries/ with one entry to chainload grub, because it is in /efi/, and then it would use /efi/ again. While having two boot loader directories may be unusual it is totally legitimate accordingly to my reading of the BLS.

    Short summary: kernel-install should not use a different logic from bootctl (which correctly follows the standard) to select $BOOT.

  3. bluca commented on Mar 3, 2023

    @bluca
    Member

    There's two issues here:

    • when there are no 'markers' anywhere (machine-id, etc), then we simply look at mountpoints, preferring /efi/, and the partition GUIDs are ignored - the linked PR fixes this as it seems pretty safe to do, as it affects completely un-configured systems
    • when there are some markers, we don't fully respect the BLS, and if both XBOOTLDR and ESP are available, but XBOOTLDR is empty and ESP has markers, we use the latter while the BLS says it should use the former - this is trickier as it might change behaviour on existing, configured systems, so I'll leave it alone for now
  4. rfc1036 commented on Mar 3, 2023

    @rfc1036
    ContributorAuthor

    It is not just that: the ESP is used also if both the XBOOTLDR partition and the ESP have markers. In this case the BLS specifies that the XBOOTLDR partition must be used.

  5. bluca commented on Mar 7, 2023

    @bluca
    Member

    Reopening as only the first issue is solved

  6. reopened this on Mar 7, 2023
  7. poettering commented on Oct 28, 2026

    @poettering
    Member

    42551ea should address this. closing.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    bug 🐛kernel-install

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions