| 30 Jul 2022 |
K900 | I think I just immediately spotted it | 08:23:13 |
K900 |  Download image.png | 08:23:22 |
@linus:schreibt.jetzt | nice, my branch rebases cleanly onto unstable! | 08:23:23 |
@linus:schreibt.jetzt | looool | 08:23:30 |
K900 | That does not look right for cross | 08:23:30 |
K900 | Also ewwww it's doing things manually wwwww | 08:24:15 |
K900 | Linux Hackerman: https://github.com/K900/nixpkgs/commit/8e07edf8fa0f268f1f37517b715ba6e17a6ddc9e try this | 08:44:17 |
@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 | * 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 | Goblin is great | 08:45:35 |
K900 | Honestly most of that diff is just me refactoring it a bit as I go | 08:46:08 |
@linus:schreibt.jetzt | I'm currently waiting for an LLVM build though so give me another hour or so :p | 08:46:12 |
@linus:schreibt.jetzt | thanks for picking it up though! | 08:46:17 |
K900 | The actual parsing is completely triival | 08:46:18 |
K900 | * The actual parsing is completely trivial | 08:46:21 |
@linus:schreibt.jetzt | * I'm currently waiting for an LLVM build though so give me another hour or 3 :p | 08:46:26 |
@elvishjerricco:matrix.org | I 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 | The ldd thing might have worked by accident | 08:51:02 |
K900 | I think it'll still kinda work if you use it on an elf64 even if it's for the wrong arch | 08:51:18 |
K900 | But armv7l is elf32 | 08:51:22 |
@elvishjerricco:matrix.org | Also, very ew on including a bunch of external rust dependencies | 08:51:38 |
@linus:schreibt.jetzt | huh, .map(|p| Box::<Path>::from(Path::new(p))) is the turbofish necessary there? | 08:51:46 |
K900 | I don't think so? | 08:51:50 |
@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 | You can probably do the same thing by parsing objdump output if you really wanted to | 08:52:34 |
K900 | But I honestly don't think it's even close to worth it | 08:52:43 |
@linus:schreibt.jetzt | right tool for the job and stuff | 08:53:00 |
@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 dep | 08:53:18 |
@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 deps | 08:53:19 |
@linus:schreibt.jetzt | all of nixos is external code | 08:54:13 |