-
-
Notifications
You must be signed in to change notification settings - Fork 14.8k
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
installer: split sd cards -> base for bespoke sd images #110827
installer: split sd cards -> base for bespoke sd images #110827
Conversation
This pull request has been mentioned on NixOS Discourse. There might be relevant details there: https://discourse.nixos.org/t/sd-images-are-they-really-installation-devices/11190/1 |
This pull request has been mentioned on NixOS Discourse. There might be relevant details there: https://discourse.nixos.org/t/casual-nixpkgs-contributions/9607/10 |
e3b52f6
to
eff70fe
Compare
This pull request has been mentioned on NixOS Discourse. There might be relevant details there: https://discourse.nixos.org/t/sd-images-are-they-really-installation-devices/11190/9 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks good, didn't test it though.
This pull request has been mentioned on NixOS Discourse. There might be relevant details there: https://discourse.nixos.org/t/how-to-deprecate-a-module-path/11247/1 |
91ee955
to
0b54ab9
Compare
@samueldr May I ask you for a review (maybe even merge)? You seem rather familiar with that portion of the code. |
This pull request has been mentioned on NixOS Discourse. There might be relevant details there: |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Didn't test it but otherwise LGTM. Also seems to be backward compatible and a change I also have thought about.
Edit: Hint: Look at the commit-wise diff. Github messes up the whole PR diff.
nixos/modules/installer/sd-card/sd-image-aarch64-new-kernel-installer.nix
Show resolved
Hide resolved
969b5e3
to
5ddb35d
Compare
squashed & rebased |
/cc @flokli @lopsided98 @jslight90 please consider a review to help me get this merged. |
This seems to make sense based on a quick look at the older version, but since you squashed the commits it is very hard to review because I can't distinguish renames from meaningful changes. I would prefer if you rebased to remove the merge commits but kept the individual commits. |
@blaggacao IMHO you should undo the squash as the previous commits were semantically easy to parse and would make more sense in the git history. |
This comment has been minimized.
This comment has been minimized.
|
5ddb35d
to
afef283
Compare
Thx! Wasn't familiar with this command. Pretty useful! |
afef283
to
68afbf9
Compare
As for 68afbf9 : should we leave any well-known regexable for the release manager of the next-next release? |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Didn't test it but LGTM. Also seems to be backward compatible and a change I also have thought about.
Hint: Look at the commit-wise diff. Github messes up the whole PR diff.
I don't know. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I haven't tested this, but the possibility of breakage seem limited assuming everything evals.
One thought I had (not necessarily a suggestion for this PR) is that we might not need sd-image-aarch64-new-kernel.nix
and sd-image-raspberrypi4.nix
. It makes sense to provide the -installer
versions so users can download them, but for building custom images they don't really offer much since they only override one option.
On the discourse thread, some people raised that this is avery valid use case. I doubt it in a way, omce you ever tried tu build something on the pi (takes days and usually hangs). I think this split will allow for a better re-assessment some poimt in the future.
Let's leave that for another PR, indeed. But I agree, it might ne wise to deduplicate a little and reduce here. |
This pull request has been mentioned on NixOS Discourse. There might be relevant details there: |
I'm not really sure what you mean. If someone doesn't already have another aarch64 machine, how would they install NixOS without downloading one of the prebuilt images? Modern aarch64 SBCs are also pretty capable builders, not necessarily the RPi <=3, but certainly the RPi 4, or RK3328/RK3399 boards (which can use the prebuilt installer image as well if you manually install the bootloader). |
I definitley failed with pi3, indeed. I was hoping that nix proper cross building would save me here. It might also be slightly more convenient to work off my powerful workstation. Actually, the driving use case for this PR is to explore cross build in the context of divnix/digga#72 I'm not actually trying to dismiss the installer version. I can imagine that cross builds are actually more user friendly and convenient, though. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
To summarize, this moves modules around so that their file paths actually make sense and extracts parts of them into new files so that they can be used independently, all without modifying existing installer image configurations.
installer: fixup sd-card folder move from #110827
Sorry for the necrobump. Someone pointed me to this topic elsewhere, which prompted me to read this whole thread. I saw this bit:
Yeah I'm one of the people who said that. I was thinking about why your experience of building on rpi is described is so different from mine when I realized: I use aarch64-linux on a Raspberry Pi 4. There's official binary cache for aarch64-linux. This means that most of the time taken to rebuild the system is to download the packages, not build them. If I need to cross-compile an image, I need to build everything, which takes hours on my laptop (yes I've tried) for the first time, and then hours whenever there's a major update. But since the native stuff is all on cache.nixos.org, rebuilding on an rpi takes a negligible amount of time compared to me testing things out and debugging stuff. Not to mention avoiding the pain of needing to physically move the SD card around to write new images. (If I remember right, there's an unofficial 32-bit ARM binary cache, but I couldn't remember the details.) So I hope that when it comes to see whether the installer targets should stay or should leave, the fact that you just simply don't have to build that much stuff when there's binary cache available is taken into consideration. Or I could have horribly misunderstood what this means, in which case I'm happy to be corrected or even ignored. |
@dramforever Thanks for the context, fortunately this change is a pareto-improvement and I (at least) don't plan to follow up on removing anything. 😉 |
203: Fix formats/sd* r=Mic92 a=LegitMagic During the [movement](NixOS/nixpkgs#110827) of the nixpkgs module paths for sd*, more than just the cd-dvd -> sd-card was changed. As noted within the [old nixpkgs module location](https://github.com/NixOS/nixpkgs/blob/master/nixos/modules/installer/cd-dvd/sd-image-aarch64.nix), the intended change of location was sd-card/sd-image-aarch64-installer, rather than just a path change. For the non installer version for sd-aarch64, I've updated the version here with the version from nixpkgs, minus the import of profiles/base.nix. This means that the images produced should work on the Pi 4 as well as the Pi 3. Although I have not personally tested on hardware. The removal of the CMA kernel param is deliberate, as 32M is too low for the Pi 4, and that it would need to be either upped to the default for the Pi 4 of 64M, or the option removed and let defaults take care of it. More information about the motivation of these changes can be seen in this comment #168 (comment). In regards to a bit of discussion, is it worth having our own copy of the nixpkgs version of sd-aarch64? The only difference I could really tell is that the version in nixos-generators doesn't include profiles/base. In my opinion there's not much of a need for profiles/base to be included, but does it hurt to do so? I'm pretty new to Nix so I'm not fully aware of its features, but as far as I understand it, I don't think there's a way to override what gets imported in an import. Co-authored-by: LegitMagic <[email protected]>
Motivation for this change
https://discourse.nixos.org/t/sd-images-are-they-really-installation-devices/11190
Things done
sandbox
innix.conf
on non-NixOS linux)nix-shell -p nixpkgs-review --run "nixpkgs-review wip"
./result/bin/
)nix path-info -S
before and after)resolved
Regardless of the future of this PR, I'd really appreciate tutoring on how to make this properly backwards compatible. I had thought of:But I've no experience with backwards compatibility.
There might also be references to those files all over the place, that I would need to update as well. How to best find those? I've never proposed such a "fundamental" change.