Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Sometimes the boot entry title is missing generation + build time #220

Closed
colemickens opened this issue Sep 7, 2023 · 9 comments · Fixed by #242
Closed

Sometimes the boot entry title is missing generation + build time #220

colemickens opened this issue Sep 7, 2023 · 9 comments · Fixed by #242
Labels

Comments

@colemickens
Copy link
Member

I'm not sure what's up here, but I've been building and deploying generations to this machine over the past few days.

But, look at generation 247, the title is different:

  • title: NixOS Tapir 23.11.20230903.9695c13 (Linux 6.4.14) (Generation 248, Built on 2023-09-06)
  • title: NixOS Tapir 23.11.20230905.2f4e16a (Linux 6.4.14)
  • title: NixOS Tapir 23.11.20230903.9695c13 (Linux 6.4.14) (Generation 246, Built on 2023-09-05)

Full(er) bootctl list output:

...
...

         type: Boot Loader Specification Type #2 (.efi)
        title: NixOS Tapir 23.11.20230903.9695c13 (Linux 6.4.14) (Generation 248, Built on 2023-09-06)
           id: nixos-generation-248.efi
       source: /efi//EFI/Linux/nixos-generation-248.efi
     sort-key: lanza
      version: Generation 248, Built on 2023-09-06
        linux: /efi//EFI/Linux/nixos-generation-248.efi
      options: init=/nix/store/12208j9s629ar1gwp7nqvx3vzrbamwhz-nixos-system-zeph-23.11.20230903.9695c13/init mitigations=off amd_pstate=active pcie_aspm.policy=powersupersave nohibernate loglevel=4

         type: Boot Loader Specification Type #2 (.efi)
        title: NixOS Tapir 23.11.20230905.2f4e16a (Linux 6.4.14)
           id: nixos-generation-247.efi
       source: /efi//EFI/Linux/nixos-generation-247.efi
     sort-key: lanza
      version: Generation 247, Built on 2023-09-05
        linux: /efi//EFI/Linux/nixos-generation-247.efi
      options: init=/nix/store/infyiwivv58bfjnigqns2idnl6rb9663-nixos-system-zeph-23.11.20230905.2f4e16a/init mitigations=off amd_pstate=active nohibernate loglevel=4

         type: Boot Loader Specification Type #2 (.efi)
        title: NixOS Tapir 23.11.20230903.9695c13 (Linux 6.4.14) (Generation 246, Built on 2023-09-05)
           id: nixos-generation-246.efi
       source: /efi//EFI/Linux/nixos-generation-246.efi
     sort-key: lanza
      version: Generation 246, Built on 2023-09-05
        linux: /efi//EFI/Linux/nixos-generation-246.efi
      options: init=/nix/store/8a07nkj1fjc61grnapfjjzmmzmghzg91-nixos-system-zeph-23.11.20230903.9695c13/init mitigations=off amd_pstate=active nohibernate loglevel=4

         type: Automatic
        title: Windows Boot Manager
           id: auto-windows
       source: /sys/firmware/efi/efivars/LoaderEntries-4a67b082-0a4c-41cf-b6c7-440b29bb8c4f

I noticed this, as it's visible on the boot menu:
PXL_20230906_132457264

@RaitoBezarius
Copy link
Member

I do notice the same behavior.

@colemickens
Copy link
Member Author

I will say, reviewing the image I posted, it's a bit odd that my nixpkgs git rev seems to ... change/advance and then revert back. I'm super jet-lagged so I'm afraid to speculate further right now.

@nikstur
Copy link
Member

nikstur commented Sep 8, 2023

Can you objdump the UKI in question (or better only the .osrel section)? I don't see a code path that can silently fail when generating the os-release (which determines how a generation is displayed). If the tool can't read the build time, for example it would display: "Generation ${X}, Built on Unknown". The generation number needs to be available otherwise lzbt fails.

@blitz
Copy link
Member

blitz commented Sep 8, 2023

Same here:

image

Wow. My display is dirty. ;)

Let me extract some osrel sections...

@blitz
Copy link
Member

blitz commented Sep 8, 2023

Broken:

/boot/EFI/Linux🔒 
❯ objdump -s -j .osrel nixos-generation-445.efi

nixos-generation-445.efi:     file format pei-x86-64

Contents of section .osrel:
 1400203cc 49443d6c 616e7a61 0a505245 5454595f  ID=lanza.PRETTY_
 1400203dc 4e414d45 3d4e6978 4f532053 746f6174  NAME=NixOS Stoat
 1400203ec 2032332e 30352e32 30323330 3930352e   23.05.20230905.
 1400203fc 34303737 61306520 284c696e 75782036  4077a0e (Linux 6
 14002040c 2e352e31 290a5645 5253494f 4e5f4944  .5.1).VERSION_ID
 14002041c 3d47656e 65726174 696f6e20 3434352c  =Generation 445,
 14002042c 20427569 6c74206f 6e203230 32332d30   Built on 2023-0
 14002043c 392d3037 0a                          9-07.           

Good:

/boot/EFI/Linux🔒 
❯ objdump -s -j .osrel nixos-generation-443.efi

nixos-generation-443.efi:     file format pei-x86-64

Contents of section .osrel:
 1400203cc 49443d6c 616e7a61 0a505245 5454595f  ID=lanza.PRETTY_
 1400203dc 4e414d45 3d4e6978 4f532053 746f6174  NAME=NixOS Stoat
 1400203ec 2032332e 30352e32 30323330 3832322e   23.05.20230822.
 1400203fc 61313666 37656220 284c696e 75782036  a16f7eb (Linux 6
 14002040c 2e342e31 31290a56 45525349 4f4e5f49  .4.11).VERSION_I
 14002041c 443d4765 6e657261 74696f6e 20343433  D=Generation 443
 14002042c 2c204275 696c7420 6f6e2032 3032332d  , Built on 2023-
 14002043c 30382d32 370a                        08-27.  

@blitz
Copy link
Member

blitz commented Sep 8, 2023

It seems systemd-boot only shows VERSION_ID when PRETTY_NAME is not unique. At least that would be my guess when looking at my and @colemickens screenshots.

So should we just add the generation number to PRETTY_NAME if people want to know it?

@colemickens
Copy link
Member Author

Alternatively, maybe a feature request to systemd-boot to always display VERSION_ID, or an option to do so?

@blitz
Copy link
Member

blitz commented Sep 10, 2023

It's probably easier to include the generation number in the pretty name.

@nikstur
Copy link
Member

nikstur commented Sep 10, 2023

It seems systemd-boot only shows VERSION_ID when PRETTY_NAME is not unique.

Thats pretty surprising behaviour. We should open a systemd issue, but I agree that we should fix it quickly by including the generation number in pretty name.

blitz added a commit that referenced this issue Oct 20, 2023
... to give a consistent user experience in systemd-boot.

Fixes #220.
blitz added a commit that referenced this issue Oct 20, 2023
... to give a consistent user experience in systemd-boot.

Fixes #220.
@blitz blitz added the tool label Oct 20, 2023
RaitoBezarius pushed a commit that referenced this issue Jul 20, 2024
... to give a consistent user experience in systemd-boot.

Fixes #220.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging a pull request may close this issue.

4 participants