I've tried all the options for install Guix on this device that I could find. The setup I have is an x86_64 PC with Guix (the distribution), an aarch64 laptop with Guix (the package manager) and the Raspberry Pi 4B. I used the ./gnu/system/examples/raspberry-pi-64.tmpl for reference to write the image. I skipped setting up the boot partition for now since I can't even get it to completely compile all the packages.

This is the image I ended up with:
```
(use-modules (gnu)
             (gnu image)
             (guix gexp)
             (guix platforms arm))

(use-package-modules linux raspberry-pi)

(define pi-img
    (image
        (format 'disk-image)
        (platform aarch64-linux)
        (partition-table-type 'gpt)
        (partitions
            (list
                (partition
                    (size (* 256 (expt 2 20))) ; 256 MiB
                    (offset 8192)
                    (label "PI_BOOT")
                    (file-system "vfat")
                    (flags '(boot))
                    ;; Do nothing. I'd set this up later manually.
                    (initializer #~(lambda* (root . rest) #t)))
                (partition
                    (size 'guess)
                    (label "PI_ROOT")
                    (file-system "ext4"))))
        (operating-system
            (operating-system
                (host-name "pi")
                (timezone "Europe/Riga")
                (locale "en_US.UTF-8")
                (bootloader
                    (bootloader-configuration
                        (bootloader grub-efi-bootloader-chain-raspi-64)
                        (targets (list "/boot/efi"))))
                (kernel linux-libre-arm64-generic)
                (file-systems (cons* (file-system
                                         (mount-point "/")
                                         (type "ext4")
(device (file-system-label "PI_ROOT")))
                                     (file-system
                                         (mount-point "/boot/efi")
                                         (type "vfat")
(device (file-system-label "PI_BOOT")))
                                     %base-file-systems))
                (users (cons* (user-account
                                    (name "usr")
                                    (group "users")
(supplementary-groups '("wheel" "netdev" "audio" "video"))
                                    (home-directory "/home/usr"))
                                %base-user-accounts))
                (packages %base-packages)
                (services %base-services)))))

pi-img
```

1)
Building an image from the aarch64 laptop failed during a test https://bpa.st/K5PQ It says the build phase finished yet when I try to re-run the command (should return the image path on success AFAIK) it restarts the build.

2)
Building an image from the x86_64 PC failed while cross-compiling gawk-mesboot. I think this might have been related to https://issues.guix.gnu.org/66866 so I tried the --no-grafts option and afterwards something went completely wrong, I guess an unhandled exception and I got the backtrace https://bpa.st/3WEQ

3)
I also tried to install on a microSD card from the aarch64 laptop using `guix system init` with the same os definition as above like described here https://guix.gnu.org/manual/en/guix.html#Manual-Installation For some reason, when running the init command it sort of ignores the import of the raspberry-pi package/gnu packages raspberry-pi module and fails with:
```
/mnt/msd/etc/config.scm:15:36: error: grub-efi-netboot-removable-bootloader: unbound variable
hint: Did you forget a `use-modules' form?
```
but if I start up a REPL with `guix repl` and
```
(use-modules (gnu))
(use-package-modules raspberry-pi)
```
and then evaluate `grub-efi-bootloader-chain-raspi-64` it works fine.

Is there something I'm missing? Is Guix just unsupported on Raspberry Pi 4B? It was a breeze installing on the x86_64 PC though.

Reply via email to