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

system-boot-builder.py: does not install devicetree dtb properly #336030

Closed
colemickens opened this issue Aug 20, 2024 · 0 comments · Fixed by #336263
Closed

system-boot-builder.py: does not install devicetree dtb properly #336030

colemickens opened this issue Aug 20, 2024 · 0 comments · Fixed by #336263
Labels
0.kind: bug Something is broken

Comments

@colemickens
Copy link
Member

Describe the bug

Spent a fair bit debugging something. Came down to my DTB being out of sync. The lack of hash prefix should've warned me sooner.

The issue is that the dtb is not copied with anything generation specific in the filename. The builder assumes the file is CA-addressed by parent store path, to avoid redundant copies. However, it also assumes it can make this path by taking basename of the specified file.

This is file for initrd/kernel since they are second level in the derivation. However, this can't be assumed, and/or isn't true for the DTB.

I would just send a PR but I can't think of a super easy/clean way to do this. The current approach (of assuming the depth of the file) is not great, IMO, but nicely avoids hashing the individual files, etc. Using a regex or chopping the /nix/store prefix is not viable.

The only idea I have -- use a regex to just capture the first instead of a b32 looking hash and hope that's good enough. I can do this depending on vibes.

Steps To Reproduce

Steps to reproduce the behavior:
1.have two generation
2. have bug in older gen
2. delete dtb from wherever it gets put (esp mount point or xbootldr), just to prove
3. re-install, which re-creates files for all generations, oldest first

boot, notice old dtb, realize it lacks hash, realize this is fundamentally problematic.

cc: @jmbaur @ElvishJerricco

Expected behavior

A clear and concise description of what you expected to happen.

Screenshots

If applicable, add screenshots to help explain your problem.

Additional context

Add any other context about the problem here.

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"
output here

Add a 👍 reaction to issues you find important.

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

Successfully merging a pull request may close this issue.

1 participant