From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from lists.gentoo.org (pigeon.gentoo.org [208.92.234.80]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (2048 bits)) (No client certificate requested) by finch.gentoo.org (Postfix) with ESMTPS id B4CB415803E for ; Mon, 1 Jan 2024 20:06:14 +0000 (UTC) Received: from pigeon.gentoo.org (localhost [127.0.0.1]) by pigeon.gentoo.org (Postfix) with SMTP id 009002BC023; Mon, 1 Jan 2024 20:06:14 +0000 (UTC) Received: from smtp.gentoo.org (woodpecker.gentoo.org [140.211.166.183]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (No client certificate requested) by pigeon.gentoo.org (Postfix) with ESMTPS id D168B2BC023 for ; Mon, 1 Jan 2024 20:06:13 +0000 (UTC) Received: from oystercatcher.gentoo.org (oystercatcher.gentoo.org [148.251.78.52]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (No client certificate requested) by smtp.gentoo.org (Postfix) with ESMTPS id D016A33D3C2 for ; Mon, 1 Jan 2024 20:06:12 +0000 (UTC) Received: from localhost.localdomain (localhost [IPv6:::1]) by oystercatcher.gentoo.org (Postfix) with ESMTP id 23FB911DB for ; Mon, 1 Jan 2024 20:06:11 +0000 (UTC) From: "Michał Górny" To: gentoo-commits@lists.gentoo.org Content-Transfer-Encoding: 8bit Content-type: text/plain; charset=UTF-8 Reply-To: gentoo-dev@lists.gentoo.org, "Michał Górny" Message-ID: <1704139568.1b8f137bc41f76e3c30abbd200ddab9b004b5775.mgorny@gentoo> Subject: [gentoo-commits] repo/gentoo:master commit in: sys-kernel/gentoo-kernel-bin/ X-VCS-Repository: repo/gentoo X-VCS-Files: sys-kernel/gentoo-kernel-bin/gentoo-kernel-bin-6.6.9.ebuild X-VCS-Directories: sys-kernel/gentoo-kernel-bin/ X-VCS-Committer: mgorny X-VCS-Committer-Name: Michał Górny X-VCS-Revision: 1b8f137bc41f76e3c30abbd200ddab9b004b5775 X-VCS-Branch: master Date: Mon, 1 Jan 2024 20:06:11 +0000 (UTC) Precedence: bulk List-Post: List-Help: List-Unsubscribe: List-Subscribe: List-Id: Gentoo Linux mail X-BeenThere: gentoo-commits@lists.gentoo.org X-Auto-Response-Suppress: DR, RN, NRN, OOF, AutoReply X-Archives-Salt: e3fa06fa-2460-4df3-b846-1f4a929b9ac9 X-Archives-Hash: c0e7223b1638db3b8995c2ed53febdbb commit: 1b8f137bc41f76e3c30abbd200ddab9b004b5775 Author: Michał Górny gentoo org> AuthorDate: Mon Jan 1 20:04:54 2024 +0000 Commit: Michał Górny gentoo org> CommitDate: Mon Jan 1 20:06:08 2024 +0000 URL: https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=1b8f137b sys-kernel/gentoo-kernel-bin: Refactoring UKI binpackage logic Refactor the UKI extraction/cleanup logic to check for valid uki.efi file rather than hardcoding the list of architectures using it. Signed-off-by: Michał Górny gentoo.org> .../gentoo-kernel-bin-6.6.9.ebuild | 27 ++++++++++++---------- 1 file changed, 15 insertions(+), 12 deletions(-) diff --git a/sys-kernel/gentoo-kernel-bin/gentoo-kernel-bin-6.6.9.ebuild b/sys-kernel/gentoo-kernel-bin/gentoo-kernel-bin-6.6.9.ebuild index 53128e72162f..fef68306ec7d 100644 --- a/sys-kernel/gentoo-kernel-bin/gentoo-kernel-bin-6.6.9.ebuild +++ b/sys-kernel/gentoo-kernel-bin/gentoo-kernel-bin-6.6.9.ebuild @@ -100,11 +100,12 @@ src_configure() { ) local kernel_dir="${BINPKG}/image/usr/src/linux-${KPV}" - if has "${ARCH}" amd64 arm64; then - local image_path="${kernel_dir}/$(dist-kernel_get_image_path)" - # We need the plain image for the test phase - kernel-install_extract_from_uki linux \ - "${image_path%/*}"/uki.efi "${image_path}" + local image="${kernel_dir}/$(dist-kernel_get_image_path)" + local uki="${image%/*}/uki.efi" + if [[ -s ${uki} ]]; then + # We need to extract the plain image for the test phase + # and USE=-generic-uki. + kernel-install_extract_from_uki linux "${uki}" "${image}" fi mkdir modprep || die @@ -115,20 +116,22 @@ src_configure() { src_test() { local kernel_dir="${BINPKG}/image/usr/src/linux-${KPV}" kernel-install_test "${KPV}" \ - "${kernel_dir}/$(dist-kernel_get_image_path)" \ + "${WORKDIR}/${kernel_dir}/$(dist-kernel_get_image_path)" \ "${BINPKG}/image/lib/modules/${KPV}" } src_install() { - if has "${ARCH}" amd64 arm64; then - local kernel_dir="${BINPKG}/image/usr/src/linux-${KPV}" + local kernel_dir="${BINPKG}/image/usr/src/linux-${KPV}" + local image="${kernel_dir}/$(dist-kernel_get_image_path)" + local uki="${image%/*}/uki.efi" + if [[ -s ${uki} ]]; then # Keep the kernel image type we don't want out of install tree # Replace back with placeholder - local to_remove="${kernel_dir}/$(dist-kernel_get_image_path)" - if ! use generic-uki; then - to_remove=${to_remove%/*}/uki.efi + if use generic-uki; then + > "${image}" || die + else + > "${uki}" || die fi - > "${to_remove}" || die fi mv "${BINPKG}"/image/{lib,usr} "${ED}"/ || die