!PSmBFWNKoXmlQBzUQf:helsinki-systems.de

Stage 1 systemd

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

Load older messages


SenderMessageTime
30 Jul 2022
@k900:0upti.meK900I think I just immediately spotted it08:23:13
@k900:0upti.meK900image.png
Download image.png
08:23:22
@linus:schreibt.jetzt@linus:schreibt.jetztnice, my branch rebases cleanly onto unstable!08:23:23
@linus:schreibt.jetzt@linus:schreibt.jetztlooool08:23:30
@k900:0upti.meK900That does not look right for cross08:23:30
@k900:0upti.meK900Also ewwww it's doing things manually wwwww08:24:15
@k900:0upti.meK900 Linux Hackerman: https://github.com/K900/nixpkgs/commit/8e07edf8fa0f268f1f37517b715ba6e17a6ddc9e try this 08:44:17
@linus:schreibt.jetzt@linus:schreibt.jetzt

oh that's a lot more extensive than what I'm currently building:

diff --git a/nixos/modules/system/boot/systemd/initrd.nix b/nixos/modules/system/boot/systemd/initrd.nix
index 88e2bf9ac70..bf92f640ca1 100644
--- a/nixos/modules/system/boot/systemd/initrd.nix
+++ b/nixos/modules/system/boot/systemd/initrd.nix
@@ -320,7 +320,7 @@ in {
   config = mkIf (config.boot.initrd.enable && cfg.enable) {
     system.build = { inherit initialRamdisk; };

-    boot.initrd.availableKernelModules = [ "autofs4" ]; # systemd needs this for some features
+    #boot.initrd.availableKernelModules = [ "autofs4" ]; # systemd needs this for some features

     boot.initrd.systemd = {
       initrdBin = [pkgs.bash pkgs.coreutils cfg.package.kmod cfg.package] ++ config.system.fsPackages;
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) {

08:45:11
@linus:schreibt.jetzt@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) {

08:45:27
@k900:0upti.meK900Goblin is great08:45:35
@k900:0upti.meK900Honestly most of that diff is just me refactoring it a bit as I go08:46:08
@linus:schreibt.jetzt@linus:schreibt.jetztI'm currently waiting for an LLVM build though so give me another hour or so :p08:46:12
@linus:schreibt.jetzt@linus:schreibt.jetztthanks for picking it up though!08:46:17
@k900:0upti.meK900The actual parsing is completely triival08:46:18
@k900:0upti.meK900 * The actual parsing is completely trivial08:46:21
@linus:schreibt.jetzt@linus:schreibt.jetzt * I'm currently waiting for an LLVM build though so give me another hour or 3 :p08:46:26
@elvishjerricco:matrix.org@elvishjerricco:matrix.orgI could have swore I tested make-initrd-ng with cross... Maybe we made some changes before merging that I didn't test or something...08:50:43
@k900:0upti.meK900The ldd thing might have worked by accident08:51:02
@k900:0upti.meK900I think it'll still kinda work if you use it on an elf64 even if it's for the wrong arch08:51:18
@k900:0upti.meK900But armv7l is elf3208:51:22
@elvishjerricco:matrix.org@elvishjerricco:matrix.orgAlso, very ew on including a bunch of external rust dependencies08:51:38
@linus:schreibt.jetzt@linus:schreibt.jetzt huh, .map(|p| Box::<Path>::from(Path::new(p))) is the turbofish necessary there? 08:51:46
@k900:0upti.meK900I don't think so?08:51:50
@linus:schreibt.jetzt@linus:schreibt.jetzt
In reply to @elvishjerricco:matrix.org
Also, very ew on including a bunch of external rust dependencies
yeah why?
08:52:13
@k900:0upti.meK900You can probably do the same thing by parsing objdump output if you really wanted to08:52:34
@k900:0upti.meK900But I honestly don't think it's even close to worth it08:52:43
@linus:schreibt.jetzt@linus:schreibt.jetztright tool for the job and stuff08:53:00
@elvishjerricco:matrix.org@elvishjerricco:matrix.orgI just don't like the idea of very critical nixos components being so heavily dependent on external code. Plus currently it builds incredibly fast because there's no dep08:53:18
@elvishjerricco:matrix.org@elvishjerricco:matrix.org * I just don't like the idea of very critical nixos components being so heavily dependent on external code. Plus currently it builds incredibly fast because there's no deps08:53:19
@linus:schreibt.jetzt@linus:schreibt.jetztall of nixos is external code08:54:13

Show newer messages


Back to Room ListRoom Version: 6