Skip to content

Raspberry Pi: Latest kernel grew larger (again) than U-Boot allows #300328

@LordMZTE

Description

@LordMZTE

Describe the bug

The U-Boot bootloader NixOS ships with on aarch64 SD card images limits kernel size to 71827456 bytes (68.5 MiB) as per this patch. This limit is very easy to hit.

Steps To Reproduce

Steps to reproduce the behavior:

  1. Grab a Raspberry Pi (3B+ in my case)
  2. Add this configuration:
boot.kernelPackages = (import nixpkgs {
  system = "x86_64-linux";
  crossSystem = "aarch64-linux";
}).linuxPackages_latest;

boot.kernelPatches = [{
  name = "enable-gpio-poweroff";
  patch = null;
  extraStructuredConfig.POWER_RESET_GPIO = lib.kernel.yes;
}];

Note: the kernel patch may not be required to hit the limit, this additional kernel module is not directly related to the issue.

My kernel image (version 6.8.1) ended up being just over the limit at 68.83 MiB.

Nixpkgs commit this was reproduced on: 57e6b3a
3. Build the system. The bootloader will fall back to the last generation where the kernel was within the size limit.

Expected behavior

The bootloader would either be able to dynamically allocate the address space in order to allow any size of kernel image (not sure if this is possible with U-Boot) or the maximum should be adjusted to give some more room.

Additional context

Add any other context about the problem here.

Notify maintainers

@bartsch
@dezgeg
@samueldr
@lopsided98

Metadata

 - system: `"aarch64-linux"`
 - host os: `Linux 6.6.22, NixOS, 24.05 (Uakari), 24.05.20240325.57e6b3a`
 - multi-user?: `yes`
 - sandbox: `yes`
 - version: `nix-env (Nix) 2.18.2`
 - channels(root): `"nixos-24.05pre603596.2726f127c15a"`
 - nixpkgs: `/nix/store/161i7cxz0w0raqmrj88z86cj66babp9z-source`

Metadata

Metadata

Assignees

No one assigned

    Labels

    0.kind: bugSomething is broken2.status: stalehttps://github.com/NixOS/nixpkgs/blob/master/.github/STALE-BOT.md

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions