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

Unable to successfully run nixos-install with xbootldrMountPoint option #296059

Closed
codingCoffee opened this issue Mar 15, 2024 · 4 comments
Closed
Labels
0.kind: bug Something is broken

Comments

@codingCoffee
Copy link
Contributor

Describe the bug

nixos-install fails when using the boot.loader.systemd-boot.xbootldrMountPoint parameter.

Steps To Reproduce

Steps to reproduce the behaviour:

  1. Create a custom ISO with nixpkgs-unstable
  2. Partition disk to use
    a. a 512GB 8300 partition ext4 formatted mounted at /
    b. a 4GB EF02 partition fat32 formatted mounted at /boot
    c. a 512MB EF00 partition fat32 formatted mounted at /boot/efi
  3. Modify configuration.nix to add the boot.loader.efi.efiSysMountPoint = "/boot/efi"; and boot.loader.systemd-boot.xbootldrMountPoint = "/boot"; lines
  4. Use nixos-install

Expected behaviour

2 things here.

  1. I expected the nixos installer to raise an error and quit after the bootctl install command failed. It raised an error and still continued with the installation. But that is not the reason I'm here.
  2. I'm unable to understand this Partition has wrong PART_ENTRY_TYPE=c12a7328-f81f-11d2-ba4b-00a0c93ec93b for XBOOTLDR partition error. Also c12a7328-f81f-11d2-ba4b-00a0c93ec93b does not match the UUID of any of my partitions.

Screenshots

[nixos@nixos:/mnt]$ sudo nix-install
installing the boot loader...
setting up /etc...
Initializing machine ID from random generator.
/dev/nvme0n1p2: Partition has wrong PART_ENTRY_TYPE=c12a7328-f81f-11d2-ba4b-00a0c93ec93b for XBOOTLDR partition.
Traceback (most recent call last):
  File "/nix/store/712p6sw61vw33f5dcqrf7ryv9gmg5lkg-systemd-boot/bin/systemd-boot-builder", line 394, in <module>
    main()
  File "/nix/store/712p6sw61vw33f5dcqrf7ryv9gmg5lkg-systemd-boot/bin/systemd-boot-builder", line 377, in main
    install_bootloader(args)
  File "/nix/store/712p6sw61vw33f5dcqrf7ryv9gmg5lkg-systemd-boot/bin/systemd-boot-builder", line 292, in install_bootloader
    subprocess.check_call([f"{SYSTEMD}/bin/bootctl", f"--esp-path={EFI_SYS_MOUNT_POINT}"] + bootctl_flags + ["install"])
  File "/nix/store/3v2ch16fkl50i85n05h5ckss8pxx6836-python3-3.11.8/lib/python3.11/subprocess.py", line 413, in check_call
    raise CalledProcessError(retcode, cmd)
subprocess.CalledProcessError: Command '['/nix/store/klc3y2c97sc22wsv1cjwf4dfwcws095l-systemd-255.2/bin/bootctl', '--esp-path=/boot/efi', '--boot-path=/boot', 'install']' returned non-zero exit status 1.
setting up /etc...
setting up /etc...
setting root password...
New password:
Retype new password:
passwd: password updated successfully
installation finished!

Additional context

Referencing this PR #285401, since that is the feature I'm trying to use.

I would've preferred to use ext4 for the /boot partition, and I did, but that too had failed, only to later realize systemd-boot in and of itself still doesn't have an ext4/btrfs/non-fat driver. (Ref)
I'm unsure if my partitioning scheme is incorrect, or if I need to add any additional configuration. Please do ask for any other information to help debug the issue.

Also, just a sidenote, I'm not using ext4 for /. I'm using BTRFS on LUKS. I mentioned ext4 for simplicity. But I don't think it should be relevant in this case. Please do ask for more information if needed.

Notify maintainers

@sdht0

Metadata

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

[nixos@nixos:~]$ nix-shell -p nix-info --run "nix-info -m"
 - system: `"x86_64-linux"`
 - host os: `Linux 6.6.21, NixOS, 24.05 (Uakari), 24.05.20240312.0ad13a6`
 - multi-user?: `yes`
 - sandbox: `yes`
 - version: `nix-env (Nix) 2.18.1`
 - channels(root): `"nixos-24.05.20240312.0ad13a6"`
 - nixpkgs: `/nix/var/nix/profiles/per-user/root/channels/nixos/nixpkgs`

Add a 👍 reaction to issues you find important.

@codingCoffee codingCoffee added the 0.kind: bug Something is broken label Mar 15, 2024
@sdht0
Copy link
Contributor

sdht0 commented Mar 15, 2024

The /boot partition should be ea00 instead.

@codingCoffee
Copy link
Contributor Author

Facing a new error

installing the boot loader...
setting up /etc...
File system "/dev/nvme0n1p2" has wrong type for an EFI System Partition (ESP).
Traceback (most recent call last):
  File "/nix/store/f9pwpw6nl9gi1rqzf6lalkn855slgs10-systemd-boot/bin/systemd-boot-builder", line 394, in <module>
    main()
  File "/nix/store/f9pwpw6nl9gi1rqzf6lalkn855slgs10-systemd-boot/bin/systemd-boot-builder", line 377, in main
    install_bootloader(args)
  File "/nix/store/f9pwpw6nl9gi1rqzf6lalkn855slgs10-systemd-boot/bin/systemd-boot-builder", line 292, in install_bootloader
    subprocess.check_call([f"{SYSTEMD}/bin/bootctl", f"--esp-path={EFI_SYS_MOUNT_POINT}"] + bootctl_flags + ["install"])
  File "/nix/store/3v2ch16fkl50i85n05h5ckss8pxx6836-python3-3.11.8/lib/python3.11/subprocess.py", line 413, in check_call
    raise CalledProcessError(retcode, cmd)
subprocess.CalledProcessError: Command '['/nix/store/klc3y2c97sc22wsv1cjwf4dfwcws095l-systemd-255.2/bin/bootctl', '--esp-path=/boot', '--boot-path=/boot/efi', 'install']' returned non-zero exit status 1.
setting up /etc...
setting up /etc...
setting root password...
New password:
Retype new password:
passwd: password updated successfully
installation finished!

/dev/nvme0n1p2 is mounted on /boot
/dev/nvme0n1p1 is mounted on /boot/efi

@sdht0
Copy link
Contributor

sdht0 commented Mar 15, 2024

'--esp-path=/boot', '--boot-path=/boot/efi': looks like your definitions got switched somehow.

Btw it is recommended to mount the EFI partition at /efi instead of /boot/efi.

@codingCoffee
Copy link
Contributor Author

Ahhh! My bad!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
0.kind: bug Something is broken
Projects
None yet
Development

No branches or pull requests

2 participants