!PSmBFWNKoXmlQBzUQf:helsinki-systems.de

Stage 1 systemd

82 Members
systemd in NixOs's stage 1, replacing the current bash tooling https://github.com/NixOS/nixpkgs/projects/5126 Servers

Load older messages


SenderMessageTime
30 Jul 2022
@linus:schreibt.jetzt@linus:schreibt.jetztoh yeah, and uncompressed size is still relevant for RAM usage12:01:55
@elvishjerricco:matrix.org@elvishjerricco:matrix.orgYea, and we probably just should not even offer the configuration option for shutdownramfs, since I can't imagine it mattering for that purpose12:01:56
@linus:schreibt.jetzt@linus:schreibt.jetztwooooo finally finished building all that crap12:11:22
@linus:schreibt.jetzt@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@linus:schreibt.jetztbut I'll give your goblin thing a try now K900, because it's definitely more elegant12:11:59
@k900:0upti.meK900Strip might still be broken12:29:54
@linus:schreibt.jetzt@linus:schreibt.jetztooooh that's why the shutdown ramfs service was failing. Probably.12:31:30
@linus:schreibt.jetzt@linus:schreibt.jetztBut I don't really care about that.12:31:35
@linus:schreibt.jetzt@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@linus:schreibt.jetztbut hey, I only care if it boots, for now.12:34:09
@linus:schreibt.jetzt@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@linus:schreibt.jetztit sure boots!12:39:07
@k900:0upti.meK900Oh wait12:43:02
@k900:0upti.meK900Yeah we can actually do that12:43:05
@k900:0upti.meK900I think12:43:16
@k900:0upti.meK900Cause the actual initrd build happens in a derivation, not in the activation script12:43:43
@linus:schreibt.jetzt@linus:schreibt.jetztexactly12:45:33
@k900:0upti.meK900The question is, will this drag in the rest of the stdenv12:54:31
@k900:0upti.meK900Which would be not great 12:54:39
@k900:0upti.meK900But we can maybe make our own stdenv with just binutils? 12:54:51
@linus:schreibt.jetzt@linus:schreibt.jetztI think adding binutils to nativeBuildInputs on stdenvNoCC should be enough?12:57:26
@linus:schreibt.jetzt@linus:schreibt.jetztI'm testing that right now :)12:57:40
@elvishjerricco:matrix.org@elvishjerricco:matrix.orgThat wouldn't set $STRIP I don't think, which is how we get the right cross name in the environment variable13:03:00
@linus:schreibt.jetzt@linus:schreibt.jetztoh yeah true13:03:37
@linus:schreibt.jetzt@linus:schreibt.jetztso targetPrefix after all I guess13:03:44
@k900:0upti.meK900But we can set it in an environment variable I guess 13:04:32
@linus:schreibt.jetzt@linus:schreibt.jetztyep13:04:34
@k900:0upti.meK900To avoid having to redo args parsing13:04:40
@linus:schreibt.jetzt@linus:schreibt.jetzt STRIP = lib.optionalString strip "${stdenv.targetPrefix}strip"; 13:04:41
@linus:schreibt.jetzt@linus:schreibt.jetztLOL I haven't been testing ANY of this correctly because I had boot.initrd.systemd.enable commented out 🙃13:09:04

Show newer messages


Back to Room ListRoom Version: 6