[PATCH] gnu: raspberry-pi: Add helpers for config.txt file generation.

  • Done
  • quality assurance status badge
Details
3 participants
  • Danny Milosavljevic
  • Léo Le Bouter
  • Stefan
Owner
unassigned
Submitted by
Stefan
Severity
normal
S
S
Stefan wrote on 10 Nov 2020 00:53
(address . guix-patches@gnu.org)(name . Danny Milosavljevic)(address . dannym@scratchpost.org)
D5EFD887-3EDE-43E7-A461-97827D00F9B1@vodafonemail.de
* gnu/packages/raspberry-pi.scm (raspi-config-file, raspi-custom.txt):
New functions.
(raspi-config.txt, raspi-u-boot-bootloader.txt, raspi-kernel.txt):
New variables.
---
gnu/packages/raspberry-pi.scm | 44 +++++++++++++++++++++++++++++++++++
1 file changed, 44 insertions(+)

Toggle diff (54 lines)
diff --git a/gnu/packages/raspberry-pi.scm b/gnu/packages/raspberry-pi.scm
index 7700c26d06..af3998c4d6 100644
--- a/gnu/packages/raspberry-pi.scm
+++ b/gnu/packages/raspberry-pi.scm
@@ -235,3 +235,47 @@ Raspberry Pi. Note: It does not work on Raspberry Pi 1.")
(install-file "arm64.bin" libexec)
#t))))))))
(supported-systems '("aarch64-linux"))))
+
+(define-public (raspi-config-file name content)
+ "Creates a configuration file like config.txt for the Raspberry Pi firmware.
+CONTENT can be a list of strings, which are concatenated with a newline
+character. Alternatively CONTENT can be a string with the full file content."
+ (plain-file
+ name
+ (if (list? content)
+ (string-join content "\n" 'suffix)
+ content)))
+
+(define-public raspi-config.txt
+ ;; Creates a config.txt to start the ARM cores up in 64-bit mode if necessary
+ ;; and to include bootloader.txt, kernel.txt, and a custom.txt, each with
+ ;; separate configurations for the Raspberry Pi firmware.
+ (raspi-config-file
+ "config.txt"
+ `("# See https://www.raspberrypi.org/documentation/configuration/config-txt/README.md for details."
+ ""
+ ,(string-append "arm_64bit=" (if (target-aarch64?) "1" "0"))
+ "include bootloader.txt"
+ "include kernel.txt"
+ "include custom.txt")))
+
+(define-public raspi-u-boot-bootloader.txt
+ ;; Creates a bootloader.txt file to be included by the config.txt to load the
+ ;; U-Boot bootloader.
+ (raspi-config-file
+ "bootloader.txt"
+ "kernel=u-boot.bin"))
+
+(define-public raspi-kernel.txt
+ ;; Creates a kernel.txt to be included by the config.txt to ensure that
+ ;; upstream kernel and device tree files can be used.
+ (raspi-config-file
+ "kernel.txt"
+ '("dtoverlay=upstream"
+ "upstream_kernel=1")))
+
+(define-public (raspi-custom.txt content)
+ "Creates a custom.txt to be included by the config.txt. CONTENT can be a list
+of strings, which are concatenated with a newline character. Alternatively
+CONTENT can be a string with the full file content."
+ (raspi-config-file "custom.txt" content))
--
2.26.0
D
D
Danny Milosavljevic wrote on 16 Nov 2020 10:32
(name . Stefan)(address . stefan-guix@vodafonemail.de)(address . guix-patches@gnu.org)
20201116103231.2c151d33@scratchpost.org
I'm waiting for Ludo to comment about the dots in the variable names.
(Apparently, to be forward-compatible with literal pairs, dots in variable names are not nice to use)

It would be nice to also have some clients of that stuff in that file.

I.e. actually boot the raspberry pi using some chainloader config.

Otherwise it's hard to say whether this is a good API. When the API is actually
used it's much easier to say.
-----BEGIN PGP SIGNATURE-----

iQEzBAEBCgAdFiEEds7GsXJ0tGXALbPZ5xo1VCwwuqUFAl+yRy8ACgkQ5xo1VCww
uqXT7wf/TQhQuQUSYu+ywUl1wBrm73SNrvX3nvkOMGpRjY9YBOZ094dPg0jGfl1X
2c3ZQaMEq96yPkqeJpE+GiJBPHIDGjqWOzMlGd2b+B0xLFSJuV0I9THb+y97S26v
YGnk41cVyJtGafcxVaCRv+m4Np44qanyEV2HdIGUX7q0VRzabNN0Hds+aa2/Efn6
c/dN2Nmx86rat8mGv3gaOoSApBqaJGq8qLI+6QTzE/8XwpUBbINutBxmvKgf+smv
N2PuipnMiX9x32FhCUjLnIMXKmk/08x3vlmS9gdhg6jzuZesBl8L7KYX2FOtYAqJ
R0fsbNXweGIP7TCF76fzLQwnNnaA0Q==
=vEjU
-----END PGP SIGNATURE-----


S
S
Stefan wrote on 16 Nov 2020 11:38
(name . Danny Milosavljevic)(address . dannym@scratchpost.org)(address . guix-patches@gnu.org)
6C52CE60-8585-4FC4-BCBC-B901CB75B35F@vodafonemail.de
Hi Danny!

Toggle quote (7 lines)
> It would be nice to also have some clients of that stuff in that file.
>
> I.e. actually boot the raspberry pi using some chainloader config.
>
> Otherwise it's hard to say whether this is a good API. When the API is actually
> used it's much easier to say.

There will be more patches to come, then there will be a use of these functions.

The firmware blob using these files can’t be handled by Guix, this will have to be left as an exercise. But could I add a skeleton for it? Maybe something like this (but better using the copy-build-system):

(define (raspi-firmware url version hash)
(package
(build-system trivial-build-system)
(arguments
'(#:modules
((guix build utils))
#:builder (begin
(use-modules (guix build utils))
(let* ((source (assoc-ref %build-inputs "source"))
(out (assoc-ref %outputs "out"))
(boot (string-append out "/boot"))
(opt (string-append out "/opt")))
(mkdir-p boot)
(copy-recursively (string-append source "/boot") boot)
(delete-file (string-append boot "/kernel.img"))
(delete-file (string-append boot "/kernel7.img"))
(delete-file (string-append boot "/kernel7l.img"))
(delete-file (string-append boot "/kernel8.img"))
(mkdir-p opt)
(copy-recursively (string-append source "/opt") opt)
(delete-file-recursively (string-append opt "/vc/src"))
#t))))
…))

Further steps will be some functionality to modify the U-Boot configuration (done with Kconfig) and to have a specific U-Boot package.

Then I’ll care for a kernel.

The board will only boot if all of this is in place.

This is how I use it all currently (left out kernel, kernel-arguments, initrd-modules):

(operating-system
(bootloader
(bootloader-configuration
(bootloader (bootloader-chain
(list (file-append raspi-firmware "/boot/")
(file-append u-boot-rpi-3 "/libexec/u-boot.bin")
raspi-config.txt
raspi-u-boot-bootloader.txt
;; Additional configurations to use.
(raspi-custom.txt '("disable_overscan=1"
"hdmi_force_hotplug=1"
"audio=on"
"dtoverlay=gpio-ir"
"dtoverlay=disable-wifi"
"dtoverlay=vc4-fkms-v3d,cma-64")))
grub-efi-netboot-bootloader
#:installer (install-grub-efi-netboot "efi/boot")
#:copy-files? #t))
(theme
(grub-theme
(resolution
'(1920 . 1080))
(image (file-append %artwork-repository "/grub/GuixSD-fully-black-16-9.svg"))))
(target "/boot")
(keyboard-layout keyboard-layout)))
…)

The above bootloader-chain could certainly be added to Guix, but leaving out the raspi-firmware and the raspi-custom.txt – maybe as a function to allow adding an own raspi-custom.txt. If someone copies the firmware by hand onto an SD card, then such a bootloader provided as e.g. raspi-grub-bootloader would work.


Bye

Stefan
D
D
Danny Milosavljevic wrote on 16 Nov 2020 15:01
(name . Stefan)(address . stefan-guix@vodafonemail.de)(address . 44543@debbugs.gnu.org)
20201116150108.26a2daa7@scratchpost.org
Hi Stefan,

thanks!

On Mon, 16 Nov 2020 11:38:19 +0100
Stefan <stefan-guix@vodafonemail.de> wrote:

Toggle quote (2 lines)
> The firmware blob using these files can’t be handled by Guix, this will have to be left as an exercise. But could I add a skeleton for it? Maybe something like this (but better using the copy-build-system):

There is a free software Raspberry VC firmware on
https://github.com/librerpi/rpi-open-firmware/(currently cannot handle graphics
and USB and lots of other important things--but it DOES boot) and development
is ongoing.

We can just package that free software firmware and use it.

I've already started packaging it for Guix.

Toggle quote (19 lines)
> (operating-system
> (bootloader
> (bootloader-configuration
> (bootloader (bootloader-chain
> (list (file-append raspi-firmware "/boot/")
> (file-append u-boot-rpi-3 "/libexec/u-boot.bin")
> raspi-config.txt
> raspi-u-boot-bootloader.txt
> ;; Additional configurations to use.
> (raspi-custom.txt '("disable_overscan=1"
> "hdmi_force_hotplug=1"
> "audio=on"
> "dtoverlay=gpio-ir"
> "dtoverlay=disable-wifi"
> "dtoverlay=vc4-fkms-v3d,cma-64")))
> grub-efi-netboot-bootloader
> #:installer (install-grub-efi-netboot "efi/boot")
> #:copy-files? #t))

I advice to add a user-level function for a free software Raspberry Pi 3 efi
netboot bootloader to Guix (and a non-efi-netboot one, too, maybe).

Something like

(define (raspi-3-efi-netboot-bootloader efi-boot custom-text)
(bootloader-chain like you do above custom-text))

I don't think that it's reasonable to expect the user to use bootloader-chain
by himself (it's not user-friendly to have to do that).

Toggle quote (2 lines)
> The above bootloader-chain could certainly be added to Guix, but leaving out the raspi-firmware and the raspi-custom.txt – maybe as a function to allow adding an own raspi-custom.txt. If someone copies the firmware by hand onto an SD card, then such a bootloader provided as e.g. raspi-grub-bootloader would work.

Yeah.
-----BEGIN PGP SIGNATURE-----

iQEzBAEBCgAdFiEEds7GsXJ0tGXALbPZ5xo1VCwwuqUFAl+yhiQACgkQ5xo1VCww
uqUcCggAiBH7DhxnyUyyP/nPGRvC3H6t/VycxoiHbFlZtR1yY0YgM1LKvPYjs16K
JheO1aVmL1CdZNKvqP5is9wU892zAQCK37gp/udHO+Kpigk4SRd+6mn++ITad4rI
UN6RJklh7FqTU+VPj/S2tEUzHZdGRo8H/B3wZtzomU74/OsIKQt7E0GENpAqwBQO
ZxMSOIO/r9llvS7WPIIWmaxKMT+e/YYy2YMmhkTuN4E1NwMFBQFYN1eAPm9JY30U
vGst6a+O3YvEzey3/rVwW1PaOu4be/aLjgwPx92/bRX8Xhfi3IJ0/CiuBOPsHmyg
/8P1mxeZuYpRUxN784gzA1+WdQlVCQ==
=rdHF
-----END PGP SIGNATURE-----


S
S
Stefan wrote on 29 Nov 2020 20:04
[PATCH] gnu: raspberry-pi: Add helpers for config.txt file generation.
(name . Danny Milosavljevic)(address . dannym@scratchpost.org)(address . 44543@debbugs.gnu.org)
C744BEF8-07E0-4BD8-A0F6-D5C5B093F28D@vodafonemail.de
* gnu/packages/raspberry-pi.scm (raspi-config-file, raspi-custom-txt):
New functions.
(raspi-config-txt, raspi-bcm27-dtb-txt, raspi-bcm28-dtb-txt
raspi-u-boot-bootloader-txt): New variables.
---
gnu/packages/raspberry-pi.scm | 62 +++++++++++++++++++++++++++++++++++
1 file changed, 62 insertions(+)

Toggle diff (72 lines)
diff --git a/gnu/packages/raspberry-pi.scm b/gnu/packages/raspberry-pi.scm
index cdea392fc7..b189ec2f4e 100644
--- a/gnu/packages/raspberry-pi.scm
+++ b/gnu/packages/raspberry-pi.scm
@@ -235,3 +235,65 @@ Raspberry Pi. Note: It does not work on Raspberry Pi 1.")
(install-file "arm64.bin" libexec)
#t))))))))
(supported-systems '("aarch64-linux"))))
+
+(define-public (raspi-config-file name content)
+ "Create a configuration file like config.txt for the Raspberry Pi firmware.
+CONTENT can be a list of strings, which are concatenated with a newline
+character. Alternatively CONTENT can be a string with the full file content."
+ (plain-file
+ name
+ (if (list? content)
+ (string-join content "\n" 'suffix)
+ content)))
+
+(define-public (raspi-config-file name content)
+ "Create a configuration file like config.txt for the Raspberry Pi firmware.
+CONTENT can be a list of strings, which are concatenated with a newline
+character. Alternatively CONTENT can be a string with the full file content."
+ (plain-file
+ name
+ (if (list? content)
+ (string-join content "\n" 'suffix)
+ content)))
+
+(define-public raspi-config-txt
+ ;; Create a config.txt to start the ARM cores up in 64-bit mode if necessary
+ ;; and to include a dtb.txt, bootloader.txt, and a custom.txt, each with
+ ;; separated configurations for the Raspberry Pi firmware.
+ (raspi-config-file
+ "config.txt"
+ `("# See https://www.raspberrypi.org/documentation/configuration/config-txt/README.md for details."
+ ""
+ ,(string-append "arm_64bit=" (if (target-aarch64?) "1" "0"))
+ "include dtb.txt"
+ "include bootloader.txt"
+ "include custom.txt")))
+
+(define-public raspi-bcm27-dtb-txt
+ ;; Create a dtb.txt to be included by the config.txt to ensure that the
+ ;; downstream device tree files bcm27*.dtb will be used.
+ (raspi-config-file
+ "dtb.txt"
+ "upstream_kernel=0"))
+
+(define-public raspi-bcm28-dtb-txt
+ ;; Create a dtb.txt to be included by the config.txt to ensure that the
+ ;; upstream device tree files bcm28*.dtb will be used.
+ ;; This also implies the use of the dtoverlay=upstream.
+ (raspi-config-file
+ "dtb.txt"
+ "upstream_kernel=1"))
+
+(define-public raspi-u-boot-bootloader-txt
+ ;; Create a bootloader.txt file to be included by the config.txt to load the
+ ;; U-Boot bootloader.
+ (raspi-config-file
+ "bootloader.txt"
+ '("dtoverlay=upstream"
+ "kernel=u-boot.bin")))
+
+(define-public (raspi-custom-txt content)
+ "Create a custom.txt for the Raspberry Pi firmware.
+CONTENT can be a list of strings, which are concatenated with a newline
+character. Alternatively CONTENT can be a string with the full file content."
+ (raspi-config-file "custom.txt" content))
--
2.29.2
S
S
Stefan wrote on 13 Dec 2020 14:06
422D2441-7132-4983-9EFF-E6C87120CCCB@vodafonemail.de
Hi Danny!

A friendly ping. :-)


Bye

Stefan
S
S
Stefan wrote on 28 Dec 2020 20:24
(name . Mathieu Othacehe)(address . othacehe@gnu.org)
F769357C-F7A2-4E6A-8F3D-AFA2CBC525BB@vodafonemail.de
Hi!

A friendly ping! :-)


Bye

Stefan
S
S
Stefan wrote on 27 Mar 2021 17:40
(name . Mathieu Othacehe)(address . othacehe@gnu.org)
C788DDB2-1293-449A-86E8-2B9133D5E006@vodafonemail.de
Hi!

Another friendly ping! This patch is meanwhile really getting old, but it is still not forgotten. :-)



Bye

Stefan
L
L
Léo Le Bouter wrote on 27 Mar 2021 17:47
Re: [bug#44543] [PATCH] gnu: raspberry-pi: Add helpers for config.txt file generation.
(name . Mathieu Othacehe)(address . othacehe@gnu.org)
f08ed5c4dae1212efb8aebf74ea1b966a7d1d887.camel@zaclys.net
On Sat, 2021-03-27 at 17:40 +0100, Stefan wrote:
Toggle quote (12 lines)
> Hi!
>
> Another friendly ping! This patch is meanwhile really getting old,
> but it is still not forgotten. :-)
>
> <http://issues.guix.gnu.org/44543>
>
>
> Bye
>
> Stefan

I have a Raspberry Pi 3B+ here at home, how can I test these changes?

I don't feel capable to review this without testing something as a
whole verifying that it works then inspecting these things that make it
work.

Thank you
-----BEGIN PGP SIGNATURE-----

iQIzBAABCgAdFiEEFIvLi9gL+xax3g6RRaix6GvNEKYFAmBfYZIACgkQRaix6GvN
EKaP2Q/9EEV2yFShNHVbIIJyZy8hLZDk1EK98ZkQbHX2xuCuWtePFkIcnyNiED2d
+By+CwvUFHiwx82X+z4ndVM7Ea0sdY3cmSpu7PcErEyN7M2KSQum78n5rHeXO5vV
yXdSasS/9RJ7hSjSybLz2Hn1tE1l1AO9iCovr04RvvYS+6tLfOA2oB2zC900S6x4
YovrUXSeiadQO22ty5QeCSCwqgtHKyTiKsGGitbMUZ15pxCe5sUjvcu0SDdrRQBc
q7P9nX+z/HWHe5WFnvnUZduxOKwl4mlAkFksf6t8vaGD0QEpATikWsM+6rSEAoXn
5FElHAaLjG9KSan3GLtEp2v8M8AF/MNlaVFMQkm8S8747AO4uOvP74106RW8WLy2
mn0llGY6iIELnXdyBEqs+7J5PuphZdB26070/76wPXfHXMrRnGfX12MQ2p68aomA
X/AxZT9kc+wUA+nqF8tggtYLmWAD9FGgNVra2T3VWy2ByLBt+DVYjLkx/DEKXWP3
UDsGGk7/UfNaur7OxiEtZr1KLjbigfMq4NI+y/aM5H6oEkbUUJ7K8TrzpPXaOkOH
BDYd3G1K9jasKssVKGcfgoOCII97O0sdwyJMfgg1qpdmt+e88RGfZF1YIPAriz8V
lo66ckEK/pzDd+m5N2qhXRcyxnrtwHJ+Mh50vT7xCvMPPSyWdcc=
=Xd6/
-----END PGP SIGNATURE-----


S
S
Stefan wrote on 27 Mar 2021 20:43
(name . Léo Le Bouter)(address . lle-bout@zaclys.net)
9537F85E-03CA-4784-85BD-0637C7A16F31@vodafonemail.de
Hi Léo!

Toggle quote (6 lines)
> I have a Raspberry Pi 3B+ here at home, how can I test these changes?
>
> I don't feel capable to review this without testing something as a
> whole verifying that it works then inspecting these things that make it
> work.

The support for the Raspberry is still not complete. I’m using mine without an SD card, booting it over TFTP with an NFS root mount.

Installing on an SD card is not tested and certainly not working yet.

One of my next patches will be several u-boot packages for different Raspberry models. To build them I need to do changes to the defconfig file of u-boot. Therefore another ticket is pending, which eases defconfig modifications (http://issues.guix.gnu.org/45046, and I hope this can also be used to modify Linux). When that one is done, then I will send that next patch to add the u-boot packages.

My bootloader currently looks like this, but I’m using already further modifications, mainly for GRUB, so this will not work for you, but you can get an impression of the final intended use of all patches:

(bootloader
(bootloader-configuration
(target "/boot")
(bootloader (efi-bootloader-chain
grub-efi-netboot-removable-bootloader
;; Packages needed to boot the Raspberry.
#:packages (list raspberrypi-firmware
u-boot-rpi-efi-64)
;; Additional files for configuration.
#:files (list ;; Detects 32 or 64 bit, includes other txt files.
raspi-config-txt
;; Use the downstream device tree (upstream is bcm28).
raspi-bcm27-dtb-txt
;; This is the next boot stage.
raspi-u-boot-bootloader-txt
;; Additional configurations to use.
(raspi-custom-txt '("disable_overscan=1"
"hdmi_force_hotplug=1"
"audio=on"
"dtoverlay=gpio-ir"
"dtoverlay=disable-wifi"
"dtoverlay=vc4-fkms-v3d,cma-64")))))))

Your bootloader configuration would need to look like this, and you may get it running from an SD card:

(bootloader
(bootloader-configuration
(target "/boot")
(bootloader
(efi-bootloader-chain
(list (file-append firmware "/boot/")
(file-append u-boot-my-scb "/libexec/u-boot.bin")
raspi-config-txt
raspi-bcm27-dtb-txt
raspi-u-boot-bootloader-txt)
grub-efi-netboot-bootloader
#:installer
(chain-efi-bootloader-installer (install-grub-efi-netboot "efi/boot")))))

So you need to provide firmware and u-boot (still) yourself. As a short cut you may omit both (file-append …) functions and copy both parts by hand from some other distribution, maybe openSUSE – this is basically how I got started.

If you mount an ext4-partition of an SD card to e.g. /my-target/ and the FAT partition to /my-target/boot, then you may try a ‘guix system init … /my-target’.

If this succeeds, then it may be possible that adding the file /my-target/boot/efi/boot/grub.cfg with this content gets you to a system booting from an SD card:

search --file /boot/grub/grub.cfg
configfile /boot/grub/grub.cfg

But this is all untested, it certainly fails. :-)

At least – regarding this patch – I can ensure that the three config files as used in these bootloader examples are properly generated working.

Bye

Stefan
L
L
Léo Le Bouter wrote on 27 Mar 2021 20:51
(name . Stefan)(address . stefan-guix@vodafonemail.de)
832c926ec211cab21f63ed9578c67662db7426cf.camel@zaclys.net
On Sat, 2021-03-27 at 20:43 +0100, Stefan wrote:
Toggle quote (102 lines)
> Hi Léo!
>
> > I have a Raspberry Pi 3B+ here at home, how can I test these
> > changes?
> >
> > I don't feel capable to review this without testing something as a
> > whole verifying that it works then inspecting these things that
> > make it
> > work.
>
> The support for the Raspberry is still not complete. I’m using mine
> without an SD card, booting it over TFTP with an NFS root mount.
>
> Installing on an SD card is not tested and certainly not working yet.
>
> One of my next patches will be several u-boot packages for different
> Raspberry models. To build them I need to do changes to the defconfig
> file of u-boot. Therefore another ticket is pending, which eases
> defconfig modifications (<http://issues.guix.gnu.org/45046>;, and I
> hope this can also be used to modify Linux). When that one is done,
> then I will send that next patch to add the u-boot packages.
>
> My bootloader currently looks like this, but I’m using already
> further modifications, mainly for GRUB, so this will not work for
> you, but you can get an impression of the final intended use of all
> patches:
>
> (bootloader
> (bootloader-configuration
> (target "/boot")
> (bootloader (efi-bootloader-chain
> grub-efi-netboot-removable-bootloader
> ;; Packages needed to boot the Raspberry.
> #:packages (list raspberrypi-firmware
> u-boot-rpi-efi-64)
> ;; Additional files for configuration.
> #:files (list ;; Detects 32 or 64 bit, includes
> other txt files.
> raspi-config-txt
> ;; Use the downstream device tree
> (upstream is bcm28).
> raspi-bcm27-dtb-txt
> ;; This is the next boot stage.
> raspi-u-boot-bootloader-txt
> ;; Additional configurations to use.
> (raspi-custom-txt
> '("disable_overscan=1"
> "hdmi_force_hotp
> lug=1"
> "audio=on"
> "dtoverlay=gpio-
> ir"
> "dtoverlay=disab
> le-wifi"
> "dtoverlay=vc4-
> fkms-v3d,cma-64")))))))
>
> Your bootloader configuration would need to look like this, and you
> may get it running from an SD card:
>
> (bootloader
> (bootloader-configuration
> (target "/boot")
> (bootloader
> (efi-bootloader-chain
> (list (file-append firmware "/boot/")
> (file-append u-boot-my-scb "/libexec/u-boot.bin")
> raspi-config-txt
> raspi-bcm27-dtb-txt
> raspi-u-boot-bootloader-txt)
> grub-efi-netboot-bootloader
> #:installer
> (chain-efi-bootloader-installer (install-grub-efi-netboot
> "efi/boot")))))
>
> So you need to provide firmware and u-boot (still) yourself. As a
> short cut you may omit both (file-append …) functions and copy both
> parts by hand from some other distribution, maybe openSUSE – this is
> basically how I got started.
>
> If you mount an ext4-partition of an SD card to e.g. /my-target/ and
> the FAT partition to /my-target/boot, then you may try a ‘guix system
> init … /my-target’.
>
> If this succeeds, then it may be possible that adding the file /my-
> target/boot/efi/boot/grub.cfg with this content gets you to a system
> booting from an SD card:
>
> search --file /boot/grub/grub.cfg
> configfile /boot/grub/grub.cfg
>
> But this is all untested, it certainly fails. :-)
>
> At least – regarding this patch – I can ensure that the three config
> files as used in these bootloader examples are properly generated
> working.
>
>
> Bye
>
> Stefan

Thanks for all your work!

I would prefer if you opened one single bug with all the changes so I
can test the whole thing, right now I don't feel at ease reviewing
things like this. How can I be sure what you are submitting is the
right abstraction for your future work? Are you sure that abstraction
will be right for your future patches? If anything needs to be changed
I feel like one big patchset about Raspberry Pi 3B+ support will be
easier to review (at least for me).

Léo
-----BEGIN PGP SIGNATURE-----

iQIzBAABCgAdFiEEFIvLi9gL+xax3g6RRaix6GvNEKYFAmBfjK4ACgkQRaix6GvN
EKYRrhAAwCnV8/8CKFE94E6zwc2yrhzIfI1omr1FUCtbEKFGHeQZ66AB8J8CA5Vn
BQ49D2gMKMXu7+VNbnjMyI332xeyctT3HOQqdAby/PasR3RbBGQB1J5fHhZUNZ9l
VkTYLAXQrYax6goSJeIuvo9ApHYnlZ+k0Q/OIxNAvQkv9VnnlRqhFneKCJo/yfA9
hiYLKc6SM6fIkOdyb6GU2p0tFIa6F5pirjJzxViMjA4ONRtZ8xGDiC7gHYpqfINi
ugcehRLOREbvCGtQMTidS1Zs6XILv4JI8vXBxPbkLbYAzSEXyMbeJpb+v16k4Aj0
7Jjbiy+7l3HPmZzQxsMv7c/QYfkj+l2TYm0ifHBesn06Yzzwfl2OhIxpa/KqQxke
fH+5eh5xJ0u/uLJB1gA9khS3NcyW7MWBxj4VSU34E63KIUtY+fjkQlXijJVN+jDb
gBx5vTvpc6V+/ho0x4GQp7OKE1vfCwklEsPdNhCyT9TT6lueAVYBXQFr4IMkT/DL
skAr4WTBQ4xEjjDUtpdGBDwi0xwg/DonGUuZcWdHRFqRknVtwbHTQgft98Y8dWo1
Ru9Aa4yB/X9yu03jrgIo9uX7fielfZ7V/h9To66Azl7piF6ePwgfnXhqiJxH8uxD
LuGKNanxVjZo+SaWhAeJlK/48Iq/4HcYPeED4CEb6bC6+2PV29Q=
=KcUY
-----END PGP SIGNATURE-----


S
S
Stefan wrote on 27 Mar 2021 23:03
(name . Léo Le Bouter)(address . lle-bout@zaclys.net)
067A8489-6150-4632-878C-BB239B1674FD@vodafonemail.de
Hi Léo!

Toggle quote (4 lines)
> I would prefer if you opened one single bug with all the changes so I
> can test the whole thing, right now I don't feel at ease reviewing
> things like this.

I see. I’m doing little steps, sending patches for the parts which I think are ready.

Toggle quote (3 lines)
> How can I be sure what you are submitting is the
> right abstraction for your future work?

True. In this case you only have the bootloader examples that I gave.

This patch is just a building block to generate some config.txt in a modular and comfortable way. There is a bootloader installer copying any listed file-like-object.

Who knows, in future there might be a TianoCore bootloader, then a similar patch might be required to provide a raspi-tianocore-bootloader-txt.

Toggle quote (3 lines)
> Are you sure that abstraction
> will be right for your future patches?

Yes. There are basically three decisions to take for a Guix System: 32 or 64 bit, which device tree (depends on the linux kernel), which bootloader. Beyond this anything is a custom setting.

Toggle quote (4 lines)
> If anything needs to be changed
> I feel like one big patchset about Raspberry Pi 3B+ support will be
> easier to review (at least for me).

I see, this is not yet testable for you out of the box to boot a system.

What is testable right now is an incomplete bootloader. At least it is possible to inspect what files will be generated by this patch and copied into /boot. It must even be buildable for x86_64.

(bootloader
(bootloader-configuration
(target "/boot")
(bootloader
(efi-bootloader-chain
(list raspi-config-txt
raspi-bcm27-dtb-txt
raspi-u-boot-bootloader-txt)
grub-efi-netboot-bootloader
#:installer
(chain-efi-bootloader-installer (install-grub-efi-netboot "efi/boot")))))


Bye

Stefan


P.S. If you change your mind and want to test that bootloader, then you should know that GRUB depends on qemu and unfortunately qemu is failing its test on aarch64 since some months. Then this patch may help you get going.

Toggle diff (16 lines)
diff --git a/gnu/packages/virtualization.scm b/gnu/packages/virtualization.scm
index 2262aa6197..3732320df8 100644
--- a/gnu/packages/virtualization.scm
+++ b/gnu/packages/virtualization.scm
@@ -161,8 +161,9 @@
(arguments
`(;; FIXME: Disable tests on i686 to work around
;; <https://bugs.gnu.org/40527>.
- #:tests? ,(or (%current-target-system)
- (not (string=? "i686-linux" (%current-system))))
+ #:tests? ,(and (not (target-aarch64?))
+ (or (%current-target-system)
+ (not (string=? "i686-linux" (%current-system)))))
#:configure-flags (list "--enable-usb-redir" "--enable-opengl"
"--enable-docs"
S
S
Stefan wrote on 6 May 2021 23:12
(address . 44543-done@debbugs.gnu.org)
86AB64B2-613D-49F9-8985-50766CB1DCF9@vodafonemail.de
Hi!

I’m closing this ticket. There will be a new patch series which will also contain this change.


Bye

Stefan
Closed
?
Your comment

This issue is archived.

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

To respond to this issue using the mumi CLI, first switch to it
mumi current 44543
Then, you may apply the latest patchset in this issue (with sign off)
mumi am -- -s
Or, compose a reply to this issue
mumi compose
Or, send patches to this issue
mumi send-email *.patch