Skip to content

systemd-boot-builder.py can't deal with versions of the form major.minor #140686

Closed

Description

@sternenseemann

Describe the bug

bootctl status shows this for me:

Available Boot Loaders on ESP:
          ESP: /boot (/dev/disk/by-partuuid/4491941f-d624-45fe-bd5f-3da695baf5ed)
         File: └─/EFI/systemd/systemd-bootx64.efi (systemd-boot 249.4)
         File: └─/EFI/BOOT/BOOTX64.EFI (systemd-boot 249.4)

When I try to upgrade my system, I get the error “could not find any previously installed systemd-boot”. This is because the systemd-boot-builder.py script can't deal with systemd-boot versions with a minor version appended to it, since the regex is \d+:

m = re.search("^\W+File:.*/EFI/(BOOT|systemd)/.*\.efi \(systemd-boot (\d+)\)$",
sdboot_status, re.IGNORECASE | re.MULTILINE)
if m is None:
print("could not find any previously installed systemd-boot")
else:
sdboot_version = m.group(2)
if systemd_version > sdboot_version:
print("updating systemd-boot from %s to %s" % (sdboot_version, systemd_version))
subprocess.check_call(["@systemd@/bin/bootctl", "--path=@efiSysMountPoint@", "update"])

Fixing this is not quite straightforward sadly, since the version is later used for comparison, so fixing this requires adding support for proper major/minor version comparison in this script.

Notify maintainers

???

Metadata

Please run nix-shell -p nix-info --run "nix-info -m" and paste the result.

[user@system:~]$ nix-shell -p nix-info --run "nix-info -m"
 - system: `"x86_64-linux"`
 - host os: `Linux 5.10.61, NixOS, 21.11 (Porcupine)`
 - multi-user?: `yes`
 - sandbox: `yes`
 - version: `nix-env (Nix) 2.3.15`
 - channels(root): `"vuizvui"`
 - channels(lukas): `""`
 - nixpkgs: `/nix/var/nix/profiles/per-user/root/channels/vuizvui/nixpkgs`

Maintainer information:

# a list of nixpkgs attributes affected by the problem
attribute:
# a list of nixos modules affected by the problem
module: boot.loader.systemd-boot

Activity

  1. added
    0.kind: bug
    6.topic: nixos
    6.topic: systemd
    on Oct 5, 2021
  2. pennae commented on Oct 5, 2021

    @pennae
    Contributor

    related #140046?

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

    0.kind: bug6.topic: nixos6.topic: systemd

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions