Netboot: Add aarch64
This commit is contained in:
parent
76090f5dc3
commit
08b8bc24cb
|
@ -18,17 +18,17 @@ with lib;
|
||||||
|
|
||||||
};
|
};
|
||||||
|
|
||||||
config = {
|
config = rec {
|
||||||
|
|
||||||
boot.loader.grub.version = 2;
|
|
||||||
|
|
||||||
# Don't build the GRUB menu builder script, since we don't need it
|
# Don't build the GRUB menu builder script, since we don't need it
|
||||||
# here and it causes a cyclic dependency.
|
# here and it causes a cyclic dependency.
|
||||||
boot.loader.grub.enable = false;
|
boot.loader.grub.enable = false;
|
||||||
|
|
||||||
# !!! Hack - attributes expected by other modules.
|
# !!! Hack - attributes expected by other modules.
|
||||||
system.boot.loader.kernelFile = "bzImage";
|
environment.systemPackages = [ pkgs.grub2_efi ]
|
||||||
environment.systemPackages = [ pkgs.grub2 pkgs.grub2_efi pkgs.syslinux ];
|
++ (if pkgs.stdenv.system == "aarch64-linux"
|
||||||
|
then []
|
||||||
|
else [ pkgs.grub2 pkgs.syslinux ]);
|
||||||
|
system.boot.loader.kernelFile = pkgs.stdenv.platform.kernelTarget;
|
||||||
|
|
||||||
fileSystems."/" =
|
fileSystems."/" =
|
||||||
{ fsType = "tmpfs";
|
{ fsType = "tmpfs";
|
||||||
|
@ -84,7 +84,12 @@ with lib;
|
||||||
];
|
];
|
||||||
};
|
};
|
||||||
|
|
||||||
system.build.netbootIpxeScript = pkgs.writeTextDir "netboot.ipxe" "#!ipxe\nkernel bzImage init=${config.system.build.toplevel}/init ${toString config.boot.kernelParams}\ninitrd initrd\nboot";
|
system.build.netbootIpxeScript = pkgs.writeTextDir "netboot.ipxe" ''
|
||||||
|
#!ipxe
|
||||||
|
kernel ${pkgs.stdenv.platform.kernelTarget} init=${config.system.build.toplevel}/init ${toString config.boot.kernelParams}
|
||||||
|
initrd initrd
|
||||||
|
boot
|
||||||
|
'';
|
||||||
|
|
||||||
boot.loader.timeout = 10;
|
boot.loader.timeout = 10;
|
||||||
|
|
||||||
|
|
|
@ -1,6 +1,6 @@
|
||||||
{ nixpkgs ? { outPath = ./..; revCount = 56789; shortRev = "gfedcba"; }
|
{ nixpkgs ? { outPath = ./..; revCount = 56789; shortRev = "gfedcba"; }
|
||||||
, stableBranch ? false
|
, stableBranch ? false
|
||||||
, supportedSystems ? [ "x86_64-linux" ]
|
, supportedSystems ? [ "x86_64-linux" "aarch64-linux" ]
|
||||||
}:
|
}:
|
||||||
|
|
||||||
with import ../lib;
|
with import ../lib;
|
||||||
|
@ -89,6 +89,27 @@ let
|
||||||
});
|
});
|
||||||
}).config));
|
}).config));
|
||||||
|
|
||||||
|
makeNetboot = config:
|
||||||
|
let
|
||||||
|
config_evaled = import lib/eval-config.nix config;
|
||||||
|
build = config_evaled.config.system.build;
|
||||||
|
kernelTarget = config_evaled.pkgs.stdenv.platform.kernelTarget;
|
||||||
|
in
|
||||||
|
pkgs.symlinkJoin {
|
||||||
|
name="netboot";
|
||||||
|
paths=[
|
||||||
|
build.netbootRamdisk
|
||||||
|
build.kernel
|
||||||
|
build.netbootIpxeScript
|
||||||
|
];
|
||||||
|
postBuild = ''
|
||||||
|
mkdir -p $out/nix-support
|
||||||
|
echo "file ${kernelTarget} $out/${kernelTarget}" >> $out/nix-support/hydra-build-products
|
||||||
|
echo "file initrd $out/initrd" >> $out/nix-support/hydra-build-products
|
||||||
|
echo "file ipxe $out/netboot.ipxe" >> $out/nix-support/hydra-build-products
|
||||||
|
'';
|
||||||
|
};
|
||||||
|
|
||||||
|
|
||||||
in rec {
|
in rec {
|
||||||
|
|
||||||
|
@ -103,28 +124,22 @@ in rec {
|
||||||
# Build the initial ramdisk so Hydra can keep track of its size over time.
|
# Build the initial ramdisk so Hydra can keep track of its size over time.
|
||||||
initialRamdisk = buildFromConfig ({ pkgs, ... }: { }) (config: config.system.build.initialRamdisk);
|
initialRamdisk = buildFromConfig ({ pkgs, ... }: { }) (config: config.system.build.initialRamdisk);
|
||||||
|
|
||||||
netboot.x86_64-linux = let build = (import lib/eval-config.nix {
|
netboot = {
|
||||||
|
x86_64-linux = makeNetboot {
|
||||||
system = "x86_64-linux";
|
system = "x86_64-linux";
|
||||||
modules = [
|
modules = [
|
||||||
./modules/installer/netboot/netboot-minimal.nix
|
./modules/installer/netboot/netboot-minimal.nix
|
||||||
versionModule
|
versionModule
|
||||||
];
|
];
|
||||||
}).config.system.build;
|
|
||||||
in
|
|
||||||
pkgs.symlinkJoin {
|
|
||||||
name="netboot";
|
|
||||||
paths=[
|
|
||||||
build.netbootRamdisk
|
|
||||||
build.kernel
|
|
||||||
build.netbootIpxeScript
|
|
||||||
];
|
|
||||||
postBuild = ''
|
|
||||||
mkdir -p $out/nix-support
|
|
||||||
echo "file bzImage $out/bzImage" >> $out/nix-support/hydra-build-products
|
|
||||||
echo "file initrd $out/initrd" >> $out/nix-support/hydra-build-products
|
|
||||||
echo "file ipxe $out/netboot.ipxe" >> $out/nix-support/hydra-build-products
|
|
||||||
'';
|
|
||||||
};
|
};
|
||||||
|
} // (optionalAttrs (elem "aarch64-linux" supportedSystems) {
|
||||||
|
aarch64-linux = makeNetboot {
|
||||||
|
system = "aarch64-linux";
|
||||||
|
modules = [
|
||||||
|
./modules/installer/netboot/netboot-minimal.nix
|
||||||
|
versionModule
|
||||||
|
];
|
||||||
|
};});
|
||||||
|
|
||||||
iso_minimal = forAllSystems (system: makeIso {
|
iso_minimal = forAllSystems (system: makeIso {
|
||||||
module = ./modules/installer/cd-dvd/installation-cd-minimal.nix;
|
module = ./modules/installer/cd-dvd/installation-cd-minimal.nix;
|
||||||
|
|
Loading…
Reference in New Issue