From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mp1 ([2001:41d0:2:bcc0::]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) by ms0.migadu.com with LMTPS id 2XFqJTRYlGB6UwEAgWs5BA (envelope-from ) for ; Thu, 06 May 2021 22:57:24 +0200 Received: from aspmx1.migadu.com ([2001:41d0:2:bcc0::]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) by mp1 with LMTPS id KA9nIDRYlGAEJwAAbx9fmQ (envelope-from ) for ; Thu, 06 May 2021 20:57:24 +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 DE1FB82D9 for ; Thu, 6 May 2021 22:57:23 +0200 (CEST) Received: from localhost ([::1]:42312 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1lel3i-0003Cd-K6 for larch@yhetil.org; Thu, 06 May 2021 16:57:22 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:36222) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1lel3O-0003CS-3j for bug-guix@gnu.org; Thu, 06 May 2021 16:57:02 -0400 Received: from debbugs.gnu.org ([209.51.188.43]:56304) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1lel3N-0005rj-Se for bug-guix@gnu.org; Thu, 06 May 2021 16:57:01 -0400 Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1lel3N-000833-RB for bug-guix@gnu.org; Thu, 06 May 2021 16:57:01 -0400 X-Loop: help-debbugs@gnu.org Subject: bug#48266: support dynamic loading of modules from initrd Resent-From: Vagrant Cascadian Original-Sender: "Debbugs-submit" Resent-CC: bug-guix@gnu.org Resent-Date: Thu, 06 May 2021 20:57:01 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: report 48266 X-GNU-PR-Package: guix X-GNU-PR-Keywords: To: 48266@debbugs.gnu.org X-Debbugs-Original-To: bug-guix@gnu.org Received: via spool by submit@debbugs.gnu.org id=B.162033461930919 (code B ref -1); Thu, 06 May 2021 20:57:01 +0000 Received: (at submit) by debbugs.gnu.org; 6 May 2021 20:56:59 +0000 Received: from localhost ([127.0.0.1]:39617 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1lel3L-00082c-EQ for submit@debbugs.gnu.org; Thu, 06 May 2021 16:56:59 -0400 Received: from lists.gnu.org ([209.51.188.17]:43812) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1lel3I-00082U-BZ for submit@debbugs.gnu.org; Thu, 06 May 2021 16:56:58 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:36164) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1lel3I-000385-1F for bug-guix@gnu.org; Thu, 06 May 2021 16:56:56 -0400 Received: from cascadia.aikidev.net ([2600:3c01:e000:267:0:a171:de7:c]:60458) by eggs.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1lel3C-0005j1-BK for bug-guix@gnu.org; Thu, 06 May 2021 16:56:55 -0400 Received: from localhost (97-120-1-76.ptld.qwest.net [97.120.1.76]) (Authenticated sender: vagrant@cascadia.debian.net) by cascadia.aikidev.net (Postfix) with ESMTPSA id AC6E91A904 for ; Thu, 6 May 2021 13:56:45 -0700 (PDT) From: Vagrant Cascadian Date: Thu, 06 May 2021 13:56:41 -0700 Message-ID: <87pmy3shrq.fsf@yucca> MIME-Version: 1.0 Content-Type: multipart/signed; boundary="=-=-="; micalg=pgp-sha512; protocol="application/pgp-signature" Received-SPF: none client-ip=2600:3c01:e000:267:0:a171:de7:c; envelope-from=vagrant@debian.org; helo=cascadia.aikidev.net 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_NONE=0.001, SPF_NONE=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-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 ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=yhetil.org; s=key1; t=1620334644; 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:resent-cc:resent-from:resent-sender: resent-message-id:list-id:list-help:list-unsubscribe:list-subscribe: list-post; bh=3Q365xSACj73Qds8RbOm3AYiBFhBJaCMbTlMFMIA0wk=; b=Rhuwu9ngW/m+4RB3x20KHKNMy6bEHFnic31fgfH6Hoqa32iCmoj4Lb6R2+BK/jUrKaQ0R4 DSiT0SBAyi9JoPZ2zlq+qp9fVZ0EMOyMQerushlTXrPmOFq6qwgzDVy+PxRffHWadOIh6w SUUE/OUrFi8j7JWf54/ux4X8+KLeCf+iGJB13o9LEY2HZtq8f4oxVJmkDAUlI09u7Nmjs6 WeVa66K81G2c1ZXGXLzoUhWLl/lm91yik5XXQeyFhZEeL3OYK1MewWREAK7zfmSjBpCvQd SWBOKgg6fefL2SoOz1oMtxEazqxg1MRPRUe3FU580FVGPguhMmVT/YwaxRSTPw== ARC-Seal: i=1; s=key1; d=yhetil.org; t=1620334644; a=rsa-sha256; cv=none; b=GWTXCNn9sPVa01KpcUeOc/0mcDCbX+xL+zkVFXJyp98KQF2C+/2u2y281/rwDZ462MauY9 X/LwGSwSvqYYM0ZQWB65fjVHUB7lU+hKUzrvAf+iMlAKw5W2EXsTDOM9hyfXblvOKAzE4k lacLQV9fTozNm9KB8JbochU5Un+xeV1Q84oj4DVkmM4ppFzV3SwHp1kmFBV84DQn77nyXj mqHUFWB123GfvgScEP8QENM/jN4C5zEQJOAggrg4p00vA9TTFNgPjdWSDPqHVku9Rkmt8c 8uY6q4+YyfBG/wd7C41amD+NZDPHW3FWLVasEQUXdCuRyAzB4cSNYvNSK6vAqw== ARC-Authentication-Results: i=1; aspmx1.migadu.com; dkim=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-Spam-Score: -0.06 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: DE1FB82D9 X-Spam-Score: -0.06 X-Migadu-Scanner: scn0.migadu.com X-TUID: 4i0ld7JStLZe --=-=-= Content-Type: text/plain Content-Transfer-Encoding: quoted-printable There should be an option to support dynamic loading of modules from the initrd. I recently pushed some changes to use the "linux-libre" kernel with pinebook pro: https://git.savannah.gnu.org/cgit/guix.git/commit/?id=3Dd330d63a29f35ebcb= ebce19b13d49c69d38a5815 But in order to even boot, I need to add a lot of modules to initrd-modules: (initrd-modules=20 (append (list "rtc-rk808" "dw_mmc" "dw_mmc-pltfm" "dw_mmc-rockchip" "joydev" "bluetooth" "jitterentropy_rng" "hid_generic" "videodev" "ghash_ce" "gf128mul" "ansi_cprng" "mc" "sha2_ce" "usbhid" "panfrost" "ecdh_generic" ;; "fusb302" "ofpart" ;; "tcpm" "hid" "ecc" "evdev" "leds_gpio" "io_domain" "dw_wdt" ;; "rockchip-thermal" "cw2015_battery" "pwm-rockchip" ;; "gpio_charger" "cpufreq_dt" "configfs" "xhci-plat-hcd" "xhci-hcd" "rk808-regulator" "clk-rk808" "udc-core" "ulpi" "fan53555" "rk808" "pwm-regulator" "fixed" "gpio_keys" "cec" ;; "phy-rockchip-typec" "phy-rockchip-emmc" "phy-rockchip-inno-usb2" ;; "analogix-dp" "sdhci-of-arasan" "sdhci-pltfm" "cqhci" "drm_kms_helper" "ohci-platform" "ohci-hcd" "ehci-platform" "panel-simple" "ehci-hcd" "sdhci" "drm" "i2c-rk3x" "usbcore" "pl330" "pwm_bl" "dwc3" ) %base-initrd-modules)) Initially, I tried adding just the obviously mmc related modules, but this gave me guile prompt from the initramfs as it failed to find the rootfs. Notably, even with the above list, I still need to explore additional modules to load in order to get the display and keyboard to work from the initramfs, in case I wanted to use this with encrypted rootfs... The above list of modules could almost certainly be trimmed, but even getting a bootable system for pinebook pro took about 20 tries, and the process of defining the modules is further complicated by several factors... * The filesystem names of the modules (e.g. dw_mmc-pltfm) do not necessarily match the runtime name from lsmod (e.g. dw_mmc_pltfm). This becomes a good deal of trial and error to figure out which modules to add. * One needs to manually resolve the soft and hard dependencies of the modules, and ensure they are loaded, and include them in the list. * If upstream changes the module name (which does happen from time to time), you have to update the system config.scm to the new module names. * If some functionality changes from a module to a built-in, or vice-versa, the system config.scm needs manual updating. * Switching system between two different arm boards potentially requires entirely different lists of modules. Rather than handling modules one at a time, I would propose to at least add an option that can add whole directory trees of modules to the initrd (e.g. kernel/drivers/usb/)... and then use modprobe (or udev?) to handle the dependencies. Maybe opt-in at first, but longer-term, explore making it default? In Debian, adding modules to the intird is done in initramfs-tools: https://salsa.debian.org/kernel-team/initramfs-tools/-/blob/f350f122a244c= 60f91a3e3e5f8b58f9cb75308b6/hook-functions#L599 As for which modules to load at runtime, initramfs-tools uses udev; maybe that could be integrated into the guix initramfs as an option? Obviously, adding more modules than a strict bare minimum to the initrd will increase boot times a bit, and adding further dependencies (modprobe, udev) to the initrd will add to that even more, but the current hard-coded list of modules to load, that you can extend with another hard-coded list, is a bit painful when trying to get a new system working... Maybe the Guix way to do this is to write some guile code that can generate the list of modules to include in the initrd at build time? But that still doesn't resolve the dynamic loading of modules at runtime, and it would be impractical to load *all* the modules at runtime... and maybe impractical to re-implement modprobe and/or udev in guile? Well, thanks for considering! live well, vagrant --=-=-= Content-Type: application/pgp-signature; name="signature.asc" -----BEGIN PGP SIGNATURE----- iHUEARYKAB0WIQRlgHNhO/zFx+LkXUXcUY/If5cWqgUCYJRYCgAKCRDcUY/If5cW qoGHAQDyNF3KxmMy43ZiU4oIK7WWhj/Qb8sAqkjqGPGSPi/IhwEAjPdH5SHFAA3p uSnpUt8FgERfhAHFHii1VmuUzDbG3AM= =FSHa -----END PGP SIGNATURE----- --=-=-=--