From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mp0 ([2001:41d0:2:4a6f::]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) by ms11 with LMTPS id iIw1GhGM7F88ZwAA0tVLHw (envelope-from ) for ; Wed, 30 Dec 2020 14:17:53 +0000 Received: from aspmx1.migadu.com ([2001:41d0:2:4a6f::]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) by mp0 with LMTPS id uJkLFhGM7F9QFAAA1q6Kng (envelope-from ) for ; Wed, 30 Dec 2020 14:17:53 +0000 Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by aspmx1.migadu.com (Postfix) with ESMTPS id 9C1489404C8 for ; Wed, 30 Dec 2020 14:17:52 +0000 (UTC) Received: from localhost ([::1]:42704 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1kucIR-0007MT-Hi for larch@yhetil.org; Wed, 30 Dec 2020 09:17:51 -0500 Received: from eggs.gnu.org ([2001:470:142:3::10]:52876) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1ku4sg-0001YN-CH for bug-guix@gnu.org; Mon, 28 Dec 2020 21:37:02 -0500 Received: from debbugs.gnu.org ([209.51.188.43]:53978) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1ku4sg-0005sG-4I for bug-guix@gnu.org; Mon, 28 Dec 2020 21:37:02 -0500 Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1ku4sg-0003yP-1i for bug-guix@gnu.org; Mon, 28 Dec 2020 21:37:02 -0500 X-Loop: help-debbugs@gnu.org Subject: bug#45517: Failed boot on arm32 with u-boot due to missing requirements with the distro boot protocol Resent-From: Denis 'GNUtoo' Carikli Original-Sender: "Debbugs-submit" Resent-CC: bug-guix@gnu.org Resent-Date: Tue, 29 Dec 2020 02:37:01 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: report 45517 X-GNU-PR-Package: guix X-GNU-PR-Keywords: To: 45517@debbugs.gnu.org X-Debbugs-Original-To: bug-guix@gnu.org Received: via spool by submit@debbugs.gnu.org id=B.160920941515257 (code B ref -1); Tue, 29 Dec 2020 02:37:01 +0000 Received: (at submit) by debbugs.gnu.org; 29 Dec 2020 02:36:55 +0000 Received: from localhost ([127.0.0.1]:37291 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1ku4sY-0003y1-Nx for submit@debbugs.gnu.org; Mon, 28 Dec 2020 21:36:55 -0500 Received: from lists.gnu.org ([209.51.188.17]:51952) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1ku4sW-0003xs-EZ for submit@debbugs.gnu.org; Mon, 28 Dec 2020 21:36:53 -0500 Received: from eggs.gnu.org ([2001:470:142:3::10]:52850) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1ku4sW-0001Rl-7Q for bug-guix@gnu.org; Mon, 28 Dec 2020 21:36:52 -0500 Received: from cyberdimension.org ([80.67.179.20]:55594 helo=gnutoo.cyberdimension.org) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_CHACHA20_POLY1305:256) (Exim 4.90_1) (envelope-from ) id 1ku4sT-0005m5-QH for bug-guix@gnu.org; Mon, 28 Dec 2020 21:36:52 -0500 Received: from gnutoo.cyberdimension.org (localhost [127.0.0.1]) by cyberdimension.org (OpenSMTPD) with ESMTP id 93f7b554 for ; Tue, 29 Dec 2020 02:30:21 +0000 (UTC) Received: from primarylaptop.localdomain (localhost.localdomain [::1]) by gnutoo.cyberdimension.org (OpenSMTPD) with ESMTP id 0051cdd7 for ; Tue, 29 Dec 2020 02:30:21 +0000 (UTC) Date: Tue, 29 Dec 2020 03:34:39 +0100 From: Denis 'GNUtoo' Carikli Message-ID: <20201229033439.60b2a9ff@primarylaptop.localdomain> X-Mailer: Claws Mail 3.17.8 (GTK+ 2.24.32; i686-pc-linux-gnu) MIME-Version: 1.0 Content-Type: multipart/signed; boundary="Sig_/jb=Zu=CXcarWt.i5//Me79r"; protocol="application/pgp-signature"; micalg=pgp-sha256 Received-SPF: pass client-ip=80.67.179.20; envelope-from=GNUtoo@cyberdimension.org; helo=gnutoo.cyberdimension.org X-Spam_score_int: -18 X-Spam_score: -1.9 X-Spam_bar: - X-Spam_report: (-1.9 / 5.0 requ) BAYES_00=-1.9, SPF_HELO_PASS=-0.001, SPF_PASS=-0.001 autolearn=ham autolearn_force=no X-Spam_action: no action X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list X-Mailman-Approved-At: Wed, 30 Dec 2020 09:17:41 -0500 X-BeenThere: bug-guix@gnu.org List-Id: Bug reports for GNU Guix List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: bug-guix-bounces+larch=yhetil.org@gnu.org Sender: "bug-Guix" X-Migadu-Flow: FLOW_IN X-Migadu-Spam-Score: -1.43 Authentication-Results: aspmx1.migadu.com; dkim=none; dmarc=none; spf=pass (aspmx1.migadu.com: domain of bug-guix-bounces@gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=bug-guix-bounces@gnu.org X-Migadu-Queue-Id: 9C1489404C8 X-Spam-Score: -1.43 X-Migadu-Scanner: scn0.migadu.com X-TUID: YzqT/4AAwy+W --Sig_/jb=Zu=CXcarWt.i5//Me79r Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: quoted-printable 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=3DttyS0,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=3Darm-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. --Sig_/jb=Zu=CXcarWt.i5//Me79r Content-Type: application/pgp-signature Content-Description: OpenPGP digital signature -----BEGIN PGP SIGNATURE----- iQIzBAEBCAAdFiEEeC+d2+Nrp/PU3kkGX138wUF34mMFAl/qlb8ACgkQX138wUF3 4mOeBA/9Gs5ZXVIg+vy4rqfO9YmwCAZCXzeD5qKgSq+toVE4iT/zxhSvuPwkfx4R tJP5taQyAneInZvn7t0MnvnRXWilw0CIoObtA7XJyOxI52IVgy5MDz8iwrSpPunC cOdKT4gL9USOfryMwDNDPvnBcAkvYYlW2cDa1NMsr20IOPbek5Etrl9wx2yRZCIx Q6PDQCbFJzRgq2NIK5+fJpsO7wATEw2GuB7cWSfje9Xfhkg/J89+57foZSmd8LlY anGKIMSjAzfWrAjJoxnFFBxJyj3uQCm+UDQm3V3l59khvTRsyxQjTBIZFI3V4Qre MHEurBi0yCXZGROVbnqw9ZMAl4PuT5XmjjuxBg/jDmeSN2I/8x5HcJf2PA2QO3TP ZjAmb6unQqXV6k+yYOX53NZCuHyFl+V02/oFA+O5Uqp27iCELJBwW85kYq0xV82x 53AAkibW5Cx9IIw4IqV/Q/QMSDVukqOQdw8+m4l9mFbNM1EAUsOJ7O4CqJqjIN9G OOK0+Ual+GkOnfstNZsQo6tKsq6hQfiseWToYGdgluf235aMvIXQ57s9osQSWakb l1VoRAibUOwOmAJ3QMECbY9+59zXYbSQrfdTAD5r87anziN8eRwWujjH49seK+8e M7f8N5QE7nMdf9Hi6kSlgXHo2eclH8/gnr3HqxvXh9G5Aj+p7oI= =tPeA -----END PGP SIGNATURE----- --Sig_/jb=Zu=CXcarWt.i5//Me79r--