From f1a582bd0be0fb887729731126d83c469446cf95 Mon Sep 17 00:00:00 2001 From: Randy MacLeod Date: Sun, 16 Jun 2019 11:48:14 -0400 Subject: util-linux: add setpriv utility Enable the setpriv utility for targets only. It will be used in the run-ptest script for bash and perhaps other packages where the ptest code is expected to run as a user. setpriv uses libcap-ng which doesn't build natively so disable it for native* builds. Also, busybox has a setpriv implementation so ensure that setpriv adheres to the alternatives scheme. (From OE-Core rev: 587ba5f4bef18e8260fe671bd2e303140369a5e5) Signed-off-by: Randy MacLeod Signed-off-by: Richard Purdie --- meta/recipes-core/util-linux/util-linux.inc | 15 +++++++++++---- 1 file changed, 11 insertions(+), 4 deletions(-) (limited to 'meta/recipes-core/util-linux/util-linux.inc') diff --git a/meta/recipes-core/util-linux/util-linux.inc b/meta/recipes-core/util-linux/util-linux.inc index 1d279a58aa..84c7012752 100644 --- a/meta/recipes-core/util-linux/util-linux.inc +++ b/meta/recipes-core/util-linux/util-linux.inc @@ -20,7 +20,7 @@ LIC_FILES_CHKSUM = "file://README.licensing;md5=972a134f1e14b2b060e365df2fab0099 #gtk-doc is not enabled as it requires xmlto which requires util-linux inherit autotools gettext manpages pkgconfig systemd update-alternatives python3-dir bash-completion ptest -DEPENDS = "zlib ncurses virtual/crypt" +DEPENDS = "libcap-ng ncurses virtual/crypt zlib" MAJOR_VERSION = "${@'.'.join(d.getVar('PV').split('.')[0:2])}" SRC_URI = "${KERNELORG_MIRROR}/linux/utils/${BPN}/v${MAJOR_VERSION}/${BP}.tar.xz \ @@ -102,6 +102,10 @@ EXTRA_OECONF = "\ --libdir='${UTIL_LINUX_LIBDIR}' \ " +EXTRA_OECONF_append_class-target = " --enable-setpriv" +EXTRA_OECONF_append_class-native = " --without-cap-ng --disable-setpriv" +EXTRA_OECONF_append_class-nativesdk = " --without-cap-ng --disable-setpriv" + PACKAGECONFIG_class-target ?= "${@bb.utils.filter('DISTRO_FEATURES', 'pam', d)}" # inherit manpages requires this to be present, however util-linux does not have # configuration options, and installs manpages always @@ -109,8 +113,6 @@ PACKAGECONFIG[manpages] = "" PACKAGECONFIG[pam] = "--enable-su --enable-runuser,--disable-su --disable-runuser, libpam," # Respect the systemd feature for uuidd PACKAGECONFIG[systemd] = "--with-systemd --with-systemdsystemunitdir=${systemd_system_unitdir}, --without-systemd --without-systemdsystemunitdir,systemd" -# Build setpriv requires libcap-ng -PACKAGECONFIG[libcap-ng] = "--enable-setpriv,--disable-setpriv,libcap-ng," # Build python bindings for libmount PACKAGECONFIG[pylibmount] = "--with-python=3 --enable-pylibmount,--without-python --disable-pylibmount,python3" # Readline support @@ -248,6 +250,7 @@ ALTERNATIVE_LINK_NAME[readprofile] = "${sbindir}/readprofile" ALTERNATIVE_LINK_NAME[renice] = "${bindir}/renice" ALTERNATIVE_LINK_NAME[rev] = "${bindir}/rev" ALTERNATIVE_LINK_NAME[rfkill] = "${sbindir}/rfkill" +ALTERNATIVE_LINK_NAME[setpriv] = "${bindir}/setpriv" ALTERNATIVE_LINK_NAME[setsid] = "${bindir}/setsid" ALTERNATIVE_LINK_NAME[su] = "${base_bindir}/su" ALTERNATIVE_LINK_NAME[sulogin] = "${base_sbindir}/sulogin" @@ -260,7 +263,10 @@ ALTERNATIVE_LINK_NAME[unshare] = "${bindir}/unshare" ALTERNATIVE_LINK_NAME[utmpdump] = "${bindir}/utmpdump" ALTERNATIVE_LINK_NAME[wall] = "${bindir}/wall" -ALTERNATIVE_${PN}-doc = "blkid.8 eject.1 findfs.8 fsck.8 kill.1 last.1 lastb.1 libblkid.3 logger.1 mesg.1 mountpoint.1 nologin.8 rfkill.8 sulogin.8 utmpdump.1 uuid.3 wall.1" +ALTERNATIVE_${PN}-doc = "\ +blkid.8 eject.1 findfs.8 fsck.8 kill.1 last.1 lastb.1 libblkid.3 logger.1 mesg.1 \ +mountpoint.1 nologin.8 rfkill.8 sulogin.8 utmpdump.1 uuid.3 wall.1\ +" ALTERNATIVE_${PN}-doc += "${@bb.utils.contains('PACKAGECONFIG', 'pam', 'su.1', '', d)}" ALTERNATIVE_LINK_NAME[blkid.8] = "${mandir}/man8/blkid.8" @@ -276,6 +282,7 @@ ALTERNATIVE_LINK_NAME[mesg.1] = "${mandir}/man1/mesg.1" ALTERNATIVE_LINK_NAME[mountpoint.1] = "${mandir}/man1/mountpoint.1" ALTERNATIVE_LINK_NAME[nologin.8] = "${mandir}/man8/nologin.8" ALTERNATIVE_LINK_NAME[rfkill.8] = "${mandir}/man8/rfkill.8" +ALTERNATIVE_LINK_NAME[setpriv.1] = "${mandir}/man1/setpriv.1" ALTERNATIVE_LINK_NAME[su.1] = "${mandir}/man1/su.1" ALTERNATIVE_LINK_NAME[sulogin.8] = "${mandir}/man8/sulogin.8" ALTERNATIVE_LINK_NAME[utmpdump.1] = "${mandir}/man1/utmpdump.1" -- cgit v1.2.3-54-g00ecf