!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.jetztEspecially deployments where size matters (small cloud servers and embedded stuff).11:44:15
@elvishjerricco:matrix.org@elvishjerricco:matrix.orgOk so to summarize11:45:09
@elvishjerricco:matrix.org@elvishjerricco:matrix.org
  • We probably want to disable shutdown ramfs in things like containers
  • We probably don't want to strip at all for shutdown ramfs
  • We should probably use targetPrefix to get the right strip from binutils for building initrd
11:45:48
@elvishjerricco:matrix.org@elvishjerricco:matrix.orgThere's also the option of just removing stripping11:46:22
@elvishjerricco:matrix.org@elvishjerricco:matrix.orgBecause IIRC it barely saved any space in initrd11:46:29
@k900:0upti.meK900How much space is it really?11:46:35
@elvishjerricco:matrix.org@elvishjerricco:matrix.orgI don't remember what it was... Probably need to test it11:46:49
@k900:0upti.meK900Can someone test? I'm reimaging an old laptop right now but I can get back to it in a few hours probably11:46:56
@elvishjerricco:matrix.org@elvishjerricco:matrix.orgor maybe there'sa comment in the pr11:47:00
@elvishjerricco:matrix.org@elvishjerricco:matrix.orghttps://github.com/NixOS/nixpkgs/pull/171134#issuecomment-111423232411:48:28
@k900:0upti.meK900So not a lot11:48:43
@elvishjerricco:matrix.org@elvishjerricco:matrix.org1M, and that's without compressing initrd11:48:55
@elvishjerricco:matrix.org@elvishjerricco:matrix.org I want to test it with compression just in case 11:49:12
@elvishjerricco:matrix.org@elvishjerricco:matrix.org1M for the minimal compressed initrd is more on the significant side11:49:25
@linus:schreibt.jetzt@linus:schreibt.jetztidk, I think 4% is fairly small but not negligible11:49:36
@janne.hess:helsinki-systems.de@janne.hess:helsinki-systems.de
In reply to @elvishjerricco:matrix.org
I want to test it with compression just in case
I did it this way because symbols should have a better compression ratio imo and that would affect test results
11:50:08
@linus:schreibt.jetzt@linus:schreibt.jetztIMHO we should continue stripping in the drv but drop it for shutdown11:50:10
@linus:schreibt.jetzt@linus:schreibt.jetzt
In reply to @janne.hess:helsinki-systems.de
I did it this way because symbols should have a better compression ratio imo and that would affect test results
so the effect of stripping is even smaller normally ;)
11:50:37
@elvishjerricco:matrix.org@elvishjerricco:matrix.org
In reply to @linus:schreibt.jetzt
IMHO we should continue stripping in the drv but drop it for shutdown
That still requires builders to have binutils, which isn't necessarily the case without stripping :/ Maybe make it a config option?
11:50:41
@elvishjerricco:matrix.org@elvishjerricco:matrix.org dammit, more inexplicable weirdness. I'm trying to build a minimal config with systemd initrd, but changing the code in make-initrd-ng is not causing a rebuild. wtf 11:55:33
@elvishjerricco:matrix.org@elvishjerricco:matrix.orgoh derp, i was pointing at my system nixpkgs11:56:07
@elvishjerricco:matrix.org@elvishjerricco:matrix.orgOk, so with compression, stripping makes the file's apparent size 675K smaller11:59:00
@elvishjerricco:matrix.org@elvishjerricco:matrix.orgFrom ~12M to ~11M11:59:23
@linus:schreibt.jetzt@linus:schreibt.jetzt
In reply to @elvishjerricco:matrix.org
That still requires builders to have binutils, which isn't necessarily the case without stripping :/ Maybe make it a config option?
config option works for me, I'd say default to enabling stripping because I suspect people are more likely to have binutils anyway (it gets pulled in by nix-shell -p too, for example)
12:01:16
@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

Show newer messages


Back to Room ListRoom Version: 6