Skip to content

Commit

Permalink
Merge pull request #32 from nix-community/ci2
Browse files Browse the repository at this point in the history
static iproute2
  • Loading branch information
Mic92 authored Dec 1, 2022
2 parents 0092c8a + cb3e66c commit 3605631
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 4 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ jobs:
strategy:
matrix:
tag:
- nixos-22.05
- nixos-22.11
- nixos-unstable
runs-on: ubuntu-latest
steps:
Expand Down
11 changes: 8 additions & 3 deletions nix/kexec-installer/module.nix
Original file line number Diff line number Diff line change
Expand Up @@ -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")
Expand Down Expand Up @@ -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
Expand All @@ -54,6 +57,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}"
Expand All @@ -76,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
'';

Expand Down

0 comments on commit 3605631

Please sign in to comment.