From patchwork Sun Nov 29 22:26:05 2026 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Ricardo Salveti X-Patchwork-Id: 106313 Received: from mx0a-0031df01.pphosted.com (mx0a-0031df01.pphosted.com [205.220.168.131]) by mx.groups.io with SMTP id smtpd.msgproc02-g2.21293.1795991169155044152 for ; Sun, 29 Nov 2026 14:26:09 -0800 Authentication-Results: mx.groups.io; dkim=pass header.i=@qualcomm.com header.s=qcppdkim1 header.b=J1h43ks7; dkim=pass header.i=@oss.qualcomm.com header.s=google header.b=aC7XrQ05; spf=permerror, err=parse error for token &{10 18 %{ir}.%{v}.%{d}.spf.has.pphosted.com}: invalid domain name (domain: oss.qualcomm.com, ip: 205.220.168.131, mailfrom: ricardo.salveti@oss.qualcomm.com) Received: from pps.filterd (m0279863.ppops.net [127.0.0.1]) by mx0a-0031df01.pphosted.com (8.18.1.11/8.18.1.11) with ESMTP id 6ATKLOSq607536 for ; Sun, 29 Nov 2026 22:26:08 GMT DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=qualcomm.com; h= content-transfer-encoding:date:from:in-reply-to:message-id :mime-version:references:subject:to; s=qcppdkim1; bh=wl6jWMx2Cb9 pMJJslMARWuEIkCITtetnW12r1z/c/uk=; b=J1h43ks70knSSpsa9pmrRQEQ+Gc d0Zokrruk/cIURWJcNJU/yGe50UZRaX+5BEIG/hiVP10tBWwwj1aw3ko/GoPh208 O/lNd2MeanXQHu09G+w3pALCagAuin6mSlDhpVs5N1TsYvBNeL7+REBjZROx0d7H Np7MdLJQBVJXBxGcRflCWEdTLvYSmEviCa6W8qbhvZj8nZv9gEXY2R4hUt/53dbK PfZu4Amig9PWLD6tuoJoDRqVAy7vKjpv+hxJoOrW9PUeKXS+wgkXIkbvnlEIrHm3 JaCVilpZV1pzGMYUjYiHVyuz4pdzRw6NHomdppOyQQKtkRUEhBMMIC+piEA== Received: from mail-pg1-f199.google.com (mail-pg1-f199.google.com [209.85.215.199]) by mx0a-0031df01.pphosted.com (PPS) with ESMTPS id 4j7q633tkj-1 (version=TLSv1.3 cipher=TLS_AES_128_GCM_SHA256 bits=128 verify=NOT) for ; Sun, 29 Nov 2026 22:26:08 +0000 (GMT) Received: by mail-pg1-f199.google.com with SMTP id 41be03b00d2f7-cd652c0385bso6619059a12.2 for ; Sun, 29 Nov 2026 14:26:08 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=oss.qualcomm.com; s=google; t=1795991168; x=1796595968; darn=lists.openembedded.org; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:to:from:from:to:cc:subject:date:message-id :reply-to:content-type; bh=wl6jWMx2Cb9pMJJslMARWuEIkCITtetnW12r1z/c/uk=; b=aC7XrQ05xsiBenEFZBEQkz3z+G0D7YuOCW3lh+bDLbAtcDNPPZR3aC7XffO0n6dHvT 0nntrDdn7THXr/7Fm3FOmFufI30ychiTMezv7SfDzNWLEfJcCiWsaAqxik3djcmcvZcD vKFE01in9MQGSSjluzE0udTyUOUfSDLMSk0anh8u9I+qMnf/8KfTSW7oixmsOMse4DP0 lGnPpwHDHN1YN1OBDGfMRxA8MOurPcVsoAjo+HHRLXHLKzv4YfjDG4JPckvjN8z3yEM6 Qx/Nr+Xrp5HWcle+CfWM7ETil1jzof5duWckCKmDEFT73NOMQbUKiskiixq+oOmJu2Lv 7G1w== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20260707; t=1795991168; x=1796595968; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:to:from:x-gm-gg:x-gm-message-state:from:to :cc:subject:date:message-id:reply-to:content-type; bh=wl6jWMx2Cb9pMJJslMARWuEIkCITtetnW12r1z/c/uk=; b=uuLkXx2yVe6A+dJ+AuYm3kxiKgzcp+LLclzadWUdxGap42WQgwkVu2USCcqXhToAxJ uv4emjOhh6M2JUTyGZz1eSK5oF2JWTSNYTIb7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1d1-3b41c7abf75mr29167511a91.6.1795991167698; Sun, 29 Nov 2026 14:26:07 -0800 (PST) X-Received: by 2002:a17:90a:e70f:b0:3b3:c8dc:a109 with SMTP id 98e67ed59e1d1-3b41c7abf75mr29167504a91.6.1795991167110; Sun, 29 Nov 2026 14:26:07 -0800 (PST) Received: from ip-172-31-25-255.us-west-2.compute.internal (ec2-35-83-207-173.us-west-2.compute.amazonaws.com. [35.83.207.173]) by smtp.gmail.com with ESMTPSA id 41be03b00d2f7-cde6d0100ccsm16496992a12.17.2026.11.29.14.26.06 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sun, 29 Nov 2026 14:26:06 -0800 (PST) From: Ricardo Salveti To: openembedded-core@lists.openembedded.org Subject: [PATCH v2] uki.bbclass: allow overriding the embedded os-release Date: Sun, 29 Nov 2026 22:26:05 +0000 Message-ID: <20261129222605.2163613-1-ricardo.salveti@oss.qualcomm.com> X-Mailer: git-send-email 2.43.0 In-Reply-To: <20261129165751.1606210-1-ricardo.salveti@oss.qualcomm.com> References: <20261129165751.1606210-1-ricardo.salveti@oss.qualcomm.com> MIME-Version: 1.0 X-Proofpoint-Spam-Info: AW1haW4tMjYxMTI5MDA4OSBTYWx0ZWRfX3JOa43CFRaMz J06DodD6fY48Jl0mRCZmRYRaLlfxIWeLFN0u5urIp6i1R4RshHqOr2m4mR7kn3PwmXI/IVgxkQB gAf9CUMjXx3wX1QK1ZFXXCHktg+j5/8= X-Proofpoint-Spam-Details-Enc: AW1haW4tMjYxMTI5MDA4OSBTYWx0ZWRfX2Kx1UGv4eXd/ h9NcYS3CRg2qpd4pDJzLOyo3HhRXSRp5zX8wd/958+Y2ImvLS4W55g95vLB/B2rXWEKcJ9eAxNK P/jV2/XQSA0HkIfyTa+8gwe1UhNEoKga4owOJJaOM3c4m8LZYD6DDSNpI8Vto//ovHUhmXKukoN iuGDgQQRyVHRxi93HRICNcGYgJ2grZWmKs4eQc1O8lahkICqP3F+KgW/zoqkZZG6TOIN1T7SMkD pvC4irKkJdIq3TUnvIauUBcG49pN8swxIgCee9ICKh551BY1fX7QWQqUqazYbWgqKVG1AQ8XdOI jvIGhUTuF8Cx6fnNF+2ELT3aQ+4ehflA+7caOATrHGbPmsmZspSgdAmLXUgXY5dA14GyYW9DLOA h8PgEp5Mo+iBPiS3cu+ohcrojN+DGD9QuijzWyO5Ip1E9en/uWl8H0/r6m8SftDKPDiitC52Dau rRV/BcIzK/wB8dSLvvQ== X-Proofpoint-ORIG-GUID: _XJ9oVRdm4kE_RkV8NGK6ulTnlbOQF8s X-Authority-Analysis: v=2.4 cv=WtO+otfv c=1 sm=1 tr=0 ts=6b0ca680 cx=c_pps a=Oh5Dbbf/trHjhBongsHeRQ==:117 a=P2/bgbqRawb6I1+7fxbs5g==:17 a=zJRp6_cAMcgA:10 a=s4-Qcg_JpJYA:10 a=VkNPw1HP01LnGYTKEx00:22 a=u7WPNUs3qKkmUXheDGA7:22 a=yOCtJkima9RkubShWh1s:22 a=nv23E9fyAAAA:8 a=EUspDBNiAAAA:8 a=EkWeAsWVgpzCBOLmTNMA:9 a=_Vgx9l1VpLgwpw_dHYaR:22 a=ehkDpipTsgk7cDPTKqUC:22 X-Proofpoint-GUID: _XJ9oVRdm4kE_RkV8NGK6ulTnlbOQF8s X-Proofpoint-Virus-Version: vendor=baseguard engine=ICAP:2.0.293,Aquarius:18.0.1176,Hydra:6.1.138,FMLib:17.12.100.49 definitions=2026-11-29_04,2026-11-27_03,2025-10-01_01 X-Proofpoint-Spam-Details: rule=outbound_notspam policy=outbound score=0 lowpriorityscore=0 suspectscore=0 adultscore=0 priorityscore=1501 malwarescore=0 clxscore=1015 impostorscore=0 phishscore=0 spamscore=0 bulkscore=0 classifier=typeunknown authscore=0 authtc= authcc= route=outbound adjust=0 reason=mlx scancount=1 engine=8.22.0-2611040001 definitions=main-2611290089 List-Id: X-Webhook-Received: from 45-33-107-173.ip.linodeusercontent.com [45.33.107.173] by lin-tor-korg-lkml-alma10-1 with HTTPS for ; Sun, 29 Nov 2026 22:26:19 -0000 X-Groupsio-URL: https://lists.openembedded.org/g/openembedded-core/message/251550 uki.bbclass copies the os-release file from the recipe sysroot into the UKI (its .osrel section), and there is no way to use a different file: the class always passes --os-release to ukify, which takes precedence over UKI_CONFIG_FILE. systemd-boot boots the UKIs placed in /EFI/Linux on the EFI system partition without any loader entry file; the Boot Loader Specification calls these "Type #2" entries [1]. It reads the os-release embedded in each UKI to name it in the menu and to order them: UKIs of the same OS are sorted by their version fields (VERSION, VERSION_ID, IMAGE_VERSION or BUILD_ID), newest first, and by file name only when those are equal, and the first one boots by default. A layer that installs several such UKIs and sets their order through the file names therefore needs to embed an os-release without the version fields, while the rootfs keeps the full one. Add UKI_OS_RELEASE, the os-release file embedded in the UKI. It defaults to the os-release from the recipe sysroot, so nothing changes unless a layer sets it. [1] https://uapi-group.org/specifications/specs/boot_loader_specification/#type-2-efi-unified-kernel-images AI-Generated: Uses Claude Code (Claude Opus 5.5) Signed-off-by: Ricardo Salveti --- meta/classes-recipe/uki.bbclass | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/meta/classes-recipe/uki.bbclass b/meta/classes-recipe/uki.bbclass index bcccf824c7..faad496f1b 100644 --- a/meta/classes-recipe/uki.bbclass +++ b/meta/classes-recipe/uki.bbclass @@ -80,6 +80,7 @@ UKI_CONFIG_FILE ?= "${UNPACKDIR}/uki.conf" UKI_FILENAME ?= "uki.efi" UKI_KERNEL_FILENAME ?= "${KERNEL_IMAGETYPE}" UKI_CMDLINE ?= "rootwait root=LABEL=root" +UKI_OS_RELEASE ?= "${RECIPE_SYSROOT}${prefix}/lib/os-release" KERNEL_DEVICETREE ??= "" UKI_DEVICETREE ?= "${KERNEL_DEVICETREE}" # secure boot keys and cert, needs sbsign-tools-native (meta-secure-core) @@ -171,8 +172,10 @@ python do_uki() { (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")) + os_release = d.getVar('UKI_OS_RELEASE') + if not os_release or not os.path.exists(os_release): + bb.fatal("ERROR: cannot find os-release %s" % (os_release)) + ukify_cmd += " --os-release=@%s" % (os_release) # TODO: tpm2 measure for secure boot, depends on systemd-native and TPM tooling # needed in systemd > 254 to fulfill ConditionSecurity=measured-uki