GNU bug report logs - #45517
Failed boot on arm32 with u-boot due to missing requirements with the distro boot protocol

Previous Next

Package: guix;

Reported by: Denis 'GNUtoo' Carikli <GNUtoo <at> cyberdimension.org>

Date: Tue, 29 Dec 2020 02:37:01 UTC

Severity: normal

Done: Mathieu Othacehe <othacehe <at> gnu.org>

Bug is archived. No further changes may be made.

Full log


View this message in rfc822 format

From: help-debbugs <at> gnu.org (GNU bug Tracking System)
To: Denis 'GNUtoo' Carikli <GNUtoo <at> cyberdimension.org>
Subject: bug#45517: closed (Re: bug#45517: Failed boot on arm32 with
 u-boot due to missing requirements with the distro boot protocol)
Date: Sat, 02 Jan 2021 10:24:02 +0000
[Message part 1 (text/plain, inline)]
Your bug report

#45517: Failed boot on arm32 with u-boot due to missing requirements with the distro boot protocol

which was filed against the guix package, has been closed.

The explanation is attached below, along with your original report.
If you require more details, please reply to 45517 <at> debbugs.gnu.org.

-- 
45517: http://debbugs.gnu.org/cgi/bugreport.cgi?bug=45517
GNU Bug Tracking System
Contact help-debbugs <at> gnu.org with problems
[Message part 2 (message/rfc822, inline)]
From: Mathieu Othacehe <othacehe <at> gnu.org>
To: Denis 'GNUtoo' Carikli <GNUtoo <at> cyberdimension.org>
Cc: 45517-done <at> debbugs.gnu.org
Subject: Re: bug#45517: Failed boot on arm32 with u-boot due to missing
 requirements with the distro boot protocol
Date: Sat, 02 Jan 2021 11:23:24 +0100
Hey Dennis,

> Thanks a lot, that works fine.

Glad it works! Maybe we should consider creating a
gnu/system/images/lime.scm file in the future.

Closing this one.

Thanks,

Mathieu

[Message part 3 (message/rfc822, inline)]
From: Denis 'GNUtoo' Carikli <GNUtoo <at> cyberdimension.org>
To: bug-guix <at> gnu.org
Subject: Failed boot on arm32 with u-boot due to missing requirements with
 the distro boot protocol
Date: Tue, 29 Dec 2020 03:34:39 +0100
[Message part 4 (text/plain, inline)]
Hi,

I've generated an image for the Lime2 with this (lime2.scm) file:
> ;; Based on Guix's beaglebone-black.tmpl
> (use-modules (gnu) (gnu bootloader u-boot))
> (use-package-modules bootloaders)
> (operating-system
>   (host-name "lime2")
>   (timezone "Europe/Paris")
>   (locale "en_US.utf8")
>   ;; We use a microSD
>   (bootloader (bootloader-configuration
>                (bootloader u-boot-a20-olinuxino-lime2-bootloader)
>                (target "/dev/mmcblk0")))
>   (kernel-arguments '("console=ttyS0,115200" "ignore_loglevel"))
>   ;; This module is required to mount the SD card.
>   (initrd-modules (cons "sunxi-mmc" %base-initrd-modules))
>   (file-systems (cons (file-system
>                         (device (file-system-label "my-root"))
>                         (mount-point "/")
>                         (needed-for-boot? #t)
>                         (type "ext4"))
>                       %base-file-systems))
>   (packages %base-packages)
>   (services (append (list
>                      (agetty-service
>                       (agetty-configuration
>                        (extra-options '("-L"))
>                        (baud-rate "115200")
>                        (term "xterm-256color")
>                        (tty "ttyS0"))))
>                     %base-services)))

I then built it with:
> cp `guix system disk-image --target=arm-linux-gnueabihf lime2.scm` \
>     guix.img

However when booting the image, u-boot doesn't find
/boot/extlinux/extlinux.conf.

However running the following command in u-boot makes the board boot:
> sysboot mmc 0:2 any $scriptaddr /boot/extlinux/extlinux.conf

When we look at the resulting image with fdisk -l we have:
> Device     Boot Start     End Sectors  Size Id Type
> guix.img1        2048   83967   81920   40M ef EFI (FAT-12/16/32)
> guix.img2       83968 3301783 3217816  1.5G 83 Linux

The second partition (which has /boot/extlinux/extlinux.conf) doesn't
have the boot flag.

Adding the boot flag with the following command results in a booting
image:
> sfdisk guix.img -A 2

This is because the distro boot protocol (documented in
doc/README.distro in u-boot source code[1]) expects the partition that
holds the extlinux.conf config file to be "explicitly marked bootable".
else "U-Boot falls back to searching the first valid partition of a
disk for boot configuration files."

So we either need to remove the first partition or to mark the second
partition as bootable or both.

I've tried looking in the partitioning code to understand how flags are
set but I'm a complete newbie in scheme so I failed. Being able to set
the bootable flag could probably help in some situations where a first
partition has to be used for some reasons.

In addition, the first partition it only contains the
/EFI/BOOT/BOOTIA32.EFI file which is of the following type:
> PE32 executable (EFI application) Intel 80386 (stripped to external
> PDB), for MS Windows
So it could also be removed and/or replaced with ARM code.

References:
-----------
[1]https://gitlab.denx.de/u-boot/u-boot/-/raw/master/doc/README.distro

Denis.
[Message part 5 (application/pgp-signature, inline)]

This bug report was last modified 4 years and 195 days ago.

Previous Next


GNU bug tracking system
Copyright (C) 1999 Darren O. Benham, 1997,2003 nCipher Corporation Ltd, 1994-97 Ian Jackson.