| 30 Jul 2022 |
@linus:schreibt.jetzt | oh yeah, and uncompressed size is still relevant for RAM usage | 12:01:55 |
@elvishjerricco:matrix.org | Yea, and we probably just should not even offer the configuration option for shutdownramfs, since I can't imagine it mattering for that purpose | 12:01:56 |
@linus:schreibt.jetzt | wooooo finally finished building all that crap | 12:11:22 |
@linus:schreibt.jetzt | In reply to @linus:schreibt.jetzt
oh that's a lot more extensive than what I'm currently building:
diff --git a/pkgs/build-support/kernel/make-initrd-ng/src/main.rs b/pkgs/build-support/kernel/make-initrd-ng/src/main.rs
index 294c570a374..681fc5468fd 100644
--- a/pkgs/build-support/kernel/make-initrd-ng/src/main.rs
+++ b/pkgs/build-support/kernel/make-initrd-ng/src/main.rs
@@ -57,12 +57,11 @@ fn copy_file<P: AsRef<Path> + AsRef<OsStr>, S: AsRef<Path> + AsRef<OsStr>>(
) -> Result<(), Error> {
fs::copy(&source, &target)?;
- if !Command::new("ldd").arg(&source).output()?.status.success() {
- // Not dynamically linked - no need to recurse
- return Ok(());
- }
-
- let rpath_string = patch_elf("--print-rpath", &source)?;
+ let rpath_string = match patch_elf("--print-rpath", &source) {
+ // Not dynamically linked probably
+ Err(_) => { return Ok(()); },
+ Ok(s) => s,
+ };
let needed_string = patch_elf("--print-needed", &source)?;
// Shared libraries don't have an interpreter
if let Ok(interpreter_string) = patch_elf("--print-interpreter", &source) {
so this little patch is enough to make it boot | 12:11:43 |
@linus:schreibt.jetzt | but I'll give your goblin thing a try now K900, because it's definitely more elegant | 12:11:59 |
K900 | Strip might still be broken | 12:29:54 |
@linus:schreibt.jetzt | ooooh that's why the shutdown ramfs service was failing. Probably. | 12:31:30 |
@linus:schreibt.jetzt | But I don't really care about that. | 12:31:35 |
@linus:schreibt.jetzt | copying path '/nix/store/1cdzcvzjjr0hv9djg4snkbvr6js29wc9-llvm-14.0.6-lib' to 'ssh://root@cube-muc.lan'
yeaaaaah that looks wrong lol
| 12:33:58 |
@linus:schreibt.jetzt | but hey, I only care if it boots, for now. | 12:34:09 |
@linus:schreibt.jetzt | How do we feel about using the environment variable STRIP within make-initrd-ng? That way it should work automagically in a derivation if it's available (runCommand vs runCommandCC would then be the difference that the option ElvishJerricco mentioned makes), and is also easy to implement in the shutdown ramfs if you really want to. | 12:37:34 |
@linus:schreibt.jetzt | it sure boots! | 12:39:07 |
K900 | Oh wait | 12:43:02 |
K900 | Yeah we can actually do that | 12:43:05 |
K900 | I think | 12:43:16 |
K900 | Cause the actual initrd build happens in a derivation, not in the activation script | 12:43:43 |
@linus:schreibt.jetzt | exactly | 12:45:33 |
K900 | The question is, will this drag in the rest of the stdenv | 12:54:31 |
K900 | Which would be not great | 12:54:39 |
K900 | But we can maybe make our own stdenv with just binutils? | 12:54:51 |
@linus:schreibt.jetzt | I think adding binutils to nativeBuildInputs on stdenvNoCC should be enough? | 12:57:26 |
@linus:schreibt.jetzt | I'm testing that right now :) | 12:57:40 |
@elvishjerricco:matrix.org | That wouldn't set $STRIP I don't think, which is how we get the right cross name in the environment variable | 13:03:00 |
@linus:schreibt.jetzt | oh yeah true | 13:03:37 |
@linus:schreibt.jetzt | so targetPrefix after all I guess | 13:03:44 |
K900 | But we can set it in an environment variable I guess | 13:04:32 |
@linus:schreibt.jetzt | yep | 13:04:34 |
K900 | To avoid having to redo args parsing | 13:04:40 |
@linus:schreibt.jetzt | STRIP = lib.optionalString strip "${stdenv.targetPrefix}strip"; | 13:04:41 |
@linus:schreibt.jetzt | LOL I haven't been testing ANY of this correctly because I had boot.initrd.systemd.enable commented out 🙃 | 13:09:04 |