From patchwork Mon Mar 17 15:12:13 2025 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Ross Burton X-Patchwork-Id: 59263 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 97950C35FF3 for ; Mon, 17 Mar 2025 15:12:30 +0000 (UTC) Received: from foss.arm.com (foss.arm.com [217.140.110.172]) by mx.groups.io with SMTP id smtpd.web10.55027.1742224341588975955 for ; Mon, 17 Mar 2025 08:12:21 -0700 Authentication-Results: mx.groups.io; dkim=none (message not signed); spf=pass (domain: arm.com, ip: 217.140.110.172, mailfrom: ross.burton@arm.com) Received: from usa-sjc-imap-foss1.foss.arm.com (unknown [10.121.207.14]) by usa-sjc-mx-foss1.foss.arm.com (Postfix) with ESMTP id E9E3913D5 for ; Mon, 17 Mar 2025 08:12:29 -0700 (PDT) Received: from cesw-amp-gbt-1s-m12830-04.lab.cambridge.arm.com (usa-sjc-imap-foss1.foss.arm.com [10.121.207.14]) by usa-sjc-imap-foss1.foss.arm.com (Postfix) with ESMTPA id B1E6C3F694 for ; Mon, 17 Mar 2025 08:12:20 -0700 (PDT) From: Ross Burton To: openembedded-core@lists.openembedded.org Subject: [PATCH 1/2] libcap: recipe cleanup Date: Mon, 17 Mar 2025 15:12:13 +0000 Message-ID: <20250317151216.3484052-1-ross.burton@arm.com> X-Mailer: git-send-email 2.43.0 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 ; Mon, 17 Mar 2025 15:12:30 -0000 X-Groupsio-URL: https://lists.openembedded.org/g/openembedded-core/message/213106 Drop 0001-ensure-the-XATTR_NAME_CAPS-is-defined-when-it-is-use.patch, fixed upstream in "libcap: Fix for older kernels"[1]. Drop 0002-tests-do-not-run-target-executables.patch, doesn't appear to be needed anymore and most likely resolved by "Don't build the tests/binaries until we want to run them"[2]. There's no need to set PACKAGECONFIG:class-native as we disable PAM in the native DISTRO_FEATURES. The recipe LICENSE needs to reflect the _source_ license, so it can't be controlled by PACKAGECONFIG. Also update the license to reflect the actual licensing. No need to set COPTS, since "Canonicalize build system"[3] the exported CFLAGS/CPPFLAGS/LDFLAGS are respected. Merge multiple make arguments into EXTRA_OEMAKE to remove duplication. SYSTEM_HEADERS is not used upstream, remove. Remove redundant FILES:PN-dev, this is part of the default. [1] f1c3ac995d02d4f17b9d15656ab6d58f4c87435a [2] 99799844ad9272d43892881d1090369e6032aec2 [3] 2762c2c1a8c98d9012fcd40f20d133493a0b3219 Signed-off-by: Ross Burton --- ..._NAME_CAPS-is-defined-when-it-is-use.patch | 35 ------------------- ...-tests-do-not-run-target-executables.patch | 29 --------------- meta/recipes-support/libcap/libcap_2.74.bb | 27 ++++---------- 3 files changed, 7 insertions(+), 84 deletions(-) delete mode 100644 meta/recipes-support/libcap/files/0001-ensure-the-XATTR_NAME_CAPS-is-defined-when-it-is-use.patch delete mode 100644 meta/recipes-support/libcap/files/0002-tests-do-not-run-target-executables.patch diff --git a/meta/recipes-support/libcap/files/0001-ensure-the-XATTR_NAME_CAPS-is-defined-when-it-is-use.patch b/meta/recipes-support/libcap/files/0001-ensure-the-XATTR_NAME_CAPS-is-defined-when-it-is-use.patch deleted file mode 100644 index c576351e819..00000000000 --- a/meta/recipes-support/libcap/files/0001-ensure-the-XATTR_NAME_CAPS-is-defined-when-it-is-use.patch +++ /dev/null @@ -1,35 +0,0 @@ -From bda8da622bd3f4d8b0e577387e988ce364b917c4 Mon Sep 17 00:00:00 2001 -From: Roy Li -Date: Thu, 23 Jun 2016 16:26:43 +0800 -Subject: [PATCH] Ensure the XATTR_NAME_CAPS is defined when it is used -MIME-Version: 1.0 -Content-Type: text/plain; charset=UTF-8 -Content-Transfer-Encoding: 8bit - -Upstream-Status: Pending - -VFS_CAP_U32 can not ensure that XATTR_NAME_CAPS is defined, and failed to build -libcap-native in old release, like CentOS release 6.7 (Final), with the blow -error: - cap_file.c: In function ‘cap_get_fd’: - cap_file.c:199: error: ‘XATTR_NAME_CAPS’ undeclared (first use in this function) - cap_file.c:199: error: (Each undeclared identifier is reported only once - -Signed-off-by: Roy Li ---- - libcap/cap_file.c | 2 +- - 1 file changed, 1 insertion(+), 1 deletion(-) - -diff --git a/libcap/cap_file.c b/libcap/cap_file.c -index 0bc07f7..37bc34e 100644 ---- a/libcap/cap_file.c -+++ b/libcap/cap_file.c -@@ -44,7 +44,7 @@ extern int fremovexattr(int, const char *); - - #include "libcap.h" - --#ifdef VFS_CAP_U32 -+#if defined (VFS_CAP_U32) && defined (XATTR_NAME_CAPS) - - #if VFS_CAP_U32 != __CAP_BLKS - # error VFS representation of capabilities is not the same size as kernel diff --git a/meta/recipes-support/libcap/files/0002-tests-do-not-run-target-executables.patch b/meta/recipes-support/libcap/files/0002-tests-do-not-run-target-executables.patch deleted file mode 100644 index 8cabed6342a..00000000000 --- a/meta/recipes-support/libcap/files/0002-tests-do-not-run-target-executables.patch +++ /dev/null @@ -1,29 +0,0 @@ -From 5846ba594bedd66c8fd216cad6518f7be11b7a92 Mon Sep 17 00:00:00 2001 -From: Alexander Kanavin -Date: Fri, 20 Dec 2019 16:54:05 +0100 -Subject: [PATCH] tests: do not run target executables - -Upstream-Status: Inappropriate [oe-core specific] -Signed-off-by: Alexander Kanavin ---- - tests/Makefile | 2 -- - 1 file changed, 2 deletions(-) - -diff --git a/tests/Makefile b/tests/Makefile -index 3d03721..fbb1d78 100644 ---- a/tests/Makefile -+++ b/tests/Makefile -@@ -69,13 +69,11 @@ endif - - # unprivileged - run_psx_test: psx_test -- ./psx_test - - psx_test: psx_test.c $(DEPS) - $(CC) $(CFLAGS) $(CPPFLAGS) $(LDFLAGS) $< -o $@ $(LINKEXTRA) $(LIBPSXLIB) - - run_libcap_psx_test: libcap_psx_test -- ./libcap_psx_test - - libcap_psx_test: libcap_psx_test.c $(DEPS) - $(CC) $(CFLAGS) $(CPPFLAGS) $(LDFLAGS) $< -o $@ $(LINKEXTRA) $(LIBCAPLIB) $(LIBPSXLIB) diff --git a/meta/recipes-support/libcap/libcap_2.74.bb b/meta/recipes-support/libcap/libcap_2.74.bb index 75019fd35fd..9240763e9a5 100644 --- a/meta/recipes-support/libcap/libcap_2.74.bb +++ b/meta/recipes-support/libcap/libcap_2.74.bb @@ -3,19 +3,16 @@ DESCRIPTION = "A library providing the API to access POSIX capabilities. \ These allow giving various kinds of specific privileges to individual \ users, without giving them full root permissions." HOMEPAGE = "http://sites.google.com/site/fullycapable/" -# no specific GPL version required -LICENSE = "BSD-3-Clause | GPL-2.0-only" -LIC_FILES_CHKSUM_PAM = "file://pam_cap/License;md5=905326f41d3d1f8df21943f9a4ed6b50" + +# The library is BSD | GPLv2, the PAM module is BSD | LGPLv2+ +LICENSE = "(BSD-3-Clause | GPL-2.0-only) & (BSD-3-Clause | LGPL-2.0-or-later)" LIC_FILES_CHKSUM = "file://License;md5=2965a646645b72ecee859b43c592dcaa \ - ${@bb.utils.contains('PACKAGECONFIG', 'pam', '${LIC_FILES_CHKSUM_PAM}', '', d)} \ + file://pam_cap/License;md5=905326f41d3d1f8df21943f9a4ed6b50 \ " DEPENDS = "hostperl-runtime-native gperf-native" -SRC_URI = "${KERNELORG_MIRROR}/linux/libs/security/linux-privs/${BPN}2/${BPN}-${PV}.tar.xz \ - file://0001-ensure-the-XATTR_NAME_CAPS-is-defined-when-it-is-use.patch \ - file://0002-tests-do-not-run-target-executables.patch \ - " +SRC_URI = "${KERNELORG_MIRROR}/linux/libs/security/linux-privs/${BPN}2/${BPN}-${PV}.tar.xz" SRC_URI:append:class-nativesdk = " \ file://0001-nativesdk-libcap-Raise-the-size-of-arrays-containing.patch \ " @@ -26,11 +23,10 @@ UPSTREAM_CHECK_URI = "https://www.kernel.org/pub/linux/libs/security/linux-privs inherit lib_package PACKAGECONFIG ??= "${@bb.utils.filter('DISTRO_FEATURES', 'pam', d)}" -PACKAGECONFIG:class-native ??= "" - PACKAGECONFIG[pam] = "PAM_CAP=yes,PAM_CAP=no,libpam" EXTRA_OEMAKE = " \ + ${PACKAGECONFIG_CONFARGS} \ INDENT= \ lib='${baselib}' \ RAISE_SETFCAP=no \ @@ -38,23 +34,16 @@ EXTRA_OEMAKE = " \ USE_GPERF=yes \ " -EXTRA_OEMAKE:append:class-target = " SYSTEM_HEADERS=${STAGING_INCDIR}" - do_compile() { - unset CFLAGS BUILD_CFLAGS oe_runmake \ - ${PACKAGECONFIG_CONFARGS} \ AR="${AR}" \ CC="${CC}" \ RANLIB="${RANLIB}" \ - OBJCOPY="${OBJCOPY}" \ - COPTS="${CFLAGS}" \ - BUILD_COPTS="${BUILD_CFLAGS}" + OBJCOPY="${OBJCOPY}" } do_install() { oe_runmake install \ - ${PACKAGECONFIG_CONFARGS} \ DESTDIR="${D}" \ prefix="${prefix}" \ SBINDIR="${sbindir}" @@ -71,8 +60,6 @@ do_install:append() { fi } -FILES:${PN}-dev += "${base_libdir}/*.so" - # pam files FILES:${PN} += "${base_libdir}/security/*.so"