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
installer: Adds AArch64 UEFI installer support. (Work towards SBBR and EBBR support) #51397
Conversation
c1f4dd8
to
ad518d3
Compare
On an AArch64 machine, my Raspberry Pi 3, I tested the iso image booting under qemu-kvm.
After a small while qemu will show the grub menu on the serial output.
|
ad518d3
to
fb41dcf
Compare
throw "Unsupported architecture"; | ||
|
||
# Syslinux (and isolinux) only supports x86-based architectures. | ||
isx86Compatible = pkgs.stdenv.isi686 || pkgs.stdenv.isx86_64; |
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.
Nit: Maybe this could be something like biosBootable
or x86BiosBootable
? It should be possible to build EFI-only x86 images after all.
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.
Hmm, while you're right for the documented purpose, it's also not right for one feature, whether or not to add the efi_uga
module for GRUB. I may as well change how it is added by instead checking for the existence of said module; it isn't entirely right either to say it's an x86 thing.
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.
Does attempting to load efi_uga
cause any problems in practice? IIRC it doesn't since install-grub.pl
will put it into the final grub.cfg
anyway on nixos-rebuild switch
and it has worked with the community box.
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 issue here is that efi_uga isn't built. Removing the newly added if
.
Adding additional modules:
- efi_uga
/nix/store/d07hfl9whmwjhj4pnajk1yz0fnr51j91-grub-2.02/bin/grub-mkimage: error: cannot open `/nix/store/d07hfl9whmwjhj4pnajk1yz0fnr51j91-grub-2.02/lib/grub/arm64-efi/efi_uga.mod': No such file or directory.
builder for '/nix/store/vhwh044bcn4fp1f7hs5hpiixw6m0vhdy-efi-directory.drv' failed with exit code 1
cannot build derivation '/nix/store/17vd0jkmdh7aq3fbdvkcarqc5nm63whh-nixos-19.03.git.ad27b06-aarch64-linux.iso.drv': 1
dependencies couldn't be built
error: build of '/nix/store/17vd0jkmdh7aq3fbdvkcarqc5nm63whh-nixos-19.03.git.ad27b06-aarch64-linux.iso.drv' failed
So it's not an issue of attempting to load efi_uga
, but more of an issue where since it doesn't exist, grub-mkimage
gets mad. I am not putting the other modules in similar conditionals to ensure they exist. If they don't then something is up with the grub build; either grub was updated and a module was removed (which may need manual intervention) or the build was broken.
Do note that the iso is not at all using the plumbing used when using the nixos configuration. So anything using nixos-rebuild switch
is not relevant here :/.
fb41dcf
to
ad27b06
Compare
Commenting here on a change I made: Yes, I'm using a |
Motivation for this change
Eventually make NixOS work with SBBR and EBBR compliant platforms.
A good first step for distros is to provide a UEFI-bootable image for ARM.
This PR makes the build process for the installer image work for AArch64.
Testing on real-world hardware
You will need an AArch64 machine which can UEFI boot. This is not as onerous as one could think. Mainline u-boot has the ability to boot UEFI-based images (this is an exercise left to the reader).
One of the most popuplar SBC, the Raspberry Pi, in its third major revision, the Raspberry Pi 3B, can boot Tiano Core, which is a reference UEFI implementation, using
@
andreiw's 64-bit Tiano Core UEFI for the Raspberry Pi 3. This is one of the way I have verified the work.First, pick an SD card you wan to use as your UEFI firmware, it can be really small, it only needs to fit the Tiano Core build. Format one FAT32 partition on it, name it as you want, I chose
$TIANOCORE$
to make sure I don't accidentally use it. Copy the contents of one of the pre-built Tiano Core builds (found underBinary/prebuilt/*/RELEASE
) to the root of the FAT32 partition. Eject your SD card and put it in the Raspberry Pi. Ensure it boots to Tiano Core (it should show up a gigantic raspberry with a countdown timer, it will eventually boot the UEFI shell).Then, burn the AArch64 iso as you would the normal x86_64 iso, (a simple
dd
). Plug that USB drive to the Raspberry Pi, boot it, it should automatically continue to GRUB. For the graphical console to work on the Raspberry Pi, you will need to addcma=32M
to the command line (presse
to edit an entry,CTRL+X
to boot it.) This PR does not touch the kernel parameters as they are a board-specific quirk.Related testing
A bad rough draft of this implementation was tested by @nbp on a SoftIron Overdrive 1000. I would like it if @nbp could test this cleaned-up build. (It should be 99% equivalent.)
Things done
sandbox
innix.conf
on non-NixOS)nix-shell -p nox --run "nox-review wip"
./result/bin/
)nix path-info -S
before and after)cc @dezgeg (arm and aarch64 knowledgeable)