From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mp12.migadu.com ([2001:41d0:2:bcc0::]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) by ms5.migadu.com with LMTPS id 4B/JEwwIBWMcBwEAbAwnHQ (envelope-from ) for ; Tue, 23 Aug 2022 19:02:04 +0200 Received: from aspmx1.migadu.com ([2001:41d0:2:bcc0::]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) by mp12.migadu.com with LMTPS id 0LKqEwwIBWPLFgEAauVa8A (envelope-from ) for ; Tue, 23 Aug 2022 19:02:04 +0200 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 D1A413BBFB for ; Tue, 23 Aug 2022 19:02:03 +0200 (CEST) Received: from localhost ([::1]:49224 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1oQXHu-0002qw-Q6 for larch@yhetil.org; Tue, 23 Aug 2022 13:02:02 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:44974) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1oQXER-00079p-Oi for help-guix@gnu.org; Tue, 23 Aug 2022 12:58:27 -0400 Received: from smtprelay01.ispgateway.de ([80.67.18.13]:2594) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1oQXEQ-00079Z-0c for help-guix@gnu.org; Tue, 23 Aug 2022 12:58:27 -0400 Received: from [79.194.160.245] (helo=jim.voodoo.lan) by smtprelay01.ispgateway.de with esmtpsa (TLS1.2) tls TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 (Exim 4.94.2) (envelope-from ) id 1oQXFk-0001v9-65 for help-guix@gnu.org; Tue, 23 Aug 2022 18:59:48 +0200 Received: by jim.voodoo.lan (Postfix, from userid 1000) id 618FC613F9C; Tue, 23 Aug 2022 18:57:50 +0200 (CEST) From: Frank Terbeck To: help-guix@gnu.org Subject: Re: Kernel module build error with system image cross-build In-Reply-To: <87h732vypw.fsf@ft.bewatermyfriend.org> (Frank Terbeck's message of "Thu, 28 Jul 2022 02:59:39 +0200") References: <87h732vypw.fsf@ft.bewatermyfriend.org> User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/29.0.50 (gnu/linux) Date: Tue, 23 Aug 2022 18:57:50 +0200 Message-ID: <87lereoq29.fsf@ft.bewatermyfriend.org> MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable X-Df-Sender: NDMwNDQ0 Received-SPF: none client-ip=80.67.18.13; envelope-from=ft@bewatermyfriend.org; helo=smtprelay01.ispgateway.de 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, RCVD_IN_DNSWL_NONE=-0.0001, RCVD_IN_MSPIKE_H3=0.001, RCVD_IN_MSPIKE_WL=0.001, SPF_HELO_PASS=-0.001, SPF_NONE=0.001, T_SCC_BODY_TEXT_LINE=-0.01 autolearn=ham autolearn_force=no X-Spam_action: no action X-BeenThere: help-guix@gnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: help-guix-bounces+larch=yhetil.org@gnu.org Sender: "Help-Guix" X-Migadu-Flow: FLOW_IN X-Migadu-To: larch@yhetil.org X-Migadu-Country: US ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=yhetil.org; s=key1; t=1661274123; h=from:from:sender:sender:reply-to:subject:subject:date:date: message-id:message-id:to:to:cc:mime-version:mime-version: content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references:list-id:list-help: list-unsubscribe:list-subscribe:list-post; bh=lWW/9YaBW/IKA2nBQeVfM3plR9fDqU/ejvmoeBTdJSU=; b=TlxqUsVIrqNeCHVrfbKiu3mfE5Y2Ss8OSuftVo5UVdurw71c1XupjJI9i5n7ZbreO315y7 X7A6QcTM1QCN4KNEfyuXEAlnfnlYw0/EQ6mwNvnZip+w+1rRYpkQdCpbswBh5g9SJmmfax VV8UYoow7l5ZyGrdzDvxMaTnSdMK0pYvmurY5810t2HV2TTmhBF/wZfUHbWolr+MLaFL3/ 0wNm8/lR8U7CHqpdLJdA6mkyesGLFpgpO8idvzSgXIEHYfSkfzXYmIgCALD2ijGzvTmgPY VtIhStToN5dPM8/T9yoprr7c+5ZB0trreu+HkAGfmD2UG0CF5S4ryZ01554B6g== ARC-Seal: i=1; s=key1; d=yhetil.org; t=1661274123; a=rsa-sha256; cv=none; b=V+keLEj8f/JfAsPx62vgF1+3UrLMT29cbmYYCswGrnGfPhPjTQQon3FmS8XXGFzwCIaz1y yxqORA4ASOoxIcJqI59Qj1FkmSDoHhsvIqhQ8C1THQPyrzmkCPIbGXM2VRK/fuVzZwtruO fvV76heY9aGhkxAfvsbjX1zplpZ3vh/De+3CQJeNNtK0O2QPEsb+7qGPWIdmCpEEISUduV yo09ZbEVou8hZ7LYBM9N4oqVOYCGCImdOnAJgS5JuHEDikyyBxmjnm+ycn+kMyWPwiPXsL YmU6iU+g4IKLJ4Z3Mrwj4/d0z3+RpidIkJyrC0n0W8OYGa7u29L7K00aVVWhDQ== ARC-Authentication-Results: i=1; aspmx1.migadu.com; dkim=none; dmarc=none; spf=pass (aspmx1.migadu.com: domain of "help-guix-bounces+larch=yhetil.org@gnu.org" designates 209.51.188.17 as permitted sender) smtp.mailfrom="help-guix-bounces+larch=yhetil.org@gnu.org" X-Migadu-Spam-Score: -2.60 Authentication-Results: aspmx1.migadu.com; dkim=none; dmarc=none; spf=pass (aspmx1.migadu.com: domain of "help-guix-bounces+larch=yhetil.org@gnu.org" designates 209.51.188.17 as permitted sender) smtp.mailfrom="help-guix-bounces+larch=yhetil.org@gnu.org" X-Migadu-Queue-Id: D1A413BBFB X-Spam-Score: -2.60 X-Migadu-Scanner: scn1.migadu.com X-TUID: BJeiiQGqUOQM I looked into this over the weekend. Frank Terbeck wrote: > [=E2=80=A6] like this: > > guix system image --target=3Darm-linux-gnueabihf ~/src/guix/gnu/system/= examples/beaglebone-black.tmpl > > After a while, this breaks like this: > [=E2=80=A6] > guix system: error: build of `/gnu/store/lqwjj7fjf235psw2br5i8y10cm22pq= 4l-disk-image.drv' failed [=E2=80=A6] > Backtrace: > 5 (primitive-load "/gnu/store/axmhy07daha215gwbqghh39k7ja?") > In ice-9/eval.scm: > 619:8 4 (_ #f) > 626:19 3 (_ #) > 293:34 2 (_ #(# #)) > In srfi/srfi-1.scm: > 586:17 1 (map1 ("omap_hsmmc" "ahci" "usb-storage" "uas" "usbh?" ?)) > In gnu/build/linux-modules.scm: > 257:5 0 (_) > > gnu/build/linux-modules.scm:257:5: kernel module not found "omap_hsmmc"= "/gnu/store/rslz7zlq11wjnvixzfasyvr4b6rv2m7j-linux-libre-5.18.14/lib/modul= es" Yeah, so the build-process here, as far as I can see, works like this: Build the kernel, then to build the initrd, use the kernel installation directory. The list of modules is just a list of strings, for which the system tries to find corresponding =E2=80=98.ko=E2=80=99 files in the ke= rnel's module tree for. If the module can't be found, this is what you end up with. The =E2=80=98beaglebone-black.tmpl=E2=80=99 file is basically just an =E2= =80=98operating-system=E2=80=99 specification: (operating-system ;; =E2=80=A6 ;; This module is required to mount the SD card. (initrd-modules (cons "omap_hsmmc" %base-initrd-modules)) ;; =E2=80=A6 ) There's also a =E2=80=98beaglebone-black-installation-os=E2=80=99 spec= ification in =E2=80=98gnu/system/install.scm=E2=80=99. It uses the deprecated =E2=80= =98#:extra-modules=E2=80=99 to add =E2=80=98omap_hsmmc=E2=80=99 to its list of initrd-modules. So it'll fa= il similarly. Odd. So I took a look at the actual kernel build result. When you check for =E2=80=98omap_hsmmc=E2=80=99 you'll notice that it comes up in =E2=80= =98modules.builtin=E2=80=99, an output from =E2=80=98kbuild=E2=80=99: This file lists all modules that are built into the kernel. This is used by modprobe to not fail when trying to load something builtin. This would suggest that this feature is not built as a module, but in- stead is a fixed part of the kernel build. And indeed, looking at the corresponding =E2=80=98.config=E2=80=99 file for the kernel build, you'll f= ind this: CONFIG_MMC_OMAP_HS=3Dy =E2=80=A6which is the Kconfig option, that controls the inclusion of this= fea- ture. Clearly something changed with time and this setting is no longer valid. Fair enough. Take it out and you should be golden, right? Not quite =E2=80=94 it'll break again, complaining about another module= . The rest of the modules is take from =E2=80=98default-initrd-modules=E2=80= =99, which is identifier-syntax'd to =E2=80=98%base-initrd-modules=E2=80=99. It's value for the =E2=80=98arm-linux-gnueabihf=E2=80=99 target is: ahci, usb-storage, uas, usbhid, hid-generic, hid-apple, dm-crypt, xts, serpent_generic, wp512, nls_iso8859-1, pata_acpi, pata_atiixp, isci, virtio_pci, virtio_balloon, virtio_blk, virtio_net, virtio_console, virtio-rng Of these, the modules that are available as actual modules: uas, xts, virtio_pci, virtio_balloon, virtio_blk, virtio_net Features that are builtin, and thus not available as a =E2=80=98.ko=E2=80= =99 file: ahci, usb-storage, usbhid, hid-generic, nls_iso8859-1, virtio_console Unavailable features: hid-apple, dm-crypt, serpent_generic, wp512, pata_acpi, pata_atiixp, isci, virtio-rng With all that in mind, I used this specification; mostly based on what's in =E2=80=98beaglebone-black.tmpl=E2=80=99: #+begin_src scheme (use-modules (srfi srfi-1) (gnu) (gnu bootloader u-boot)) (use-service-modules networking) (use-package-modules bootloaders screen ssh) (operating-system (host-name "bbb-test") (timezone "Europe/Berlin") (locale "en_GB.utf8") (bootloader (bootloader-configuration (bootloader u-boot-beaglebone-black-bootloader) (targets '("/dev/mmcblk1")))) (initrd-modules (map symbol->string '(uas xts virtio_pci virtio_balloon virtio_blk virtio_net))) (file-systems (cons (file-system (device (file-system-label "my-root")) (mount-point "/") (type "ext4")) %base-file-systems)) (users (cons (user-account (name "ft") (home-directory "/home/ft") (group "users") (supplementary-groups '("wheel" "audio" "video= "))) %base-user-accounts)) (packages (cons* screen openssh %base-packages)) (services (cons* (service dhcp-client-service-type) (agetty-service (agetty-configuration (extra-options '("= -L")) (baud-rate "115200= ") (term "vt100") (tty "ttyO0"))) %base-services))) #+end_src This builds. Not sure of it boots, because of course none of my micro-sd cards work. I'm building a VM image now and will try to see if QEMU can boot the thing. Regards, Frank --=20 In protocol design, perfection has been reached not when there is nothing left to add, but when there is nothing left to take away. -- RFC 1925