-
-
Notifications
You must be signed in to change notification settings - Fork 15.4k
Aarch64 Netboot #32031
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Aarch64 Netboot #32031
Conversation
|
||
boot.loader.grub.version = 2; | ||
|
||
config = rec { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'm going to restore the grub version for not-aarch64-linux.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Shouldn't it also be '2' for aarch64?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Turns out we don't need this, anyway. Defaults to 2.
# Don't build the GRUB menu builder script, since we don't need it | ||
# here and it causes a cyclic dependency. | ||
boot.loader.grub.enable = false; | ||
|
||
# !!! Hack - attributes expected by other modules. | ||
system.boot.loader.kernelFile = "bzImage"; | ||
environment.systemPackages = [ pkgs.grub2 pkgs.grub2_efi pkgs.syslinux ]; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'm going to restore these packages for not aarch64, but I don't think they build on aarch64. I wonder what that means for # !!! Hack - attributes expected by other modules.
.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
git grep kernelTarget
already gives the answer to "bzImage"
, so whatever uses that should be refactored to use kernelTarget
.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
nixos/modules/system/activation/top-level.nix
32: "${config.system.boot.loader.kernelFile}";
173: system.boot.loader.kernelFile = mkOption {
nixos/modules/installer/cd-dvd/iso-image.nix
269: system.boot.loader.kernelFile = "bzImage";
nixos/modules/installer/cd-dvd/system-tarball-sheevaplug.nix
85: system.boot.loader.kernelFile = "uImage";
153: { source = config.boot.kernelPackages.kernel + "/" + config.system.boot.loader.kernelFile;
154: target = "/boot/" + config.system.boot.loader.kernelFile;
nixos/modules/installer/cd-dvd/system-tarball-pc.nix
82: [ { source = config.boot.kernelPackages.kernel + "/" + config.system.boot.loader.kernelFile;
83: target = "/boot/" + config.system.boot.loader.kernelFile;
nixos/modules/installer/cd-dvd/system-tarball-fuloong2f.nix
139: { source = config.boot.kernelPackages.kernel + "/" + config.system.boot.loader.kernelFile;
140: target = "/boot/" + config.system.boot.loader.kernelFile;
155: system.boot.loader.kernelFile = "vmlinux";
nixos/modules/installer/netboot/netboot.nix
30: system.boot.loader.kernelFile = if pkgs.stdenv.system == "aarch64-linux"
90: kernel ${system.boot.loader.kernelFile} init=${config.system.build.toplevel}/init ${toString config.boot.kernelParams}
nixos/modules/system/boot/loader/generations-dir/generations-dir.nix
62: system.boot.loader.kernelFile = platform.kernelTarget;
nixos/modules/system/boot/loader/raspberrypi/raspberrypi.nix
46: system.boot.loader.kernelFile = platform.kernelTarget;
I'm not sure I want to take this on in this PR 😅
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Eh ... might as well ...
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Well you could change it to system.boot.loader.kernelFile = platform.kernelTarget;
and call it a day.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
As for the packages, grub2_efi
should does build on AArch64.
BTW, don't you need to use mkIf
to not end up with infinite recursion?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I don't, systemPackages doesn't impact pkgs here. Fixed up the kernelTarget issue, added grub2_efi on aarch64.
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 ${system.boot.loader.kernelFile} init=${config.system.build.toplevel}/init ${toString config.boot.kernelParams} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The only thing changing here is bzImage
is becoming variable.
@@ -442,7 +442,8 @@ in | |||
|
|||
virtualisation.pathsInNixDB = [ config.system.build.toplevel ]; | |||
|
|||
virtualisation.qemu.options = [ "-vga std" "-usbdevice tablet" ]; | |||
virtualisation.qemu.options = [ "-machine gic-version=host" "-cpu host" | |||
"-machine virt" "-device virtio-gpu" ]; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'm not sure these are useful, I don't think they ever worked. I plan on removing these changes.
@@ -81,10 +81,21 @@ stdenv.mkDerivation rec { | |||
done |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'm not sure these are useful. Thoughts?
@@ -164,18 +164,15 @@ let | |||
chmod u+w -R ../source |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think these changes have been incorporated already.
pkgs/top-level/all-packages.nix
Outdated
@@ -12227,7 +12227,7 @@ with pkgs; | |||
qemu_xen = lowPrio (qemu.override { x86Only = true; xenSupport = true; xen = xen-slim; }); | |||
qemu_xen-light = lowPrio (qemu.override { x86Only = true; xenSupport = true; xen = xen-light; }); | |||
|
|||
qemu_test = lowPrio (qemu.override { x86Only = true; nixosTestRunner = true; }); | |||
qemu_test = lowPrio (qemu.override { x86Only = false; nixosTestRunner = true; }); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This might depend on my changes to pkgs/applications/virtualization/qemu/default.nix ... thoughts?
aa55683
to
468c3fb
Compare
nixos/release.nix
Outdated
@@ -126,6 +126,30 @@ in rec { | |||
''; | |||
}; | |||
|
|||
netboot.aarch64-linux = let build = (import lib/eval-config.nix { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Don't you need to do something special here in case the supportedSystems
parameter passed to the file doesn't include aarch64
?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Fixed
23d6ccf
to
6c8d314
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Ok, other than my one comment this should be good to go.
@@ -1,6 +1,6 @@ | |||
{ nixpkgs ? { outPath = ./..; revCount = 56789; shortRev = "gfedcba"; } | |||
, stableBranch ? false | |||
, supportedSystems ? [ "x86_64-linux" ] | |||
, supportedSystems ? [ "x86_64-linux" "aarch64-linux" ] |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'm not certain we want to do this yet. Thoughts?
0ea9e57
to
bc9e48d
Compare
bc9e48d
to
f8e17f5
Compare
f8e17f5
to
ab67fea
Compare
ab67fea
to
08b8bc2
Compare
Some old patches I've had kicking around, and need to upstream ... :)
Here to clean them up and solicit feedback.