From ded46403ec1766fbd5e126e994a58e827b99524a Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Charlotte=20=F0=9F=A6=9D=20Delenk?= Date: Wed, 14 Dec 2022 09:59:05 +0100 Subject: [PATCH] Remove the kexec tarball --- .github/workflows/build.yml | 2 -- config/aarch64-kexec.nix | 65 ------------------------------------- flake.nix | 5 --- 3 files changed, 72 deletions(-) delete mode 100644 config/aarch64-kexec.nix diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index 5f2d8ea5..180ac4b8 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -13,8 +13,6 @@ jobs: - nixos-8gb-fsn1-1.x86_64-linux - nutty-noon.x86_64-linux - thinkrac.x86_64-linux - - aarch64-kexec.aarch64-linux - - aarch64-kexec-tarball - instance-20221213-1915.aarch64-linux runs-on: ubuntu-latest steps: diff --git a/config/aarch64-kexec.nix b/config/aarch64-kexec.nix deleted file mode 100644 index 3ff072bc..00000000 --- a/config/aarch64-kexec.nix +++ /dev/null @@ -1,65 +0,0 @@ -# Adapted from https://github.com/cleverca22/nix-tests/tree/master/kexec -{ - pkgs, - config, - nixpkgs, - ... -}: { - imports = [ - "${nixpkgs}/nixos/modules/installer/netboot/netboot-minimal.nix" - ]; - networking.hostName = "nixos"; - networking.hostId = "d5b14b97"; - boot.kernelParams = ["net.ifnames=0"]; - system.stateVersion = "22.11"; - system.build = rec { - image = pkgs.runCommand "image" {buildInputs = [pkgs.nukeReferences];} '' - mkdir $out - cp ${config.system.build.kernel}/${config.system.boot.loader.kernelFile} $out/kernel - cp ${config.system.build.netbootRamdisk}/initrd $out/initrd - echo "init=${builtins.unsafeDiscardStringContext config.system.build.toplevel}/init ${toString config.boot.kernelParams}" > $out/cmdline - nuke-refs $out/kernel - ''; - kexec_script = pkgs.writeTextFile { - executable = true; - name = "kexec-nixos"; - text = '' - #!${pkgs.stdenv.shell} - export PATH=${pkgs.kexectools}/bin:${pkgs.cpio}/bin:$PATH - set -x - set -e - cd $(mktemp -d) - pwd - mkdir initrd - pushd initrd - if [ -e /ssh_pubkey ]; then - cat /ssh_pubkey >> authorized_keys - fi - find -type f | cpio -o -H newc | gzip -9 > ../extra.gz - popd - cat ${image}/initrd extra.gz > final.gz - kexec -l ${image}/kernel --initrd=final.gz --append="init=${builtins.unsafeDiscardStringContext config.system.build.toplevel}/init ${toString config.boot.kernelParams}" - sync - echo "executing kernel, filesystems will be improperly umounted" - kexec -e - ''; - }; - }; - boot.initrd.postMountCommands = '' - mkdir -p /mnt-root/root/.ssh/ - cp /authorized_keys /mnt-root/root/.ssh/ - ''; - system.build.kexec_tarball = pkgs.callPackage "${nixpkgs}/nixos/lib/make-system-tarball.nix" { - storeContents = [ - { - object = config.system.build.kexec_script; - symlink = "/kexec_nixos"; - } - ]; - contents = []; - }; - networking.wireguard.interfaces."wg0".ips = [ - "fd0d:a262:1fa6:e621:6ec2:1e4e:ce7f:d2af/64" - ]; - boot.supportedFilesystems = ["zfs"]; -} diff --git a/flake.nix b/flake.nix index f580d53e..8f5ecd74 100644 --- a/flake.nix +++ b/flake.nix @@ -95,10 +95,6 @@ rec { name = "nas"; # My nas system = "x86_64-linux"; } - { - name = "aarch64-kexec"; # kexec tarball for aarch64 - system = "aarch64-linux"; - } { name = "instance-20221213-1915"; # Oracle server system = "aarch64-linux"; @@ -170,7 +166,6 @@ rec { systems)) // { inherit devShell; - aarch64-kexec-tarball = nixosConfigurations.aarch64-kexec.config.system.build.kexec_tarball; # Uncomment the line to build an installer image # This is EXTREMELY LARGE and will make builds take forever # installer.x86_64-linux = nixosConfigurations.installer.config.system.build.isoImage;