From 0c19eb3e5559a9e27a3402dda4357d0cd2b58dae Mon Sep 17 00:00:00 2001 From: Emily Date: Tue, 24 Jun 2025 18:56:51 +0100 Subject: [PATCH] lib/systems: unify ARMv5 platforms with stock kernel configuration MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit The `sheevaplug` kernel configuration was added a very long time ago and has not been adjusted for years. `pogoplug4` was identical to `sheevaplug` except for an even more stripped‐down kernel configuration, no device tree support, and a different load address for the uImage. These days, the stock kernel configuration builds and there has been an upstream device tree for the Pogoplug Series 4 for years; unify `sheevaplug` and `pogoplug4` into an `armv5tel-multiplatform` that uses the standard configuration. ARMv5 was also the only platform that defaulted to uImage, the [legacy U‐Boot image format] that is deprecated upstream. Our bootloader machinery in NixOS does not handle these images in any special way and even the original ARMv6 Raspberry Pi platform defaults to the standard zImage. We switch `armv5tel-multiplatform` to zImage to match. [legacy U‐Boot image format]: https://docs.u-boot.org/en/latest/usage/cmd/bootm.html#legacy-boot It is of course natural to worry about backwards compatibility here: this switches to a different kernel image format and drops support for root on NFS along with random oddities like KGDB and LatencyTOP. Renaming the platform is intended to help mitigate this risk. The reality, however, is that it is currently very difficult to build a configuration for ARMv5. I found online as an example configuration from many years ago; it already set `autoModules`, and builds U‐Boot using `CONFIG_DISTRO_DEFAULTS`, which should work out of the box without requiring the legacy U‐Boot image format. Even then, however, I confirmed with the author that it hasn’t been used in years, and I could barely get it to build with a modern Nixpkgs: OpenSSH is broken, Nix is broken, multiple default `environment.systemPackages` in the SD image profile are broken, `boot.initrd.includeDefaultModules` is broken, and `hardware.enableAllHardware` is broken. I conclude that if anyone is actively building systems on ARMv5, they have a forked Nixpkgs or a very custom setup. Given our general move to standard boot chains and no platform‐specific hacks, and the decaying state of our unofficial support for 32‐bit ARM, I think it is not worth maintaining support for the legacy image format for this one ancient platform. If anyone is running a heavily stripped‐down NixOS configuration on mission‐critical SheevaPlugs using a custom Nix‐free deployment setup relying on the legacy U‐Boot image format and somehow none of these kernel changes manage to loudly break their build, hopefully they’ll at least notice the release notes entry! Otherwise there’s always JTAG… --- doc/release-notes/rl-2611.section.md | 4 + lib/systems/examples.nix | 10 +- lib/systems/platforms.nix | 137 +----------------- .../linux/make-bootstrap-tools-cross.nix | 2 +- pkgs/test/cross/default.nix | 2 +- pkgs/top-level/release-cross.nix | 6 +- 6 files changed, 17 insertions(+), 144 deletions(-) diff --git a/doc/release-notes/rl-2611.section.md b/doc/release-notes/rl-2611.section.md index 6aa19f0952b7..4b36a630421d 100644 --- a/doc/release-notes/rl-2611.section.md +++ b/doc/release-notes/rl-2611.section.md @@ -19,6 +19,10 @@ - `uhttpmock` providing 0.0 ABI was removed. `uhttpmock_1_0` providing 1.0 ABI was renamed to `uhttpmock` and `uhttpmock_1_0` was kept as an alias. +- The ARMv5 Linux kernel build now uses a standard configuration and generates a standard compressed image instead of the deprecated legacy U‐Boot image format. + `lib.systems.{examples,platforms}.{sheevaplug,pogoplug4}` have been unified into `lib.systems.examples.armv5tel-multiplatform`. + Note that there is no official support for ARMv5 and it is not possible to build even a simple NixOS configuration out of the box. + - `requireFile` now sets `meta.license = lib.licenses.unfree` by default. Users of `requireFile`-based derivations that preserve this default will need to explicitly allow their evaluation as described in [](#sec-allow-unfree). - `librest` providing 0.7 ABI was removed. `librest_1_0` providing 1.0 ABI was renamed to `librest` and `librest_1_0` was kept as an alias. diff --git a/lib/systems/examples.nix b/lib/systems/examples.nix index 18c954ffc06e..055f727d53c9 100644 --- a/lib/systems/examples.nix +++ b/lib/systems/examples.nix @@ -40,10 +40,9 @@ rec { rust.rustcTarget = "powerpc-unknown-linux-gnu"; }; - sheevaplug = { + armv5tel-multiplatform = { config = "armv5tel-unknown-linux-gnueabi"; - } - // platforms.sheevaplug; + }; raspberryPi = { config = "armv6l-unknown-linux-gnueabihf"; @@ -99,11 +98,6 @@ rec { useLLVM = true; }; - pogoplug4 = { - config = "armv5tel-unknown-linux-gnueabi"; - } - // platforms.pogoplug4; - ben-nanonote = { config = "mipsel-unknown-linux-uclibc"; } diff --git a/lib/systems/platforms.nix b/lib/systems/platforms.nix index ee220ce31cf2..b10c787728a0 100644 --- a/lib/systems/platforms.nix +++ b/lib/systems/platforms.nix @@ -46,138 +46,15 @@ rec { ## ARM ## - pogoplug4 = { + armv5tel-multiplatform = { linux-kernel = { - name = "pogoplug4"; + name = "armv5tel-multiplatform"; baseConfig = "multi_v5_defconfig"; - autoModules = false; - extraConfig = '' - # Ubi for the mtd - MTD_UBI y - UBIFS_FS y - UBIFS_FS_XATTR y - UBIFS_FS_ADVANCED_COMPR y - UBIFS_FS_LZO y - UBIFS_FS_ZLIB y - UBIFS_FS_DEBUG n - ''; - makeFlags = [ "LOADADDR=0x8000" ]; - target = "uImage"; - # TODO reenable once manual-config's config actually builds a .dtb and this is checked to be working - #DTB = true; - }; - gcc = { - arch = "armv5te"; - }; - }; - - sheevaplug = { - linux-kernel = { - name = "sheevaplug"; - - baseConfig = "multi_v5_defconfig"; - autoModules = false; - extraConfig = '' - BLK_DEV_RAM y - BLK_DEV_INITRD y - BLK_DEV_CRYPTOLOOP m - BLK_DEV_DM m - DM_CRYPT m - MD y - BTRFS_FS m - XFS_FS m - JFS_FS m - EXT4_FS m - USB_STORAGE_CYPRESS_ATACB m - - # mv cesa requires this sw fallback, for mv-sha1 - CRYPTO_SHA1 y - # Fast crypto - CRYPTO_TWOFISH y - CRYPTO_TWOFISH_COMMON y - CRYPTO_BLOWFISH y - CRYPTO_BLOWFISH_COMMON y - - IP_PNP y - IP_PNP_DHCP y - NFS_FS y - ROOT_NFS y - TUN m - NFS_V4 y - NFS_V4_1 y - NFS_FSCACHE y - NFSD m - NFSD_V2_ACL y - NFSD_V3 y - NFSD_V3_ACL y - NFSD_V4 y - NETFILTER y - IP_NF_IPTABLES y - IP_NF_FILTER y - IP_NF_MATCH_ADDRTYPE y - IP_NF_TARGET_LOG y - IP_NF_MANGLE y - IPV6 m - VLAN_8021Q m - - CIFS y - CIFS_XATTR y - CIFS_POSIX y - CIFS_FSCACHE y - CIFS_ACL y - - WATCHDOG y - WATCHDOG_CORE y - ORION_WATCHDOG m - - ZRAM m - NETCONSOLE m - - # Disable OABI to have seccomp_filter (required for systemd) - # https://github.com/raspberrypi/firmware/issues/651 - OABI_COMPAT n - - # Fail to build - DRM n - SCSI_ADVANSYS n - USB_ISP1362_HCD n - SND_SOC n - SND_ALI5451 n - FB_SAVAGE n - SCSI_NSP32 n - ATA_SFF n - SUNGEM n - IRDA n - ATM_HE n - SCSI_ACARD n - BLK_DEV_CMD640_ENHANCED n - - FUSE_FS m - - # systemd uses cgroups - CGROUPS y - - # Latencytop - LATENCYTOP y - - # Ubi for the mtd - MTD_UBI y - UBIFS_FS y - UBIFS_FS_XATTR y - UBIFS_FS_ADVANCED_COMPR y - UBIFS_FS_LZO y - UBIFS_FS_ZLIB y - UBIFS_FS_DEBUG n - - # Kdb, for kernel troubles - KGDB y - KGDB_SERIAL_CONSOLE y - KGDB_KDB y - ''; - makeFlags = [ "LOADADDR=0x0200000" ]; - target = "uImage"; - DTB = true; # Beyond 3.10 + DTB = true; + autoModules = true; + preferBuiltin = true; + target = "zImage"; }; gcc = { arch = "armv5te"; @@ -407,7 +284,7 @@ rec { if version == null then pc else if lib.versionOlder version "6" then - sheevaplug + armv5tel-multiplatform else if lib.versionOlder version "7" then raspberrypi else diff --git a/pkgs/stdenv/linux/make-bootstrap-tools-cross.nix b/pkgs/stdenv/linux/make-bootstrap-tools-cross.nix index d69cc836a19e..5b670400ef43 100644 --- a/pkgs/stdenv/linux/make-bootstrap-tools-cross.nix +++ b/pkgs/stdenv/linux/make-bootstrap-tools-cross.nix @@ -25,7 +25,7 @@ lib.mapAttrs (n: make) ( # on how to request an upload. # Sort following the sorting in `./default.nix` `bootstrapFiles` argument. - armv5tel-unknown-linux-gnueabi = sheevaplug; + armv5tel-unknown-linux-gnueabi = armv5tel-multiplatform; armv6l-unknown-linux-gnueabihf = raspberryPi; armv7l-unknown-linux-gnueabihf = armv7l-hf-multiplatform; aarch64-unknown-linux-gnu = aarch64-multiplatform; diff --git a/pkgs/test/cross/default.nix b/pkgs/test/cross/default.nix index c5320f72a4bc..b4a007fa17e2 100644 --- a/pkgs/test/cross/default.nix +++ b/pkgs/test/cross/default.nix @@ -189,7 +189,7 @@ let pkgs.pkgsLLVM.stdenv pkgs.pkgsStatic.bash pkgs.pkgsCross.arm-embedded.stdenv - pkgs.pkgsCross.sheevaplug.stdenv # for armv5tel + pkgs.pkgsCross.armv5tel-multiplatform.stdenv pkgs.pkgsCross.raspberryPi.stdenv # for armv6l pkgs.pkgsCross.armv7l-hf-multiplatform.stdenv pkgs.pkgsCross.m68k.stdenv diff --git a/pkgs/top-level/release-cross.nix b/pkgs/top-level/release-cross.nix index e264d1cf8590..cc0ab49a8c40 100644 --- a/pkgs/top-level/release-cross.nix +++ b/pkgs/top-level/release-cross.nix @@ -197,8 +197,8 @@ in crossIphone32 = mapTestOnCross systems.examples.iphone32 darwinCommon; - # Test some cross builds to the Sheevaplug - crossSheevaplugLinux = mapTestOnCross systems.examples.sheevaplug ( + # Test some cross builds to ARMv5 + armv5tel = mapTestOnCross systems.examples.armv5tel-multiplatform ( linuxCommon // { ubootSheevaplug = nativePlatforms; @@ -235,8 +235,6 @@ in # Linux on armv7l-hf armv7l-hf = mapTestOnCross systems.examples.armv7l-hf-multiplatform linuxCommon; - pogoplug4 = mapTestOnCross systems.examples.pogoplug4 linuxCommon; - # Linux on aarch64 aarch64 = mapTestOnCross systems.examples.aarch64-multiplatform linuxCommon; aarch64-musl = mapTestOnCross systems.examples.aarch64-multiplatform-musl linuxCommon;