Patches to install guix system on Raspberry Pi

OpenSubmitted by Stefan.
Details
2 participants
  • Danny Milosavljevic
  • Stefan
Owner
unassigned
Severity
normal
S
S
Stefan wrote on 9 May 17:32 +0200
(address . guix-patches@gnu.org)
19E4796A-B0DB-444F-8773-2E8D3EF6132D@vodafonemail.de
Hi!
This patch series adds support for the Raspberry Pi. It allows to use ‘sudo -E guix system init … /mnt’ with the root partition mounted at /mnt and the boot partition mounted at /mnt/boot/efi, as you would expect it for a PC with UEFI. Installing for netboot is possible as well.
It is currently not possible to build an image with this patch series, because of the intercepting handling for efi system image creation.
Some of these patches are generic and not related to the Raspberry Pi. I hope they will be a useful contribution for everyone.
Here is a quick overview of the single patches:
01: Disable the tests on aarch64 for qemu-minimal, because it is non-deterministic but needed to build grub.
02: Rework the grub-efi-netboot-bootloader and add a grub-efi-netboot-removable-bootloader which then are pre-installed. This allows a simplification of the efi-bootloader-chain, as these pre-installed bootloaders just need to be copied and can therefore easily be collected in a bootloader-profile.
03: A new build-side module to modify a defconfig. It is used to customize U-Boot and Linux packages.
04: Customized and pre-installed U-Boot packages for the Raspberry Pi.
05: Fixed the EXTRAVERSION variable used to build Linux, so that the extra-version argument will be visible with uname.
06: New function to modify a Linux package by using another defconfig and/or adding or removing configurations.
07: Raspberry Pi specific defconfig objects.
08: Some helpers to construct config.txt files for the Raspberry Pi firmware.
09: A function to create a package with device-tree files from a Linux package for the Raspberry Pi.
10: A bootloader for the Raspberry Pi. Additionally two examples of operating-system definitions to boot from local storage or over network, the latter is making necessary configuration changes to Linux.
The firmware topic is excluded. In the same way that guix assumes that some UEFI firmware is already present on a PC, this patch series assumes that a firmware to start U-Boot is already present.
The grub bootloaders are usable on PCs as well. In contrast to the normal grub-efi, all grub files are copied to the EFI system partition, instead of the root partition. This is a side effect of the netboot capability. Maybe this is helpful for some spacial cases. I realized for example that the normal grub-efi locates the partition containing the grub.cfg by a device name like (hd0,gpt1), this may be problematic when adding disks to a system. The new grub bootloaders determine the partition by UUID.
The new possibility to customize Linux with (modify-linux) will be useful for anyone in need to do small configuration changes. There is also the possibility to pass an own defconfig file to this function. It can either be the name of a defconfig file from the Linux sources, or it can be a file-like object, like produced by (local-file) or possibly downloaded with the new (make-defconfig) function.

Bye
Stefan
S
S
Stefan wrote on 16 May 14:46 +0200
(address . 48314@debbugs.gnu.org)
53799D56-08BA-401A-BC09-81BA61736AAC@vodafonemail.de
Hi!
There were errors in the patches 05 and 06 in the EXTRAVERSION handling and in the modify-linux function.
Here an updated patch series. They apply to commit f661e6883ec345258634940ce5d52957e1bb90c3.

Bye
Stefan
D
D
Danny Milosavljevic wrote on 19 Jun 20:11 +0200
(name . Stefan)(address . stefan-guix@vodafonemail.de)
20210619201103.69502840@scratchpost.org
Hi Stefan,
Thanks!
Pushed 05-gnu-linux-correct-name-of.patch to guix master as commit b04cba9ee533945f90ffd72637f064c60188f945.
(I've also started testing the other patches of this patchset, but it will take a while)
Toggle diff (36 lines)diff --git a/gnu/packages/linux.scm b/gnu/packages/linux.scmindex 84ea849108..51e692a8c3 100644--- a/gnu/packages/linux.scm+++ b/gnu/packages/linux.scm@@ -749,9 +749,9 @@ for ARCH and optionally VARIANT, or #f if there is no such configuration." (define* (make-linux-libre version hash-string supported-systems #:key+ (extra-version #f) ;; A function that takes an arch and a variant. ;; See kernel-config for an example.- (extra-version #f) (configuration-file #f) (defconfig "defconfig") (extra-options %default-extra-linux-options)@@ -770,9 +770,9 @@ for ARCH and optionally VARIANT, or #f if there is no such configuration." (define* (make-linux-libre* version source supported-systems #:key+ (extra-version #f) ;; A function that takes an arch and a variant. ;; See kernel-config for an example.- (extra-version #f) (configuration-file #f) (defconfig "defconfig") (extra-options %default-extra-linux-options))@@ -838,7 +838,8 @@ for ARCH and optionally VARIANT, or #f if there is no such configuration." (format #t "`CROSS_COMPILE' set to `~a'~%" (getenv "CROSS_COMPILE")))) - (setenv "EXTRA_VERSION" ,extra-version)+ (setenv "EXTRAVERSION" ,(and extra-version+ (string-append "-" extra-version))) (let ((build (assoc-ref %standard-phases 'build)) (config (assoc-ref (or native-inputs inputs) "kconfig")))
-----BEGIN PGP SIGNATURE-----
iQEzBAEBCgAdFiEEds7GsXJ0tGXALbPZ5xo1VCwwuqUFAmDOMzcACgkQ5xo1VCwwuqVnVgf+MFlQTHVvJg/06G3HbaXgAe0tqPql7swHL83tSPikO1XRB9VjGp2FdzSHNqFiGnGhVwUboEH4x3i6DuK8BOPz2A6Xc8aUDG4taNr0Tc9rttde5qg7cOY5lzj54dJuDURrUvvM5HQir73Kb/kgkAqvpqLQMwESl6uYE6nPDdLZaQLXuSYclnkrVFAIMpViIUWfEVuMJlKId59YnzSXcoTgFwHgFN7SO1dGAyjL9Dl4+EqQMWkUAR1UQ32soXEaapihBsIN+bkNA9iSDXSTM02mJvdg0vDjEsFARSIzsK4x1n/2TC7Um+Fzq6HpDr2r5W3qo9c8pOvHYWxbdyjNCHN/Tw===f5GG-----END PGP SIGNATURE-----

D
D
Danny Milosavljevic wrote on 19 Jun 20:13 +0200
(name . Stefan)(address . stefan-guix@vodafonemail.de)(address . 48314@debbugs.gnu.org)
20210619201311.7f3c5f60@scratchpost.org
Hi Stefan,
Since bug 43534 is closed, does that mean I can drop patch 01-gnu-qemu-disable-tests-on.patch ?
-----BEGIN PGP SIGNATURE-----
iQEzBAEBCgAdFiEEds7GsXJ0tGXALbPZ5xo1VCwwuqUFAmDOM7gACgkQ5xo1VCwwuqVt6gf/YjZphtgKR4fzrQCi9gra8qv1hMqQvAPlE1MKha8AFUEPnHI29vIKX/pTw2TUUEoh10mk0yfOD+V+WhU4YB3PyN1x6J86iAIF3dY9MPejh/vPWxUsMXsY3uVHVyKDwYjfkHJbDlS3hr4wVXHic+IKixR3tBF4myXpyA5IVSqL/92Q1EWCTH9CVEby5E9qH9tgGhoCbuCtYOSeNuhS+W5z2YirRaogcSRaNS7zzH7eNBWSxXuehfBYDHX++M5ZeJSu3bKghk2CK5x6ioxbGxe/lv97fy+vPtVN5OX7Nff5OQBrCc7yhdhoVe0bAFsbNwinvUkU1xRhcNOSmQRMZcRJOg===QWVZ-----END PGP SIGNATURE-----

D
D
Danny Milosavljevic wrote on 19 Jun 21:04 +0200
(name . Stefan)(address . stefan-guix@vodafonemail.de)(address . 48314@debbugs.gnu.org)
20210619210417.67c21720@scratchpost.org
Hi Stefan,
In 04-gnu-bootloader-add-u-boot.patch, I think that having #:name is too magical(it still only replaces part of the package name, and then still only aftersubstitution). But if made non-magical, then it has too little benefit.
Likewise for #:description.
If it's alright with you, can we just drop #:name xxx and #:description xxxaltogether and instead do:
(define-public u-boot-rpi-3-efi (package (inherit (make-preinstalled-u-boot-package "rpi_3_32b" "arm-linux-gnueabihf" #:name "rpi-3-efi" #:configs %u-boot-rpi-efi-configs #:description %u-boot-rpi-efi-description-32-bit)) (name "u-boot-rpi-3-efi") (description %u-boot-rpi-efi-description-32-bit)))
And similar for all the other u-boot definitions, and forthe usage of make-u-boot-package inside make-preinstalled-u-boot-package ?
Or are there upsides to doing it like you did it?
I'm aware that the same can be said for "board" ... which is used already.However, that parameter is also used for something else, so it needs to be there.
NAME isn't used for anything else but for doing what a regular package inheritcould do anyway. Is there a downside when using package inherit?
-----BEGIN PGP SIGNATURE-----
iQEzBAEBCgAdFiEEds7GsXJ0tGXALbPZ5xo1VCwwuqUFAmDOP7EACgkQ5xo1VCwwuqVAaAf9HBxCMDHNFiQOsIsHVDFut+nWPG+PQGUa/IvGqBZglqoAZU/PH1XpmAhBkuF4mcd4OUl88BADffwa2ur3ymgdrxYZweOlEZNPg5GoqoJd9LoEGjBJdfU+l4kK/aWZlDWxLSX1LLRZGO5vIydWdEO+ClzRPmVit1z6UnGCZOLrs2hpnxNVoAI/7VaKaVLhfskhoiR98rUOH5RseV2vxzafpkWL7QEkMbnUieE8WnNmi4ziYWADlJmnJjBcn0gIoIrKdKoITdRME1oJM1kt/E4wC0nK5vdzn9/JtnYlp3saHgxJb4wbSxWNcbLWS22zXd1f9GsnncLbh9wtJJzCNdGgLQ===1Gd1-----END PGP SIGNATURE-----

D
D
Danny Milosavljevic wrote on 19 Jun 21:10 +0200
(name . Stefan)(address . stefan-guix@vodafonemail.de)
20210619211026.5eb44073@scratchpost.org
Hi Mark,Hi Leo,
could you look at 06-gnu-linux-new-function-to.patch of this patchset?
It provides the user a means of (slightly) editing kernel configs using ahigh-level interface, called "modify-linux".
What do you think?
@Stefan: On the other hand, I'm not sure of the general utility of make-defconfig.I've never needed something like it in decades. Is it worth exporting as publicfrom (gnu packages linux) ? Sounds like a too weird special case to have generalutility.
-----BEGIN PGP SIGNATURE-----
iQEzBAEBCgAdFiEEds7GsXJ0tGXALbPZ5xo1VCwwuqUFAmDOQSIACgkQ5xo1VCwwuqX35Qf/UePQutH3t4R3n2mL1izoKqJD7RNq+4T6RYkC+Ic8I4w3+aig9akcAmR07WxTZ33N3bhhV05VrMH8kyZftlSQky6JfslqgxIkJXFZwi81Qf+2unr5+GAaVdy5+ATIRs2/M4C+/Xs55dMoVaOpw4ZfhGcG4nVKLkt3UbUdxSA7ZS4B3V/UwvzpF2NQCOTP9VzrqEzH8aVlGgWgOn/XuV4YxLMUrNFncTegjtDs/HVnq1NlhBkCwVGEw2+ag7mF2O/QbEV2GKu12jipQWf6+fajBqCaNEuYSvwN/ny+x1p+f8PrB5+spBadFdwf7rVmslqAuLXnUFV+4RClU3pRfjhGRg===qGer-----END PGP SIGNATURE-----

S
S
Stefan wrote on 19 Jun 21:10 +0200
(name . Danny Milosavljevic)(address . dannym@scratchpost.org)(address . 48314@debbugs.gnu.org)
D30A68B9-D3C1-4DF7-BE68-7ECE39EE296E@vodafonemail.de
Hi Danny!
Toggle quote (2 lines)> Since bug 43534 is closed, does that mean I can drop patch 01-gnu-qemu-disable-tests-on.patch ?
Yes.
On the other side I have a bad experience with qemu substitutes for aarch64 and building qemu on a Raspberry takes a night and then still fails during the test. I hope the substitute situation improves, otherwise this patch should still be considered.

Bye
Stefan
S
S
Stefan wrote on 19 Jun 21:18 +0200
(name . Danny Milosavljevic)(address . dannym@scratchpost.org)(address . 48314@debbugs.gnu.org)
56852507-062B-4242-8584-488E691DCD84@vodafonemail.de
Hi Danny!
Toggle quote (3 lines)> If it's alright with you, can we just drop #:name xxx and #:description xxx> altogether
That’s OK.

Bye
Stefan
S
S
Stefan wrote on 19 Jun 22:21 +0200
(name . Danny Milosavljevic)(address . dannym@scratchpost.org)
897B7FF7-24C1-4B96-8441-415596267E99@vodafonemail.de
Hi!
Toggle quote (2 lines)> @Stefan: On the other hand, I'm not sure of the general utility of make-defconfig.
There is currently no simple way change the Linux configuration. Also by modifying the final .config as of today (which kind of contains all CONFIG_…-variables), as far as I know dependencies will not be resolved and conflicting configurations can easily happen.
A defconfig however gets striped down to a minimum of required CONFIG_…-variables and all “missing” ones get either default values or get determined through dependecies. So adding /removing/changing some few configurations to a defconfig is less error-prone. Further defconfig files are easier to maintain in git. There is a reason that only defconfig files are maintained in the Linux sources.
Please note that the patch allows to select a defconfig file from the Linux sources (if the parameter is a string), and also to provide an own defconfig file (if it is a file-like object).
Toggle quote (2 lines)> Sounds like a too weird special case to have general utility.
Well, there is the need already in Guix to have e.g. the predefined linux-libre-arm64-generic kernel, wich just uses a certain defconfig file from the Linux sources. But this possibility is not exported.
There are many defconfig files for all sorts of boards, especially for arm32. Why shouldn’t we allow to use any of these? Why should users be restrict to “selected” configurations? Why should Guix’ kernel configuration be preferred over the plain x86_64_defconfig?
And take a look at the last patch: In order to make that kernel boot on a Raspberry from an NFS root, some few configurations are missing, which can easily be added with the “modify-linux” function. By the way, maybe “customize-linux” would be a better name.
And there is another patch from me to make the NFS root test pass. As the Linux kernel build by Guix is not able to boot over NFS root in qemu, I used the same function there to add the missing configurations.
Oh, and finally, I need the same underlying kconfig.scm and a similar defconfig modification for U-Boot as well, which allowed me to simplify the existing U-Boot packages.

Bye
Stefan
S
S
Stefan wrote on 28 Jul 20:58 +0200
(name . Danny Milosavljevic)(address . dannym@scratchpost.org)
BDB9E76C-37FF-4033-81C1-9D5F0AA575F2@vodafonemail.de
Hi Danny!
Are there any news on this topic¹?

Bye
Stefan

¹ https://debbugs.gnu.org/cgi/bugreport.cgi?bug=48314
?
Your comment

Commenting via the web interface is currently disabled.

To comment on this conversation send email to 48314@debbugs.gnu.org