From patchwork Thu Sep 19 14:36:55 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Mikko Rapeli X-Patchwork-Id: 49311 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 20619CF3950 for ; Thu, 19 Sep 2024 14:37:34 +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.21243.1726756650354258995 for ; Thu, 19 Sep 2024 07:37:30 -0700 Authentication-Results: mx.groups.io; dkim=pass header.i=@linaro.org header.s=google header.b=DDJvEHEx; 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-5356bb55224so1340532e87.0 for ; Thu, 19 Sep 2024 07:37:30 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1726756648; x=1727361448; 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=y7o+gnznbqn5KpDoFPpylEINQPs1ltBErWP66Vkg2T4=; b=DDJvEHExVfNTbAj6hycFK7W3okDGGZ/pIgfKmGGg49xftTgcQ3lerH694jnXc61Ssy 5tTZaJEii4fEMby25msSb1GDanc3RFJ9Xz1yeQuXFvFlzHTN3Kxn8ZWJNKKU0vgY2H7O jRKuz5NpwVXDBooEjLcSGWe7uBIWWeFaL5uj4efMvAdFob3AbFfMw5kwOKRq8oo80Stf gEOOd1riOf6fNG/dIQ/ilJFrouLHBlyZLM+zuT6MGEoQT5FYqV3DU8XAUcfm73wz8SqS 67w2Ug/LyYgXBk/Q/wDhxP4Iz/70XJnGxUhunPtJW/1dPzPO6UdQat98iL+7UN8uWLMy cCsw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1726756648; x=1727361448; 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=y7o+gnznbqn5KpDoFPpylEINQPs1ltBErWP66Vkg2T4=; b=xPVx4bkmpQzfVvS19PZrq1rdNIuLnv80HVn2QvSc1NyVSulgWWZZp/3kKxEL63+NGC yjIROjupyrPb6647r9bhbCSU6Lg8wV8mbmmS465yDGVsaSiNaXTRi7aWCBJSgO4fDT1S eCk1vwUv0SJ3T9d+a+/3nh+QROVLyY1R3VRU71RJD4uq7TbEeQOELMlO6FFG0KUYMakz NTr6/C6SRXyoMdcXHRf3g6OgmaqN4QvbKpMuUWeIZ/rlGKBBeIx60G0d7OU8EQd4ctc4 2JuQtm2o7nUiIw6jzw3yZfCv4bBUXBtvjoIrq+fkLwOkQWD0aixZWMbwcTo1Tm2UfoxD IvXg== X-Gm-Message-State: AOJu0YwAYKsWm+kFl0YCCp4MhtPRklgXMukFq49rmFahDvh7i7EzsLUT 9ScBjK+xvnydCIa+7k87r8cgvWKMf2spjAaCAmATnGlM1O9ppEd4CfUx1sq9Ein+Wx6SDPFLoF5 wsv8= X-Google-Smtp-Source: AGHT+IF0v4Yid34wfENhAbE2E5Z1YSEfCZtHiq0vV9rtXTCRlzLHZDj5F0S2QX/mdD6MkyxDkdWVMA== X-Received: by 2002:a05:6512:3e1a:b0:52e:76d5:9504 with SMTP id 2adb3069b0e04-53678faaed7mr16405772e87.3.1726756648394; Thu, 19 Sep 2024 07:37:28 -0700 (PDT) Received: from localhost.localdomain (87-100-245-199.bb.dnainternet.fi. [87.100.245.199]) by smtp.gmail.com with ESMTPSA id 2adb3069b0e04-536870a8721sm1889194e87.232.2024.09.19.07.37.27 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 19 Sep 2024 07:37:27 -0700 (PDT) From: Mikko Rapeli To: openembedded-core@lists.openembedded.org Cc: Mikko Rapeli Subject: [PATCH v3 01/12] python3-pefile: add recipe from meta-openembedded Date: Thu, 19 Sep 2024 17:36:55 +0300 Message-ID: <20240919143706.6074-2-mikko.rapeli@linaro.org> X-Mailer: git-send-email 2.45.2 In-Reply-To: <20240919143706.6074-1-mikko.rapeli@linaro.org> References: <20240919143706.6074-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 ; Thu, 19 Sep 2024 14:37:34 -0000 X-Groupsio-URL: https://lists.openembedded.org/g/openembedded-core/message/204693 It is needed by systemd ukify tool and uki.bbclass to generate UEFI boot binaries. Signed-off-by: Mikko Rapeli --- .../python/python3-pefile/run-ptest | 3 ++ .../python/python3-pefile_2023.2.7.bb | 28 +++++++++++++++++++ 2 files changed, 31 insertions(+) create mode 100644 meta/recipes-devtools/python/python3-pefile/run-ptest create mode 100644 meta/recipes-devtools/python/python3-pefile_2023.2.7.bb diff --git a/meta/recipes-devtools/python/python3-pefile/run-ptest b/meta/recipes-devtools/python/python3-pefile/run-ptest new file mode 100644 index 0000000000..95ae72306f --- /dev/null +++ b/meta/recipes-devtools/python/python3-pefile/run-ptest @@ -0,0 +1,3 @@ +#!/bin/sh + +pytest --automake --ignore=./tests/pefile_test.py diff --git a/meta/recipes-devtools/python/python3-pefile_2023.2.7.bb b/meta/recipes-devtools/python/python3-pefile_2023.2.7.bb new file mode 100644 index 0000000000..e30b362323 --- /dev/null +++ b/meta/recipes-devtools/python/python3-pefile_2023.2.7.bb @@ -0,0 +1,28 @@ +SUMMARY = "Python PE parsing module" +DESCRIPTION = "A multi-platform Python module to parse and work with Portable Executable (PE) files." +HOMEPAGE = "https://github.com/erocarrera/pefile" +LICENSE = "MIT" +LIC_FILES_CHKSUM = "file://LICENSE;md5=38066667888b01d8118ff9cc23da1873" + +inherit setuptools3 ptest +SRCREV = "1ab2807c4eec16041e791d7a6acc68cc23fd5266" +SRC_URI = "git://github.com/erocarrera/pefile;branch=master;protocol=https \ + file://run-ptest" +S = "${WORKDIR}/git" + +BBCLASSEXTEND = "native nativesdk" + +do_install_ptest() { + install -d ${D}${PTEST_PATH}/tests + cp -rf ${S}/tests/* ${D}${PTEST_PATH}/tests/ +} + +RDEPENDS:${PN} += " \ + python3-mmap \ + python3-netclient \ + python3-stringold \ +" +RDEPENDS:${PN}-ptest += "\ + python3-pytest \ + python3-unittest-automake-output \ +" From patchwork Thu Sep 19 14:36:56 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Mikko Rapeli X-Patchwork-Id: 49310 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 EFE7DCF3945 for ; Thu, 19 Sep 2024 14:37:33 +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.21512.1726756653229442260 for ; Thu, 19 Sep 2024 07:37:33 -0700 Authentication-Results: mx.groups.io; dkim=pass header.i=@linaro.org header.s=google header.b=ecc3q6GJ; 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-536562739baso914698e87.1 for ; Thu, 19 Sep 2024 07:37:32 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1726756651; x=1727361451; 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=dMHKrlrsTVk0uUvK/TIRcDwWQtyRXn6XEb4zPPLaQRU=; b=ecc3q6GJnXpXpayTvy0rnE5HQ6N6T9JpAUkK8OqGitWaCpVn9cADKh7It2apN4mVl4 DaDIZWiUKdCvFHHcL4WOMw9da3dWDW1iNHqMB3iSGsghkTAurs9TcKww3d4fztpLTw9K wTQjfPNamLuHDROFYhJ5BUkz4+X4kLyiGRGawa8MqLzw993Fi7zgquudiXsq2Osy5hX/ itfMRcc0rdCyaQD43nCwBsXgzFp2o9VCs88jkHdA7Lgv9OTNrPXJP/w6b5hu52lTeYqs WGYsm4KUey1RogASWbwOxjLpfv57QB61hRHPCbzGpLsuYpgKwL1bwA+MwVSYcPgacNTL i2UA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1726756651; x=1727361451; 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=dMHKrlrsTVk0uUvK/TIRcDwWQtyRXn6XEb4zPPLaQRU=; b=j1tJtEmeN6j3SEYyW42Koq5xOK7TkknauXt1Ut/9kn1A8EfZ2eamaxyH1TXOlZ2yoh cDmr9I+RM8s0dFJ7xYkGIcyuQ600xZP8I19TCiwLzq7LCW/hABlAPA6M5hYxC/e+qOvw ybi5ejxcbEr9nvWhTqXb2zCD51VIWjjhJctU/oFWxe+Vs4J4J0v04UjxsL3ocvMSqjzD N5Z3yErAjGFjAs7uXGSmolvbZpS/GjQUbLr/wrE0tbwczxFEMLnHgOznxOUKWPPReqKO ADb+HSMH2NircemmRJmSuEH79UpEx91AccbVyWVMDsy7wJ2FDIo060/lkY/Q2lVTyA/j 7zcw== X-Gm-Message-State: AOJu0YzXqUoHoU2G/MwbcjJ/Je59n+H0trcJDDBtJkKpJJmE2BrdK3dF iK440dYUqaqsKzdshgwT2gIaswVNlJNXbDQqE8azr4ibZ+Dtd3uP/8LG+rIE9SFN+u5eWVLkHB+ MjBI= X-Google-Smtp-Source: AGHT+IEkD0Y9/ftx5e3xzkRlFOt8bjGLSxQxWuoC8/M4JZZ+2CHqBjEY7IOoUgO/ceRYjUDWk0GS4A== X-Received: by 2002:a05:6512:2345:b0:536:545f:3893 with SMTP id 2adb3069b0e04-53678ff5e83mr14645150e87.57.1726756651309; Thu, 19 Sep 2024 07:37:31 -0700 (PDT) Received: from localhost.localdomain (87-100-245-199.bb.dnainternet.fi. [87.100.245.199]) by smtp.gmail.com with ESMTPSA id 2adb3069b0e04-536870a8721sm1889194e87.232.2024.09.19.07.37.29 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 19 Sep 2024 07:37:29 -0700 (PDT) From: Mikko Rapeli To: openembedded-core@lists.openembedded.org Cc: Mikko Rapeli Subject: [PATCH v3 02/12] maintainers.inc: add python3-pefile Date: Thu, 19 Sep 2024 17:36:56 +0300 Message-ID: <20240919143706.6074-3-mikko.rapeli@linaro.org> X-Mailer: git-send-email 2.45.2 In-Reply-To: <20240919143706.6074-1-mikko.rapeli@linaro.org> References: <20240919143706.6074-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 ; Thu, 19 Sep 2024 14:37:33 -0000 X-Groupsio-URL: https://lists.openembedded.org/g/openembedded-core/message/204694 Recipe moved from meta-oe to oe-core and Khem Raj agreed to continue as maintainer. Signed-off-by: Mikko Rapeli --- meta/conf/distro/include/maintainers.inc | 1 + 1 file changed, 1 insertion(+) diff --git a/meta/conf/distro/include/maintainers.inc b/meta/conf/distro/include/maintainers.inc index 60f36a9449..b86c91c5d6 100644 --- a/meta/conf/distro/include/maintainers.inc +++ b/meta/conf/distro/include/maintainers.inc @@ -662,6 +662,7 @@ RECIPE_MAINTAINER:pn-python3-numpy = "Trevor Gamblin " RECIPE_MAINTAINER:pn-python3-packaging = "Tim Orling " RECIPE_MAINTAINER:pn-python3-pathspec = "Ross Burton " RECIPE_MAINTAINER:pn-python3-pbr = "Zang Ruochen " +RECIPE_MAINTAINER:pn-python3-pefile = "Khem Raj " RECIPE_MAINTAINER:pn-python3-pip = "Zang Ruochen " RECIPE_MAINTAINER:pn-python3-pluggy = "Tim Orling " RECIPE_MAINTAINER:pn-python3-ply = "Tim Orling " From patchwork Thu Sep 19 14:36:57 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Mikko Rapeli X-Patchwork-Id: 49312 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 D45D0CF3951 for ; Thu, 19 Sep 2024 14:37:43 +0000 (UTC) Received: from mail-lf1-f51.google.com (mail-lf1-f51.google.com [209.85.167.51]) by mx.groups.io with SMTP id smtpd.web10.21245.1726756656475997387 for ; Thu, 19 Sep 2024 07:37:36 -0700 Authentication-Results: mx.groups.io; dkim=pass header.i=@linaro.org header.s=google header.b=FtNFqPjb; spf=pass (domain: linaro.org, ip: 209.85.167.51, mailfrom: mikko.rapeli@linaro.org) Received: by mail-lf1-f51.google.com with SMTP id 2adb3069b0e04-5356bb5522bso1149481e87.1 for ; Thu, 19 Sep 2024 07:37:36 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1726756655; x=1727361455; 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=mJ/knW2N7PVRDDB5R+brL7z9Erq/BRnXkTj06+QJIXc=; b=FtNFqPjbh0Y20ULPsKa6YdMAFwOOjL6LRrDohklUq2W+4YxJX5z9DkzR5MfZVnf3Gx SFuz+yBWPf+DY8YwlvA+djdYKAltP9DwdAL3FBF+PZ4Dh0JqnPmBkm9g003HaM209kpQ V74XO7sRB5kGo3rRHoqlDmMPRWwhiBSElusQ/Y2DUvm2txxtLAV+svNT+wQv9IF2TWTM 52FagYAfhplyOSH2BvSH3mEsoWpJi80T6md3jSda4bcR1XpAMU6s7Mb1JN35phcEptAB T7AuIZK9Z/K0D61kXFWcUelcQYNVm1stcaCCz78M4Vp1BOMa54OWOxvlI2fb0ogR9LZ6 hWmA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1726756655; x=1727361455; 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=mJ/knW2N7PVRDDB5R+brL7z9Erq/BRnXkTj06+QJIXc=; b=PewB3Et1CrezhE7laXNee+hpnD/edEr+jaVgfzpCtuU6s6eUzEmOkPbLuYBdpeKaET LDqxcQmQ9lYDnwIWNoDY4tK9YtKZSWjwdFf1fx55SXeLPF1GtDYqnna1pRQJUOGbj2i1 ffVcPWRh/HdJBMN00fYf+0MORWSiaiuno3yLEqKKcKnB0udGUo5dwnl4JRaPHjJpDMtt RaB4zlddk0V4IIbkNW9WT4U+RdOv1woqVPUz0dJPt2htio7ouvvQv/y5dSi+5eYBlxOU sJDLHn8PGuqC9sLEuIHIw6rVOg63+tmda+loJG7VXV8lWU81WGs4xSwO8JErQATOKX/u OOEQ== X-Gm-Message-State: AOJu0YxnnMYP2+GOOm9Ag4QaoLrN8VX9U3k7zaNUOOPFs+Cm7i1QQXoK 1bPKh3LaEYwbztOWKkk/htKyVeW3INdcOdvcCvmcdix6NlOU3Bb7iWuBglylc7e5wrn7kz3NTaB QYhU= X-Google-Smtp-Source: AGHT+IEUEXfMasVoJtwFkAblrY5nbyHUghLKstDSnpK+BnUKWZrWlTmZm/AYP9XofV0OMLFZSDQ1Ag== X-Received: by 2002:a05:6512:e9e:b0:52c:df6f:a66 with SMTP id 2adb3069b0e04-5367ff3291bmr12844950e87.58.1726756654509; Thu, 19 Sep 2024 07:37:34 -0700 (PDT) Received: from localhost.localdomain (87-100-245-199.bb.dnainternet.fi. [87.100.245.199]) by smtp.gmail.com with ESMTPSA id 2adb3069b0e04-536870a8721sm1889194e87.232.2024.09.19.07.37.32 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 19 Sep 2024 07:37:33 -0700 (PDT) From: Mikko Rapeli To: openembedded-core@lists.openembedded.org Cc: Mikko Rapeli Subject: [PATCH v3 03/12] systemd-boot-native: add runtime dependency to python3-pefile-native Date: Thu, 19 Sep 2024 17:36:57 +0300 Message-ID: <20240919143706.6074-4-mikko.rapeli@linaro.org> X-Mailer: git-send-email 2.45.2 In-Reply-To: <20240919143706.6074-1-mikko.rapeli@linaro.org> References: <20240919143706.6074-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 ; Thu, 19 Sep 2024 14:37:43 -0000 X-Groupsio-URL: https://lists.openembedded.org/g/openembedded-core/message/204695 It's needed to run the ukify script. Signed-off-by: Mikko Rapeli --- meta/recipes-core/systemd/systemd-boot-native_256.5.bb | 2 ++ 1 file changed, 2 insertions(+) diff --git a/meta/recipes-core/systemd/systemd-boot-native_256.5.bb b/meta/recipes-core/systemd/systemd-boot-native_256.5.bb index 73db59b14e..58db408dcf 100644 --- a/meta/recipes-core/systemd/systemd-boot-native_256.5.bb +++ b/meta/recipes-core/systemd/systemd-boot-native_256.5.bb @@ -13,3 +13,5 @@ addtask install after do_unpack PACKAGES = "${PN}" FILES:${PN} = "${bindir}/ukify" + +RDEPENDS:${PN} += "python3-pefile-native" From patchwork Thu Sep 19 14:36:58 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Mikko Rapeli X-Patchwork-Id: 49313 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 D4602CF3952 for ; Thu, 19 Sep 2024 14:37:43 +0000 (UTC) Received: from mail-lf1-f52.google.com (mail-lf1-f52.google.com [209.85.167.52]) by mx.groups.io with SMTP id smtpd.web10.21251.1726756661807644897 for ; Thu, 19 Sep 2024 07:37:42 -0700 Authentication-Results: mx.groups.io; dkim=pass header.i=@linaro.org header.s=google header.b=Cwg4jdcS; spf=pass (domain: linaro.org, ip: 209.85.167.52, mailfrom: mikko.rapeli@linaro.org) Received: by mail-lf1-f52.google.com with SMTP id 2adb3069b0e04-52f01b8738dso846837e87.1 for ; Thu, 19 Sep 2024 07:37:41 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1726756660; x=1727361460; 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=TY1LcLRkDV0dwoZOYgyz7hs4xM3PQA3/2P0EdgxcE/o=; b=Cwg4jdcSgpMJVoscBmEZF+2SjWtFjlAALdFCq7WFlUPauHnguPl2gSLpqCmR9tEATh S9ZZJzjVrl+Hz96sF6OphNCYOTPaNPX6hh3l9opsovCg+i05KlDZI/V7nUUtA9BYqSyJ iQQLsRAFJGVFHFL2BRmZMw6A4LhUmwEHQY87Kd16baPqdmKwWtg71AD9LOjd7/AbI9OX u3J4TEs54SvcNUjPmXYvaNaP49zrhdZDdYQ2oBt1euNBbX8kaVVp/K3yhkwflbXk6AO5 6ONqD2CJVaWWoSzg4awluH9BruIqEGfDf8/h0XusCTMtRSsm6uso2Yzxt4/C/VZP2lOj 9H7Q== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1726756660; x=1727361460; 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=TY1LcLRkDV0dwoZOYgyz7hs4xM3PQA3/2P0EdgxcE/o=; b=AUfbbsaSxE/vCAZl22vywdmOXdfBYFOUxgrwMGypL4KpP6wc8WmRAKzLnSkEMt5PPZ 68sgvkAWE3CFNzC8pM5s6CaQU3pF88HP1MlrP+sXGHp6ameXYp/ifF075neGTQNRTJwv atndV9hU/yXoNAkkC6u+ybsQ99KKfeaepvcNIAjDTz3NQ4WgoIePgAdl1+YRWL1z8v0T ss9I0huAQi/A8Tr9HEf8+1oxRCCwka017TG0ud5xxYqKiDsQhVf0dH8qtvtp6YYKiPya 4maRa4UAwgs8TdI2uKRuU5QqZFQJxRqbzk1JKKLtttzVirxuK1hgJSelLvPUnxDwcboE plGw== X-Gm-Message-State: AOJu0YymgJAToUVDGU8ogsS0l93JKEJOb30gckTnvqbWeoSPBdXkAvNv fzQk2CU6Tbm3Qym+i3MiQM4AFMRUdf8YZmVLxaJDhhIi0qFEzVhJbCZHe6yJSFSH1LbHmo3k+S6 PM8E= X-Google-Smtp-Source: AGHT+IG8+bjF6KKDu7swaBYdEbFoYJVZuIag9+aXJamqFQMjcyBmbiqmUNWz/j40EdDU+XQskD503A== X-Received: by 2002:a05:6512:3e02:b0:536:569b:a59c with SMTP id 2adb3069b0e04-53678fb1ed6mr14622987e87.4.1726756659792; Thu, 19 Sep 2024 07:37:39 -0700 (PDT) Received: from localhost.localdomain (87-100-245-199.bb.dnainternet.fi. [87.100.245.199]) by smtp.gmail.com with ESMTPSA id 2adb3069b0e04-536870a8721sm1889194e87.232.2024.09.19.07.37.35 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 19 Sep 2024 07:37:37 -0700 (PDT) From: Mikko Rapeli To: openembedded-core@lists.openembedded.org Cc: Michelle Lin , Erik Schilling , Mikko Rapeli Subject: [PATCH v3 04/12] uki.bbclass: add class for building Unified Kernel Images (UKI) Date: Thu, 19 Sep 2024 17:36:58 +0300 Message-ID: <20240919143706.6074-5-mikko.rapeli@linaro.org> X-Mailer: git-send-email 2.45.2 In-Reply-To: <20240919143706.6074-1-mikko.rapeli@linaro.org> References: <20240919143706.6074-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 ; Thu, 19 Sep 2024 14:37:43 -0000 X-Groupsio-URL: https://lists.openembedded.org/g/openembedded-core/message/204696 From: Michelle Lin This class calls systemd ukify tool, which will combine kernel/initrd/stub components to build the UKI. To sign the UKI (i.e. SecureBoot), the keys/cert files can be specified in a configuration file or UEFI binary signing can be done via separate steps, see qemuarm64-secureboot in meta-arm. UKIs are loaded by UEFI firmware on target which can improve security by loading only correctly signed kernel, initrd and kernel command line. Using systemd-measure to pre-calculate TPM PCR values and sign them is not supported since that requires a TPM device on the build host. Thus "ConditionSecurity=measured-uki" default from systemd 256 does not work but "ConditionSecurity=tpm2" in combination with secure boot will. These can be used to boot securely into systemd-boot, kernel, kernel command line and initrd which then securely mounts a read-only dm-verity /usr partition and creates a TPM encrypted read-write / rootfs. Tested via qemuarm64-secureboot in meta-arm with https://lists.yoctoproject.org/g/meta-arm/topic/patch_v3_02_13/108031399 and a few more changes needed, will be posted separately. Signed-off-by: Michelle Lin Acked-by: Erik Schilling Signed-off-by: Mikko Rapeli --- meta/classes-recipe/uki.bbclass | 197 ++++++++++++++++++++++++++++++++ 1 file changed, 197 insertions(+) create mode 100644 meta/classes-recipe/uki.bbclass diff --git a/meta/classes-recipe/uki.bbclass b/meta/classes-recipe/uki.bbclass new file mode 100644 index 0000000000..fac50ea8ca --- /dev/null +++ b/meta/classes-recipe/uki.bbclass @@ -0,0 +1,197 @@ +# Unified kernel image (UKI) class +# +# This bbclass merges kernel, initrd etc as a UKI standard UEFI binary, +# to be loaded with UEFI firmware and systemd-boot on target HW. +# TPM PCR pre-calculation is not supported since systemd-measure tooling +# is meant to run on target, not in cross compile environment. +# +# See: +# https://www.freedesktop.org/software/systemd/man/latest/ukify.html +# https://uapi-group.org/specifications/specs/unified_kernel_image/ +# +# The UKI contains: +# +# - UEFI stub +# The linux kernel can generate a UEFI stub, however the one from systemd-boot can fetch +# the command line from a separate section of the EFI application, avoiding the need to +# rebuild the kernel. +# - kernel +# - initramfs +# - kernel command line +# - uname -r kernel version +# - /etc/os-release to create a boot menu with version details +# - optionally secure boot signature(s) +# - other metadata (e.g. TPM PCR measurements) +# +# Usage instructions: +# +# - requires UEFI compatible firmware on target, e.g. qemuarm64-secureboot u-boot based +# from meta-arm or qemux86 ovmf/edk2 based firmware for x86_64 +# +# - Distro/build config: +# +# INIT_MANAGER = "systemd" +# MACHINE_FEATURES:append = " efi" +# DISTRO_FEATURES:append = " systemd" +# DISTRO_FEATURES_NATIVE:append = " systemd" +# EFI_PROVIDER = "systemd-boot" +# INITRAMFS_IMAGE = "core-image-minimal-initramfs" +# +# - image recipe: +# +# inherit uki +# +# - qemuboot/runqemu changes in image recipe or build config: +# +# # Kernel command line must be inside the signed uki +# QB_KERNEL_ROOT = "" +# # kernel is in the uki image, not loaded separately +# QB_DEFAULT_KERNEL = "none" +# +# - for UEFI secure boot, systemd-boot and uki (including kernel) can +# be signed but require sbsign-tool-native (recipe available from meta-secure-core, +# see also qemuarm64-secureboot from meta-arm). Set variable +# UKI_SB_KEY to path of private key and UKI_SB_CERT for certificate. +# Note that systemd-boot also need to be signed with the same key. +# +# - at runtime, UEFI firmware will load and boot systemd-boot which +# creates a menu from all detected uki binaries. No need to manually +# setup boot menu entries. +# +# - see efi-uki-bootdisk.wks.in how to create ESP partition which hosts systemd-boot, +# config file(s) for systemd-boot and the UKI binaries. +# + +DEPENDS += "\ + os-release \ + systemd-boot \ + systemd-boot-native \ + virtual/${TARGET_PREFIX}binutils \ + virtual/kernel \ +" + +inherit image-artifact-names +require ../conf/image-uefi.conf + +INITRAMFS_IMAGE ?= "core-image-minimal-initramfs" + +INITRD_ARCHIVE ?= "${INITRAMFS_IMAGE}-${MACHINE}.${INITRAMFS_FSTYPES}" + +do_image_complete[depends] += "${INITRAMFS_IMAGE}:do_image_complete" + +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}" +# secure boot keys and cert, needs sbsign-tools-native (meta-secure-core) +#UKI_SB_KEY ?= "" +#UKI_SB_CERT ?= "" + +IMAGE_EFI_BOOT_FILES ?= "${UKI_FILENAME};EFI/Linux/${UKI_FILENAME}" + +do_uki[depends] += " \ + systemd-boot:do_deploy \ + virtual/kernel:do_deploy \ + " +do_uki[depends] += "${@ '${INITRAMFS_IMAGE}:do_image_complete' if d.getVar('INITRAMFS_IMAGE') else ''}" + +# ensure that the build directory is empty everytime we generate a newly-created uki +do_uki[cleandirs] = "${B}" +# influence the build directory at the start of the builds +do_uki[dirs] = "${B}" + +# we want to allow specifying files in SRC_URI, such as for signing the UKI +python () { + d.delVarFlag("do_fetch","noexec") + d.delVarFlag("do_unpack","noexec") +} + +# main task +python do_uki() { + import glob + import bb.process + + # base ukify command, can be extended if needed + ukify_cmd = d.getVar('UKIFY_CMD') + + deploy_dir_image = d.getVar('DEPLOY_DIR_IMAGE') + + # architecture + target_arch = d.getVar('EFI_ARCH') + if target_arch: + ukify_cmd += " --efi-arch %s" % (target_arch) + + # systemd stubs + stub = "%s/linux%s.efi.stub" % (d.getVar('DEPLOY_DIR_IMAGE'), target_arch) + if not os.path.exists(stub): + bb.fatal(f"ERROR: cannot find {stub}.") + ukify_cmd += " --stub %s" % (stub) + + # initrd + initramfs_image = "%s" % (d.getVar('INITRD_ARCHIVE')) + ukify_cmd += " --initrd=%s" % (os.path.join(deploy_dir_image, initramfs_image)) + + deploy_dir_image = d.getVar('DEPLOY_DIR_IMAGE') + + # kernel + kernel_filename = d.getVar('UKI_KERNEL_FILENAME') or None + if kernel_filename: + kernel = "%s/%s" % (deploy_dir_image, kernel_filename) + if not os.path.exists(kernel): + bb.fatal(f"ERROR: cannot find %s" % (kernel)) + ukify_cmd += " --linux=%s" % (kernel) + # not always needed, ukify can detect version from kernel binary + kernel_version = d.getVar('KERNEL_VERSION') + if kernel_version: + ukify_cmd += "--uname %s" % (kernel_version) + else: + bb.fatal("ERROR - UKI_KERNEL_FILENAME not set") + + # command line + cmdline = d.getVar('UKI_CMDLINE') + if cmdline: + ukify_cmd += " --cmdline='%s'" % (cmdline) + + # dtb + if d.getVar('KERNEL_DEVICETREE'): + for dtb in d.getVar('KERNEL_DEVICETREE').split(): + dtb_path = "%s/%s" % (deploy_dir_image, dtb) + if not os.path.exists(dtb_path): + bb.fatal(f"ERROR: cannot find {dtb_path}.") + ukify_cmd += " --devicetree %s" % (dtb_path) + + # custom config for ukify + if os.path.exists(d.getVar('UKI_CONFIG_FILE')): + ukify_cmd += " --config=%s" % (d.getVar('UKI_CONFIG_FILE')) + + # systemd tools + ukify_cmd += " --tools=%s%s/lib/systemd/tools" % \ + (d.getVar("RECIPE_SYSROOT_NATIVE"), d.getVar("prefix")) + + # version + ukify_cmd += " --os-release=@%s%s/lib/os-release" % \ + (d.getVar("RECIPE_SYSROOT"), d.getVar("prefix")) + + # TODO: tpm2 measure for secure boot, depends on systemd-native and TPM tooling + # needed in systemd > 254 to fulfill ConditionSecurity=measured-uki + # Requires TPM device on build host, thus not supported at build time. + #ukify_cmd += " --measure" + + # securebooot signing, also for kernel + key = d.getVar('UKI_SB_KEY') + if key: + ukify_cmd += " --sign-kernel --secureboot-private-key='%s'" % (key) + cert = d.getVar('UKI_SB_CERT') + if cert: + ukify_cmd += " --secureboot-certificate='%s'" % (cert) + + # custom output UKI filename + output = " --output=%s/%s" % (d.getVar('DEPLOY_DIR_IMAGE'), d.getVar('UKI_FILENAME')) + ukify_cmd += " %s" % (output) + + # Run the ukify command + bb.warn("uki: running command: %s" % (ukify_cmd)) + bb.process.run(ukify_cmd, shell=True) +} +addtask uki after do_rootfs before do_deploy do_image_complete do_image_wic From patchwork Thu Sep 19 14:36:59 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Mikko Rapeli X-Patchwork-Id: 49316 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 CF7BECF3953 for ; Thu, 19 Sep 2024 14:37:53 +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.web10.21254.1726756663627106446 for ; Thu, 19 Sep 2024 07:37:43 -0700 Authentication-Results: mx.groups.io; dkim=pass header.i=@linaro.org header.s=google header.b=poA9ML7Z; 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-5365cf5de24so1200158e87.1 for ; Thu, 19 Sep 2024 07:37:43 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1726756662; x=1727361462; 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=DJNo4wGhLEtqK+sIgiiDtzQuGcRIfZ4uZOnsGWSPLew=; b=poA9ML7ZjoBz0kPwZzgXn41qb/wDPEYwgir+6qTyPvQ0HDZ92K+TSXwbLxCN+eazez Hpy8ENlBmzNVqgA/Ys4ACrL7DdkSqoAC87b4p/VPrMFqvG2xbMjecaeFOmoe2Up3o0yf WrATtBbw8sOfJUE9ydKIRFURbxvmllyGw3589X1p2hVwK6dcrXeEPXoHdJ+A5Kv/mN7d Yi4xhHB+VjGWnQPsSSlORXji961Lex8QFMr9qlXg4eygcyu1ALrjulXlVhKtlPJT9Htc sV6OgYfvpR5UyMmilspuqAG6mGvhhJGg5rF3OgW0xPm4Y76+JYN9vISONFmkcU4I8s/s SPFA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1726756662; x=1727361462; 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=DJNo4wGhLEtqK+sIgiiDtzQuGcRIfZ4uZOnsGWSPLew=; b=cfr2sDIT04h+FFNJhjEIf8BDz+mpGN45xgodv93qQFc31h6Jv1QT3gU4cNrT9Saif6 WPE2Y6JaehGntOYlpzMYfeBiXx3haBElyLuJEXwVPVjDq0bPfybBr7BmQQ7RIQHOnpJi Ib40YvuaeoyTxJ86AM9xZ+u+FTqen1TIY+5dQVGmogW7Hf6QVT0+TzZzseFfUgi24I9V Jb82MDkZmqI/AmyQGHV5Sx6e6rAuqAXxGg8SePwAWfcky2Ap3HBXcodNTcCvBpMsi+Jq Kfgd4Hb5XxnCURo8DE607kiqh7Jj+xllu96D1DOfTu5kvduocaDu6jEpGWmc9AlmvW3E WN0w== X-Gm-Message-State: AOJu0YyTOsvi5TKK9kjWmajU7eCv3jLvVuj7AGxkBmI4Rja7gB5/DtDl xS1yRggn21AFrAWMvzrCGcp7cGr92lvIZR/xEWAKdfpFZNRC0xXX7qKMHcpx+jnQepHNnNCVdkJ xQSo= X-Google-Smtp-Source: AGHT+IH/PCZ5UqdPSWb/L1chRcf2TaE4QmVLKfBVBx9LiPgcq3IeVmHGx03TTIhmVaiNOnNYm/AR2g== X-Received: by 2002:a05:6512:220c:b0:52f:df:db40 with SMTP id 2adb3069b0e04-53678fec496mr13470487e87.56.1726756661669; Thu, 19 Sep 2024 07:37:41 -0700 (PDT) Received: from localhost.localdomain (87-100-245-199.bb.dnainternet.fi. [87.100.245.199]) by smtp.gmail.com with ESMTPSA id 2adb3069b0e04-536870a8721sm1889194e87.232.2024.09.19.07.37.40 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 19 Sep 2024 07:37:41 -0700 (PDT) From: Mikko Rapeli To: openembedded-core@lists.openembedded.org Cc: Mikko Rapeli Subject: [PATCH v3 05/12] image_types_wic.bbclass: set systemd-boot and os-release dependency for all archs Date: Thu, 19 Sep 2024 17:36:59 +0300 Message-ID: <20240919143706.6074-6-mikko.rapeli@linaro.org> X-Mailer: git-send-email 2.45.2 In-Reply-To: <20240919143706.6074-1-mikko.rapeli@linaro.org> References: <20240919143706.6074-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 ; Thu, 19 Sep 2024 14:37:53 -0000 X-Groupsio-URL: https://lists.openembedded.org/g/openembedded-core/message/204697 These work on all archs not just x86. 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 86f40633eb..e02eb0b367 100644 --- a/meta/classes-recipe/image_types_wic.bbclass +++ b/meta/classes-recipe/image_types_wic.bbclass @@ -110,7 +110,7 @@ WKS_FILE_DEPENDS_DEFAULT = '${@bb.utils.contains_any("BUILD_ARCH", [ 'x86_64', ' WKS_FILE_DEPENDS_DEFAULT += "bmaptool-native cdrtools-native btrfs-tools-native squashfs-tools-native e2fsprogs-native erofs-utils-native" # Unified kernel images need objcopy WKS_FILE_DEPENDS_DEFAULT += "virtual/${TARGET_PREFIX}binutils" -WKS_FILE_DEPENDS_BOOTLOADERS = "" +WKS_FILE_DEPENDS_BOOTLOADERS ?= "systemd-boot os-release" WKS_FILE_DEPENDS_BOOTLOADERS:x86 = "syslinux grub-efi systemd-boot os-release" WKS_FILE_DEPENDS_BOOTLOADERS:x86-64 = "syslinux grub-efi systemd-boot os-release" WKS_FILE_DEPENDS_BOOTLOADERS:x86-x32 = "syslinux grub-efi" From patchwork Thu Sep 19 14:37:00 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Mikko Rapeli X-Patchwork-Id: 49314 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 CF7EECF3954 for ; Thu, 19 Sep 2024 14:37:53 +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.web11.21523.1726756666863321882 for ; Thu, 19 Sep 2024 07:37:47 -0700 Authentication-Results: mx.groups.io; dkim=pass header.i=@linaro.org header.s=google header.b=PJUnk8Jx; 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-53653682246so1058598e87.1 for ; Thu, 19 Sep 2024 07:37:46 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1726756665; x=1727361465; 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=l0By32o/C+iOFmrKlzNfHouLvy5UgXAOcr2DlyVaw4c=; b=PJUnk8JxMDig1y5BIuGLTqz+x3ugGyfP8LC7uqToNFGJlnc9UqjUq+5MvSZV1ghqBF M1qCT7PBZAZYUiWq/oUWC95z7l8CTCPmOTCbmQFhLCk5c3Y6V3BaLGBpCc8mEPBD2bVN 5IvWZ7Up3FHfv8iWq/oRwQd82c4L1qrQTMkvSrPNkMdhIBVcMyvmvKZ+UzT18gLFd9fe 8VVzpZM42JTc0Ghh1+yay/rMWJc8KOE7a0vryrcPC9JgaYmvuKe2j1gTlt413I0wPWIX WV1sYHnErrpuEJpjNZ/waFCGp8JzzHZY24S3oEuPYLUoSd269NsJx8Rjs/4AqGbtJE28 OTHQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1726756665; x=1727361465; 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=l0By32o/C+iOFmrKlzNfHouLvy5UgXAOcr2DlyVaw4c=; b=KqlFrCP9DY/bmfHdrm9/+tPJoi/sLcF+yp3nsqBuiDPgGrf+rkzR7Fy2hWKENxNPC8 uFfOHsl2j+flbkmNSSQY01458tA8duvFVEUJrbCAJKPO24wXkgomD6hX28ViMSpyoX7g jSZzWcQ8wkUVLiXywfZKvn1eYqi+y7HKy2BdqYng8x6GyyylPwul558SxrXgs54ynjxC 1we6RRM6FtRWZg2D5P1Nl2SJ6DEAPFPxCMp0E0zrgJOX1TPbxpEjPebjtWO+b7YcpW+D hUncruN4JGoLLwKCgssx3Hyv/OIEBA1PujPXp4OSQOIFiuCzlnigULNmcFIMdPnwmnhJ LfvA== X-Gm-Message-State: AOJu0Yzx0F3pAhu0Adnhi2BtBfUdBxmSloIekAuHaCFtb/rqjY8MQFBj +ROebNnpMUhfWvX9WdVpIohmHVZVXaO1vFrPmr1AQu1K2vqP3Fx+FSdDalyvQOO4Uoxab79550j jE4w= X-Google-Smtp-Source: AGHT+IEdUKFcUJtj5ENJiXPIJKDNGtxQRZRjGQCwz5atidumhFAA5PUJQWx/KOrb7W98gBUfFRX29g== X-Received: by 2002:a05:6512:1581:b0:533:4327:b4cc with SMTP id 2adb3069b0e04-53678ff3092mr16790338e87.52.1726756664912; Thu, 19 Sep 2024 07:37:44 -0700 (PDT) Received: from localhost.localdomain (87-100-245-199.bb.dnainternet.fi. [87.100.245.199]) by smtp.gmail.com with ESMTPSA id 2adb3069b0e04-536870a8721sm1889194e87.232.2024.09.19.07.37.42 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 19 Sep 2024 07:37:43 -0700 (PDT) From: Mikko Rapeli To: openembedded-core@lists.openembedded.org Cc: Mikko Rapeli Subject: [PATCH v3 06/12] wic bootimg-efi.py: keep timestamps and add debug prints Date: Thu, 19 Sep 2024 17:37:00 +0300 Message-ID: <20240919143706.6074-7-mikko.rapeli@linaro.org> X-Mailer: git-send-email 2.45.2 In-Reply-To: <20240919143706.6074-1-mikko.rapeli@linaro.org> References: <20240919143706.6074-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 ; Thu, 19 Sep 2024 14:37:53 -0000 X-Groupsio-URL: https://lists.openembedded.org/g/openembedded-core/message/204698 Keep timestamps etc to help build reproducibility. Add prints to see what is being copied to ESP partition. Signed-off-by: Mikko Rapeli --- scripts/lib/wic/plugins/source/bootimg-efi.py | 49 ++++++++++++------- 1 file changed, 30 insertions(+), 19 deletions(-) diff --git a/scripts/lib/wic/plugins/source/bootimg-efi.py b/scripts/lib/wic/plugins/source/bootimg-efi.py index 7cc5131541..d00f5428da 100644 --- a/scripts/lib/wic/plugins/source/bootimg-efi.py +++ b/scripts/lib/wic/plugins/source/bootimg-efi.py @@ -43,16 +43,18 @@ class BootimgEFIPlugin(SourcePlugin): if initrd: initrds = initrd.split(';') for rd in initrds: - cp_cmd = "cp %s/%s %s" % (bootimg_dir, rd, hdddir) - exec_cmd(cp_cmd, True) + cp_cmd = "cp -v -p %s/%s %s" % (bootimg_dir, rd, hdddir) + out = exec_cmd(cp_cmd, True) + logger.debug("initrd files:\n%s" % (out)) else: logger.debug("Ignoring missing initrd") if dtb: if ';' in dtb: raise WicError("Only one DTB supported, exiting") - cp_cmd = "cp %s/%s %s" % (bootimg_dir, dtb, hdddir) - exec_cmd(cp_cmd, True) + cp_cmd = "cp -v -p %s/%s %s" % (bootimg_dir, dtb, hdddir) + out = exec_cmd(cp_cmd, True) + logger.debug("dtb files:\n%s" % (out)) @classmethod def do_configure_grubefi(cls, hdddir, creator, cr_workdir, source_params): @@ -150,6 +152,7 @@ class BootimgEFIPlugin(SourcePlugin): "%s/hdd/boot/loader/loader.conf", cr_workdir) cfg = open("%s/hdd/boot/loader/loader.conf" % cr_workdir, "w") cfg.write(loader_conf) + logger.debug("loader.conf:\n%s" % (loader_conf)) cfg.close() configfile = creator.ks.bootloader.configfile @@ -401,30 +404,33 @@ class BootimgEFIPlugin(SourcePlugin): exec_native_cmd(objcopy_cmd, native_sysroot) else: if source_params.get('install-kernel-into-boot-dir') != 'false': - install_cmd = "install -m 0644 %s/%s %s/%s" % \ + install_cmd = "install -v -p -m 0644 %s/%s %s/%s" % \ (staging_kernel_dir, kernel, hdddir, kernel) - exec_cmd(install_cmd) + out = exec_cmd(install_cmd) + logger.debug("Installed kernel files:\n%s" % out) if get_bitbake_var("IMAGE_EFI_BOOT_FILES"): for src_path, dst_path in cls.install_task: - install_cmd = "install -m 0644 -D %s %s" \ + install_cmd = "install -v -p -m 0644 -D %s %s" \ % (os.path.join(kernel_dir, src_path), os.path.join(hdddir, dst_path)) - exec_cmd(install_cmd) + out = exec_cmd(install_cmd) + logger.debug("Installed IMAGE_EFI_BOOT_FILES:\n%s" % out) try: if source_params['loader'] == 'grub-efi': shutil.copyfile("%s/hdd/boot/EFI/BOOT/grub.cfg" % cr_workdir, "%s/grub.cfg" % cr_workdir) for mod in [x for x in os.listdir(kernel_dir) if x.startswith("grub-efi-")]: - cp_cmd = "cp %s/%s %s/EFI/BOOT/%s" % (kernel_dir, mod, hdddir, mod[9:]) + cp_cmd = "cp -v -p %s/%s %s/EFI/BOOT/%s" % (kernel_dir, mod, hdddir, mod[9:]) exec_cmd(cp_cmd, True) shutil.move("%s/grub.cfg" % cr_workdir, "%s/hdd/boot/EFI/BOOT/grub.cfg" % cr_workdir) elif source_params['loader'] == 'systemd-boot': for mod in [x for x in os.listdir(kernel_dir) if x.startswith("systemd-")]: - cp_cmd = "cp %s/%s %s/EFI/BOOT/%s" % (kernel_dir, mod, hdddir, mod[8:]) - exec_cmd(cp_cmd, True) + 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) elif source_params['loader'] == 'uefi-kernel': kernel = get_bitbake_var("KERNEL_IMAGETYPE") if not kernel: @@ -445,8 +451,9 @@ class BootimgEFIPlugin(SourcePlugin): raise WicError("UEFI stub kernel is incompatible with target %s" % target) for mod in [x for x in os.listdir(kernel_dir) if x.startswith(kernel)]: - cp_cmd = "cp %s/%s %s/EFI/BOOT/%s" % (kernel_dir, mod, hdddir, kernel_efi_image) - exec_cmd(cp_cmd, True) + cp_cmd = "cp -v -p %s/%s %s/EFI/BOOT/%s" % (kernel_dir, mod, hdddir, kernel_efi_image) + out = exec_cmd(cp_cmd, True) + logger.debug("uefi-kernel files:\n%s" % out) else: raise WicError("unrecognized bootimg-efi loader: %s" % source_params['loader']) @@ -455,13 +462,15 @@ class BootimgEFIPlugin(SourcePlugin): startup = os.path.join(kernel_dir, "startup.nsh") if os.path.exists(startup): - cp_cmd = "cp %s %s/" % (startup, hdddir) - exec_cmd(cp_cmd, True) + cp_cmd = "cp -v -p %s %s/" % (startup, hdddir) + out = exec_cmd(cp_cmd, True) + logger.debug("startup files:\n%s" % out) for paths in part.include_path or []: for path in paths: - cp_cmd = "cp -r %s %s/" % (path, hdddir) + cp_cmd = "cp -v -p -r %s %s/" % (path, hdddir) exec_cmd(cp_cmd, True) + logger.debug("include_path files:\n%s" % out) du_cmd = "du -bks %s" % hdddir out = exec_cmd(du_cmd) @@ -489,12 +498,14 @@ class BootimgEFIPlugin(SourcePlugin): label = part.label if part.label else "ESP" - dosfs_cmd = "mkdosfs -n %s -i %s -C %s %d" % \ + dosfs_cmd = "mkdosfs -v -n %s -i %s -C %s %d" % \ (label, part.fsuuid, bootimg, blocks) exec_native_cmd(dosfs_cmd, native_sysroot) + logger.debug("mkdosfs:\n%s" % (str(out))) - mcopy_cmd = "mcopy -i %s -s %s/* ::/" % (bootimg, hdddir) - exec_native_cmd(mcopy_cmd, native_sysroot) + mcopy_cmd = "mcopy -v -p -i %s -s %s/* ::/" % (bootimg, hdddir) + out = exec_native_cmd(mcopy_cmd, native_sysroot) + logger.debug("mcopy:\n%s" % (str(out))) chmod_cmd = "chmod 644 %s" % bootimg exec_cmd(chmod_cmd) From patchwork Thu Sep 19 14:37:01 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Mikko Rapeli X-Patchwork-Id: 49315 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 DE1F1CF3955 for ; Thu, 19 Sep 2024 14:37:53 +0000 (UTC) Received: from mail-lj1-f177.google.com (mail-lj1-f177.google.com [209.85.208.177]) by mx.groups.io with SMTP id smtpd.web11.21525.1726756668993958676 for ; Thu, 19 Sep 2024 07:37:49 -0700 Authentication-Results: mx.groups.io; dkim=pass header.i=@linaro.org header.s=google header.b=mCJa/7Dq; spf=pass (domain: linaro.org, ip: 209.85.208.177, mailfrom: mikko.rapeli@linaro.org) Received: by mail-lj1-f177.google.com with SMTP id 38308e7fff4ca-2f763e9e759so10599401fa.3 for ; Thu, 19 Sep 2024 07:37:48 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1726756667; x=1727361467; 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=0fqvkLatHUcGlPBaIeQKYhFgmt1O9nIIWDQ/lF/bFug=; b=mCJa/7DqbOnY/FS4oClKL6RNCZ/7GBth2QCyt0FORgxEPipP3Xaz3iWH3HXPd4aBvc 8y8hr+w41XpX7pn+XY16hXZeZO09N+DQNtmLOxaeEbpGebkmYb37g7RCckTyuOopxafh KlFAUj8rW0smIgE9yZEazlZuWPsCF3uRlyANK/7VpLlR0MKCLdtGQvgAti3Xgmu77ztb ZIRJd+7OhyYUvrZ62PUs7u5zd7TtId/qxx77+WCsoea2Mze0DOdnH049OBIWXtTCxXiP nMqNNuBkx/b8V0Ni95otdDvCBoYRPu82HJwv84mbYKUIJFXAFIfmsGz+46XzO49lVEaP 0uUg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1726756667; x=1727361467; 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=0fqvkLatHUcGlPBaIeQKYhFgmt1O9nIIWDQ/lF/bFug=; b=ad8kaOz+zSF9Hq36YrKBlECxDEhS72Pu1zGVirW2zBHdSWkNH7JpY89roEH9FzXuXA znsymyvO2Q9hVuJbD20OZ6EVDETKOkih+U5qkCUGwQMOn3zR+ZUqxYNZHR4YDmEgeCAW Zufm1vuvat1uKvEWPWns9/aFdepG9Yzxk3mlcRBQj4Sk6bVHMYbrOn+v3Y17Dnko9ecw XRuE15W6pPydX4VoLOCdwK2kLSspJOKCRkuHTHgHxe++ZssNQ3LdTlpPNplTTSfxhAN2 f0U4SZ5Qk77KdIgs/HXuujG36e40etKtW44eyy3L6rcb+gYCEgPuAX8VM3wFnoTCsucX 5wYA== X-Gm-Message-State: AOJu0Yz/aPc+/mIkfhQztzzKEuCGJXu8qfXBPcmIupP+thD6flavkiOY DmuaqhcsSRZXGl9FNK1Ne/LdzK2QVafArEwE8gVbQKkOGusX0xceNYVPPFWZqeY2o6fCAevMfCU rWKY= X-Google-Smtp-Source: AGHT+IFla6PXEYtW4cCDHHmmdDag4ABPPNyyWZNSfTGDZJW7ZiOrboadoIhi54njb3PEtKFnLoHuvQ== X-Received: by 2002:a05:6512:b8e:b0:536:55a9:4b6c with SMTP id 2adb3069b0e04-53678fbb03fmr16120085e87.13.1726756666871; Thu, 19 Sep 2024 07:37:46 -0700 (PDT) Received: from localhost.localdomain (87-100-245-199.bb.dnainternet.fi. [87.100.245.199]) by smtp.gmail.com with ESMTPSA id 2adb3069b0e04-536870a8721sm1889194e87.232.2024.09.19.07.37.45 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 19 Sep 2024 07:37:46 -0700 (PDT) From: Mikko Rapeli To: openembedded-core@lists.openembedded.org Cc: Mikko Rapeli Subject: [PATCH v3 07/12] wic bootimg-efi.py: change UKI support from wic plugin to uki.bbclass Date: Thu, 19 Sep 2024 17:37:01 +0300 Message-ID: <20240919143706.6074-8-mikko.rapeli@linaro.org> X-Mailer: git-send-email 2.45.2 In-Reply-To: <20240919143706.6074-1-mikko.rapeli@linaro.org> References: <20240919143706.6074-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 ; Thu, 19 Sep 2024 14:37:53 -0000 X-Groupsio-URL: https://lists.openembedded.org/g/openembedded-core/message/204699 Remove custom wic plugin implementation and use systemd ukify reference implementation when generating UKI images. Fail if users still have create-unified-kernel-image in wic image config. uki.bbclass use is detected from IMAGE_CLASSES variable ("inherit uki" in image recipe) so export that to wic plugins. If UKI is used, then only generate a minimal loader config for systemd-boot which basically just sets a timeout. Also set 5 second timeout by default instead of failing if wic bootloader config is missing. Boot menu is generated at runtime based on UKI binaries found from ESP partition. Signed-off-by: Mikko Rapeli --- meta/classes-recipe/image_types_wic.bbclass | 3 +- scripts/lib/wic/plugins/source/bootimg-efi.py | 144 ++++-------------- 2 files changed, 31 insertions(+), 116 deletions(-) diff --git a/meta/classes-recipe/image_types_wic.bbclass b/meta/classes-recipe/image_types_wic.bbclass index e02eb0b367..668d0c6d64 100644 --- a/meta/classes-recipe/image_types_wic.bbclass +++ b/meta/classes-recipe/image_types_wic.bbclass @@ -15,6 +15,7 @@ WICVARS ?= "\ HOSTTOOLS_DIR \ IMAGE_BASENAME \ IMAGE_BOOT_FILES \ + IMAGE_CLASSES \ IMAGE_EFI_BOOT_FILES \ IMAGE_LINK_NAME \ IMAGE_ROOTFS \ @@ -112,7 +113,7 @@ WKS_FILE_DEPENDS_DEFAULT += "bmaptool-native cdrtools-native btrfs-tools-native WKS_FILE_DEPENDS_DEFAULT += "virtual/${TARGET_PREFIX}binutils" WKS_FILE_DEPENDS_BOOTLOADERS ?= "systemd-boot os-release" WKS_FILE_DEPENDS_BOOTLOADERS:x86 = "syslinux grub-efi systemd-boot os-release" -WKS_FILE_DEPENDS_BOOTLOADERS:x86-64 = "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" WKS_FILE_DEPENDS ??= "${WKS_FILE_DEPENDS_DEFAULT} ${WKS_FILE_DEPENDS_BOOTLOADERS}" diff --git a/scripts/lib/wic/plugins/source/bootimg-efi.py b/scripts/lib/wic/plugins/source/bootimg-efi.py index d00f5428da..dbe1dcde07 100644 --- a/scripts/lib/wic/plugins/source/bootimg-efi.py +++ b/scripts/lib/wic/plugins/source/bootimg-efi.py @@ -125,8 +125,16 @@ class BootimgEFIPlugin(SourcePlugin): @classmethod def do_configure_systemdboot(cls, hdddir, creator, cr_workdir, source_params): """ - Create loader-specific systemd-boot/gummiboot config + Create loader-specific systemd-boot/gummiboot config. Unified Kernel Image (uki) + support is done in image recipe with uki.bbclass and only systemd-boot loader config + and ESP partition structure is created here. """ + # detect uki.bbclass usage + image_classes = get_bitbake_var("IMAGE_CLASSES").split() + unified_image = False + if "uki" in image_classes: + unified_image = True + install_cmd = "install -d %s/loader" % hdddir exec_cmd(install_cmd) @@ -134,19 +142,10 @@ class BootimgEFIPlugin(SourcePlugin): exec_cmd(install_cmd) bootloader = creator.ks.bootloader - - unified_image = source_params.get('create-unified-kernel-image') == "true" - loader_conf = "" - if not unified_image: - loader_conf += "default boot\n" - loader_conf += "timeout %d\n" % bootloader.timeout - initrd = source_params.get('initrd') - dtb = source_params.get('dtb') - - if not unified_image: - cls._copy_additional_files(hdddir, initrd, dtb) + # 5 seconds is a sensible default timeout + loader_conf += "timeout %d\n" % (bootloader.timeout or 5) logger.debug("Writing systemd-boot config " "%s/hdd/boot/loader/loader.conf", cr_workdir) @@ -155,8 +154,14 @@ class BootimgEFIPlugin(SourcePlugin): logger.debug("loader.conf:\n%s" % (loader_conf)) cfg.close() + initrd = source_params.get('initrd') + dtb = source_params.get('dtb') + if not unified_image: + cls._copy_additional_files(hdddir, initrd, dtb) + configfile = creator.ks.bootloader.configfile custom_cfg = None + boot_conf = "" if configfile: custom_cfg = get_custom_config(configfile) if custom_cfg: @@ -167,8 +172,7 @@ class BootimgEFIPlugin(SourcePlugin): else: raise WicError("configfile is specified but failed to " "get it from %s.", configfile) - - if not custom_cfg: + else: # Create systemd-boot configuration using parameters from wks file kernel = get_bitbake_var("KERNEL_IMAGETYPE") if get_bitbake_var("INITRAMFS_IMAGE_BUNDLE") == "1": @@ -178,7 +182,6 @@ class BootimgEFIPlugin(SourcePlugin): title = source_params.get('title') - boot_conf = "" boot_conf += "title %s\n" % (title if title else "boot") boot_conf += "linux /%s\n" % kernel @@ -198,11 +201,16 @@ class BootimgEFIPlugin(SourcePlugin): if dtb: boot_conf += "devicetree /%s\n" % dtb + boot_conf = "" + boot_conf += "title %s\n" % (title if title else "boot") + boot_conf += "efi /linux.efi\n" + if not unified_image: logger.debug("Writing systemd-boot config " "%s/hdd/boot/loader/entries/boot.conf", cr_workdir) cfg = open("%s/hdd/boot/loader/entries/boot.conf" % cr_workdir, "w") cfg.write(boot_conf) + logger.debug("boot.conf:\n%s" % (boot_conf)) cfg.close() @@ -307,107 +315,13 @@ class BootimgEFIPlugin(SourcePlugin): (get_bitbake_var("KERNEL_IMAGETYPE"), get_bitbake_var("INITRAMFS_LINK_NAME")) if source_params.get('create-unified-kernel-image') == "true": - initrd = source_params.get('initrd') - if not initrd: - raise WicError("initrd= must be specified when create-unified-kernel-image=true, exiting") - - deploy_dir = get_bitbake_var("DEPLOY_DIR_IMAGE") - efi_stub = glob("%s/%s" % (deploy_dir, "linux*.efi.stub")) - if len(efi_stub) == 0: - raise WicError("Unified Kernel Image EFI stub not found, exiting") - efi_stub = efi_stub[0] - - with tempfile.TemporaryDirectory() as tmp_dir: - label = source_params.get('label') - label_conf = "root=%s" % creator.rootdev - if label: - label_conf = "LABEL=%s" % label - - bootloader = creator.ks.bootloader - cmdline = open("%s/cmdline" % tmp_dir, "w") - cmdline.write("%s %s" % (label_conf, bootloader.append)) - cmdline.close() + raise WicError("create-unified-kernel-image is no longer supported. Please use uki.bbclass.") - initrds = initrd.split(';') - initrd = open("%s/initrd" % tmp_dir, "wb") - for f in initrds: - with open("%s/%s" % (deploy_dir, f), 'rb') as in_file: - shutil.copyfileobj(in_file, initrd) - initrd.close() - - # Searched by systemd-boot: - # https://systemd.io/BOOT_LOADER_SPECIFICATION/#type-2-efi-unified-kernel-images - install_cmd = "install -d %s/EFI/Linux" % hdddir - exec_cmd(install_cmd) - - staging_dir_host = get_bitbake_var("STAGING_DIR_HOST") - target_sys = get_bitbake_var("TARGET_SYS") - - objdump_cmd = "%s-objdump" % target_sys - objdump_cmd += " -p %s" % efi_stub - objdump_cmd += " | awk '{ if ($1 == \"SectionAlignment\"){print $2} }'" - - ret, align_str = exec_native_cmd(objdump_cmd, native_sysroot) - align = int(align_str, 16) - - objdump_cmd = "%s-objdump" % target_sys - objdump_cmd += " -h %s | tail -2" % efi_stub - ret, output = exec_native_cmd(objdump_cmd, native_sysroot) - - offset = int(output.split()[2], 16) + int(output.split()[3], 16) - - osrel_off = offset + align - offset % align - osrel_path = "%s/usr/lib/os-release" % staging_dir_host - osrel_sz = os.stat(osrel_path).st_size - - cmdline_off = osrel_off + osrel_sz - cmdline_off = cmdline_off + align - cmdline_off % align - cmdline_sz = os.stat(cmdline.name).st_size - - dtb_off = cmdline_off + cmdline_sz - dtb_off = dtb_off + align - dtb_off % align - - dtb = source_params.get('dtb') - if dtb: - if ';' in dtb: - raise WicError("Only one DTB supported, exiting") - dtb_path = "%s/%s" % (deploy_dir, dtb) - dtb_params = '--add-section .dtb=%s --change-section-vma .dtb=0x%x' % \ - (dtb_path, dtb_off) - linux_off = dtb_off + os.stat(dtb_path).st_size - linux_off = linux_off + align - linux_off % align - else: - dtb_params = '' - linux_off = dtb_off - - linux_path = "%s/%s" % (staging_kernel_dir, kernel) - linux_sz = os.stat(linux_path).st_size - - initrd_off = linux_off + linux_sz - initrd_off = initrd_off + align - initrd_off % align - - # https://www.freedesktop.org/software/systemd/man/systemd-stub.html - objcopy_cmd = "%s-objcopy" % target_sys - objcopy_cmd += " --enable-deterministic-archives" - objcopy_cmd += " --preserve-dates" - objcopy_cmd += " --add-section .osrel=%s" % osrel_path - objcopy_cmd += " --change-section-vma .osrel=0x%x" % osrel_off - objcopy_cmd += " --add-section .cmdline=%s" % cmdline.name - objcopy_cmd += " --change-section-vma .cmdline=0x%x" % cmdline_off - objcopy_cmd += dtb_params - objcopy_cmd += " --add-section .linux=%s" % linux_path - objcopy_cmd += " --change-section-vma .linux=0x%x" % linux_off - objcopy_cmd += " --add-section .initrd=%s" % initrd.name - objcopy_cmd += " --change-section-vma .initrd=0x%x" % initrd_off - objcopy_cmd += " %s %s/EFI/Linux/linux.efi" % (efi_stub, hdddir) - - exec_native_cmd(objcopy_cmd, native_sysroot) - else: - if source_params.get('install-kernel-into-boot-dir') != 'false': - install_cmd = "install -v -p -m 0644 %s/%s %s/%s" % \ - (staging_kernel_dir, kernel, hdddir, kernel) - out = exec_cmd(install_cmd) - logger.debug("Installed kernel files:\n%s" % out) + if source_params.get('install-kernel-into-boot-dir') != 'false': + install_cmd = "install -v -p -m 0644 %s/%s %s/%s" % \ + (staging_kernel_dir, kernel, hdddir, kernel) + out = exec_cmd(install_cmd) + logger.debug("Installed kernel files:\n%s" % out) if get_bitbake_var("IMAGE_EFI_BOOT_FILES"): for src_path, dst_path in cls.install_task: From patchwork Thu Sep 19 14:37:02 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Mikko Rapeli X-Patchwork-Id: 49317 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 DDA95CF3957 for ; Thu, 19 Sep 2024 14:37:53 +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.web11.21528.1726756672328595353 for ; Thu, 19 Sep 2024 07:37:52 -0700 Authentication-Results: mx.groups.io; dkim=pass header.i=@linaro.org header.s=google header.b=L1Qtale3; 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-53654e2ed93so1160055e87.0 for ; Thu, 19 Sep 2024 07:37:52 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1726756670; x=1727361470; 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=ls3jxLuz1JCKMCjAs0zwSaBBboNoGcmmpkKK9zS+Geg=; b=L1Qtale3C5VWslPAyff7WCmYlLiYgyTMkaXnGwSSXM63vi3N8pGzKd2h9b1wE9FEak d4XoQ+l3u6D1aCsa5JwovVvpcsz04tPhAh+JmAKjWu6wNG4fmuDIHOVA2WZISxz/J8vs dB4rShyaO3e5MXR0jiUuxhfuTvav7YwvK+bf+EsBmQT7dA5xxsgBiYXDKuwbmYEVKo7G QeS24HkyaPnfO6UyRnqApVh54DVXqEdUpxl1LSMIyJBAWqZAp/V78z3TuBr4bFdrVA82 T/P0QRGQJTgylRHhMYjIPHESEwKmNvtNWygzcqfYajrBTUM8KKp5h3U/RJO8XcTngLiI QC/Q== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1726756670; x=1727361470; 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=ls3jxLuz1JCKMCjAs0zwSaBBboNoGcmmpkKK9zS+Geg=; b=TntgSbv5dneVr2sGkkFQjqLLZwhyheRPpLE7/krRfDzbAz1nIOK+CEJ8uCIh2sMQer 7fGM0Kja9laWWgv6+3FG1QCx+N98tB0ijq8yVT2T45S0LxMuoI1cw2kuxRXOdAGPNT01 8Gondo0SQIJ/wsEApZZZpXJlCwuxXSxy/81zUWih+bJfnG6Rh/79dJwPi6yCorGpV+kl kJyicqy3ypHsNtsaeKSaHOtVLXxjUdvnokS24EzEp4d2018ODMZkKZ6wiQqdnaamkEij bIq+NVxJjkH2PkrTDW89llub/V5Rm/GEn7GHy/zX2TcvvzlL9c6Z3P1/ckVA+b8Ubjgg FGnw== X-Gm-Message-State: AOJu0Ywttgu0jS9y0rT8Dx+dQdVVFYgXJUCl2t7p1KB553X6jQIT9MrN ud+xzqd1XhUVoM6grA9bEm0DJwb5ILxrCRexs7SievyZhqduTa5elG/gcd3NH2eMiCeSX3chePb 5GsU= X-Google-Smtp-Source: AGHT+IHg7Wi7/rhzigZGN6jR9l0Bv0sT/jtv3g7LjC0wNdy2OZ3a9ABos3/Pfa385Jj0JvZknbwXwA== X-Received: by 2002:a05:6512:280d:b0:52e:7f09:aaae with SMTP id 2adb3069b0e04-53678fc85e7mr13767196e87.27.1726756670427; Thu, 19 Sep 2024 07:37:50 -0700 (PDT) Received: from localhost.localdomain (87-100-245-199.bb.dnainternet.fi. [87.100.245.199]) by smtp.gmail.com with ESMTPSA id 2adb3069b0e04-536870a8721sm1889194e87.232.2024.09.19.07.37.48 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 19 Sep 2024 07:37:49 -0700 (PDT) From: Mikko Rapeli To: openembedded-core@lists.openembedded.org Cc: Mikko Rapeli Subject: [PATCH v3 08/12] oeqa selftest uki.py: add tests for uki.bbclass Date: Thu, 19 Sep 2024 17:37:02 +0300 Message-ID: <20240919143706.6074-9-mikko.rapeli@linaro.org> X-Mailer: git-send-email 2.45.2 In-Reply-To: <20240919143706.6074-1-mikko.rapeli@linaro.org> References: <20240919143706.6074-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 ; Thu, 19 Sep 2024 14:37:53 -0000 X-Groupsio-URL: https://lists.openembedded.org/g/openembedded-core/message/204700 Tests builds and boots qemu into uki binary with systemd and sysvinit. Due to depedency to x86 specific ovmf UEFI firmware, tests are specific to x86 curently. UEFI firmware for ARM can be generated via qemuarm64-secureboot machine in meta-arm and similar tests on qemu will pass. Signed-off-by: Mikko Rapeli --- meta/lib/oeqa/selftest/cases/uki.py | 138 ++++++++++++++++++ .../wic/canned-wks/efi-uki-bootdisk.wks.in | 3 + 2 files changed, 141 insertions(+) create mode 100644 meta/lib/oeqa/selftest/cases/uki.py create mode 100644 scripts/lib/wic/canned-wks/efi-uki-bootdisk.wks.in diff --git a/meta/lib/oeqa/selftest/cases/uki.py b/meta/lib/oeqa/selftest/cases/uki.py new file mode 100644 index 0000000000..a2d2ad6efc --- /dev/null +++ b/meta/lib/oeqa/selftest/cases/uki.py @@ -0,0 +1,138 @@ +# Based on runqemu.py test file +# +# Copyright (c) 2017 Wind River Systems, Inc. +# +# SPDX-License-Identifier: MIT +# + +from oeqa.selftest.case import OESelftestTestCase +from oeqa.utils.commands import bitbake, runqemu, get_bb_var +from oeqa.core.decorator.data import skipIfNotArch +from oeqa.core.decorator import OETestTag +import oe.types + +class UkiTest(OESelftestTestCase): + """Boot Unified Kernel Image (UKI) generated with uki.bbclass on UEFI firmware (omvf/edk2)""" + + @skipIfNotArch(['i586', 'i686', 'x86_64']) + @OETestTag("runqemu") + def test_uki_boot_systemd(self): + """Build and boot into UEFI firmware (omvf/edk2), systemd-boot, initrd without systemd, rootfs with systemd""" + image = "core-image-minimal" + runqemu_params = get_bb_var('TEST_RUNQEMUPARAMS', image) + cmd = "runqemu %s nographic serial wic ovmf" % (runqemu_params) + if oe.types.qemu_use_kvm(self.td.get('QEMU_USE_KVM', 0), self.td["TARGET_ARCH"]): + cmd += " kvm" + + 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" +MACHINE_FEATURES:append = " efi" +DISTRO_FEATURES:append = " uki" +DISTRO_FEATURES:append = " systemd" +DISTRO_FEATURES_NATIVE:append = " systemd" +IMAGE_CLASSES:append:pn-core-image-minimal = " uki" + +# uki embeds also an initrd +INITRAMFS_IMAGE = "core-image-minimal-initramfs" + +# runqemu must not load kernel separately, it's in the uki +QB_KERNEL_ROOT = "" +QB_DEFAULT_KERNEL = "none" + +# boot command line provided via uki, not via bootloader +UKI_CMDLINE = "rootwait root=LABEL=root console=${KERNEL_CONSOLE}" +""" % (image)) + + uki_filename = get_bb_var('UKI_FILENAME', image) + + bitbake(image + " ovmf") + with runqemu(image, ssh=False, launch_cmd=cmd) as qemu: + self.assertTrue(qemu.runner.logged, "Failed: %s" % cmd) + + # Verify from efivars that firmware was: + # x86_64, qemux86_64 = edk2 + # arm, = u-boot + cmd = "echo $( cat /sys/firmware/efi/efivars/LoaderFirmwareInfo-4a67b082-0a4c-41cf-b6c7-440b29bb8c4f ) | grep 'EDK II'" + 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)) + + @skipIfNotArch(['i586', 'i686', 'x86_64']) + @OETestTag("runqemu") + def test_uki_sysvinit(self): + """Build and boot into UEFI firmware (omvf/edk2), systemd-boot, initrd with sysvinit, rootfs with sysvinit""" + 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-core-image-base:append = " wic" +WKS_FILE = "efi-uki-bootdisk.wks.in" + +# efi, uki and systemd features must be enabled +MACHINE_FEATURES:append = " efi" +DISTRO_FEATURES_NATIVE:append = " systemd" +IMAGE_CLASSES:append:pn-core-image-base = " uki" + +# uki embeds also an initrd, no systemd or udev +INITRAMFS_IMAGE = "core-image-initramfs-boot" + +# runqemu must not load kernel separately, it's in the uki +QB_KERNEL_ROOT = "" +QB_DEFAULT_KERNEL = "none" + +# boot command line provided via uki, not via bootloader +UKI_CMDLINE = "rootwait root=LABEL=root console=${KERNEL_CONSOLE}" + +""" + self.append_config(config) + bitbake('core-image-base ovmf') + runqemu_params = get_bb_var('TEST_RUNQEMUPARAMS', 'core-image-base') + uki_filename = get_bb_var('UKI_FILENAME', 'core-image-base') + self.remove_config(config) + + with runqemu('core-image-base', ssh=False, + runqemuparams='%s slirp nographic ovmf' % (runqemu_params), image_fstype='wic') as qemu: + # Verify from efivars that firmware was: + # x86_64, qemux86_64 = edk2 + # arm, = u-boot + cmd = "echo $( cat /sys/firmware/efi/efivars/LoaderFirmwareInfo-4a67b082-0a4c-41cf-b6c7-440b29bb8c4f ) | grep 'EDK II'" + 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)) diff --git a/scripts/lib/wic/canned-wks/efi-uki-bootdisk.wks.in b/scripts/lib/wic/canned-wks/efi-uki-bootdisk.wks.in new file mode 100644 index 0000000000..1ea9c8a845 --- /dev/null +++ b/scripts/lib/wic/canned-wks/efi-uki-bootdisk.wks.in @@ -0,0 +1,3 @@ +bootloader --ptable gpt --timeout=5 +part /boot --source bootimg-efi --sourceparams="loader=${EFI_PROVIDER}" --label boot --active --align 1024 --use-uuid --part-name="ESP" --part-type=C12A7328-F81F-11D2-BA4B-00A0C93EC93B --fixed-size 512M +part / --source rootfs --fstype=ext4 --label root --align 1024 --exclude-path boot/ From patchwork Thu Sep 19 14:37:03 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Mikko Rapeli X-Patchwork-Id: 49319 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 DEBA6CF3958 for ; Thu, 19 Sep 2024 14:38:03 +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.21530.1726756674302156903 for ; Thu, 19 Sep 2024 07:37:54 -0700 Authentication-Results: mx.groups.io; dkim=pass header.i=@linaro.org header.s=google header.b=FwnQ1g6b; 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-535dc4ec181so969363e87.3 for ; Thu, 19 Sep 2024 07:37:54 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1726756672; x=1727361472; 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=TWp9RylT+KR4FZb1lIW/0UhAhnGCU5MMU0wbOObb1l8=; b=FwnQ1g6bN09xCkXFSSbhL0XaQoORMt3OByQeMZoRUVHw0R5T+OHUxCST6tDg7KXF4F rVd5V0bEy5SZy3gRI0aVFegA6VMvwRj5yxXzkwVmBPSUqlgtFQFZPHkp/OWGk5trOGm1 yU/ms7uUHNYkrq7IIB5vqPwS4VeNfW+tDfeAJelkeTm5YSNKJKHqug3gDpLy7AWCFDtj /uETfjKBB9Ux2IXCecmyD9ZwuC3HXjG6fRZh4J+HTcyXZsg046NEimVlsNX5qkaYqS/V 0//K49df/zQocKSmHDXz3+uOatWjGORuFFbKGxVpQsA/JxU2KP8y2IgMK/b8DikqaLCr +bIA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1726756672; x=1727361472; 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=TWp9RylT+KR4FZb1lIW/0UhAhnGCU5MMU0wbOObb1l8=; b=FZI9wQUl2Fzf/3XscXoEWcdINySxAnlsF3mhDj5/oB2ruhAklcwJUY1wbd+HYWlSZV EDsJOOXHH3/HkIfZ+R7SWSkCjpyZPwGV7GfSA3ZZ4Q5S1L0XbfOCyGv4imVpdvHYbaZZ Vs9YSuENyFCIoHmiLTa/0yhfk9QaZKQ67LODhAN0VmWU6aeLFTtCv/URk+n/9fqnck7x RBxjc26AvXavxrli7q9VKs8QraLgeqiBVpp+94xo8D6E3aFAa9vQzZDumjefztzhEUfm bA3WIDbXGpHtI+1WD09lKbfAk370uE0zg2f3Kjsecuglg/jOG/GZqQbulKchKV8vnWQb Z01g== X-Gm-Message-State: AOJu0YzKvrxSnlo46P/8s0A80xbxab496mBpVnoo2vdJ+h/pfy2TLBub xLGFTr+jrzx4LvEhy42/JPr53RmnCFRATt5eN4q5wWBCuwblcQ1EmsU8+HwK3ryqIVlCAk6116U 0NuE= X-Google-Smtp-Source: AGHT+IGW3UB7t1ZMzLqcRyJNJHIduXxsK0w1BHYSuRiW7/s0INNoTuGO4jcZqF42KBij721am3U9GA== X-Received: by 2002:a05:6512:a8a:b0:52f:159:2dc5 with SMTP id 2adb3069b0e04-53678fe69a7mr17525867e87.42.1726756672352; Thu, 19 Sep 2024 07:37:52 -0700 (PDT) Received: from localhost.localdomain (87-100-245-199.bb.dnainternet.fi. [87.100.245.199]) by smtp.gmail.com with ESMTPSA id 2adb3069b0e04-536870a8721sm1889194e87.232.2024.09.19.07.37.51 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 19 Sep 2024 07:37:51 -0700 (PDT) From: Mikko Rapeli To: openembedded-core@lists.openembedded.org Cc: Mikko Rapeli Subject: [PATCH v3 09/12] oeqa selftest efibootpartition.py: add TEST_RUNQEMUPARAMS to runqemu Date: Thu, 19 Sep 2024 17:37:03 +0300 Message-ID: <20240919143706.6074-10-mikko.rapeli@linaro.org> X-Mailer: git-send-email 2.45.2 In-Reply-To: <20240919143706.6074-1-mikko.rapeli@linaro.org> References: <20240919143706.6074-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 ; Thu, 19 Sep 2024 14:38:03 -0000 X-Groupsio-URL: https://lists.openembedded.org/g/openembedded-core/message/204701 TEST_RUNQEMUPARAMS variable is used to add runqemu parameters like "slirp" networking. Support this also in selftests so that "slirp" networking can be used instead of the tun/tap devices setup which is easier to work with on shared build machines. Signed-off-by: Mikko Rapeli --- meta/lib/oeqa/selftest/cases/efibootpartition.py | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/meta/lib/oeqa/selftest/cases/efibootpartition.py b/meta/lib/oeqa/selftest/cases/efibootpartition.py index fa74103dec..671bb68f2c 100644 --- a/meta/lib/oeqa/selftest/cases/efibootpartition.py +++ b/meta/lib/oeqa/selftest/cases/efibootpartition.py @@ -6,7 +6,7 @@ # from oeqa.selftest.case import OESelftestTestCase -from oeqa.utils.commands import bitbake, runqemu +from oeqa.utils.commands import bitbake, runqemu, get_bb_var from oeqa.core.decorator.data import skipIfNotMachine import oe.types @@ -14,10 +14,11 @@ class GenericEFITest(OESelftestTestCase): """EFI booting test class""" @skipIfNotMachine("qemux86-64", "test is qemux86-64 specific currently") def test_boot_efi(self): - cmd = "runqemu nographic serial wic ovmf" + image = "core-image-minimal" + runqemu_params = get_bb_var('TEST_RUNQEMUPARAMS', image) + cmd = "runqemu %s nographic serial wic ovmf" % (runqemu_params) if oe.types.qemu_use_kvm(self.td.get('QEMU_USE_KVM', 0), self.td["TARGET_ARCH"]): cmd += " kvm" - image = "core-image-minimal" self.write_config(""" EFI_PROVIDER = "systemd-boot" From patchwork Thu Sep 19 14:37:04 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Mikko Rapeli X-Patchwork-Id: 49320 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 E8172CF3959 for ; Thu, 19 Sep 2024 14:38:03 +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.21533.1726756677626762904 for ; Thu, 19 Sep 2024 07:37:57 -0700 Authentication-Results: mx.groups.io; dkim=pass header.i=@linaro.org header.s=google header.b=hHLpgo+5; 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-5365aec6fc1so1149253e87.3 for ; Thu, 19 Sep 2024 07:37:57 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1726756676; x=1727361476; 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=V6FtSuErjFeDPdu94Z43XasX0hpYQN6ZTLUYfJaj6NI=; b=hHLpgo+5FjM1SsstKwPywEYpEfQ53QlBlsR94Iw7cYFSocsdjgk6giZXk2mtmT7fF5 6bv0c095AcnRc8fwu/Lk8UiLakUmSNvsr6OA8EdGJebCtARcQsFaedHmAjSsnYqp8S7u 8rmzh+CTA/6h5/lJwnkQB/SqfpTAYJA2EWSc7o/dDEZQa5AqFpw4fn04wGE9xDVvj7L3 s6uAHW9XD32bCiL9k78fL0GulQO/AjNPGOzWizUBml6yHlGlwd7tng0RmmK1xaae9oEB K6HoHdb5CQ+zWJQ6xSc7295i0F/Z9cITtEKyiI/xY4L+T/xhoG3FXXCLgMlxFu6N3sOP FhCw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1726756676; x=1727361476; 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=V6FtSuErjFeDPdu94Z43XasX0hpYQN6ZTLUYfJaj6NI=; b=fq9gAaT3BRq0cBWCl8RUmQsiyRB8JR0qUhaU9Q3oyqsAulCL3qTg59zNKOk6hJSwKZ ejYUxx5MjVBtZgJ1AJM6b2f9ZQlhbJdfj9e8PatB3TCT6Ggsfg28yht89BfsrrCaBb2x vyIDpBWqRFmZV0NTsioAljLz1MDdWWYvVDAbp2TGAup7A05seVWJQgriAG9swhfvPWbA BujVW9EAnv9FwMdG3ugcYkt6KE124pLHm1bE5i/idHVbRDOycNcbG/eojMWAM89HVyof ckSSI0lpBGZS4CSPf8MzN1G2ee2tI/2A1pTyHCtJp94bexyNrLrfG8rNSEL/6LjFCtQj dIvA== X-Gm-Message-State: AOJu0YzyhiL8U7+Xl8FIwI5gD2R3a1QoDksnehAH72wzzXAynik9o0+U COdz35tglxNwMOozeFl2NGkNHsPHqN4tT96RkGD0UD9/Zg3B6PmkSIWwQGYfnMWmdU9GqyehY4O +iBM= X-Google-Smtp-Source: AGHT+IEYcFyDiUfl7P3auU6o+KCnfgtWHEPAqYiV72rzOjZRm5646lxO+GAjNPmJyGGPWD4jfRMB8w== X-Received: by 2002:a05:6512:ac6:b0:52f:1a0:b49 with SMTP id 2adb3069b0e04-53678fcebc9mr15019030e87.31.1726756675674; Thu, 19 Sep 2024 07:37:55 -0700 (PDT) Received: from localhost.localdomain (87-100-245-199.bb.dnainternet.fi. [87.100.245.199]) by smtp.gmail.com with ESMTPSA id 2adb3069b0e04-536870a8721sm1889194e87.232.2024.09.19.07.37.54 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 19 Sep 2024 07:37:54 -0700 (PDT) From: Mikko Rapeli To: openembedded-core@lists.openembedded.org Cc: Mikko Rapeli Subject: [PATCH v3 10/12] oeqa selftest efibootpartition.py: remove systemd-boot from grub-efi test Date: Thu, 19 Sep 2024 17:37:04 +0300 Message-ID: <20240919143706.6074-11-mikko.rapeli@linaro.org> X-Mailer: git-send-email 2.45.2 In-Reply-To: <20240919143706.6074-1-mikko.rapeli@linaro.org> References: <20240919143706.6074-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 ; Thu, 19 Sep 2024 14:38:03 -0000 X-Groupsio-URL: https://lists.openembedded.org/g/openembedded-core/message/204702 The test is actually using grub-efi not systemd-boot so remove it completely. systemd-boot will be tested via uki.py tests. Signed-off-by: Mikko Rapeli --- meta/lib/oeqa/selftest/cases/efibootpartition.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/meta/lib/oeqa/selftest/cases/efibootpartition.py b/meta/lib/oeqa/selftest/cases/efibootpartition.py index 671bb68f2c..e039ba0386 100644 --- a/meta/lib/oeqa/selftest/cases/efibootpartition.py +++ b/meta/lib/oeqa/selftest/cases/efibootpartition.py @@ -21,11 +21,11 @@ class GenericEFITest(OESelftestTestCase): cmd += " kvm" self.write_config(""" -EFI_PROVIDER = "systemd-boot" +EFI_PROVIDER = "grub-efi" IMAGE_FSTYPES:pn-%s:append = " wic" MACHINE_FEATURES:append = " efi" WKS_FILE = "efi-bootdisk.wks.in" -IMAGE_INSTALL:append = " grub-efi systemd-boot kernel-image-bzimage" +IMAGE_INSTALL:append = " grub-efi kernel-image-bzimage" """ % (image)) From patchwork Thu Sep 19 14:37:05 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Mikko Rapeli X-Patchwork-Id: 49318 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 DEA63CF3957 for ; Thu, 19 Sep 2024 14:38:03 +0000 (UTC) Received: from mail-lf1-f49.google.com (mail-lf1-f49.google.com [209.85.167.49]) by mx.groups.io with SMTP id smtpd.web10.21267.1726756679943859631 for ; Thu, 19 Sep 2024 07:38:00 -0700 Authentication-Results: mx.groups.io; dkim=pass header.i=@linaro.org header.s=google header.b=LRTQh5UG; spf=pass (domain: linaro.org, ip: 209.85.167.49, mailfrom: mikko.rapeli@linaro.org) Received: by mail-lf1-f49.google.com with SMTP id 2adb3069b0e04-5365c060f47so1175560e87.2 for ; Thu, 19 Sep 2024 07:37:59 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1726756678; x=1727361478; 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=g5i3mJb6yOab7xNaPlCaVKAqusTsAOf/bLVHjvrfRkg=; b=LRTQh5UGc9fWMoSA1SCAUFJ9K4WOkML7ATGy/9V/ShzzJJ1ZZuuE4LjTCTNDWxHmx3 bE5qVq2PtNd0CXzV5zZ2qpDq3CWyPVcdwcCZnmi3x9xOq0A3wHEMlFRPQSrI7BMO4VjA mSWxhtVLn8lvcZbhtB2IcvA5FlwWb6TKyxx9dd0BAQmR0uS8XaeFZxxepTZYzrPmlyGy zYu761699caWxLZwvBCGVbOjtaengTGcjpBTtuYewFISKN6io/paXP9Xag8bVBqTF6uo IuJvRQ/aSWC+MJQaCaXXGizagysgTbSEA68+kI2rPML51yKEpH3gZ5OKZv5eJk3W3yaP Gbfg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1726756678; x=1727361478; 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=g5i3mJb6yOab7xNaPlCaVKAqusTsAOf/bLVHjvrfRkg=; b=CGfkFEM644gZayPo78Wkr56oDLw/CWnzD8KIkGsurkkkLkoMIL8QHNoKWhaioQGVLC 3spAld9srNdL3P+Nl/apbtIxgirlFcWfd6+/JUAEfPmsA5CIpopA3P+C2hZRA7wBmhwu vTR9NMiAe76BBI+0bXSq2lfp134rurdZjtHnBrNnCWzvZ9veemePRpXYBCGf/aDmi1ok 6s/BUPkGh4rfIPO1dwunwchPJ10hY8txDg9xyY169s8tenDAbev+koVZ1KNKaw/3o7QS nadYJD9FA7ijybzqB9x/hoC1iDTc9t2HmV+FHDZt7OG4lv/Avbno/FBR1ug6O04tu6aq ttDA== X-Gm-Message-State: AOJu0YyxD8r+Uk/bsq7a2vBqyxGv+cNouetuT0uH7soWIGIUpYz3KryD yta2IYb0vB4c48qvXs1l2VGxL/IMTeZBMoeRbtxzNlWe+mAApa+IW96X2UfvaNCyg347MhG3Ewq WNs0= X-Google-Smtp-Source: AGHT+IHXJjvRhHnAyE68vUJFmeIZHNO9jzEbPPcpTHhRaJ+96vuodgsv654HmOiYavnl6bfWRWMp9w== X-Received: by 2002:a05:6512:31cb:b0:52f:89aa:c344 with SMTP id 2adb3069b0e04-53678fc22e7mr15790421e87.16.1726756678040; Thu, 19 Sep 2024 07:37:58 -0700 (PDT) Received: from localhost.localdomain (87-100-245-199.bb.dnainternet.fi. [87.100.245.199]) by smtp.gmail.com with ESMTPSA id 2adb3069b0e04-536870a8721sm1889194e87.232.2024.09.19.07.37.56 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 19 Sep 2024 07:37:57 -0700 (PDT) From: Mikko Rapeli To: openembedded-core@lists.openembedded.org Cc: Mikko Rapeli Subject: [PATCH v3 11/12] oeqa selftest wic.py: add TEST_RUNQEMUPARAMS to runqemu Date: Thu, 19 Sep 2024 17:37:05 +0300 Message-ID: <20240919143706.6074-12-mikko.rapeli@linaro.org> X-Mailer: git-send-email 2.45.2 In-Reply-To: <20240919143706.6074-1-mikko.rapeli@linaro.org> References: <20240919143706.6074-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 ; Thu, 19 Sep 2024 14:38:03 -0000 X-Groupsio-URL: https://lists.openembedded.org/g/openembedded-core/message/204703 To support "slirp" networking on shared build machines instead of tun/tap devices. Users can set TEST_RUNQEMUPARAMS = "slirp" in their build/conf/local.conf to run selftests using "slirp" networking. The same works for testimage.bbclass and oeqa runtime tests. Signed-off-by: Mikko Rapeli --- meta/lib/oeqa/selftest/cases/wic.py | 16 ++++++++++------ 1 file changed, 10 insertions(+), 6 deletions(-) diff --git a/meta/lib/oeqa/selftest/cases/wic.py b/meta/lib/oeqa/selftest/cases/wic.py index b616759209..7d5da74de4 100644 --- a/meta/lib/oeqa/selftest/cases/wic.py +++ b/meta/lib/oeqa/selftest/cases/wic.py @@ -939,7 +939,8 @@ class Wic2(WicTestCase): bitbake('wic-image-minimal') self.remove_config(config) - with runqemu('wic-image-minimal', ssh=False, runqemuparams='nographic') as qemu: + runqemu_params = get_bb_var('TEST_RUNQEMUPARAMS', 'wic-image-minimal') + with runqemu('wic-image-minimal', ssh=False, runqemuparams='%s nographic' % (runqemu_params)) as qemu: cmd = "mount | grep '^/dev/' | cut -f1,3 -d ' ' | egrep -c -e '/dev/sda1 /boot' " \ "-e '/dev/root /|/dev/sda2 /' -e '/dev/sda3 /media' -e '/dev/sda4 /mnt'" status, output = qemu.run_serial(cmd) @@ -959,8 +960,9 @@ class Wic2(WicTestCase): bitbake('core-image-minimal ovmf') self.remove_config(config) + runqemu_params = get_bb_var('TEST_RUNQEMUPARAMS', 'core-image-minimal') with runqemu('core-image-minimal', ssh=False, - runqemuparams='nographic ovmf', image_fstype='wic') as qemu: + runqemuparams='%s nographic ovmf' % (runqemu_params), image_fstype='wic') as qemu: cmd = "grep sda. /proc/partitions |wc -l" status, output = qemu.run_serial(cmd) self.assertEqual(1, status, 'Failed to run command "%s": %s' % (cmd, output)) @@ -1154,8 +1156,9 @@ class Wic2(WicTestCase): bitbake('core-image-minimal-mtdutils') self.remove_config(config) + runqemu_params = get_bb_var('TEST_RUNQEMUPARAMS', 'core-image-minimal-mtdutils') with runqemu('core-image-minimal-mtdutils', ssh=False, - runqemuparams='nographic', image_fstype='wic') as qemu: + runqemuparams='%s nographic' % (runqemu_params), image_fstype='wic') as qemu: cmd = "grep sda. /proc/partitions |wc -l" status, output = qemu.run_serial(cmd) self.assertEqual(1, status, 'Failed to run command "%s": %s' % (cmd, output)) @@ -1214,8 +1217,9 @@ class Wic2(WicTestCase): bitbake('core-image-minimal') self.remove_config(config) + runqemu_params = get_bb_var('TEST_RUNQEMUPARAMS', 'core-image-minimal') with runqemu('core-image-minimal', ssh=False, - runqemuparams='nographic', image_fstype='wic') as qemu: + runqemuparams='%s nographic' % (runqemu_params), image_fstype='wic') as qemu: # Check that we have ONLY two /dev/sda* partitions (/boot and /) cmd = "grep sda. /proc/partitions | wc -l" status, output = qemu.run_serial(cmd) @@ -1446,8 +1450,8 @@ class Wic2(WicTestCase): os.rename(image_path, image_path + '.bak') os.rename(new_image_path, image_path) - # Check if it boots in qemu - with runqemu('core-image-minimal', ssh=False, runqemuparams='nographic') as qemu: + runqemu_params = get_bb_var('TEST_RUNQEMUPARAMS', 'core-image-minimal') + with runqemu('core-image-minimal', ssh=False, runqemuparams='%s nographic' % (runqemu_params)) as qemu: cmd = "ls /etc/" status, output = qemu.run_serial('true') self.assertEqual(1, status, 'Failed to run command "%s": %s' % (cmd, output)) From patchwork Thu Sep 19 14:37:06 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Mikko Rapeli X-Patchwork-Id: 49321 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 DF989CF3959 for ; Thu, 19 Sep 2024 14:38:13 +0000 (UTC) Received: from mail-lf1-f49.google.com (mail-lf1-f49.google.com [209.85.167.49]) by mx.groups.io with SMTP id smtpd.web10.21270.1726756684459760083 for ; Thu, 19 Sep 2024 07:38:04 -0700 Authentication-Results: mx.groups.io; dkim=pass header.i=@linaro.org header.s=google header.b=fyVb00pt; spf=pass (domain: linaro.org, ip: 209.85.167.49, mailfrom: mikko.rapeli@linaro.org) Received: by mail-lf1-f49.google.com with SMTP id 2adb3069b0e04-536a2759f0eso1189181e87.3 for ; Thu, 19 Sep 2024 07:38:04 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1726756683; x=1727361483; 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=LQGsEUw+X+3kKC9HihOU7N5QZLd2TmRQ9EFXmtDtZ08=; b=fyVb00ptItUv7rdMpjwFUChz5xKq7kffDDCyYnYGELXyTd5p7HkDn9NgpYmh6dugnB M1nHOguho27eZmGi2WZpDEBwe0Z6dXJ2/m7UJIsfMAoC3mRs4TqRqwHuFWBuSTTcpkMX /lYYldw5w56yGcAwHgW6cQaKe6wMgdw+JMIcjV2dA5JqRHkgAQplTtpV62hNim7TP7B3 xEJdFaCdBpt3zWFGTp0oXw4AzbdlVkNsJZrpaFOPuNsmhpgx6l/XjcSOzdeLEv0j6Ima 2Up7NJKXnZTpSOT6udDYPyJegP27KGg3xn2BxufPPBgrFVwB0r1OthIIht8fqNLwHFps Zg4Q== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1726756683; x=1727361483; 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=LQGsEUw+X+3kKC9HihOU7N5QZLd2TmRQ9EFXmtDtZ08=; b=n406rHm4LCU1PcPdlTcADQQYSFAydxpdttw3iTY0GHY7v7GVtRyClVc4lJvsAZT2q2 jRsyZNpcIT2RISBhwMfzRhDmJOeO/qq8rhomfqvHKjD1DzPbwhiILVoFfGE4OglwC9Ag rZY6s5td7U89cQdXM1t9SnoSe8T9io8Q1Plq8bLbK9fhguOb0wZ1MvUhOvhxYBncy2X6 YLc9IPOLaXUff+f4bMbMs2gGbBD60/DntxINwwSnnK/APs6L0c8vGmCZA8ZjNv6eZQmC i5AgXBU+vLakOp3uGt+0Q9e8NLSe5B9jvMjKeGzcdh5Xh0dDsyOQDIsDaQ087PMJHDFX MJjQ== X-Gm-Message-State: AOJu0Yy0CVGfzKnHaAit8lX2FOjpg6xbGfZU+RPm7prO+OrAJzn2LUrk vgVBv0cfoYv9NC2hETj81YH/8SqDeIKBXqHtITlGk9hka7WkV66vxrpkk3jgVxs6/yiVOew2fcS tOmI= X-Google-Smtp-Source: AGHT+IFaHGtneIZVqLbQDfcYXDbCZCC4Yn8CRF5qjdgbdKUVM+gc/vZlbxPmuO1e66Pl9b5Cu0xovg== X-Received: by 2002:a05:6512:138e:b0:533:44e7:1b2a with SMTP id 2adb3069b0e04-53678feb5f4mr15103283e87.40.1726756682521; Thu, 19 Sep 2024 07:38:02 -0700 (PDT) Received: from localhost.localdomain (87-100-245-199.bb.dnainternet.fi. [87.100.245.199]) by smtp.gmail.com with ESMTPSA id 2adb3069b0e04-536870a8721sm1889194e87.232.2024.09.19.07.37.58 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 19 Sep 2024 07:38:00 -0700 (PDT) From: Mikko Rapeli To: openembedded-core@lists.openembedded.org Cc: Mikko Rapeli Subject: [PATCH v3 12/12] oeqa selftest wic.py: support UKIs via uki.bbclass Date: Thu, 19 Sep 2024 17:37:06 +0300 Message-ID: <20240919143706.6074-13-mikko.rapeli@linaro.org> X-Mailer: git-send-email 2.45.2 In-Reply-To: <20240919143706.6074-1-mikko.rapeli@linaro.org> References: <20240919143706.6074-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 ; Thu, 19 Sep 2024 14:38:13 -0000 X-Groupsio-URL: https://lists.openembedded.org/g/openembedded-core/message/204704 Use label to detect rootfs since UKI with kernel command line is generated before rootfs is generated by wic. Adapt wic tests to build and boot uki.bbclass generated UKIs. Keeping one tests in wic.py and rest of the UKI features are tested with dedicated uki.py test. Signed-off-by: Mikko Rapeli --- meta-selftest/wic/test_efi_plugin.wks | 5 ++-- meta/lib/oeqa/selftest/cases/wic.py | 42 ++++++++++++++++++++------- 2 files changed, 34 insertions(+), 13 deletions(-) diff --git a/meta-selftest/wic/test_efi_plugin.wks b/meta-selftest/wic/test_efi_plugin.wks index 1603d6c4bb..e876a4be0e 100644 --- a/meta-selftest/wic/test_efi_plugin.wks +++ b/meta-selftest/wic/test_efi_plugin.wks @@ -1,6 +1,5 @@ # short-description: This file is used in oe-selftest wic module to test efi plugin - -part /boot --source bootimg-efi --sourceparams="loader=systemd-boot,create-unified-kernel-image=true,initrd=${INITRAMFS_IMAGE}-${MACHINE}.${INITRAMFS_FSTYPES}" --active --align 1024 --use-uuid -part / --source rootfs --fstype=ext4 --align 1024 --use-uuid +part /boot --source bootimg-efi --sourceparams="loader=systemd-boot" --active --align 1024 --use-uuid +part / --source rootfs --fstype=ext4 --align 1024 --use-uuid --label root bootloader --timeout=0 --append="console=ttyS0,115200n8" diff --git a/meta/lib/oeqa/selftest/cases/wic.py b/meta/lib/oeqa/selftest/cases/wic.py index 7d5da74de4..8b680a87a6 100644 --- a/meta/lib/oeqa/selftest/cases/wic.py +++ b/meta/lib/oeqa/selftest/cases/wic.py @@ -1292,24 +1292,46 @@ class Wic2(WicTestCase): @skipIfNotArch(['i586', 'i686', 'x86_64']) @OETestTag("runqemu") def test_efi_plugin_unified_kernel_image_qemu(self): - """Test efi plugin's Unified Kernel Image feature in qemu""" - config = 'IMAGE_FSTYPES = "wic"\n'\ - 'INITRAMFS_IMAGE = "core-image-minimal-initramfs"\n'\ - 'WKS_FILE = "test_efi_plugin.wks"\n'\ - 'MACHINE_FEATURES:append = " efi"\n' + """Test Unified Kernel Image feature in qemu without systemd in initramfs or rootfs""" + 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-core-image-base:append = " wic" +WKS_FILE = "test_efi_plugin.wks" + +# efi, uki and systemd features must be enabled +MACHINE_FEATURES:append = " efi" +DISTRO_FEATURES_NATIVE:append = " systemd" +IMAGE_CLASSES:append:pn-core-image-base = " uki" + +# uki embeds also an initrd, no systemd or udev +INITRAMFS_IMAGE = "core-image-initramfs-boot" + +# runqemu must not load kernel separately, it's in the uki +QB_KERNEL_ROOT = "" +QB_DEFAULT_KERNEL = "none" + +# boot command line provided via uki, not via bootloader +UKI_CMDLINE = "rootwait root=LABEL=root console=${KERNEL_CONSOLE}" + +""" self.append_config(config) - bitbake('core-image-minimal core-image-minimal-initramfs ovmf') + bitbake('core-image-base ovmf') + runqemu_params = get_bb_var('TEST_RUNQEMUPARAMS', 'core-image-base') + uki_filename = get_bb_var('UKI_FILENAME', 'core-image-base') self.remove_config(config) - with runqemu('core-image-minimal', ssh=False, - runqemuparams='nographic ovmf', image_fstype='wic') as qemu: + with runqemu('core-image-base', ssh=False, + runqemuparams='%s nographic ovmf' % (runqemu_params), image_fstype='wic') as qemu: # Check that /boot has EFI bootx64.efi (required for EFI) cmd = "ls /boot/EFI/BOOT/bootx64.efi | wc -l" status, output = qemu.run_serial(cmd) self.assertEqual(1, status, 'Failed to run command "%s": %s' % (cmd, output)) self.assertEqual(output, '1') - # Check that /boot has EFI/Linux/linux.efi (required for Unified Kernel Images auto detection) - cmd = "ls /boot/EFI/Linux/linux.efi | wc -l" + # Check that /boot has EFI/Linux/${UKI_FILENAME} (required for Unified Kernel Images auto detection) + cmd = "ls /boot/EFI/Linux/%s | wc -l" % (uki_filename) status, output = qemu.run_serial(cmd) self.assertEqual(1, status, 'Failed to run command "%s": %s' % (cmd, output)) self.assertEqual(output, '1')