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

nixos/systemd-boot: different generations cannot use different device trees #338024

Closed
kuruczgy opened this issue Aug 28, 2024 · 2 comments
Closed
Labels
0.kind: bug Something is broken

Comments

@kuruczgy
Copy link
Contributor

Describe the bug

The device tree support introduced in #319422 has an issue where the name of the device tree file copied to the ESP has the same name for all generations, making all generations boot with the device tree corresponding to the oldest one.

Steps To Reproduce

  1. Set hardware.deviceTree.enable = true and hardware.deviceTree.name = "qcom/x1e80100-lenovo-yoga-slim7x.dtb".
  2. Update your kernel, which also brings with it an updated device tree.
  3. Observe that all device trees are attempted to be written to $ESP/EFI/nixos/qcom-x1e80100-lenovo-yoga-slim7x.dtb.efi. If this file already exists it will not be overwritten, making all generations boot with the oldest device tree.

Expected behavior

Each generation boots with the device tree specified in its bootspec.

Additional context

This is an issue with the copy_from_file function:

def copy_from_file(file: str, dry_run: bool = False) -> str:
    store_file_path = os.path.realpath(file)
    suffix = os.path.basename(store_file_path)
    store_dir = os.path.basename(os.path.dirname(store_file_path))
    efi_file_path = f"{NIXOS_DIR}/{store_dir}-{suffix}.efi"
    if not dry_run:
        copy_if_not_exists(store_file_path, f"{BOOT_MOUNT_POINT}{efi_file_path}")
    return efi_file_path

This function assumes that file is contained in the root of a store directory, and computes store_dir as the parent of file. In my case, store_dir gets set to qcom, and so the resulting filename will be qcom-x1e80100-lenovo-yoga-slim7x.dtb.efi.

Notify maintainers

@jmbaur
@colemickens you also might be interested

Add a 👍 reaction to issues you find important.

@kuruczgy kuruczgy added the 0.kind: bug Something is broken label Aug 28, 2024
@colemickens
Copy link
Member

dupe of #336030

@kuruczgy
Copy link
Contributor Author

Oops, yeah, did not update my nixpkgs in the past 4 hours I guess :D Thanks!

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