Skip to content
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 images: Add available modules to stage-1 on ARM platforms #121720

Merged
merged 14 commits into from
May 7, 2021

Conversation

samueldr
Copy link
Member

@samueldr samueldr commented May 4, 2021

See relevant PRs

Motivation for this change

There are two main classes of modules this adds:

  • graphics enablement
  • storage enablement

Graphics is to give end-users feedback about the current boot. If and when things fail in stage-1, it is helpful for users.

Storage is to allow loading stage-2! All of the additions here are for USB support in stage-1. This allows using a USB drive to write either of the "SD" image or the UEFI iso installer.

This was tested on

  • Pinebook (A64)
  • Pine A64-LTS
  • Raspberry Pi 3B
  • Raspberry Pi 4B
  • Libre Computer AML-S805X-AC (La Frite)

Special note:

  • Pinebook Pro (the UEFI iso seems to break rockchipdrm or something else in the display chain, SD image on USB works fine)
  • Orange Pi PC (armv7l)

Testing, for aarch64 included installing from the UEFI iso (except for the Pinebook Pro).

Testing, for armv7l was limited to running the UEFI iso. Installing requires a complete native build due to the lack of native compilation.

But... how were the images built?

Using this commit (branch tip might move), which includes some cross-compilation fixes:

Using my recently refactored "cross-system" repo.

 # Assuming <nixpkgs> is correct, or `--arg pkgs` is given
 $ nix-build -A aarch64-linux -A armv7l-linux
Things done
  • Tested using sandboxing (nix.useSandbox on NixOS, or option sandbox in nix.conf on non-NixOS linux)
  • Built on platform(s)
    • NixOS
    • macOS
    • other Linux distributions
  • Tested via one or more NixOS test(s) if existing and applicable for the change (look inside nixos/tests)
  • Tested compilation of all pkgs that depend on this change using nix-shell -p nixpkgs-review --run "nixpkgs-review wip"
  • Tested execution of all binary files (usually in ./result/bin/)
  • Determined the impact on package closure size (by running nix path-info -S before and after)
  • Ensured that relevant documentation is up to date
  • Fits CONTRIBUTING.md.

@github-actions github-actions bot added 6.topic: kernel The Linux kernel 6.topic: nixos Issues or PRs affecting NixOS modules, or package usability issues specific to NixOS 8.has: module (update) This PR changes an existing module in `nixos/` labels May 4, 2021
@samueldr samueldr changed the title installer images: Add available modules to stage-1 installer images: Add available modules to stage-1 on ARM platforms May 4, 2021
@ofborg ofborg bot added 11.by: package-maintainer This PR was created by the maintainer of the package it changes 10.rebuild-darwin: 0 This PR does not cause any packages to rebuild on Darwin 10.rebuild-linux: 1-10 labels May 4, 2021
@samueldr samueldr force-pushed the feature/arm-stage-1-modules branch from 4c08ac1 to 1cb977c Compare May 4, 2021 23:42
@samueldr samueldr marked this pull request as ready for review May 4, 2021 23:42
@samueldr
Copy link
Member Author

samueldr commented May 4, 2021

This isn't touching anything #121450 touches, so it can be reviewed in parallel!

@ofborg ofborg bot added 10.rebuild-linux: 0 This PR does not cause any packages to rebuild on Linux and removed 10.rebuild-linux: 1-10 labels May 4, 2021
@domenkozar
Copy link
Member

domenkozar commented May 7, 2021

Boots on Rpi4 via an SD card (USB didn't boot). I do get an error for bluetooth:
IMG_20210507_215617

Since that's better than not booting, let's merge this.

@domenkozar domenkozar merged commit 8ecb034 into NixOS:master May 7, 2021
@samueldr samueldr deleted the feature/arm-stage-1-modules branch May 7, 2021 21:22
@lopsided98
Copy link
Contributor

This PR enables ARM_LPAE on armv7l, which has the unfortunate side effect of disabling support for the Cortex-A5, A8, and A9 processors. In my case, this prevents the standard NixOS kernel from booting on the Beaglebone boards (TI AM335x).

There's no explanation given in this PR, but was this was done to support 32-bit kernels on the RPi 4?

@misuzu
Copy link
Contributor

misuzu commented Jul 30, 2021

There's no explanation given in this PR, but was this was done to support 32-bit kernels on the RPi 4?

I guess it's for future (I hope) native armv7l builders (the ones that use qemu-kvm on aarch64).

@lopsided98
Copy link
Contributor

Perhaps they should just apply that option in their config, rather than in the standard kernel.

@samueldr
Copy link
Member Author

samueldr commented Jul 30, 2021

At the time I tried searching information about which CPUs supported LPAE, and was led to believe that all "relevant" (read: armv7 Cortex-A*) CPUs supported LPAE. Though I still can't find proper information about LPAE support, only some notes about "A7 and A15", by digging.

@lopsided98 We can remove this. armv7 as a whole is more important than only some.

When we'll need it for builders, we'll see how we'll handle it. Whether we add a new attribute (for more broad use) or "just" customize the kernel config in the builder's config.

@lopsided98
Copy link
Contributor

#132100

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
6.topic: kernel The Linux kernel 6.topic: nixos Issues or PRs affecting NixOS modules, or package usability issues specific to NixOS 8.has: module (update) This PR changes an existing module in `nixos/` 10.rebuild-darwin: 0 This PR does not cause any packages to rebuild on Darwin 10.rebuild-linux: 0 This PR does not cause any packages to rebuild on Linux 11.by: package-maintainer This PR was created by the maintainer of the package it changes
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants