From bae7cbaa7509fa2f05b8e3ef66e9b181589db032 Mon Sep 17 00:00:00 2001 From: Alexander Kanavin Date: Wed, 28 Oct 2020 22:05:48 +0100 Subject: libcap: update 2.43 -> 2.44 Rebase the patches. Signed-off-by: Alexander Kanavin Signed-off-by: Richard Purdie --- .../0001-tests-do-not-statically-link-a-test.patch | 38 ++++------- .../0002-tests-do-not-run-target-executables.patch | 14 ++-- meta/recipes-support/libcap/libcap_2.43.bb | 76 ---------------------- meta/recipes-support/libcap/libcap_2.44.bb | 76 ++++++++++++++++++++++ 4 files changed, 97 insertions(+), 107 deletions(-) delete mode 100644 meta/recipes-support/libcap/libcap_2.43.bb create mode 100644 meta/recipes-support/libcap/libcap_2.44.bb (limited to 'meta/recipes-support') diff --git a/meta/recipes-support/libcap/files/0001-tests-do-not-statically-link-a-test.patch b/meta/recipes-support/libcap/files/0001-tests-do-not-statically-link-a-test.patch index 81fdd2a15c..d9fd48a9db 100644 --- a/meta/recipes-support/libcap/files/0001-tests-do-not-statically-link-a-test.patch +++ b/meta/recipes-support/libcap/files/0001-tests-do-not-statically-link-a-test.patch @@ -1,4 +1,4 @@ -From e4fe6890e07821d60f01f000a95f7944f3d68139 Mon Sep 17 00:00:00 2001 +From 03e925f0d68bc51e1acf1ac2014a9c2452c664bf Mon Sep 17 00:00:00 2001 From: Alexander Kanavin Date: Wed, 15 Jan 2020 17:16:28 +0100 Subject: [PATCH] tests: do not statically link a test @@ -9,35 +9,25 @@ Upstream-Status: Inappropriate [oe-core specific] Signed-off-by: Alexander Kanavin --- - tests/Makefile | 8 ++++---- - 1 file changed, 4 insertions(+), 4 deletions(-) + tests/Makefile | 4 ++-- + 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/tests/Makefile b/tests/Makefile -index 876a8b9..93a0e3a 100644 +index d569650..f5ca377 100644 --- a/tests/Makefile +++ b/tests/Makefile -@@ -26,23 +26,23 @@ psx_test: psx_test.c $(DEPS) - run_libcap_psx_test: libcap_psx_test +@@ -11,7 +11,7 @@ ifeq ($(DYNAMIC),yes) + LDPATH = LD_LIBRARY_PATH=../libcap + DEPSBUILD = all + else +-LDFLAGS += --static ++LDFLAGS += + DEPSBUILD = libcap.a libpsx.a + endif - libcap_psx_test: libcap_psx_test.c $(DEPS) -- $(CC) $(CFLAGS) $(IPATH) $< -o $@ $(LIBCAPLIB) $(LIBPSXLIB) -Wl,-wrap,pthread_create --static -+ $(CC) $(CFLAGS) $(IPATH) $< -o $@ $(LIBCAPLIB) $(LIBPSXLIB) -Wl,-wrap,pthread_create - - run_libcap_launch_test: libcap_launch_test libcap_psx_launch_test noop - sudo ./libcap_launch_test - sudo ./libcap_psx_launch_test - - libcap_launch_test: libcap_launch_test.c $(DEPS) -- $(CC) $(CFLAGS) $(IPATH) $< -o $@ $(LIBCAPLIB) --static -+ $(CC) $(CFLAGS) $(IPATH) $< -o $@ $(LIBCAPLIB) - - # this varies only slightly from the above insofar as it currently - # only links in the pthreads fork support. TODO() we need to change - # the source to do something interesting with pthreads. - libcap_psx_launch_test: libcap_launch_test.c $(DEPS) -- $(CC) $(CFLAGS) $(IPATH) -DWITH_PTHREADS $< -o $@ $(LIBCAPLIB) $(LIBPSXLIB) -Wl,-wrap,pthread_create --static -+ $(CC) $(CFLAGS) $(IPATH) -DWITH_PTHREADS $< -o $@ $(LIBCAPLIB) $(LIBPSXLIB) -Wl,-wrap,pthread_create +@@ -51,7 +51,7 @@ libcap_psx_launch_test: libcap_launch_test.c $(DEPS) + # This one runs in a chroot with no shared library files. noop: noop.c - $(CC) $(CFLAGS) $< -o $@ --static + $(CC) $(CFLAGS) $< -o $@ 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 index e8f1df98c1..bfce8e0547 100644 --- 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 @@ -1,4 +1,4 @@ -From 5583b48c04d5bf50b56473d88d990c3f0bc45c14 Mon Sep 17 00:00:00 2001 +From 7744c1f678f5226a151bc6b2a254a56835229d91 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 @@ -11,20 +11,20 @@ Signed-off-by: Alexander Kanavin 1 file changed, 2 deletions(-) diff --git a/tests/Makefile b/tests/Makefile -index bfedbc2..876a8b9 100644 +index 8956d5d..d569650 100644 --- a/tests/Makefile +++ b/tests/Makefile -@@ -19,13 +19,11 @@ sudotest: test run_libcap_launch_test run_libcap_launch_test +@@ -27,13 +27,11 @@ sudotest: test run_libcap_launch_test run_libcap_launch_test install: all run_psx_test: psx_test -- ./psx_test +- $(LDPATH) ./psx_test psx_test: psx_test.c $(DEPS) - $(CC) $(CFLAGS) $(IPATH) $< -o $@ $(LIBPSXLIB) -Wl,-wrap,pthread_create + $(CC) $(CFLAGS) $(IPATH) $< -o $@ $(LIBPSXLIB) run_libcap_psx_test: libcap_psx_test -- ./libcap_psx_test +- $(LDPATH) ./libcap_psx_test libcap_psx_test: libcap_psx_test.c $(DEPS) - $(CC) $(CFLAGS) $(IPATH) $< -o $@ $(LIBCAPLIB) $(LIBPSXLIB) -Wl,-wrap,pthread_create --static + $(CC) $(CFLAGS) $(IPATH) $< -o $@ $(LIBCAPLIB) $(LIBPSXLIB) $(LDFLAGS) diff --git a/meta/recipes-support/libcap/libcap_2.43.bb b/meta/recipes-support/libcap/libcap_2.43.bb deleted file mode 100644 index c712c25947..0000000000 --- a/meta/recipes-support/libcap/libcap_2.43.bb +++ /dev/null @@ -1,76 +0,0 @@ -SUMMARY = "Library for getting/setting POSIX.1e capabilities" -HOMEPAGE = "http://sites.google.com/site/fullycapable/" - -# no specific GPL version required -LICENSE = "BSD | GPLv2" -LIC_FILES_CHKSUM = "file://License;md5=3f84fd6f29d453a56514cb7e4ead25f1" - -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 \ - file://0001-tests-do-not-statically-link-a-test.patch \ - " -SRC_URI[sha256sum] = "512a0e5fc4c1e06d472a20da26aa96a9b9bf2a26b23f094f77f1b8da56cc427f" - -UPSTREAM_CHECK_URI = "https://www.kernel.org/pub/linux/libs/security/linux-privs/${BPN}2/" - -inherit lib_package - -# do NOT pass target cflags to host compilations -# -do_configure() { - # libcap uses := for compilers, fortunately, it gives us a hint - # on what should be replaced with ?= - sed -e 's,:=,?=,g' -i Make.Rules - sed -e 's,^BUILD_CFLAGS ?= ,BUILD_CFLAGS := $(BUILD_CFLAGS) ,' -i Make.Rules -} - -PACKAGECONFIG ??= "${@bb.utils.filter('DISTRO_FEATURES', 'pam', d)}" -PACKAGECONFIG_class-native ??= "" - -PACKAGECONFIG[pam] = "PAM_CAP=yes,PAM_CAP=no,libpam" - -EXTRA_OEMAKE = " \ - INDENT= \ - lib='${baselib}' \ - RAISE_SETFCAP=no \ - DYNAMIC=yes \ - BUILD_GPERF=yes \ -" - -EXTRA_OEMAKE_append_class-target = " SYSTEM_HEADERS=${STAGING_INCDIR}" - -# these are present in the libcap defaults, so include in our CFLAGS too -CFLAGS += "-D_LARGEFILE64_SOURCE -D_FILE_OFFSET_BITS=64" - -do_compile() { - oe_runmake ${PACKAGECONFIG_CONFARGS} -} - -do_install() { - oe_runmake install \ - ${PACKAGECONFIG_CONFARGS} \ - DESTDIR="${D}" \ - prefix="${prefix}" \ - SBINDIR="${sbindir}" -} - -do_install_append() { - # Move the library to base_libdir - install -d ${D}${base_libdir} - if [ ! ${D}${libdir} -ef ${D}${base_libdir} ]; then - mv ${D}${libdir}/libcap* ${D}${base_libdir} - if [ -d ${D}${libdir}/security ]; then - mv ${D}${libdir}/security ${D}${base_libdir} - fi - fi -} - -FILES_${PN}-dev += "${base_libdir}/*.so" - -# pam files -FILES_${PN} += "${base_libdir}/security/*.so" - -BBCLASSEXTEND = "native nativesdk" diff --git a/meta/recipes-support/libcap/libcap_2.44.bb b/meta/recipes-support/libcap/libcap_2.44.bb new file mode 100644 index 0000000000..79875522d6 --- /dev/null +++ b/meta/recipes-support/libcap/libcap_2.44.bb @@ -0,0 +1,76 @@ +SUMMARY = "Library for getting/setting POSIX.1e capabilities" +HOMEPAGE = "http://sites.google.com/site/fullycapable/" + +# no specific GPL version required +LICENSE = "BSD | GPLv2" +LIC_FILES_CHKSUM = "file://License;md5=3f84fd6f29d453a56514cb7e4ead25f1" + +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 \ + file://0001-tests-do-not-statically-link-a-test.patch \ + " +SRC_URI[sha256sum] = "92188359cd5be86e8e5bd3f6483ac6ce582264f912398937ef763def2205c8e1" + +UPSTREAM_CHECK_URI = "https://www.kernel.org/pub/linux/libs/security/linux-privs/${BPN}2/" + +inherit lib_package + +# do NOT pass target cflags to host compilations +# +do_configure() { + # libcap uses := for compilers, fortunately, it gives us a hint + # on what should be replaced with ?= + sed -e 's,:=,?=,g' -i Make.Rules + sed -e 's,^BUILD_CFLAGS ?= ,BUILD_CFLAGS := $(BUILD_CFLAGS) ,' -i Make.Rules +} + +PACKAGECONFIG ??= "${@bb.utils.filter('DISTRO_FEATURES', 'pam', d)}" +PACKAGECONFIG_class-native ??= "" + +PACKAGECONFIG[pam] = "PAM_CAP=yes,PAM_CAP=no,libpam" + +EXTRA_OEMAKE = " \ + INDENT= \ + lib='${baselib}' \ + RAISE_SETFCAP=no \ + DYNAMIC=yes \ + BUILD_GPERF=yes \ +" + +EXTRA_OEMAKE_append_class-target = " SYSTEM_HEADERS=${STAGING_INCDIR}" + +# these are present in the libcap defaults, so include in our CFLAGS too +CFLAGS += "-D_LARGEFILE64_SOURCE -D_FILE_OFFSET_BITS=64" + +do_compile() { + oe_runmake ${PACKAGECONFIG_CONFARGS} +} + +do_install() { + oe_runmake install \ + ${PACKAGECONFIG_CONFARGS} \ + DESTDIR="${D}" \ + prefix="${prefix}" \ + SBINDIR="${sbindir}" +} + +do_install_append() { + # Move the library to base_libdir + install -d ${D}${base_libdir} + if [ ! ${D}${libdir} -ef ${D}${base_libdir} ]; then + mv ${D}${libdir}/libcap* ${D}${base_libdir} + if [ -d ${D}${libdir}/security ]; then + mv ${D}${libdir}/security ${D}${base_libdir} + fi + fi +} + +FILES_${PN}-dev += "${base_libdir}/*.so" + +# pam files +FILES_${PN} += "${base_libdir}/security/*.so" + +BBCLASSEXTEND = "native nativesdk" -- cgit 1.2.3-korg