From patchwork Fri Apr 4 16:29:22 2025 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Mikko Rapeli X-Patchwork-Id: 60726 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from aws-us-west-2-korg-lkml-1.web.codeaurora.org (localhost.localdomain [127.0.0.1]) by smtp.lore.kernel.org (Postfix) with ESMTP id B1863C36010 for ; Fri, 4 Apr 2025 16:29:54 +0000 (UTC) Received: from mail-lf1-f44.google.com (mail-lf1-f44.google.com [209.85.167.44]) by mx.groups.io with SMTP id smtpd.web11.1439.1743784192825428587 for ; Fri, 04 Apr 2025 09:29:53 -0700 Authentication-Results: mx.groups.io; dkim=pass header.i=@linaro.org header.s=google header.b=TXuDIQk5; spf=pass (domain: linaro.org, ip: 209.85.167.44, mailfrom: mikko.rapeli@linaro.org) Received: by mail-lf1-f44.google.com with SMTP id 2adb3069b0e04-5493b5bc6e8so2671215e87.2 for ; Fri, 04 Apr 2025 09:29:52 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1743784191; x=1744388991; darn=lists.openembedded.org; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to; bh=15SmjIPRbXq6D1yL96ViOWCE00A39+FYKQ5Y9tFpvvM=; b=TXuDIQk51FM2JRFQ8cnlDfgshmIsWtnVs2uJq9DHcZCPMwA/GY7ZyYeqJKj2noV2ol ac9yRGSonrO8JbLj/n9dSoF1nEN5k+jYp74rUW/m9Foxi/Vds2tNdEZkv+eQbQMtQSN3 kY7KSezsIr7pXx+XVDOEz1rZK3eDieW1c/C3WaCuce67nhKEoDLAK/gN+xpFl/IJ1NU3 sxCsoefwsV92LWB9aYBt+M5mHK/+r+g6Oq4b2JXqGMbhxrqCC8SIjAKxeWDT1O8vu2MM 8K4vQd2y9aRu2zR4N29RkT+AP2G3/zERS9g8xNSxGNybNKLy7rhw3nPwKD4lyBwu5PYd zr6A== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1743784191; x=1744388991; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=15SmjIPRbXq6D1yL96ViOWCE00A39+FYKQ5Y9tFpvvM=; b=wtCW9Hk8TvLppOUEnUMoScpEQFTZ/NYVgU37yLvGhp+tFraFC6LHzoSSXj9/yEqMHR ohJPO6H0eZYeqIVUu7si+o5xs7vvt1rJwo2JGo22BaR8umOQEfskUk2dWPFjg/3mw1RY FTxsKDDrVgqdznSkCfjY6pPRLSs/4yGzmGRkHXdwiJYWw+3C/b1cNH6BrJihUhsrOcxc iLh6iJTJUe517OEZzklYq9i2nt2tUKnRjkXroiwUZsOhg5BykeEH4QXKExAt9eV1OC5z woo1CA1Hm7AXnz+my0L9pcZyBjFSZPxs/qml4cyNjYjU9Yo0/mrCUXK75BHVZu3jK44F eBNw== X-Gm-Message-State: AOJu0YzgzLQZ9+ZwGB0TbKvVeqF3n9hZNJ6g8gHUcaJvqJ078UJCvmQV Aa6G6C/YgAUCy9nj9NSXDWKLiZDeCthMSH5OJDuEzs3nx/4Iwjd1djKV4l102zMIYvlGk0HuB5T ObAc= X-Gm-Gg: ASbGnctdOkTSpg5vuyDMZJQHUd0lp20Oprync8ML2xKUQzdusD10gytz1NVQPYTn4si v6n3DAI/w80n6kYR1XP30dIZInMpG8CVYFeIGn/2w65+7+Kp50SWbprc1i5n95emQ0fj5uPXyM/ M2fqke45gQdbfu3IDR7gVo9X1mr3u4WbOfZ4TLNVLkwoAY4AGDJFz3gQ0m2qKnPI/RbnTJqum2Q u+3REGqoHmCtIBivTcl7iRp3UhhmXwblboAtZPWMvQZXGhpDPeSaveEIC+9870Nuut1YQJ9DzIy sSr9CxJjzi7+kv4B3q5GKVJLnaFrRi6sWcv6jlUXM2/7RYPwsORbP14sgAZVg0JmX7jpPWtRcdI 4WnBnu/ZH7L7sqw3Xx66lSA== X-Google-Smtp-Source: AGHT+IHowXdjZ5hQ06dywvpXJCebIDamIVTa3RCWpgWwpU53wF8xfLmnnZ4lb1hG99fPI+nicyHO8A== X-Received: by 2002:a05:6512:3c82:b0:54a:f7a7:6800 with SMTP id 2adb3069b0e04-54c23375434mr961576e87.41.1743784191002; Fri, 04 Apr 2025 09:29:51 -0700 (PDT) Received: from localhost.localdomain (87-100-218-141.bb.dnainternet.fi. [87.100.218.141]) by smtp.gmail.com with ESMTPSA id 2adb3069b0e04-54c1e671f54sm469786e87.228.2025.04.04.09.29.50 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 04 Apr 2025 09:29:50 -0700 (PDT) From: Mikko Rapeli To: openembedded-core@lists.openembedded.org Cc: Mikko Rapeli Subject: [PATCH v3 01/11] systemd: enable efi support by default Date: Fri, 4 Apr 2025 19:29:22 +0300 Message-ID: <20250404162932.447699-2-mikko.rapeli@linaro.org> X-Mailer: git-send-email 2.49.0 In-Reply-To: <20250404162932.447699-1-mikko.rapeli@linaro.org> References: <20250404162932.447699-1-mikko.rapeli@linaro.org> MIME-Version: 1.0 List-Id: X-Webhook-Received: from li982-79.members.linode.com [45.33.32.79] by aws-us-west-2-korg-lkml-1.web.codeaurora.org with HTTPS for ; Fri, 04 Apr 2025 16:29:54 -0000 X-Groupsio-URL: https://lists.openembedded.org/g/openembedded-core/message/214352 For example genericarm64 enables "efi" in MACHINE_FEATURES and in u-boot. Boot without "efi" in systemd works with EFI protocols but for example efivars is not mounted at all so various checks fail in userspace. Fix these by enabling "efi" support by default to avoid making it machine specific. Fixes efivars mount to /sys/firmware/efi/efivars etc. Signed-off-by: Mikko Rapeli --- meta/recipes-core/systemd/systemd_257.4.bb | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/meta/recipes-core/systemd/systemd_257.4.bb b/meta/recipes-core/systemd/systemd_257.4.bb index 64fb8fe69a..06e5621398 100644 --- a/meta/recipes-core/systemd/systemd_257.4.bb +++ b/meta/recipes-core/systemd/systemd_257.4.bb @@ -68,13 +68,14 @@ PAM_PLUGINS = " \ " PACKAGECONFIG ??= " \ - ${@bb.utils.filter('DISTRO_FEATURES', 'acl audit apparmor efi ldconfig pam pni-names selinux smack polkit seccomp', d)} \ + ${@bb.utils.filter('DISTRO_FEATURES', 'acl audit apparmor ldconfig pam pni-names selinux smack polkit seccomp', d)} \ ${@bb.utils.contains('DISTRO_FEATURES', 'minidebuginfo', 'coredump elfutils', '', d)} \ ${@bb.utils.contains('DISTRO_FEATURES', 'wifi', 'rfkill', '', d)} \ ${@bb.utils.contains('DISTRO_FEATURES', 'x11', 'xkbcommon', '', d)} \ ${@bb.utils.contains('DISTRO_FEATURES', 'sysvinit', 'sysvinit', 'link-udev-shared', d)} \ backlight \ binfmt \ + efi \ gshadow \ hibernate \ hostnamed \ From patchwork Fri Apr 4 16:29:23 2025 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Mikko Rapeli X-Patchwork-Id: 60728 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from aws-us-west-2-korg-lkml-1.web.codeaurora.org (localhost.localdomain [127.0.0.1]) by smtp.lore.kernel.org (Postfix) with ESMTP id 9987FC36010 for ; Fri, 4 Apr 2025 16:30:04 +0000 (UTC) Received: from mail-lf1-f50.google.com (mail-lf1-f50.google.com [209.85.167.50]) by mx.groups.io with SMTP id smtpd.web10.1461.1743784194594582802 for ; Fri, 04 Apr 2025 09:29:54 -0700 Authentication-Results: mx.groups.io; dkim=pass header.i=@linaro.org header.s=google header.b=ov6dZuwZ; spf=pass (domain: linaro.org, ip: 209.85.167.50, mailfrom: mikko.rapeli@linaro.org) Received: by mail-lf1-f50.google.com with SMTP id 2adb3069b0e04-549b116321aso2585778e87.3 for ; Fri, 04 Apr 2025 09:29:54 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1743784192; x=1744388992; darn=lists.openembedded.org; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to; bh=xULRQVdTY/LxRb9S1oZ219XVrnqgSCEV0rTfQfvvQAA=; b=ov6dZuwZSuVRqEi9/OI5Vzw9f5FkBu0Na36Ri1rH3fG7/RxZ+ssJPniPslsilMoknH 82ZmLSFJe7EOGkwm3U7s9ChOz7HinkscgAYWveYjOq+lVntd6Yzy6DxJn58zWPKbU+xU cjFniFfwEi1zV4ST7AhCky1t9MQw2is79loOuenvsq3nutmPDy8beDUxDKQ4F7du0fgO FEeyfG1ZSZSnQj6ZFRr1wzb2UK7Fdjbax5RIP8Y63rGBjIYqDj1wj3kDSKNo+lc1uIIy uPdqM5osmaxoG2RlB0q0XMmLzJ4qyj6D5zNBbi370aoQVfo+MAbS3RRpNNZXi0NfAQpG esjw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1743784192; x=1744388992; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=xULRQVdTY/LxRb9S1oZ219XVrnqgSCEV0rTfQfvvQAA=; b=RMFFQSQb43ACW7IUEClTvv5cexGlhHnqDAbKg62n70JnMBu2UCfNMIq8ivEViO/8Rx 7oRd5TWXpNDjJbHkIrd1PmgdFRn+r2DiGsXY0elkJn9a5B3T/sknkYhWdmZyl+oQbpzj aEvFYQI0GbVKi4zs579hLXQVWw4pbPyc+flwHLjnXqsaFO6U+osq9JP87WB4r3faBU+b MtAVD1DS9QENNIpC6h/xIxdfQRE02o4xqJoFVfOoJHlC7LW0MeVgm8vtroYNbM1owRBe 9e1ZIqegwcvhDoblPUQFmauAKH4M8R1A5g1gRLuXCrP6iz9ZuPLxiBzFAdsLuM4UaQ9c NRfg== X-Gm-Message-State: AOJu0Yx2w24LcDj4+CzZGvC7WM4Rhg8o6BxYAiXR85E3G2oePH6NMZwz 1zrXz+rCjL2pk9rRsMkjo49pTSzO7hr/r9a8Hriu8dHMTd+kEGqM/3HePYAp81hsAh0DGM8eh/h sjS8= X-Gm-Gg: ASbGncsW/rdCTp9WMATfTWHmvGKVilCFvyniuQnJQ0HmVWKH9FBsRp28/FTuMocG8Ct Gs+X0z5pKQwWz1rvHn+GKYfdO1JHOZxfm7Xe80Ycj6nl8MKOviBzP2G0sdOo8+2CzL7cXr2z0vn /WJOw1HjzizUPnNCqGZPDMEqkhVPLe8WqR6uySilqiK8FT34FYuPcv5RG7v+SopdeeyCxCC3UqY 03A91qmWphvCppMsZL9IJOFD+xf6aGz4sr6nvgQ6oLVyARoT7jh4gltHcNOvdFRXuABODoxu63u 2v4CIHDCFUUfKBkx3rE/HgPlzoxiZCiARkttQuy6fucs0wHY0nAEmEf+eqvwroiwemaUuZFnixa kr9AXHQqUhUHCqRbh8oAEiA== X-Google-Smtp-Source: AGHT+IE6pOp+r+RFyjPX8C24MbaHHX2HvGRpb/qgSfohygVo5s9chGltlSXdvdfYi8OkD4LL8KlySA== X-Received: by 2002:a05:6512:3d94:b0:549:8f06:8225 with SMTP id 2adb3069b0e04-54c227ff846mr1054157e87.53.1743784192441; Fri, 04 Apr 2025 09:29:52 -0700 (PDT) Received: from localhost.localdomain (87-100-218-141.bb.dnainternet.fi. [87.100.218.141]) by smtp.gmail.com with ESMTPSA id 2adb3069b0e04-54c1e671f54sm469786e87.228.2025.04.04.09.29.51 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 04 Apr 2025 09:29:52 -0700 (PDT) From: Mikko Rapeli To: openembedded-core@lists.openembedded.org Cc: Mikko Rapeli Subject: [PATCH v3 02/11] uki.bbclass: drop serial console from kernel command line Date: Fri, 4 Apr 2025 19:29:23 +0300 Message-ID: <20250404162932.447699-3-mikko.rapeli@linaro.org> X-Mailer: git-send-email 2.49.0 In-Reply-To: <20250404162932.447699-1-mikko.rapeli@linaro.org> References: <20250404162932.447699-1-mikko.rapeli@linaro.org> MIME-Version: 1.0 List-Id: X-Webhook-Received: from li982-79.members.linode.com [45.33.32.79] by aws-us-west-2-korg-lkml-1.web.codeaurora.org with HTTPS for ; Fri, 04 Apr 2025 16:30:04 -0000 X-Groupsio-URL: https://lists.openembedded.org/g/openembedded-core/message/214353 The kernel will continue using console from firmware which is much better on HW when we may not know at build time which console HW and drivers are available, e.g. like on genericarm64 machine. Signed-off-by: Mikko Rapeli --- meta/classes-recipe/uki.bbclass | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/meta/classes-recipe/uki.bbclass b/meta/classes-recipe/uki.bbclass index d9a7fb0e6f..fedff222c6 100644 --- a/meta/classes-recipe/uki.bbclass +++ b/meta/classes-recipe/uki.bbclass @@ -81,7 +81,7 @@ UKIFY_CMD ?= "ukify build" UKI_CONFIG_FILE ?= "${UNPACKDIR}/uki.conf" UKI_FILENAME ?= "uki.efi" UKI_KERNEL_FILENAME ?= "${KERNEL_IMAGETYPE}" -UKI_CMDLINE ?= "rootwait root=LABEL=root console=${KERNEL_CONSOLE}" +UKI_CMDLINE ?= "rootwait root=LABEL=root" # secure boot keys and cert, needs sbsign-tools-native (meta-secure-core) #UKI_SB_KEY ?= "" #UKI_SB_CERT ?= "" From patchwork Fri Apr 4 16:29:24 2025 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Mikko Rapeli X-Patchwork-Id: 60736 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from aws-us-west-2-korg-lkml-1.web.codeaurora.org (localhost.localdomain [127.0.0.1]) by smtp.lore.kernel.org (Postfix) with ESMTP id E29FDC369AA for ; Fri, 4 Apr 2025 16:30:04 +0000 (UTC) Received: from mail-lf1-f45.google.com (mail-lf1-f45.google.com [209.85.167.45]) by mx.groups.io with SMTP id smtpd.web10.1462.1743784195397342876 for ; Fri, 04 Apr 2025 09:29:55 -0700 Authentication-Results: mx.groups.io; dkim=pass header.i=@linaro.org header.s=google header.b=ET/t/8Px; spf=pass (domain: linaro.org, ip: 209.85.167.45, mailfrom: mikko.rapeli@linaro.org) Received: by mail-lf1-f45.google.com with SMTP id 2adb3069b0e04-54998f865b8so2050269e87.3 for ; Fri, 04 Apr 2025 09:29:55 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1743784193; x=1744388993; darn=lists.openembedded.org; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to; bh=4xaYtMYmz77OMFXSactMtdw6dSA8FtMuGWPtR7pFiWg=; b=ET/t/8PxNJuAh9eX/yXJJyNnzHEs8P9T1UuOP9b+GqzMWsOMaJR9BNfv3zDcBg3Z33 nTbh43IoW2d8VsPW2IML+3sRyz4nw1lP/7tRt3yYD6QLBx1MutXCDEWXbe3xYP7rAlyZ y1aEH00nwE4qerZRLkaTftYqnh8rfib544ARNLROEPV+zy2yg8YM6QdrJzV34HgtKZHf 4CGvbUoToDwIF+ZOVO7uv5HirE25CBYnfbh0ojev7LpJp9CEM0Snjrke54BbO9Gdf9Kk HkJoFeWn3OLzQXXOqkNeSbkhFkpmDpWLS27yimLZgPmN9xBT8KGDLetuif0N+tIOdNOx m7Nw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1743784193; x=1744388993; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=4xaYtMYmz77OMFXSactMtdw6dSA8FtMuGWPtR7pFiWg=; b=R4y3dtMGGbT/DBiIMXYxvAqMEc8TXfjGVE7+kf0t0RpNpBizKRmCImOPc1rNf2NHaP qxM2yCJEdzrP+ctMObfWIyga0YhQsBIau590RjRf5GI4YVpZgDQAF24pHm/1QBc4bjtj c39mDutekXt3se7tx8I9gMEt+/cJqbjel2Og9xOYVS+dPWQlpvUWvxftcuhWQejXojkf m9zBcLNEJtsCJvWRGRIpeXcv1zrvYNUL+2BbSWZ7H2OoRJ57+3ii7U2urXgNkjokNZ6I Zb75LhY+ioLytAQZhhEGcOdoX1wd2UgjqoLpFStCrSdC656+ZBu0vUlxl2IDWYIgB0lY ml/g== X-Gm-Message-State: AOJu0Yw2cCU+UxB0Qd13uFVNATJYlqR+sFWNKnm0KTyCcExIVA2B5rgF WRagiWUjwyngymgoWrQrhk3stZ4u+K92Bxp8S5CRa2aW7RSpyIF/PFueXpvWQmd0LxWWT1qotVA /xYY= X-Gm-Gg: ASbGncuB0n992RR3kEiI3l4/lrH/tueJ5HpZaL70/VYTIDzS1fAGFQ6bTAwBLm/OgHp dJCMUszroY3CoKdEaIQLEERM46cN8FWC7yqiHIkfwD6vRg1o+5pcz2566FtVgbHKReiZFTaZMOc s063jjx6guvjMGUO+1JWN6TK/axOsb/EufUTlqU6m/mVLRSzplhRLDHi6tfEFv7GS//bDrYhZiv zoJua3zBNs3fU6Y4vJn/1JVvhFhG9HboXZjdMjr1RI/6M1Mn0nDD30suqvTxhiZYSVtzMyzN4FE jsYiaYk4tFRVfikp8qCLBPAW/1kCCE5AXz+bRUkVOsoZRGHjElkSujVjmnAOkdIC92DwJBi2htW sb/qFVGRwsnieTAWMUCf5xA== X-Google-Smtp-Source: AGHT+IH4Jqj7zSy84uMNm77BS9UAPj4CmTytPmki1LOgSjSZch9Rnu4EKG1qSaC7SegjKihQBUuGQQ== X-Received: by 2002:a05:6512:3351:b0:54a:cc07:4091 with SMTP id 2adb3069b0e04-54c2276e863mr846282e87.2.1743784193415; Fri, 04 Apr 2025 09:29:53 -0700 (PDT) Received: from localhost.localdomain (87-100-218-141.bb.dnainternet.fi. [87.100.218.141]) by smtp.gmail.com with ESMTPSA id 2adb3069b0e04-54c1e671f54sm469786e87.228.2025.04.04.09.29.53 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 04 Apr 2025 09:29:53 -0700 (PDT) From: Mikko Rapeli To: openembedded-core@lists.openembedded.org Cc: Mikko Rapeli Subject: [PATCH v3 03/11] kernel.bbclass: add kernel-initrd-modules meta package Date: Fri, 4 Apr 2025 19:29:24 +0300 Message-ID: <20250404162932.447699-4-mikko.rapeli@linaro.org> X-Mailer: git-send-email 2.49.0 In-Reply-To: <20250404162932.447699-1-mikko.rapeli@linaro.org> References: <20250404162932.447699-1-mikko.rapeli@linaro.org> MIME-Version: 1.0 List-Id: X-Webhook-Received: from li982-79.members.linode.com [45.33.32.79] by aws-us-west-2-korg-lkml-1.web.codeaurora.org with HTTPS for ; Fri, 04 Apr 2025 16:30:04 -0000 X-Groupsio-URL: https://lists.openembedded.org/g/openembedded-core/message/214354 At the moment linux-yocto kernels for various architectures are not very modular and a lot of drivers are built into the kernel even when they are not needed at runtime. These make the main kernel binary big and slow to boot. This also impacts udev in userspace which takes a long time processing events from all these built in drivers, for example when udev runs in initrd. Then constructing the initrd is very device and kernel configuration specific. initrd image needs explicitly define which binary packages to install to avoid pulling in complex dependencies. A full set of kernel modules via kernel-modules meta package is too big for initrd and most of the drivers are not needed for use cases like "just load modules to mount main rootfs". Then the initrd configuration breaks if kernel driver is built into the kernel since the binary package doesn't exist. Introduce kernel-initrd-modules meta package to solve these problems. The meta package adds dependencies to real kernel modules based on the kernel module file paths so that it will include several kernel subsystems and their drivers which are often needed to find main rootfs from some block device. This works when drivers are built as modules but does not break if drivers are built into the kernel. The resulting initrd is also smaller since only a subset of drivers are needed for "mount the rootfs" usecase. Tested on genericarm64 kernel and qemu and AMD KV260 HW. Signed-off-by: Mikko Rapeli --- .../kernel-module-split.bbclass | 48 +++++++++++++++++++ meta/classes-recipe/kernel.bbclass | 5 +- meta/classes-recipe/module.bbclass | 37 ++++++++++++++ 3 files changed, 89 insertions(+), 1 deletion(-) diff --git a/meta/classes-recipe/kernel-module-split.bbclass b/meta/classes-recipe/kernel-module-split.bbclass index 9487365eb7..101c5cd959 100644 --- a/meta/classes-recipe/kernel-module-split.bbclass +++ b/meta/classes-recipe/kernel-module-split.bbclass @@ -42,6 +42,40 @@ KERNEL_MODULE_PACKAGE_PREFIX ?= "" KERNEL_MODULE_PACKAGE_SUFFIX ?= "-${KERNEL_VERSION}" KERNEL_MODULE_PROVIDE_VIRTUAL ?= "1" +# subset of kernel modules needed in initrd, to e.g. mount rootfs from block device +KERNEL_INITRD_MODULES_META_PACKAGE ?= "${@ d.getVar("KERNEL_PACKAGE_NAME") or "kernel" }-initrd-modules" + +# match regex to path or file name. E.g. include all drivers with files in path /drivers/ata/ +KERNEL_INITRD_MODULES_REGEX ?= "(.*)(\ +/drivers/acpi/|\ +/drivers/ata/|\ +/drivers/block/|\ +/drivers/cdrom/|\ +/drivers/char/hw_random/|\ +/drivers/char/tpm/|\ +/drivers/char/|\ +/drivers/crypto/|\ +/drivers/dax/|\ +/drivers/firmware/arm_scmi/|\ +/drivers/gpu/drm/|\ +/drivers/md/|\ +/drivers/mmc/|\ +/drivers/mtd/|\ +/drivers/nvdimm/|\ +/drivers/nvme/|\ +/drivers/pci/|\ +/drivers/scsi/|\ +/drivers/tee/|\ +/drivers/tty/serial/|\ +/drivers/virtio/|\ +/drivers/watchdog/|\ +/kernel/arch/|\ +/kernel/block/|\ +/kernel/crypto/|\ +/kernel/fs/|\ +/kernel/lib/\ +)(.*)" + python split_kernel_module_packages () { import re @@ -183,6 +217,20 @@ python split_kernel_module_packages () { modules = do_split_packages(d, root='${nonarch_base_libdir}/modules', file_regex=module_regex, output_pattern=module_pattern, description='%s kernel module', postinst=postinst, postrm=postrm, recursive=True, hook=frob_metadata, extra_depends='%s-%s' % (kernel_package_name, kernel_version)) if modules: d.appendVar('RDEPENDS:' + metapkg, ' '+' '.join(modules)) + + initrd_metapkg = d.getVar('KERNEL_INITRD_MODULES_META_PACKAGE') or "" + initrd_module_regex = d.getVar('KERNEL_INITRD_MODULES_REGEX') or "" + if (initrd_metapkg != "") and (initrd_module_regex != ""): + initrd_module_regex = re.compile(initrd_module_regex) + initrd_modules = [] + for module in modules: + files = d.getVar('FILES:' + module) + m = re.match(initrd_module_regex, files) + if m: + initrd_modules.append(module) + + if initrd_modules: + d.appendVar('RDEPENDS:' + initrd_metapkg, ' '+' '.join(initrd_modules)) } do_package[vardeps] += '${@" ".join(map(lambda s: "module_conf_" + s, (d.getVar("KERNEL_MODULE_PROBECONF") or "").split()))}' diff --git a/meta/classes-recipe/kernel.bbclass b/meta/classes-recipe/kernel.bbclass index 36ce659762..3dcaebcaed 100644 --- a/meta/classes-recipe/kernel.bbclass +++ b/meta/classes-recipe/kernel.bbclass @@ -695,13 +695,14 @@ EXPORT_FUNCTIONS do_compile do_transform_kernel do_transform_bundled_initramfs d # kernel-base becomes kernel-${KERNEL_VERSION} # kernel-image becomes kernel-image-${KERNEL_VERSION} -PACKAGES = "${KERNEL_PACKAGE_NAME} ${KERNEL_PACKAGE_NAME}-base ${KERNEL_PACKAGE_NAME}-vmlinux ${KERNEL_PACKAGE_NAME}-image ${KERNEL_PACKAGE_NAME}-dev ${KERNEL_PACKAGE_NAME}-modules ${KERNEL_PACKAGE_NAME}-dbg" +PACKAGES = "${KERNEL_PACKAGE_NAME} ${KERNEL_PACKAGE_NAME}-base ${KERNEL_PACKAGE_NAME}-vmlinux ${KERNEL_PACKAGE_NAME}-image ${KERNEL_PACKAGE_NAME}-dev ${KERNEL_PACKAGE_NAME}-modules ${KERNEL_PACKAGE_NAME}-initrd-modules ${KERNEL_PACKAGE_NAME}-dbg" FILES:${PN} = "" FILES:${KERNEL_PACKAGE_NAME}-base = "${nonarch_base_libdir}/modules/${KERNEL_VERSION}/modules.order ${nonarch_base_libdir}/modules/${KERNEL_VERSION}/modules.builtin ${nonarch_base_libdir}/modules/${KERNEL_VERSION}/modules.builtin.modinfo" FILES:${KERNEL_PACKAGE_NAME}-image = "" FILES:${KERNEL_PACKAGE_NAME}-dev = "/${KERNEL_IMAGEDEST}/System.map* /${KERNEL_IMAGEDEST}/Module.symvers* /${KERNEL_IMAGEDEST}/config* ${KERNEL_SRC_PATH} ${nonarch_base_libdir}/modules/${KERNEL_VERSION}/build" FILES:${KERNEL_PACKAGE_NAME}-vmlinux = "/${KERNEL_IMAGEDEST}/vmlinux-${KERNEL_VERSION_NAME}" FILES:${KERNEL_PACKAGE_NAME}-modules = "" +FILES:${KERNEL_PACKAGE_NAME}-initrd-modules = "" FILES:${KERNEL_PACKAGE_NAME}-dbg = "/usr/lib/debug /usr/src/debug" RDEPENDS:${KERNEL_PACKAGE_NAME} = "${KERNEL_PACKAGE_NAME}-base (= ${EXTENDPKGV})" # Allow machines to override this dependency if kernel image files are @@ -716,7 +717,9 @@ ALLOW_EMPTY:${KERNEL_PACKAGE_NAME} = "1" ALLOW_EMPTY:${KERNEL_PACKAGE_NAME}-base = "1" ALLOW_EMPTY:${KERNEL_PACKAGE_NAME}-image = "1" ALLOW_EMPTY:${KERNEL_PACKAGE_NAME}-modules = "1" +ALLOW_EMPTY:${KERNEL_PACKAGE_NAME}-initrd-modules = "1" DESCRIPTION:${KERNEL_PACKAGE_NAME}-modules = "Kernel modules meta package" +DESCRIPTION:${KERNEL_PACKAGE_NAME}-initrd-modules = "Kernel initrd modules meta package" pkg_postinst:${KERNEL_PACKAGE_NAME}-base () { if [ ! -e "$D/lib/modules/${KERNEL_VERSION}" ]; then diff --git a/meta/classes-recipe/module.bbclass b/meta/classes-recipe/module.bbclass index f2f0b25a2d..51f864f1f9 100644 --- a/meta/classes-recipe/module.bbclass +++ b/meta/classes-recipe/module.bbclass @@ -86,3 +86,40 @@ EXPORT_FUNCTIONS do_compile do_install KERNEL_MODULES_META_PACKAGE = "${PN}" FILES:${PN} = "" ALLOW_EMPTY:${PN} = "1" + +# subset of kernel modules needed in initrd, to e.g. mount rootfs from block device +KERNEL_INITRD_MODULES_META_PACKAGE ?= "${@ d.getVar("KERNEL_PACKAGE_NAME") or "kernel" }-initrd-modules" + +# match regex to path or file name. E.g. include all drivers with files in path /drivers/ata/ +KERNEL_INITRD_MODULES_REGEX ?= "(.*)(\ +/drivers/acpi/|\ +/drivers/ata/|\ +/drivers/block/|\ +/drivers/cdrom/|\ +/drivers/char/hw_random/|\ +/drivers/char/tpm/|\ +/drivers/char/|\ +/drivers/crypto/|\ +/drivers/dax/|\ +/drivers/firmware/arm_scmi/|\ +/drivers/gpu/drm/|\ +/drivers/md/|\ +/drivers/mmc/|\ +/drivers/mtd/|\ +/drivers/nvdimm/|\ +/drivers/nvme/|\ +/drivers/pci/|\ +/drivers/scsi/|\ +/drivers/tee/|\ +/drivers/tty/serial/|\ +/drivers/virtio/|\ +/drivers/watchdog/|\ +/kernel/arch/|\ +/kernel/block/|\ +/kernel/crypto/|\ +/kernel/fs/|\ +/kernel/lib/\ +)(.*)" + +FILES:${PN}-initrd = "" +ALLOW_EMPTY:${PN}-initrd = "1" From patchwork Fri Apr 4 16:29:25 2025 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Mikko Rapeli X-Patchwork-Id: 60731 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from aws-us-west-2-korg-lkml-1.web.codeaurora.org (localhost.localdomain [127.0.0.1]) by smtp.lore.kernel.org (Postfix) with ESMTP id 9C13CC3601A for ; Fri, 4 Apr 2025 16:30:04 +0000 (UTC) Received: from mail-lf1-f43.google.com (mail-lf1-f43.google.com [209.85.167.43]) by mx.groups.io with SMTP id smtpd.web11.1440.1743784196152479222 for ; Fri, 04 Apr 2025 09:29:56 -0700 Authentication-Results: mx.groups.io; dkim=pass header.i=@linaro.org header.s=google header.b=dtuMt5FD; spf=pass (domain: linaro.org, ip: 209.85.167.43, mailfrom: mikko.rapeli@linaro.org) Received: by mail-lf1-f43.google.com with SMTP id 2adb3069b0e04-54b1095625dso2577091e87.0 for ; Fri, 04 Apr 2025 09:29:55 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1743784194; x=1744388994; darn=lists.openembedded.org; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to; bh=MZ3KA8XBXOb873950h1w3JQeb0On5NMVFauIgvLGGoI=; b=dtuMt5FDNwOFc3FN5ouSCe6lbtilZfzBbahjIR2+PxIgb3BuqNi8aGqMUHaGZ2M5yB lIqU4QwTmn1098/Xevr0Su4hM7UTlHHU7rysR7BnwV+uvYgneMuwYV23ElcTfPJU0D66 x0ExK7HFYZWjGv52oQyXor7pVmlnf3WOWMyt+8sZz4V7MW+qIsHszjK1aFve5RtR1dGo 86G/j6s78A1rRYUZwIfsGmTu+m2TZh9AeTHqY8F5e8z9aEGBRKJgUHuHP261EJ0QGXT/ 1hpq/o5EytzVdfvBbuJsIZyuxOGnGYjEnLnjXGinQJoggw1/exEpu50rEV/ODKJSpQzs jd1Q== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1743784194; x=1744388994; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=MZ3KA8XBXOb873950h1w3JQeb0On5NMVFauIgvLGGoI=; b=hd3BvQBvhbeJYarZIXUCs6Oc7Bt5f8wWppB1PotgbcxSpJNkR2GGsnhXPq8Px5MHbt Q8LSJMpq91tGAzf2Zuy0bHX+M5/Wl8UqImTn7Bjgpt+iV1SoY+c4d77NH63aSjVPI8B2 2VyKXzO3m1Dz/Ql89BQGX4yNGM+Kf31lS+lId3hTY4Lyokep4vB8JkiOXT4gcPOb/5/w V/k4VcHNGXK0N/0mwDTEJjoq1CxOE08WCGMkMEeGss5Gs28Qjy3j8aNLqAlGDmDbtknJ BWy2lkuIOBVfvCLvbte+aHVQY9IYD9XP5gf/njQG6+U+nKoNC/A9jZaQRgaLfNhQeEkk CnzQ== X-Gm-Message-State: AOJu0YwpUxHzJ88DEig17oBZU+Ei8y51TM2v0xsHtDBpIo2skOxPUp6+ jv2q+mvEgHh9MSlgP5vhJ3+9ab7WeQv7ES0DRuFp4UqwzU4n1VLMReEkGXDOnICsM0uGYoyZDzT Ubak= X-Gm-Gg: ASbGncvhVf3Oj6in/CzCzzpInRy0DBrb082N8WHhyfdXqd1g/kvbZQ9yfh7NH4mXAoH cO+FU1rmQP/tAgW6Qku2Lu9cdepAcsGkhYzWaQ6xvCCuS7JY+SoTDUl2ARFMgBSaoz6xUeLKV4t zOXEm9mC8REhaGG/2tZ3EnWxrmwSAaN/0W8mqtLJ7GrvpJ/d1Y1C0p3oOviNNfvMEQviD3p2ulo EPZPrprOBwOzFmXamJQWcZbK0W7m7gGzpROSoiD0cZ9DQTHdP4tREt7Nj9ehNy6rgeq0ar9yNZP Q2bkDoxZ85tvPstRVKZJuoqSdQ3+IZeHmFXc/jq/XlYKRmJL1zXtLp7gadEOjT/H7x+fq6NTdFe c1bwnKcEeuHfKmIF69KaE4A== X-Google-Smtp-Source: AGHT+IGxldQ/XkCoBw6CwcaD3CEUiZEub8aaobtVRbLF0YtHxJ0pURIGDjSEuqeq8EndgtCD3gj85w== X-Received: by 2002:a05:6512:3048:b0:549:b28b:17bd with SMTP id 2adb3069b0e04-54c227f91c8mr1226597e87.35.1743784194322; Fri, 04 Apr 2025 09:29:54 -0700 (PDT) Received: from localhost.localdomain (87-100-218-141.bb.dnainternet.fi. [87.100.218.141]) by smtp.gmail.com with ESMTPSA id 2adb3069b0e04-54c1e671f54sm469786e87.228.2025.04.04.09.29.54 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 04 Apr 2025 09:29:54 -0700 (PDT) From: Mikko Rapeli To: openembedded-core@lists.openembedded.org Cc: Mikko Rapeli Subject: [PATCH v3 04/11] core-image-initramfs-boot: add option to build systemd based initrd Date: Fri, 4 Apr 2025 19:29:25 +0300 Message-ID: <20250404162932.447699-5-mikko.rapeli@linaro.org> X-Mailer: git-send-email 2.49.0 In-Reply-To: <20250404162932.447699-1-mikko.rapeli@linaro.org> References: <20250404162932.447699-1-mikko.rapeli@linaro.org> MIME-Version: 1.0 List-Id: X-Webhook-Received: from li982-79.members.linode.com [45.33.32.79] by aws-us-west-2-korg-lkml-1.web.codeaurora.org with HTTPS for ; Fri, 04 Apr 2025 16:30:04 -0000 X-Groupsio-URL: https://lists.openembedded.org/g/openembedded-core/message/214355 If "systemd-initramfs" is in DISTRO_FEATURES then convert core-image-initramfs-boot from shell scripts to systemd. The resulting initramfs is much bigger than shell script one but supports much more features like disk encryption and TPM devices. Also includes udev which can load any drivers needed to mount rootfs. Signed-off-by: Mikko Rapeli --- .../images/core-image-initramfs-boot.bb | 20 ++++++++++++++++--- 1 file changed, 17 insertions(+), 3 deletions(-) diff --git a/meta/recipes-core/images/core-image-initramfs-boot.bb b/meta/recipes-core/images/core-image-initramfs-boot.bb index 7258944751..c66c28db76 100644 --- a/meta/recipes-core/images/core-image-initramfs-boot.bb +++ b/meta/recipes-core/images/core-image-initramfs-boot.bb @@ -4,7 +4,23 @@ LICENSE = "MIT" INITRAMFS_SCRIPTS ?= "initramfs-framework-base initramfs-module-udev" -PACKAGE_INSTALL = "${INITRAMFS_SCRIPTS} ${VIRTUAL-RUNTIME_base-utils} base-passwd" +inherit image + +PACKAGE_INSTALL = " \ + ${VIRTUAL-RUNTIME_base-utils} \ + ${@bb.utils.contains('DISTRO_FEATURES', 'systemd-initramfs', ' \ + base-files \ + coreutils \ + e2fsprogs-mke2fs \ + os-release-initrd \ + util-linux-blkid \ + util-linux-mount \ + util-linux-umount \ + ${VIRTUAL-RUNTIME_init_manager} \ + ${VIRTUAL-RUNTIME_dev_manager} \ + ', '${INITRAMFS_SCRIPTS}', d)} \ + base-passwd \ +" # Ensure the initramfs only contains the bare minimum IMAGE_FEATURES = "" @@ -18,5 +34,3 @@ IMAGE_FSTYPES = "${INITRAMFS_FSTYPES}" IMAGE_NAME_SUFFIX ?= "" IMAGE_ROOTFS_SIZE = "8192" IMAGE_ROOTFS_EXTRA_SPACE = "0" - -inherit image From patchwork Fri Apr 4 16:29:26 2025 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Mikko Rapeli X-Patchwork-Id: 60732 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from aws-us-west-2-korg-lkml-1.web.codeaurora.org (localhost.localdomain [127.0.0.1]) by smtp.lore.kernel.org (Postfix) with ESMTP id B41F1C369A4 for ; Fri, 4 Apr 2025 16:30:04 +0000 (UTC) Received: from mail-lf1-f44.google.com (mail-lf1-f44.google.com [209.85.167.44]) by mx.groups.io with SMTP id smtpd.web10.1465.1743784197204117125 for ; Fri, 04 Apr 2025 09:29:57 -0700 Authentication-Results: mx.groups.io; dkim=pass header.i=@linaro.org header.s=google header.b=uW+zzfwN; spf=pass (domain: linaro.org, ip: 209.85.167.44, mailfrom: mikko.rapeli@linaro.org) Received: by mail-lf1-f44.google.com with SMTP id 2adb3069b0e04-549963b5551so2681999e87.2 for ; Fri, 04 Apr 2025 09:29:56 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1743784195; x=1744388995; darn=lists.openembedded.org; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to; bh=3iToOKuBuSfo6pYT5W3DHUHLqyPFY5W8PRhcmQnKdR0=; b=uW+zzfwNIjK+2z3wF3LunTG581drjes2cHWmr6xpXc0/DH9hmYebbTdruy+BFCrTzo 9QVKKII8zpZc6heSzQJgebkxe6T/S8muXunm28dV/jN+1fDVVZiok2scOLg6Njoww7Vl aTs+kPreabLXOJW6RbYcv8dkGxGiLOZBi4hLh8uQ3SzkXOpEc08BxjCpmahMzVgdAPsk lkKuJoBOyNOUj0/U0zq5Y+mim0GTj0WnqbGMU68Lzovb2ni9CoKz4qVoO3qXQKt9hJMP XA3M7/HtIV324LYtpKQBn3cZIkB8eQZ+QziTLAPr03SHaci+joNHwpO6Jh/l+aHPd5hY pJ6Q== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1743784195; x=1744388995; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=3iToOKuBuSfo6pYT5W3DHUHLqyPFY5W8PRhcmQnKdR0=; b=sD8QgX6h3l6awGGSUvPHdUYHoPZMWnkfDX4rkZntcQyly3L/NkFf5Jh42u+XZKsRZz L+QPLcsfvnkEy9r8TJ70EwrRvA9B3wSH/bzEODrQggdi1NtPNqlzDhAVTUmuU9r8kBxQ wqK2LE+sMvbtjKzYAWwEe5GoNZw5diUzQtImzqnNX7touOUW32Sg2HCWCPowe7XEba+0 gT7tVmeuP3vooke3rCIS6NbPo9SkAgPnFfwBplXS5Cuj/LioZGeKFgVbhD5XnYZK4KVp 61ektKi66vLzLfwvdUuO9h9bXcxMfagBqjv916G1oXh+TW9DKKYNOiWiD6Iw0V36EgV4 ThsA== X-Gm-Message-State: AOJu0Yzmv0f9aLKSaSM543BNpS4wZ5brR8tTWU0pEI89ULHcgK1SnAPD ohwKxcs2X6nvMrVg/p8VZ73huv+c8Kqfkcj9kyiSiLd4uKja4c6IYDQ6cOJU3Yz2nnasBjtgvFE 6rkg= X-Gm-Gg: ASbGncsKgpkz9AK4B+cCY9h2ukl0smrZZVLs63Mv3Y7nVuwAwZDQHF2ED5Q4zPToTiq 7fR4+lCeveEk4TIOXO4KCLKmiNtOwVrwbB5JZmdOoKJcGYMRLWdn1rrVXXkEf5fkh484ChHBMrW cHQzNrrfvgrG9hT3o3E0RUZ3JlnP8ECVa6EaYUsDSsVqwqv4ZNcI3OwsNVPGn2ErcmyxuWBH7Hm /g7VU/A2HCQtd9pTagnZdSGs1a5j62jlOLm5TbzlJ6Mds1OZclNpCoQZRsDmU4wXruTGIockJeS AOeAJMtOyGATcKVPey8Ffdym+xcbsilMPc/L2eKq12HFuy5zeYDOL1nocL7++xB9LyOP4n9ZCij 58iwFdrdbSLj7S70EP6t9BQ== X-Google-Smtp-Source: AGHT+IG33SKg2ig0qX6Xk5t4ugw0iWkfATHnuJ0voRPSRhEfvHRSG6u3c1QTtBuRDDKRPozzZCENvQ== X-Received: by 2002:a05:6512:10d1:b0:549:8f06:8239 with SMTP id 2adb3069b0e04-54c227fef60mr1142120e87.51.1743784195410; Fri, 04 Apr 2025 09:29:55 -0700 (PDT) Received: from localhost.localdomain (87-100-218-141.bb.dnainternet.fi. [87.100.218.141]) by smtp.gmail.com with ESMTPSA id 2adb3069b0e04-54c1e671f54sm469786e87.228.2025.04.04.09.29.54 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 04 Apr 2025 09:29:55 -0700 (PDT) From: Mikko Rapeli To: openembedded-core@lists.openembedded.org Cc: Mikko Rapeli Subject: [PATCH v3 05/11] core-image-initramfs-boot: don't install RRECOMMENDS to reduce size Date: Fri, 4 Apr 2025 19:29:26 +0300 Message-ID: <20250404162932.447699-6-mikko.rapeli@linaro.org> X-Mailer: git-send-email 2.49.0 In-Reply-To: <20250404162932.447699-1-mikko.rapeli@linaro.org> References: <20250404162932.447699-1-mikko.rapeli@linaro.org> MIME-Version: 1.0 List-Id: X-Webhook-Received: from li982-79.members.linode.com [45.33.32.79] by aws-us-west-2-korg-lkml-1.web.codeaurora.org with HTTPS for ; Fri, 04 Apr 2025 16:30:04 -0000 X-Groupsio-URL: https://lists.openembedded.org/g/openembedded-core/message/214356 Disables recommends to only install important packages. Disable machine specific additions which are meant for full rootfs boot. For example on genericarm64, full set of kernel modules and WiFi related firmware is in the machine recommends and those are not needed when booting to rootfs from an initrd. These reduce systemd initrd size from 200Mb to 54Mb. Since recommends are not automatically installed anymore, explicitly add initramfs-module-rootfs, busybox-udhcpc and libkmod to shell script based initrd. initramfs-module-rootfs is needed to mount the rootfs. Installing busybox-udhcpc and libkmod for backwards compatibility. Not installing openssl-conf, openssl-ossl-module-legacy or ldconfig packages since they don't seem essential in initrd to mount the rootfs. Signed-off-by: Mikko Rapeli --- meta/recipes-core/images/core-image-initramfs-boot.bb | 11 ++++++++++- 1 file changed, 10 insertions(+), 1 deletion(-) diff --git a/meta/recipes-core/images/core-image-initramfs-boot.bb b/meta/recipes-core/images/core-image-initramfs-boot.bb index c66c28db76..99388476ac 100644 --- a/meta/recipes-core/images/core-image-initramfs-boot.bb +++ b/meta/recipes-core/images/core-image-initramfs-boot.bb @@ -2,7 +2,7 @@ SUMMARY = "Basic initramfs to boot a fully-featured rootfs" DESCRIPTION = "Small initramfs that contains just udev and init, to find the real rootfs." LICENSE = "MIT" -INITRAMFS_SCRIPTS ?= "initramfs-framework-base initramfs-module-udev" +INITRAMFS_SCRIPTS ?= "initramfs-framework-base initramfs-module-udev initramfs-module-rootfs" inherit image @@ -20,8 +20,17 @@ PACKAGE_INSTALL = " \ ${VIRTUAL-RUNTIME_dev_manager} \ ', '${INITRAMFS_SCRIPTS}', d)} \ base-passwd \ + busybox-udhcpc \ + libkmod \ " +# reduce size +NO_RECOMMENDATIONS = "1" + +# don't install automatically, pick manually instead +MACHINE_EXTRA_RDEPENDS = "" +MACHINE_EXTRA_RRECOMMENDS = "" + # Ensure the initramfs only contains the bare minimum IMAGE_FEATURES = "" IMAGE_LINGUAS = "" From patchwork Fri Apr 4 16:29:27 2025 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Mikko Rapeli X-Patchwork-Id: 60733 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from aws-us-west-2-korg-lkml-1.web.codeaurora.org (localhost.localdomain [127.0.0.1]) by smtp.lore.kernel.org (Postfix) with ESMTP id BF359C369A6 for ; Fri, 4 Apr 2025 16:30:04 +0000 (UTC) Received: from mail-lf1-f50.google.com (mail-lf1-f50.google.com [209.85.167.50]) by mx.groups.io with SMTP id smtpd.web10.1466.1743784198153766063 for ; Fri, 04 Apr 2025 09:29:58 -0700 Authentication-Results: mx.groups.io; dkim=pass header.i=@linaro.org header.s=google header.b=qrwOjin1; spf=pass (domain: linaro.org, ip: 209.85.167.50, mailfrom: mikko.rapeli@linaro.org) Received: by mail-lf1-f50.google.com with SMTP id 2adb3069b0e04-5499bd3084aso1988954e87.0 for ; Fri, 04 Apr 2025 09:29:57 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1743784196; x=1744388996; darn=lists.openembedded.org; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to; bh=AEdcHTXNTo7S4AHroNTI64Bs0zK9/f0xYWd5QZeIfJM=; b=qrwOjin1sZRk7VYHY62On9sRqORFdOgozruxC96WC7L+2yc39bMuqp2sGqNmBWd2e2 pIypuoRis7gvVJe/alxiwmOjfg0DB4p2RDgftkyJLPZHmjKsRwIkHCHsAEHKMq/8Q4H1 nBtpRxhV4q+hoeX0ZByIQXAGWcJ9uteHSasGzLhLxySIQ4j6hbeYph+sAhKP7jkQfxlp 0VzAKe961soB2S4ewitgW+pvz+MnXm80AvAnBBeFSNIO8P+tRj/ENwIjo0QX0qHFHq9v gV0KtUvsm1HtRx+0fu41LCk37xzEclsTPbANMTGRuW0HCDRLWq2AWHOFzTwsGCR2osYs hG9A== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1743784196; x=1744388996; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=AEdcHTXNTo7S4AHroNTI64Bs0zK9/f0xYWd5QZeIfJM=; b=gNPKmMy6EkdQbEdXTVN8RfyxrnDQpJ5aaVELrfqLGo6BiqgQUfIt9hs8DquCpD0q2s 7ogLFf56TDYDImn7+grTOQ9x3wrHGLyqsUKuUSh1iS3xzUuaYJR7a6P0t0gvy6bgQrx/ m1N7NYVAVC+QHD3HTB/vpbrB8vFpQN/2dhkucOo90HXbfVRyJJCV+jrR5K57io93+Kk+ MUlCznCYijh5hydmiisyELrXRnyHZJwptky4J2KfuBRjDg+JLhRR7Rx0c30Vk5MFhufD ejdBu0EYI8CPKXfhOQKejlKxJISlDlc1or4lrBJC8asJJGnMrQgoi4H5Vha9vQcIR83n s8+g== X-Gm-Message-State: AOJu0YyCld4IBcnXcgDWz5/TvUtwJ+9LhPl0HNc9eegHQQ0OmjERV0hj v0jkAfL2aJrlv1DAl6oFqGgCXRUPZYlmIezmb3EfsrJQJ1o6JwevBpZsmUAhO8x1zKCTfnBcuC/ MrWQ= X-Gm-Gg: ASbGncsC2IuEMD1Lg6yjTnJdzDy/YgOrWD8y6MUA0VfV0hN7R5TPOCezSMl4/5DUFlv VyBrJyaZMP0HvfH9kp2vA15mCX43dG+dXOVBh7F3RMXT4FIdvzOaea0o3nsFC9kdkKOe2h+yPR6 sWFJX4YW44Tx5WLSOQ+nwBcv/N5Pfx0uIWRDHQnflsya2KDPbPaKN6kNYxOxyYxEd0BqBrVHthH qFaSl+KpX6aMSijY0XhghE0vZ+sHhTSqqDs2ylA1Sc3j37oLrR3ap9XJi9k664heEfdt1dYojyb 8RAfJLbpUt+KLF6kD0lEU0SKOvubNKHOjaHxJI31tHA1cSsdCldWkuqBsHERemrZ4tWYFF3Q5CE 7fYiGr9WiavfTZgBWLGQkNw== X-Google-Smtp-Source: AGHT+IFITs+1plSt0KJq8WyXiRFX8JowREoUTeREq6dCCCkArOM9HqkRSZylJn8KNogVZBXJBnpHxg== X-Received: by 2002:a05:6512:3d2a:b0:545:c33:4099 with SMTP id 2adb3069b0e04-54c2278c23emr1056523e87.27.1743784196233; Fri, 04 Apr 2025 09:29:56 -0700 (PDT) Received: from localhost.localdomain (87-100-218-141.bb.dnainternet.fi. [87.100.218.141]) by smtp.gmail.com with ESMTPSA id 2adb3069b0e04-54c1e671f54sm469786e87.228.2025.04.04.09.29.55 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 04 Apr 2025 09:29:56 -0700 (PDT) From: Mikko Rapeli To: openembedded-core@lists.openembedded.org Cc: Mikko Rapeli Subject: [PATCH v3 06/11] core-image-initramfs-boot: install kernel-initrd-modules by default Date: Fri, 4 Apr 2025 19:29:27 +0300 Message-ID: <20250404162932.447699-7-mikko.rapeli@linaro.org> X-Mailer: git-send-email 2.49.0 In-Reply-To: <20250404162932.447699-1-mikko.rapeli@linaro.org> References: <20250404162932.447699-1-mikko.rapeli@linaro.org> MIME-Version: 1.0 List-Id: X-Webhook-Received: from li982-79.members.linode.com [45.33.32.79] by aws-us-west-2-korg-lkml-1.web.codeaurora.org with HTTPS for ; Fri, 04 Apr 2025 16:30:04 -0000 X-Groupsio-URL: https://lists.openembedded.org/g/openembedded-core/message/214357 Most real machines in core set MACHINE_EXTRA_RRECOMMENDS = "kernel-modules" which means that all images including initrd have all kernel modules by default. Only default qemu machines don't do this and instead the kernel configs there seem to include enough drivers built-in to mount the rootfs, and this may be reflected in qemu machine configuration e.g. which block device emulation is used. Since for initrd "boot to rootfs" usecase full set of kernel modules way too much, use the subset from kernel-initrd-modules which should work on all machines. If not, then the KERNEL_INITRD_MODULES_REGEX needs to be fixed for the machine or for everyone to include any missing driver classes. Same could be achieved by introducing a MACHINE_EXTRA_INITRD or similar variable for machine configs to define extra packages for initrd usecase of mounting target rootfs. I have not done this for now since currently only user is kernel-initrd-modules. Installing kernel-initrd-modules by default enables the machine specific kernel configs to move drivers from built-in to modules. The other e.g. firmware packages installed via MACHINE_EXTRA variables in core machines are not needed to mount the rootfs. Signed-off-by: Mikko Rapeli --- meta/recipes-core/images/core-image-initramfs-boot.bb | 1 + 1 file changed, 1 insertion(+) diff --git a/meta/recipes-core/images/core-image-initramfs-boot.bb b/meta/recipes-core/images/core-image-initramfs-boot.bb index 99388476ac..743e0da132 100644 --- a/meta/recipes-core/images/core-image-initramfs-boot.bb +++ b/meta/recipes-core/images/core-image-initramfs-boot.bb @@ -21,6 +21,7 @@ PACKAGE_INSTALL = " \ ', '${INITRAMFS_SCRIPTS}', d)} \ base-passwd \ busybox-udhcpc \ + kernel-initrd-modules \ libkmod \ " From patchwork Fri Apr 4 16:29:28 2025 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Mikko Rapeli X-Patchwork-Id: 60735 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from aws-us-west-2-korg-lkml-1.web.codeaurora.org (localhost.localdomain [127.0.0.1]) by smtp.lore.kernel.org (Postfix) with ESMTP id D017AC369A7 for ; Fri, 4 Apr 2025 16:30:04 +0000 (UTC) Received: from mail-lf1-f42.google.com (mail-lf1-f42.google.com [209.85.167.42]) by mx.groups.io with SMTP id smtpd.web10.1470.1743784199496018275 for ; Fri, 04 Apr 2025 09:29:59 -0700 Authentication-Results: mx.groups.io; dkim=pass header.i=@linaro.org header.s=google header.b=eo4r7uWm; spf=pass (domain: linaro.org, ip: 209.85.167.42, mailfrom: mikko.rapeli@linaro.org) Received: by mail-lf1-f42.google.com with SMTP id 2adb3069b0e04-5499c5d9691so2549272e87.2 for ; Fri, 04 Apr 2025 09:29:59 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1743784198; x=1744388998; darn=lists.openembedded.org; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to; bh=mowHB+GyPObXHHUyFruDF08rUA0X5sNItOs/AzldHBM=; b=eo4r7uWmTCBoNEMh4tWX7w404qRidjQAezVkBRilvfPon1ly09U5Jpksb6HwWBQTbc V57ozrEW7zXoFTmg6T6D8t5b7dRIQbvLfK7/lswbNVpAW9K5pWN3QbDhGvrgPzDA6WZv S+v3E7tWJF/yMYS3SGCs5ZYnek+GR2VK+ajWwGhOySIP7Tnt0VAyWqTSkvSNvoRu6XSC H+yKlRskjhyWVX+BQ5mBBGgCPUdyJQdLX271sQoSwvguZUCrMnj7NM2et1JcyvV/zlmC KTDH4FL9b3bvhEnsNvkDoPlwHe4Nuxtwwy+0z1TKiTbPorXacXDbOPj3ssCMpSv0aXn4 Hk/w== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1743784198; x=1744388998; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=mowHB+GyPObXHHUyFruDF08rUA0X5sNItOs/AzldHBM=; b=xBDuRS5K9Vwzze8q8Mo5lLSCWkvnxfO8cgzVdpx1jUwvx4C+EVYLMguoXBdCojVsW2 u6SiUMZgReKrtC9DrQQdwe4eUDsydCdFUl+epXaWsp2DwqUUXU3ADrd/ylgCGoqAzBhE k/CJ4Mczi4aMJ91jWq1hBmacrscV6ZVUWE/yn41eE7p2VvUgYbEk1B7lv1lqHbvm2jsv H92/XuPYs30GNCb5pfiEkes8yuXsL+MBDC1c3FFPTk8aTvFPo86uoE/xYsUBbyrxebzv pKYiSJZZ8nzUIWe9+ZhuJnT/qIfAVm5FcdItAwgLzRzcREl6+gSPZA5cBXjW7IvEZW3b /y/w== X-Gm-Message-State: AOJu0YywKJwY6RUlXgQDdyaettH2VvmpXtCCy6TQaE7zQoUZfWbnoLua 5nJ5kM59OoLwWuWm/XYLOTGi2VoUl4vypMeU/t7jj5IEblS9pmz2vdNiH0/m+CrpnsRt3GWLcoD HzK4= X-Gm-Gg: ASbGnctm4yOVqwDkG8ochqZHaB1ZJaAVAadu9f7Mq6a0P7tykahi7S0XNEwXFfVxgFc sJC3RPUVcz8gVvX5cNJUw8SYgDKVYU48z6LaImcgazyJdC9H02y+ZYnVOgIKg/3qIlg1XkgTouD x6/rNnoavsRzT6XSAVYZ4l2Ksl7KTrdLBzvGrH+WdTaxU7w21tDS9069ZD/lLKHnbSQJ8TGOPFt XzP2u7rPGsKIDOuV/z+3r9fg9OGKFG5DFyIslHJhK3cgGGvcwIQC4jjJYwV/Ak+Z2Kq6dmOYNlM l2ZUrZj/L3nf78NgdEC65Wd/YZE8SB8r4hL0TRTj3NtdyALGuwl1tiAWgjKIr4EsitIOsgM2kKl y8+dqZ9N47Uv6gHLwf4JIoA== X-Google-Smtp-Source: AGHT+IFRfvSlNLwzWRErflZTxQuKvPgZmR5bzlTNNLMWUJdzZg/9L60PVWMLt9sbK3g3zJGXltiijQ== X-Received: by 2002:a05:6512:b1d:b0:545:746:f36a with SMTP id 2adb3069b0e04-54c2278b039mr1142732e87.34.1743784197658; Fri, 04 Apr 2025 09:29:57 -0700 (PDT) Received: from localhost.localdomain (87-100-218-141.bb.dnainternet.fi. [87.100.218.141]) by smtp.gmail.com with ESMTPSA id 2adb3069b0e04-54c1e671f54sm469786e87.228.2025.04.04.09.29.56 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 04 Apr 2025 09:29:57 -0700 (PDT) From: Mikko Rapeli To: openembedded-core@lists.openembedded.org Cc: Mikko Rapeli Subject: [PATCH v3 07/11] oeqa selftest uki.py: add aarch64/arm test with systemd based initrd Date: Fri, 4 Apr 2025 19:29:28 +0300 Message-ID: <20250404162932.447699-8-mikko.rapeli@linaro.org> X-Mailer: git-send-email 2.49.0 In-Reply-To: <20250404162932.447699-1-mikko.rapeli@linaro.org> References: <20250404162932.447699-1-mikko.rapeli@linaro.org> MIME-Version: 1.0 List-Id: X-Webhook-Received: from li982-79.members.linode.com [45.33.32.79] by aws-us-west-2-korg-lkml-1.web.codeaurora.org with HTTPS for ; Fri, 04 Apr 2025 16:30:04 -0000 X-Groupsio-URL: https://lists.openembedded.org/g/openembedded-core/message/214358 Use core-image-initramfs-boot with systemd to boot via UKI on arm/aarch64. Tested on qemuarm, qemuarm64 and genericarm64 on aarch64 build host. The machines have different image and qemuboot configs so they need to be configured in test. Signed-off-by: Mikko Rapeli --- meta/lib/oeqa/selftest/cases/uki.py | 76 +++++++++++++++++++++++++++++ 1 file changed, 76 insertions(+) diff --git a/meta/lib/oeqa/selftest/cases/uki.py b/meta/lib/oeqa/selftest/cases/uki.py index 9a1aa4e269..4830fb3403 100644 --- a/meta/lib/oeqa/selftest/cases/uki.py +++ b/meta/lib/oeqa/selftest/cases/uki.py @@ -139,3 +139,79 @@ IMAGE_CLASSES:remove = 'testimage' cmd = "echo $( cat /sys/firmware/efi/efivars/LoaderEntrySelected-4a67b082-0a4c-41cf-b6c7-440b29bb8c4f ) | grep '%s'" % (uki_filename) status, output = qemu.run_serial(cmd) self.assertEqual(1, status, 'Failed to run command "%s": %s' % (cmd, output)) + + @skipIfNotArch(['aarch64', 'arm']) + @OETestTag("runqemu") + def test_uki_boot_systemd_initrd(self): + """Build and boot into UEFI firmware (u-boot), systemd-boot, initrd with systemd, rootfs with systemd""" + image = "core-image-base" + runqemu_params = get_bb_var('TEST_RUNQEMUPARAMS', image) or "" + cmd = "runqemu %s nographic serial wic" % (runqemu_params) + + self.write_config(""" +# efi firmware must load systemd-boot, not grub +EFI_PROVIDER = "systemd-boot" + +# image format must be wic, needs esp partition for firmware etc +IMAGE_FSTYPES:pn-%s:append = " wic" +WKS_FILE = "efi-uki-bootdisk.wks.in" + +# efi, uki and systemd features must be enabled +INIT_MANAGER = "systemd" +DISTRO_FEATURES += "systemd-initramfs" +MACHINE_FEATURES:append = " efi" +IMAGE_CLASSES:append:pn-core-image-base = " uki" + +# uki embeds also an initrd +INITRAMFS_IMAGE = "core-image-initramfs-boot" + +# runqemu must not load kernel separately, it's in the uki +QB_KERNEL_ROOT = "" +QB_DEFAULT_KERNEL = "none" + +# u-boot, not all qemu* machines set this correctly +QB_DEFAULT_BIOS = "u-boot.bin" +# machines may not set this correctly +QB_DEFAULT_FSTYPE = "wic" + +# u-boot needs to find ESP partition so use virtio block device instead of default scsi +QB_ROOTFS_OPT = "-drive id=root,file=@ROOTFS@,if=none,format=raw -device virtio-blk-pci,drive=root" +QB_DRIVE_TYPE = "/dev/vd" + +# boot command line provided via uki, not via bootloader +UKI_CMDLINE = "rootwait root=LABEL=root" +# enable if debug output is needed +# UKI_CMDLINE += "systemd.log_level=debug systemd.log_target=console systemd.journald.forward_to_console=1" + +# disable kvm, breaks boot +QEMU_USE_KVM = "" + +IMAGE_CLASSES:remove = 'testimage' +""" % (image)) + + uki_filename = get_bb_var('UKI_FILENAME', image) + + bitbake(image + " u-boot") + with runqemu(image, ssh=False, launch_cmd=cmd) as qemu: + self.assertTrue(qemu.runner.logged, "Failed: %s" % cmd) + + # Verify from efivars that firmware was: + # aarch64 + cmd = "echo $( cat /sys/firmware/efi/efivars/LoaderFirmwareInfo-4a67b082-0a4c-41cf-b6c7-440b29bb8c4f ) | grep 'Das U-Boot'" + status, output = qemu.run_serial(cmd) + self.assertEqual(1, status, 'Failed to run command "%s": %s' % (cmd, output)) + + # Check that systemd-boot was the loader + cmd = "echo $( cat /sys/firmware/efi/efivars/LoaderInfo-4a67b082-0a4c-41cf-b6c7-440b29bb8c4f ) | grep systemd-boot" + status, output = qemu.run_serial(cmd) + self.assertEqual(1, status, 'Failed to run command "%s": %s' % (cmd, output)) + + # Check that systemd-stub was used + cmd = "echo $( cat /sys/firmware/efi/efivars/StubInfo-4a67b082-0a4c-41cf-b6c7-440b29bb8c4f ) | grep systemd-stub" + status, output = qemu.run_serial(cmd) + self.assertEqual(1, status, 'Failed to run command "%s": %s' % (cmd, output)) + + # Check that the compiled uki file was booted into + cmd = "echo $( cat /sys/firmware/efi/efivars/LoaderEntrySelected-4a67b082-0a4c-41cf-b6c7-440b29bb8c4f ) | grep '%s'" % (uki_filename) + status, output = qemu.run_serial(cmd) + self.assertEqual(1, status, 'Failed to run command "%s": %s' % (cmd, output)) From patchwork Fri Apr 4 16:29:29 2025 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Mikko Rapeli X-Patchwork-Id: 60734 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from aws-us-west-2-korg-lkml-1.web.codeaurora.org (localhost.localdomain [127.0.0.1]) by smtp.lore.kernel.org (Postfix) with ESMTP id DE30EC369A8 for ; Fri, 4 Apr 2025 16:30:04 +0000 (UTC) Received: from mail-lf1-f41.google.com (mail-lf1-f41.google.com [209.85.167.41]) by mx.groups.io with SMTP id smtpd.web10.1472.1743784200611006731 for ; Fri, 04 Apr 2025 09:30:00 -0700 Authentication-Results: mx.groups.io; dkim=pass header.i=@linaro.org header.s=google header.b=jA3790k5; spf=pass (domain: linaro.org, ip: 209.85.167.41, mailfrom: mikko.rapeli@linaro.org) Received: by mail-lf1-f41.google.com with SMTP id 2adb3069b0e04-54b0d638e86so2565891e87.1 for ; Fri, 04 Apr 2025 09:30:00 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1743784199; x=1744388999; darn=lists.openembedded.org; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to; bh=WeRlJsYwVM3cbEZg09wa/3SJvsINQ1+FMrV/BPgtirQ=; b=jA3790k5drKjNW8KIyKDN1g7vJAYeY24mXnliMR0XUjNXu/QJ2omcbj5GZakfwitG3 Zmd8jfABayHJ17Eyzidy7yfE9S2W0Qct6F5laIiA54OFRnGVPreJhD19EF+WPLjqFdDo TMMDwDpVotfXkbMctMWmLDlZ43/A92G0Dy3R13SMqhaWANWxzMxcpqnnu6juv//Y5QqO zRBKr5Fop6fU0/Pid0+XCKw64t32OQ1dgQ/ljzx5yuazTkA3RVpLFvEQ7bq0IL0XbluQ WejR6UjzneEhsJk+pMTsJz+/wcaVZ0UeEL49eI8IJUGatp5iSn+2yDkqkqtmoSwI5sjT 36Kw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1743784199; x=1744388999; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=WeRlJsYwVM3cbEZg09wa/3SJvsINQ1+FMrV/BPgtirQ=; b=f34KL7SfvkFeXUKd6Lipk/GvaW8ZkKX0XhCALqbUkIAGZqicx5npZm/i1CbonNLJvR kKzo7sGQC3hAgONVr+aJD/AhYt3K2632S527AnOlplLiaTUhhMrqzMLWBb/rQJzkqRxq p11w8m+hi/R97NXIae5yh0Tymc2u1SQIzOkyGE63byaJmZLy7RVdtVHdH164B/24WQe0 DqH4b/xKidTgg6TLAxRIJiaeyrHxrgP+QkL7fWKcJZcd2E04sSmuXqzX0wd7km3qhEZX LYhhgCO/Gm09S1V5Y7XSHRy4RINlRe7RUvfWBFaaSGyidnpwU5M28EhSXupTSiHXHodZ 2XIg== X-Gm-Message-State: AOJu0Yzcinh5w2GrRKQs+kjLL14AXQ/50+s8sC6HLD1HJF6zY/zk+6Lq JZqaPCkd+jCrYR/AKLfQbubXuuvkqQh5yAAlapa36ICPXpEqKSSa9iRVhyCDRnd2+xrAosP3Iju ZcfY= X-Gm-Gg: ASbGnctLB4S2d1Uqx3//Os0JXvGug2SbolG8xVKdLcw6af8ugTTGSW8KVlDrYEFkLJG c+Qh50VYa5hDZCYVd175NPim5jSs51F5H959sB27vKfHdtM5NkT+NcnzguDMTQr7JbF7YODsxew erNp7cBuIh9MbdAhNipecu/S7IKZLS6VNGzs8P5w2cWuPLbMykSKYG1q0UH/iNpq0Mu9NLM8rbv Mk2OTTdKXy5EE/ePjW/wXPTF4rLYOYrWbL1vscE74g9WYdAbDdl+ckxSl76yHTbYQLtl+0ua4f/ koXRbo3ppd6dDHDkZqBC8LABgQwm1v6e71sy1VbnOA2gUDqm3TN5J9vLzAud2nCYeumQTJLRgkk VQBnzr1QqNvBe/yyDFovYNA== X-Google-Smtp-Source: AGHT+IH2Uvs3C28INtw50B4hDTcoLQDCqOCwkTwskCWvvzMHEFN3yxsWviLcpR4nggkdIORZaiiysw== X-Received: by 2002:a05:6512:691:b0:545:93b:30c3 with SMTP id 2adb3069b0e04-54c2277878emr1126378e87.18.1743784198779; Fri, 04 Apr 2025 09:29:58 -0700 (PDT) Received: from localhost.localdomain (87-100-218-141.bb.dnainternet.fi. [87.100.218.141]) by smtp.gmail.com with ESMTPSA id 2adb3069b0e04-54c1e671f54sm469786e87.228.2025.04.04.09.29.58 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 04 Apr 2025 09:29:58 -0700 (PDT) From: Mikko Rapeli To: openembedded-core@lists.openembedded.org Cc: Mikko Rapeli Subject: [PATCH v3 08/11] test_efi_plugin_plain_systemd-boot: don't set console Date: Fri, 4 Apr 2025 19:29:29 +0300 Message-ID: <20250404162932.447699-9-mikko.rapeli@linaro.org> X-Mailer: git-send-email 2.49.0 In-Reply-To: <20250404162932.447699-1-mikko.rapeli@linaro.org> References: <20250404162932.447699-1-mikko.rapeli@linaro.org> MIME-Version: 1.0 List-Id: X-Webhook-Received: from li982-79.members.linode.com [45.33.32.79] by aws-us-west-2-korg-lkml-1.web.codeaurora.org with HTTPS for ; Fri, 04 Apr 2025 16:30:04 -0000 X-Groupsio-URL: https://lists.openembedded.org/g/openembedded-core/message/214359 This effectively disables the boot time serial console so that kernel and initrd logs are not visible which makes debugging boot failures hard. The logs are not too verbose, around 270 lines, and can be reduced with kernel side settings if needed. For example "loglevel=4" on kernel command line reduces the output to only warning messages. Signed-off-by: Mikko Rapeli --- meta-selftest/wic/test_efi_plugin_plain_systemd-boot.wks | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/meta-selftest/wic/test_efi_plugin_plain_systemd-boot.wks b/meta-selftest/wic/test_efi_plugin_plain_systemd-boot.wks index 2745c19e85..83f136ac15 100644 --- a/meta-selftest/wic/test_efi_plugin_plain_systemd-boot.wks +++ b/meta-selftest/wic/test_efi_plugin_plain_systemd-boot.wks @@ -2,4 +2,4 @@ part /boot --source bootimg-efi --sourceparams="loader=systemd-boot,initrd=${INITRAMFS_IMAGE}-${MACHINE}.${INITRAMFS_FSTYPES}" --active --align 1024 --use-uuid part / --source rootfs --fstype=ext4 --align 1024 --use-uuid -bootloader --timeout=0 --append="console=ttyS0,115200n8" +bootloader --timeout=0 From patchwork Fri Apr 4 16:29:30 2025 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Mikko Rapeli X-Patchwork-Id: 60730 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from aws-us-west-2-korg-lkml-1.web.codeaurora.org (localhost.localdomain [127.0.0.1]) by smtp.lore.kernel.org (Postfix) with ESMTP id AC82DC369A5 for ; Fri, 4 Apr 2025 16:30:04 +0000 (UTC) Received: from mail-lf1-f48.google.com (mail-lf1-f48.google.com [209.85.167.48]) by mx.groups.io with SMTP id smtpd.web11.1444.1743784201614315947 for ; Fri, 04 Apr 2025 09:30:01 -0700 Authentication-Results: mx.groups.io; dkim=pass header.i=@linaro.org header.s=google header.b=vxGH+t6I; spf=pass (domain: linaro.org, ip: 209.85.167.48, mailfrom: mikko.rapeli@linaro.org) Received: by mail-lf1-f48.google.com with SMTP id 2adb3069b0e04-5493b5bc6e8so2671366e87.2 for ; Fri, 04 Apr 2025 09:30:01 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1743784200; x=1744389000; darn=lists.openembedded.org; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to; bh=4ALVr6r/uvKn6zuQDHQgIRccVCwpoa+Tg3F1piZ4GOo=; b=vxGH+t6IIuSQwnwjAEZL2ojhVXY1/2oSPncJkgWLTLLoNdkvCfTYEtd2WgqKEWqD6O SB6Lc9+48zGB0LmXwRkmG8HeANgP+riXpqbAsVbPd94KG0Gh6q/vznsib4N16QOFwmUo /PH8IzFbabU22tLXblgwYPohQrO4svosKuIt+yyax5y0PV8TVc9UdwtJoeMtDBSrU37z zkQ5JYDCRYreuKeVbRJ8jbeGhVrrZFARU2XKORhyXtzyb2MU1BlTSsG9lSZSXUSIhi8r rxmZvFR83iC3V4J5ykROJFlizgpYJ/r8GRXQNR+bqia9MixM54JGpszm9jHfIwJQO1kH yB/g== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1743784200; x=1744389000; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=4ALVr6r/uvKn6zuQDHQgIRccVCwpoa+Tg3F1piZ4GOo=; b=oqT7yzRHWihfU4hP+658w0IYl6JTdXwL69TBEEpwaSUY1hrft8WXcDxG42Vxz6yiq9 a6rLTWV1sNAqJ19s19HVUW1CRkR1QRHmBa5bDNENaFdWf4AQov6R3/DBs/uByEvXvRsK MAk8Wau9t9U6vQlkQ0YMR+hAsz2r8wHcbJf/Cq5pkdS6oEVwj6haGDvq2g+NIQgu+mOh PJjHRbHB8KwxOCU5P5rLyQke1K3oFyLzutN4yRKCEEFELt+SvA43GapvAQo9u5iKJrgU Mx/ZREOSHL3Wme/FrHCXM9XhgBow9P8OvnQ+eM9YG3KPyak5s/7HRBpGldc4M7Kcw2jd IiaQ== X-Gm-Message-State: AOJu0YwHtblc6unOIk6vq4Mnlb2Uguc9jsZYB0SKwSh+SGNkRhKP3BRZ HVeARso+QdPian2qsYrW+NTMh96uiWBkVbc6r3qHpgKcb8SOjgIMDSmDKcLkkhrGZvqcbjK11RD f1OQ= X-Gm-Gg: ASbGncsT4D2KAbfqjNwS8yNyDBO9uq+AE7H3xbpb712V2kR3IKHLDUmcEKHOU7NOQFl RefvqNo/ipplEKiN+VkcLZh+l3XuQLh0wfAqlT8WF89iz0lUZZXD2iB+zvYCSmET5ma4KctSV3W 7dxn4oroObQaFW1M1Tq7Z9yU2MmN9rXvofgnK04WraBthl8yjwtBr0Ybt/XZeBtfORPcWtxsPP5 ggQeb7bwY42b0DGy+uV1u6df9gdoBrSoi6CQbpn+qqNaXJkPq0/Xj1CgCyfoUFWi3KjhBgmr3hh IFsoBVI3tZAOYk5pSipOhhjFPdBiNrmleMX4Mtd7jnZvufzInP6PYL9pilvkgkTCkqza8K4uzGf U56j1GA/OWJM+S6gkSb0WiQ== X-Google-Smtp-Source: AGHT+IEIxqzm51A2GJMbf94Qz9yL69yRdwPQeHnqeBvrl3lGT8SSPJlHAictwrIySKrW+DL1t9L1DQ== X-Received: by 2002:a05:6512:398c:b0:545:3031:40aa with SMTP id 2adb3069b0e04-54c232c410cmr1000686e87.9.1743784199727; Fri, 04 Apr 2025 09:29:59 -0700 (PDT) Received: from localhost.localdomain (87-100-218-141.bb.dnainternet.fi. [87.100.218.141]) by smtp.gmail.com with ESMTPSA id 2adb3069b0e04-54c1e671f54sm469786e87.228.2025.04.04.09.29.59 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 04 Apr 2025 09:29:59 -0700 (PDT) From: Mikko Rapeli To: openembedded-core@lists.openembedded.org Cc: Mikko Rapeli Subject: [PATCH v3 09/11] image_types_wic.bbclass: capture verbose wic output by default Date: Fri, 4 Apr 2025 19:29:30 +0300 Message-ID: <20250404162932.447699-10-mikko.rapeli@linaro.org> X-Mailer: git-send-email 2.49.0 In-Reply-To: <20250404162932.447699-1-mikko.rapeli@linaro.org> References: <20250404162932.447699-1-mikko.rapeli@linaro.org> MIME-Version: 1.0 List-Id: X-Webhook-Received: from li982-79.members.linode.com [45.33.32.79] by aws-us-west-2-korg-lkml-1.web.codeaurora.org with HTTPS for ; Fri, 04 Apr 2025 16:30:04 -0000 X-Groupsio-URL: https://lists.openembedded.org/g/openembedded-core/message/214360 Call wic with --debug to capture logs from wic internals so that it's clear which partitions get created and which files get copied where. wic plugins contain for example race conditions which don't install files at all and thus images fail to boot and it's not possible to debug these without something in wic task logs. For example core-image-initramfs-boot do_image_wic log is now 576 lines which is not excessive but very important when debugging problems, especially race conditions which are only hit in some builds in CI. Signed-off-by: Mikko Rapeli --- meta/classes-recipe/image_types_wic.bbclass | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/meta/classes-recipe/image_types_wic.bbclass b/meta/classes-recipe/image_types_wic.bbclass index 1b422b6280..10888bc12b 100644 --- a/meta/classes-recipe/image_types_wic.bbclass +++ b/meta/classes-recipe/image_types_wic.bbclass @@ -72,7 +72,7 @@ IMAGE_CMD:wic () { if [ -z "$wks" ]; then bbfatal "No kickstart files from WKS_FILES were found: ${WKS_FILES}. Please set WKS_FILE or WKS_FILES appropriately." fi - BUILDDIR="${TOPDIR}" PSEUDO_UNLOAD=1 wic create "$wks" --vars "${STAGING_DIR}/${MACHINE}/imgdata/" -e "${IMAGE_BASENAME}" -o "$build_wic/" -w "$tmp_wic" ${WIC_CREATE_EXTRA_ARGS} + BUILDDIR="${TOPDIR}" PSEUDO_UNLOAD=1 wic create --debug "$wks" --vars "${STAGING_DIR}/${MACHINE}/imgdata/" -e "${IMAGE_BASENAME}" -o "$build_wic/" -w "$tmp_wic" ${WIC_CREATE_EXTRA_ARGS} # look to see if the user specifies a custom imager IMAGER=direct From patchwork Fri Apr 4 16:29:31 2025 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Mikko Rapeli X-Patchwork-Id: 60729 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from aws-us-west-2-korg-lkml-1.web.codeaurora.org (localhost.localdomain [127.0.0.1]) by smtp.lore.kernel.org (Postfix) with ESMTP id ABB50C369A1 for ; Fri, 4 Apr 2025 16:30:04 +0000 (UTC) Received: from mail-lf1-f48.google.com (mail-lf1-f48.google.com [209.85.167.48]) by mx.groups.io with SMTP id smtpd.web10.1477.1743784202759972476 for ; Fri, 04 Apr 2025 09:30:03 -0700 Authentication-Results: mx.groups.io; dkim=pass header.i=@linaro.org header.s=google header.b=T4NHk0dj; spf=pass (domain: linaro.org, ip: 209.85.167.48, mailfrom: mikko.rapeli@linaro.org) Received: by mail-lf1-f48.google.com with SMTP id 2adb3069b0e04-54b10594812so2543284e87.1 for ; Fri, 04 Apr 2025 09:30:02 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1743784201; x=1744389001; darn=lists.openembedded.org; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to; bh=GfS4TVgenKD6mOiWnq5dgV2GgU3Hd+vNNEhJ9l3PIuk=; b=T4NHk0djJHX4m8FhpBE0WksNmbkpgxankS0v+I07K2ATKW+9jI4PxKYvli+8Y7zIJi a7A4EBdo1R6gv309BL1HKg437ibBElzp3vASC9ISGhBbw/NASocFYxd+6l2Rop5Iluw+ mpBDfqr/vMqgtwj06n1xobZOgzmYxvArpf0wQmzwLJPiuGUobbsjucpQljGVOFVPeJLb G9rFZcz/WNcaeh6dXZTz3S0oWn0qU0OPCcgNG//VTLPJMnCELNcsDzBu5Nyv2xGNCXaV lQt1JBrL1F7rKk49JMqGa1uSBPmFDT5ZPx1Rnz6rBWeyQDp96Lj1/ATrdKap8N+6E3Ea Dc5w== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1743784201; x=1744389001; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=GfS4TVgenKD6mOiWnq5dgV2GgU3Hd+vNNEhJ9l3PIuk=; b=D10UP0gRccKNi0ZV+KC2sAjzmptvW5ukxik/0s7uvtfK6DgBRJzx9JHOs9H6rqNT1z HZZnFNhRDfxeozxZKRh3OjIohCQoHeViI1g+CTOVJJrb8NA/g2XHXiwmCAGJAO+FItEI o9XRoqgLcpS7E7P9NPvpqrnLb5nUFipHJoawn5OdQsUIn6u8QdrsNdDmi2WwGk/Bsb68 l68tgClGCkiYqJIHBDqO+2kok+0JEPErVymGUnIpdtYYR5Df1dt6NSP7uWhGY7qEg/pM fxKH558AOG1cQ9mop2ERjb58kt7Wf3dEM1FX9JzRza5nEHpcIPsEWZzvzDoxFivrIxAk OO9g== X-Gm-Message-State: AOJu0Yz0GWQj6aBqupr6jHIySYO8Y8CRyGbslCRGMAGBpHMMUR1CunV7 p/zxHBzNvDKNdV0S0yhk0a90AMMw54hnunXiR80w5SnnpkFMoSvwwUJ0m4SPLpd0Fmj8uea1QEM WWeA= X-Gm-Gg: ASbGncvSXdvkxEAvRiuVs8gg+gUD6dMwotL2DpfEMQJNl92BQGTyFL89KeJCGZBiC2y ImgOOVQRRGIh4iXkB10gvHfIO/UL29cqXJ7hbWoj1JM+Iy1vV8etzjKtQo8kx7jkdDCBZvnPg1t A4GvRlaPCnX5tl8sj3ohqLCezdj2ZeXHwn3uEb22BAFIJ7gYNyUWuya19iLgPb9JBBOyCb/EtcO /YVh8R9Cvo96Ir3mpanBtqF4gtqT3j8IKK08FHPHzbUbq0WFFZiup0AMjvNumXKkwVwSP81cwh1 VF07YiIYjVsyVZqqwv0sLtgFVb9QsDyGwQ7cz29BVF6CIm7Zpo9mAfu45OLm3RY5Cv96zgWDS9M r/sssgKj6mGG3AQjqm6QJhYBZjzzUa5TD X-Google-Smtp-Source: AGHT+IHJg61NMhSsjG+NIXkrqnN0q1xFjYug2+kEwVapmMfP9cPWxgWBiKM+zh1B1Iz4JYhP8/L6rA== X-Received: by 2002:a05:6512:4010:b0:545:b28:2fa2 with SMTP id 2adb3069b0e04-54c232bf03amr1168395e87.7.1743784200972; Fri, 04 Apr 2025 09:30:00 -0700 (PDT) Received: from localhost.localdomain (87-100-218-141.bb.dnainternet.fi. [87.100.218.141]) by smtp.gmail.com with ESMTPSA id 2adb3069b0e04-54c1e671f54sm469786e87.228.2025.04.04.09.30.00 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 04 Apr 2025 09:30:00 -0700 (PDT) From: Mikko Rapeli To: openembedded-core@lists.openembedded.org Cc: Mikko Rapeli Subject: [PATCH v3 10/11] wic bootimg-efi.py: fail build if no binaries installed Date: Fri, 4 Apr 2025 19:29:31 +0300 Message-ID: <20250404162932.447699-11-mikko.rapeli@linaro.org> X-Mailer: git-send-email 2.49.0 In-Reply-To: <20250404162932.447699-1-mikko.rapeli@linaro.org> References: <20250404162932.447699-1-mikko.rapeli@linaro.org> MIME-Version: 1.0 List-Id: X-Webhook-Received: from li982-79.members.linode.com [45.33.32.79] by aws-us-west-2-korg-lkml-1.web.codeaurora.org with HTTPS for ; Fri, 04 Apr 2025 16:30:04 -0000 X-Groupsio-URL: https://lists.openembedded.org/g/openembedded-core/message/214361 With systemd-boot, some builds included correct EFI bootloader binaries and some not. Thus some builds booted and some not. Check that some boot binary was installed so that build fails if none were installed. Signed-off-by: Mikko Rapeli --- scripts/lib/wic/plugins/source/bootimg-efi.py | 3 +++ 1 file changed, 3 insertions(+) diff --git a/scripts/lib/wic/plugins/source/bootimg-efi.py b/scripts/lib/wic/plugins/source/bootimg-efi.py index 96c710bf77..20b1c36a46 100644 --- a/scripts/lib/wic/plugins/source/bootimg-efi.py +++ b/scripts/lib/wic/plugins/source/bootimg-efi.py @@ -341,6 +341,9 @@ class BootimgEFIPlugin(SourcePlugin): cp_cmd = "cp -v -p %s/%s %s/EFI/BOOT/%s" % (kernel_dir, mod, hdddir, mod[8:]) out = exec_cmd(cp_cmd, True) logger.debug("systemd-boot files:\n%s" % out) + # must have installed at least one EFI bootloader + out = exec_cmd("ls %s/EFI/BOOT/boot*.efi" % (hdddir), True) + logger.debug("Installed systemd-boot files:\n%s" % out) elif source_params['loader'] == 'uefi-kernel': kernel = get_bitbake_var("KERNEL_IMAGETYPE") if not kernel: From patchwork Fri Apr 4 16:29:32 2025 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Mikko Rapeli X-Patchwork-Id: 60727 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from aws-us-west-2-korg-lkml-1.web.codeaurora.org (localhost.localdomain [127.0.0.1]) by smtp.lore.kernel.org (Postfix) with ESMTP id 9CA78C369A2 for ; Fri, 4 Apr 2025 16:30:04 +0000 (UTC) Received: from mail-lf1-f42.google.com (mail-lf1-f42.google.com [209.85.167.42]) by mx.groups.io with SMTP id smtpd.web10.1480.1743784203758427791 for ; Fri, 04 Apr 2025 09:30:04 -0700 Authentication-Results: mx.groups.io; dkim=pass header.i=@linaro.org header.s=google header.b=YJtfHorU; spf=pass (domain: linaro.org, ip: 209.85.167.42, mailfrom: mikko.rapeli@linaro.org) Received: by mail-lf1-f42.google.com with SMTP id 2adb3069b0e04-54addb5a139so2500882e87.0 for ; Fri, 04 Apr 2025 09:30:03 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1743784202; x=1744389002; darn=lists.openembedded.org; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to; bh=7I96RY5HJq72tfigXOgg6a/AbJBsfULA6D40J4yHnXY=; b=YJtfHorUwrIMY9FUTHiw+dStdm7M3PAywA5CEZXK2KlgtDgmLAC+PAwEfcTn8MRx+/ RBl1DnbIkAoAajRGyoYKt7nxLmZ6QVRiJDS0rWlEYXbVoyiQ0/sOtQy/ZuS5e+Ul+hXw pTGBd8enCllUk4EW1aFyvuFbFcG7s13dIklGwVNYzRjb5qXbIRQ7tiO+BUfJfXQYmI1R DPeiUekStKnKoONdrEDmXvvguOe3kzwlJ2OPWqgC71IpwdrGKTEv+k/DuWDHu0P54ZdU 7ajmAhjn4clkBS9d7dWWGMiGtoJXYAXd4CsD5m7Yxl4EFHeo5gs5ts5eh+FPA4h5ONyf SJWQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1743784202; x=1744389002; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=7I96RY5HJq72tfigXOgg6a/AbJBsfULA6D40J4yHnXY=; b=MmDEGv0GcFt4sIgfiNnDDYed2R1Fmb8pwp1mpBnwmzjwKqYWJ/tHOygtc6jJoaPaS0 xug6qOOQnNFrbbdu2aYuGPV9ynasbGuwoBwjHbahBNakMpsOj1J/GP4fDNvkmLd5l1LH AQcn7FZHa51dWAdPRFQgUfp3WvbyN0fNVG1XGkAvN09jeBnvI/YQSauTrWgWTnV1RshG 3R6uWuluie0eZIvV+Uy64iRg5FbEiATtnE7eNg2kjawlESF1yDZaSfPFfG+46IiIjxq/ eAmqbpRMZ0jLdzJrZwTu+LTuBeTw7ObnQiYKTIQQiPOUd84Q2qOTUi8VU0ZeXdNor6m8 OvWw== X-Gm-Message-State: AOJu0Yxh4RyrswuSuyILVDy7aOEo0cIBpnOyCa4oR9juLRKOeErMR64C KH4/C0Fq/IwPXlzyAfoxKYMWgapgyJJ6bJPzs+k4QHzifbp7B+GavPNTJnV95svSHAeXD0c5bNo +dBM= X-Gm-Gg: ASbGnctYynor4GV4gcGnkjaJ8YHE0tjZGZ/CVRi+zgJ+vjXYhef5fGAdzbsaMumSy61 K8U0kWbEFvld3w/JQgNiZnEEICA1G9m6T6CEOrf9zMm6gcylPsLt55OduXibZmn431u+/QiLyhM 5/tSY2cblz6uXpH5EmftsFcv5RAok92oT7O7lwXg/nKORkUt7ZW3kmpdQ65S/8SLgaU6VfyKpkG zHcqSCmTdH+dpSHhkqlp7E9NBvF0okRaf/Iu5y/5XrvtBd8uUXkKe+YUYvC2aBSlzkTAti5Y2/P 0j8CRT6+LbieSDSjh/IZkeduKKxNKn1rPqpVlpb4nxgaRVnRsGPbPwSqJI7VIZss8CxN9+uoTop QdDpMcODOCb5sLIY6MH+EnQ== X-Google-Smtp-Source: AGHT+IGe5o0LnQEbOJ4doJe1VB5mGrbSb4dRKIfRcUWZhD7nH/s1LpxequWwYGtzBf4q//JH8LXjWA== X-Received: by 2002:a05:6512:a8b:b0:549:38d5:8858 with SMTP id 2adb3069b0e04-54c22776e8emr1168638e87.20.1743784201871; Fri, 04 Apr 2025 09:30:01 -0700 (PDT) Received: from localhost.localdomain (87-100-218-141.bb.dnainternet.fi. [87.100.218.141]) by smtp.gmail.com with ESMTPSA id 2adb3069b0e04-54c1e671f54sm469786e87.228.2025.04.04.09.30.01 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 04 Apr 2025 09:30:01 -0700 (PDT) From: Mikko Rapeli To: openembedded-core@lists.openembedded.org Cc: Mikko Rapeli Subject: [PATCH v3 11/11] image_types_wic.bbclass: depend on grub-efi and systemd-boot on aarch64, systemd-boot on arm Date: Fri, 4 Apr 2025 19:29:32 +0300 Message-ID: <20250404162932.447699-12-mikko.rapeli@linaro.org> X-Mailer: git-send-email 2.49.0 In-Reply-To: <20250404162932.447699-1-mikko.rapeli@linaro.org> References: <20250404162932.447699-1-mikko.rapeli@linaro.org> MIME-Version: 1.0 List-Id: X-Webhook-Received: from li982-79.members.linode.com [45.33.32.79] by aws-us-west-2-korg-lkml-1.web.codeaurora.org with HTTPS for ; Fri, 04 Apr 2025 16:30:04 -0000 X-Groupsio-URL: https://lists.openembedded.org/g/openembedded-core/message/214362 On x86 family builds, grub and systemd-boot are always included and thus get built and deployed before wic image builds. On aarch64 builds that was not the case. Result is that some builds added systemd-boot binaries to the wic image ESP partition and some not, though bugs in wic plugins contributed here too since missing files were silently ignored. Boot of such images fails since firmware is not able to load the default EFI binaries. Adding EFI_PROVIDER to WKS_FILE_DEPENDS_BOOTLOADERS is not possible because of parsing order so adding grub-efi and systemd-boot to aarch64 and systemd-boot to arm depends which makes sure their do_deploy is always executed before wic image is generated. Thus systemd-boot and grub binaries will get copied from deploy directory to the wic image ESP partition, and boot of the images succeeds. Signed-off-by: Mikko Rapeli --- meta/classes-recipe/image_types_wic.bbclass | 2 ++ 1 file changed, 2 insertions(+) diff --git a/meta/classes-recipe/image_types_wic.bbclass b/meta/classes-recipe/image_types_wic.bbclass index 10888bc12b..b2f450026d 100644 --- a/meta/classes-recipe/image_types_wic.bbclass +++ b/meta/classes-recipe/image_types_wic.bbclass @@ -113,6 +113,8 @@ WKS_FILE_DEPENDS_DEFAULT += "bmaptool-native cdrtools-native btrfs-tools-native # Unified kernel images need objcopy WKS_FILE_DEPENDS_DEFAULT += "virtual/cross-binutils" WKS_FILE_DEPENDS_BOOTLOADERS = "" +WKS_FILE_DEPENDS_BOOTLOADERS:aarch64 = "grub-efi systemd-boot" +WKS_FILE_DEPENDS_BOOTLOADERS:arm = "systemd-boot" WKS_FILE_DEPENDS_BOOTLOADERS:x86 = "syslinux grub-efi systemd-boot os-release" WKS_FILE_DEPENDS_BOOTLOADERS:x86-64 = "syslinux systemd-boot os-release" WKS_FILE_DEPENDS_BOOTLOADERS:x86-x32 = "syslinux grub-efi"