From f603bff7ffca8106b79f8c0ccb914a7200d0f7c7 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?J=C3=B6rg=20Thalheim?= Date: Thu, 1 Dec 2022 14:09:11 +0100 Subject: [PATCH 1/3] kexec: use `kexec-syscall-auto` apparantly faster on aarch64-linux: https://github.com/NixOS/nixpkgs/pull/203415 --- nix/kexec-installer/module.nix | 1 + 1 file changed, 1 insertion(+) diff --git a/nix/kexec-installer/module.nix b/nix/kexec-installer/module.nix index 86f376d..c588539 100644 --- a/nix/kexec-installer/module.nix +++ b/nix/kexec-installer/module.nix @@ -54,6 +54,7 @@ in { rm -r "$INITRD_TMP" "$SCRIPT_DIR/kexec" --load "''${SCRIPT_DIR}/bzImage" \ + --kexec-syscall-auto \ --initrd="''${SCRIPT_DIR}/initrd" \ --command-line "init=${config.system.build.toplevel}/init ${toString config.boot.kernelParams}" From fa24694578ae27f1fbb6dcbfc58105d0a1ae51dc Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?J=C3=B6rg=20Thalheim?= Date: Thu, 1 Dec 2022 16:11:43 +0100 Subject: [PATCH 2/3] add static iproute binary This adds 500KB to the tarball but fixes hosts where iproute2 is old --- nix/kexec-installer/module.nix | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) diff --git a/nix/kexec-installer/module.nix b/nix/kexec-installer/module.nix index c588539..f502d6a 100644 --- a/nix/kexec-installer/module.nix +++ b/nix/kexec-installer/module.nix @@ -3,6 +3,9 @@ let restoreNetwork = pkgs.writers.writePython3 "restore-network" { flakeIgnore = ["E501"]; } ./restore_routes.py; + + # does not link with iptables enabled + iprouteStatic = pkgs.pkgsStatic.iproute2.override { iptables = null; }; in { imports = [ (modulesPath + "/installer/netboot/netboot-minimal.nix") @@ -39,10 +42,10 @@ in { # save the networking config for later use if type -p ip &>/dev/null; then - ip --json addr > addrs.json + "$SCRIPT_DIR/ip" --json addr > addrs.json - ip -4 --json route > routes-v4.json - ip -6 --json route > routes-v6.json + "$SCRIPT_DIR/ip" -4 --json route > routes-v4.json + "$SCRIPT_DIR/ip" -6 --json route > routes-v6.json else echo "Skip saving static network addresses because no iproute2 binary is available." 2>&1 echo "The image can depends only on DHCP to get network after reboot!" 2>&1 @@ -77,6 +80,7 @@ in { cp "${config.system.build.kernel}/${config.system.boot.loader.kernelFile}" kexec/bzImage cp "${config.system.build.kexecRun}" kexec/run cp "${pkgs.pkgsStatic.kexec-tools}/bin/kexec" kexec/kexec + cp "${iprouteStatic}/bin/ip" kexec/ip tar -czvf $out/nixos-kexec-installer-${pkgs.stdenv.hostPlatform.system}.tar.gz kexec ''; From cb3e66cb92873bc02621f525cab94cec7504369a Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?J=C3=B6rg=20Thalheim?= Date: Thu, 1 Dec 2022 15:46:20 +0000 Subject: [PATCH 3/3] build images for 22.11 --- .github/workflows/build.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index ebede94..a385c3f 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -9,7 +9,7 @@ jobs: strategy: matrix: tag: - - nixos-22.05 + - nixos-22.11 - nixos-unstable runs-on: ubuntu-latest steps: