diff options
Diffstat (limited to 'meta/recipes-core/util-linux')
8 files changed, 404 insertions, 420 deletions
diff --git a/meta/recipes-core/util-linux/util-linux-libuuid_2.37.4.bb b/meta/recipes-core/util-linux/util-linux-libuuid_2.37.4.bb new file mode 100644 index 0000000000..5d759aed94 --- /dev/null +++ b/meta/recipes-core/util-linux/util-linux-libuuid_2.37.4.bb @@ -0,0 +1,16 @@ +# To allow util-linux to optionally build-depend on cryptsetup, libuuid is +# split out of the main recipe, as it's needed by cryptsetup + +require util-linux.inc + +inherit autotools gettext pkgconfig + +S = "${WORKDIR}/util-linux-${PV}" +EXTRA_OECONF += "--disable-all-programs --enable-libuuid" +LICENSE = "BSD-3-Clause" + +do_install:append() { + rm -rf ${D}${datadir} ${D}${bindir} ${D}${base_bindir} ${D}${sbindir} ${D}${base_sbindir} ${D}${exec_prefix}/sbin +} + +BBCLASSEXTEND = "native nativesdk" diff --git a/meta/recipes-core/util-linux/util-linux.inc b/meta/recipes-core/util-linux/util-linux.inc index 0b7db529fd..982ec669a2 100644 --- a/meta/recipes-core/util-linux/util-linux.inc +++ b/meta/recipes-core/util-linux/util-linux.inc @@ -1,338 +1,40 @@ SUMMARY = "A suite of basic system administration utilities" -HOMEPAGE = "http://userweb.kernel.org/~kzak/util-linux/" +HOMEPAGE = "https://en.wikipedia.org/wiki/Util-linux" DESCRIPTION = "Util-linux includes a suite of basic system administration utilities \ commonly found on most Linux systems. Some of the more important utilities include \ disk partitioning, kernel message management, filesystem creation, and system login." SECTION = "base" -LICENSE = "GPLv2+ & LGPLv2.1+ & BSD" +LICENSE = "GPL-2.0-or-later & LGPL-2.1-or-later & BSD-3-Clause & BSD-4-Clause" +LICENSE:${PN}-libblkid = "LGPL-2.1-or-later" +LICENSE:${PN}-libfdisk = "LGPL-2.1-or-later" +LICENSE:${PN}-libmount = "LGPL-2.1-or-later" +LICENSE:${PN}-libsmartcols = "LGPL-2.1-or-later" -LIC_FILES_CHKSUM = "file://README.licensing;md5=1715f5ee3e01203ca1e1e0b9ee65918c \ +LIC_FILES_CHKSUM = "file://README.licensing;md5=0fd5c050c6187d2bf0a4492b7f4e33da \ file://COPYING;md5=b234ee4d69f5fce4486a80fdaf4a4263 \ - file://Documentation/licenses/COPYING.GPLv2;md5=b234ee4d69f5fce4486a80fdaf4a4263 \ - file://Documentation/licenses/COPYING.LGPLv2.1;md5=4fbd65380cdd255951079008b364516c \ - file://Documentation/licenses/COPYING.BSD-3;md5=58dcd8452651fc8b07d1f65ce07ca8af \ - file://Documentation/licenses/COPYING.UCB;md5=263860f8968d8bafa5392cab74285262 \ - file://libuuid/COPYING;md5=b442ffb762cf8d3e9df1b99e0bb4af70 \ - file://libmount/COPYING;md5=fb93f01d4361069c5616327705373b16 \ - file://libblkid/COPYING;md5=fb93f01d4361069c5616327705373b16" - -#gtk-doc is not enabled as it requires xmlto which requires util-linux -inherit autotools gettext pkgconfig systemd update-alternatives python3-dir bash-completion ptest -DEPENDS = "zlib ncurses virtual/crypt" -DEPENDS_append_class-native = " lzo-native" -DEPENDS_append_class-nativesdk = " lzo-native" + file://Documentation/licenses/COPYING.GPL-2.0-or-later;md5=b234ee4d69f5fce4486a80fdaf4a4263 \ + file://Documentation/licenses/COPYING.LGPL-2.1-or-later;md5=4fbd65380cdd255951079008b364516c \ + file://Documentation/licenses/COPYING.BSD-3-Clause;md5=58dcd8452651fc8b07d1f65ce07ca8af \ + file://Documentation/licenses/COPYING.BSD-4-Clause-UC;md5=263860f8968d8bafa5392cab74285262 \ + file://libuuid/COPYING;md5=6d2cafc999feb2c2de84d4d24b23290c \ + file://libmount/COPYING;md5=7c7e39fb7d70ffe5d693a643e29987c2 \ + file://libblkid/COPYING;md5=693bcbbe16d3a4a4b37bc906bc01cc04 \ + file://libfdisk/COPYING;md5=693bcbbe16d3a4a4b37bc906bc01cc04 \ + file://libsmartcols/COPYING;md5=693bcbbe16d3a4a4b37bc906bc01cc04 \ +" +FILESEXTRAPATHS:prepend := "${THISDIR}/util-linux:" +MAJOR_VERSION = "${@'.'.join(d.getVar('PV').split('.')[0:2])}" SRC_URI = "${KERNELORG_MIRROR}/linux/utils/util-linux/v${MAJOR_VERSION}/util-linux-${PV}.tar.xz \ + file://configure-sbindir.patch \ + file://runuser.pamd \ + file://runuser-l.pamd \ + file://ptest.patch \ + file://run-ptest \ + file://display_testname_for_subtest.patch \ + file://avoid_parallel_tests.patch \ " -PACKAGES =+ "util-linux-agetty util-linux-fdisk util-linux-cfdisk util-linux-sfdisk \ - util-linux-swaponoff util-linux-losetup util-linux-umount \ - util-linux-mount util-linux-readprofile util-linux-uuidd \ - util-linux-uuidgen util-linux-lscpu util-linux-fsck.cramfs util-linux-fsck \ - util-linux-blkid util-linux-mkfs util-linux-mcookie util-linux-rfkill \ - util-linux-lsblk util-linux-mkfs.cramfs util-linux-fstrim \ - util-linux-partx util-linux-hwclock util-linux-mountpoint \ - util-linux-findfs util-linux-getopt util-linux-sulogin util-linux-prlimit \ - util-linux-ionice util-linux-switch-root" -PACKAGES += "${@bb.utils.contains('PACKAGECONFIG', 'pylibmount', 'util-linux-pylibmount', '', d)}" -PACKAGES =+ "${@bb.utils.contains('DISTRO_FEATURES', 'pam', 'util-linux-runuser util-linux-su', '', d)}" - -PACKAGES_DYNAMIC = "^util-linux-lib.*" - -SHARED_EXTRA_OECONF = "--disable-use-tty-group \ - --disable-makeinstall-chown \ - --enable-kill --enable-last --enable-mesg --enable-partx \ - --enable-raw --enable-rfkill --disable-login \ - --disable-vipw --disable-newgrp --disable-chfn-chsh \ - --enable-write --enable-mount \ - --enable-libuuid --enable-libblkid --enable-fsck \ - --disable-minix --disable-bfs --without-udev \ - usrsbin_execdir='${sbindir}' \ -" - -EXTRA_OECONF = "${SHARED_EXTRA_OECONF} --libdir=${base_libdir}" - -PACKAGECONFIG_class-target ?= "${@bb.utils.filter('DISTRO_FEATURES', 'pam', d)}" -PACKAGECONFIG[pam] = "--enable-su --enable-runuser,--disable-su --disable-runuser, libpam," - -# Respect the systemd feature for uuidd -PACKAGECONFIG[systemd] = "--with-systemd --with-systemdsystemunitdir=${systemd_unitdir}/system/, --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 -PACKAGECONFIG[readline] = "--with-readline,--without-readline,readline" - -FILES_${PN}-doc += "${datadir}/getopt/getopt-*.*" - -FILES_${PN}-dev += "${PYTHON_SITEPACKAGES_DIR}/libmount/pylibmount.la" - -FILES_util-linux-agetty = "${base_sbindir}/agetty" -FILES_util-linux-fdisk = "${base_sbindir}/fdisk.${BPN}" -FILES_util-linux-fstrim = "${base_sbindir}/fstrim" -FILES_util-linux-cfdisk = "${base_sbindir}/cfdisk" -FILES_util-linux-sfdisk = "${sbindir}/sfdisk" -FILES_util-linux-swaponoff = "${base_sbindir}/swapon.${BPN} ${base_sbindir}/swapoff.${BPN}" -FILES_util-linux-losetup = "${base_sbindir}/losetup.${BPN}" -FILES_util-linux-mount = "${base_bindir}/mount.${BPN}" -FILES_util-linux-mcookie = "${bindir}/mcookie" -FILES_util-linux-umount = "${base_bindir}/umount.${BPN}" -FILES_util-linux-readprofile = "${sbindir}/readprofile.${BPN}" -FILES_util-linux-uuidgen = "${bindir}/uuidgen" -FILES_util-linux-uuidd = "${sbindir}/uuidd" -FILES_util-linux-rfkill = "${sbindir}/rfkill*" -FILES_util-linux-partx = "${sbindir}/partx" -FILES_util-linux-hwclock = "${base_sbindir}/hwclock.${BPN}" -FILES_util-linux-findfs = "${sbindir}/findfs" -FILES_util-linux-getopt = "${base_bindir}/getopt.${BPN}" -FILES_util-linux-runuser = "${sbindir}/runuser" -FILES_util-linux-prlimit = "${bindir}/prlimit" -FILES_util-linux-ionice = "${bindir}/ionice" -FILES_util-linux-su = "${bindir}/su.util-linux ${sysconfdir}/pam.d/su-l" -CONFFILES_util-linux-su = "${sysconfdir}/pam.d/su-l" - -FILES_util-linux-pylibmount = "${PYTHON_SITEPACKAGES_DIR}/libmount/pylibmount.so \ - ${PYTHON_SITEPACKAGES_DIR}/libmount/__init__.* \ - ${PYTHON_SITEPACKAGES_DIR}/libmount/__pycache__/*" -FILES_util-linux-lsblk = "${bindir}/lsblk" -FILES_util-linux-lscpu = "${bindir}/lscpu" - -FILES_util-linux-fsck = "${base_sbindir}/fsck*" -FILES_util-linux-mkfs = "${sbindir}/mkfs" - -FILES_util-linux-fsck.cramfs = "${sbindir}/fsck.cramfs" -FILES_util-linux-mkfs.cramfs = "${sbindir}/mkfs.cramfs" - -FILES_util-linux-sulogin = "${base_sbindir}/sulogin*" -FILES_util-linux-mountpoint = "${base_bindir}/mountpoint.${BPN}" - -FILES_util-linux-switch-root = "${base_sbindir}/switch_root.${BPN}" - -# Util-linux' blkid replaces the e2fsprogs one -FILES_util-linux-blkid = "${base_sbindir}/blkid*" -RCONFLICTS_util-linux-blkid = "e2fsprogs-blkid" -RREPLACES_util-linux-blkid = "e2fsprogs-blkid" - -RDEPENDS_util-linux-runuser += "libpam" -RDEPENDS_util-linux-su += "libpam" - -RDEPENDS_${PN} = "util-linux-umount util-linux-swaponoff util-linux-losetup util-linux-sulogin util-linux-lsblk" -RDEPENDS_${PN} += "${@bb.utils.contains('DISTRO_FEATURES', 'pam', 'util-linux-runuser util-linux-su', '', d)}" - -RRECOMMENDS_${PN} = "util-linux-fdisk util-linux-cfdisk util-linux-sfdisk util-linux-mount util-linux-readprofile util-linux-mkfs util-linux-mountpoint util-linux-prlimit util-linux-ionice util-linux-switch-root" - -RRECOMMENDS_${PN}_class-native = "" -RRECOMMENDS_${PN}_class-nativesdk = "" -RDEPENDS_${PN}_class-native = "" -RDEPENDS_${PN}_class-nativesdk = "" - -RPROVIDES_${PN}-dev = "util-linux-libblkid-dev util-linux-libmount-dev util-linux-libuuid-dev" - -#SYSTEMD_PACKAGES = "${PN}-uuidd ${PN}-fstrim" -SYSTEMD_SERVICE_${PN}-uuidd = "uuidd.socket uuidd.service" -SYSTEMD_AUTO_ENABLE_${PN}-uuidd = "disable" -SYSTEMD_SERVICE_${PN}-fstrim = "fstrim.timer fstrim.service" -SYSTEMD_AUTO_ENABLE_${PN}-fstrim = "disable" - -do_compile () { - set -e - oe_runmake ARCH=${TARGET_ARCH} CPU= CPUOPT= 'OPT=${CFLAGS}' -} - -do_install () { - # with ccache the timestamps on compiled files may - # end up earlier than on their inputs, this allows - # for the resultant compilation in the install step. - oe_runmake ARCH=${TARGET_ARCH} CPU= CPUOPT= \ - 'OPT=${CFLAGS}' 'CC=${CC}' 'LD=${LD}' \ - 'LDFLAGS=${LDFLAGS}' 'DESTDIR=${D}' install - - mkdir -p ${D}${base_bindir} - - sbinprogs="agetty ctrlaltdel cfdisk vipw vigr" - sbinprogs_a="pivot_root hwclock mkswap mkfs.minix fsck.minix losetup swapon swapoff fdisk fsck blkid blockdev fstrim sulogin switch_root nologin" - binprogs_a="dmesg getopt kill more umount mount login su mountpoint" - - if [ "${base_sbindir}" != "${sbindir}" ]; then - mkdir -p ${D}${base_sbindir} - for p in $sbinprogs $sbinprogs_a; do - if [ -f "${D}${sbindir}/$p" ]; then - mv "${D}${sbindir}/$p" "${D}${base_sbindir}/$p" - fi - done - fi - - if [ "${base_bindir}" != "${bindir}" ]; then - mkdir -p ${D}${base_bindir} - for p in $binprogs_a; do - if [ -f "${D}${bindir}/$p" ]; then - mv "${D}${bindir}/$p" "${D}${base_bindir}/$p" - fi - done - fi - - install -d ${D}${sysconfdir}/default/ - echo 'MOUNTALL="-t nonfs,nosmbfs,noncpfs"' > ${D}${sysconfdir}/default/mountall - - rm -f ${D}${bindir}/chkdupexe - - if [ "${@bb.utils.filter('DISTRO_FEATURES', 'pam', d)}" ]; then - install -d ${D}${sysconfdir}/pam.d - install -m 0644 ${WORKDIR}/runuser.pamd ${D}${sysconfdir}/pam.d/runuser - install -m 0644 ${WORKDIR}/runuser-l.pamd ${D}${sysconfdir}/pam.d/runuser-l - fi - if [ "${@bb.utils.filter('PACKAGECONFIG', 'pam', d)}" ]; then - # Required for "su -" aka "su --login" because - # otherwise it uses "other", which has "auth pam_deny.so" - # and thus prevents the operation. - ln -s su ${D}${sysconfdir}/pam.d/su-l - fi -} - -# nologin causes a conflict with shadow-native -# kill causes a conflict with coreutils-native (if ${bindir}==${base_bindir}) -do_install_append_class-native () { - rm -f ${D}${base_sbindir}/nologin - rm -f ${D}${base_bindir}/kill -} - -ALTERNATIVE_PRIORITY = "80" - -ALTERNATIVE_${PN} = "dmesg kill more mkswap blockdev pivot_root switch_root" -ALTERNATIVE_${PN} += "hexdump last lastb logger mesg renice wall" -ALTERNATIVE_${PN} += "setsid chrt flock utmpdump eject nologin taskset" - -ALTERNATIVE_LINK_NAME[dmesg] = "${base_bindir}/dmesg" -ALTERNATIVE_LINK_NAME[kill] = "${base_bindir}/kill" -ALTERNATIVE_LINK_NAME[more] = "${base_bindir}/more" -ALTERNATIVE_LINK_NAME[mkswap] = "${base_sbindir}/mkswap" -ALTERNATIVE_LINK_NAME[blockdev] = "${base_sbindir}/blockdev" -ALTERNATIVE_LINK_NAME[pivot_root] = "${base_sbindir}/pivot_root" -ALTERNATIVE_LINK_NAME[switch_root] = "${base_sbindir}/switch_root" -ALTERNATIVE_LINK_NAME[eject] = "${bindir}/eject" -ALTERNATIVE_LINK_NAME[nologin] = "${base_sbindir}/nologin" - -ALTERNATIVE_${PN}-doc = "mountpoint.1 last.1 lastb.1 mesg.1 wall.1 nologin.8 sulogin.8 utmpdump.1 rfkill.8 kill.1 libblkid.3 blkid.8 findfs.8 fsck.8 uuid.3 eject.1 logger.1" - -ALTERNATIVE_LINK_NAME[last.1] = "${mandir}/man1/last.1" -ALTERNATIVE_LINK_NAME[lastb.1] = "${mandir}/man1/lastb.1" -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[sulogin.8] = "${mandir}/man8/sulogin.8" -ALTERNATIVE_LINK_NAME[utmpdump.1] = "${mandir}/man1/utmpdump.1" -ALTERNATIVE_LINK_NAME[wall.1] = "${mandir}/man1/wall.1" -ALTERNATIVE_LINK_NAME[kill.1] = "${mandir}/man1/kill.1" -ALTERNATIVE_LINK_NAME[libblkid.3] = "${mandir}/man3/libblkid.3" -ALTERNATIVE_LINK_NAME[blkid.8] = "${mandir}/man8/blkid.8" -ALTERNATIVE_LINK_NAME[findfs.8] = "${mandir}/man8/findfs.8" -ALTERNATIVE_LINK_NAME[fsck.8] = "${mandir}/man8/fsck.8" -ALTERNATIVE_LINK_NAME[uuid.3] = "${mandir}/man3/uuid.3" -ALTERNATIVE_LINK_NAME[eject.1] = "${mandir}/man1/eject.1" -ALTERNATIVE_LINK_NAME[logger.1] = "${mandir}/man1/logger.1" - -ALTERNATIVE_util-linux-hwclock = "hwclock" -ALTERNATIVE_LINK_NAME[hwclock] = "${base_sbindir}/hwclock" - -ALTERNATIVE_util-linux-fdisk = "fdisk" -ALTERNATIVE_LINK_NAME[fdisk] = "${base_sbindir}/fdisk" - -ALTERNATIVE_util-linux-agetty = "getty" -ALTERNATIVE_LINK_NAME[getty] = "${base_sbindir}/getty" -ALTERNATIVE_TARGET[getty] = "${base_sbindir}/agetty" - -ALTERNATIVE_util-linux-mount = "mount" -ALTERNATIVE_LINK_NAME[mount] = "${base_bindir}/mount" - -ALTERNATIVE_util-linux-umount = "umount" -ALTERNATIVE_LINK_NAME[umount] = "${base_bindir}/umount" - -ALTERNATIVE_util-linux-readprofile = "readprofile" -ALTERNATIVE_LINK_NAME[readprofile] = "${sbindir}/readprofile" - -ALTERNATIVE_util-linux-losetup = "losetup" -ALTERNATIVE_LINK_NAME[losetup] = "${base_sbindir}/losetup" - -ALTERNATIVE_util-linux-swaponoff = "swapoff swapon" -ALTERNATIVE_LINK_NAME[swapoff] = "${base_sbindir}/swapoff" -ALTERNATIVE_LINK_NAME[swapon] = "${base_sbindir}/swapon" - -ALTERNATIVE_util-linux-fsck = "fsck" -ALTERNATIVE_LINK_NAME[fsck] = "${base_sbindir}/fsck" - -ALTERNATIVE_util-linux-blkid = "blkid" -ALTERNATIVE_LINK_NAME[blkid] = "${base_sbindir}/blkid" - -ALTERNATIVE_util-linux-rfkill = "rfkill" -ALTERNATIVE_LINK_NAME[rfkill] = "${sbindir}/rfkill" - -ALTERNATIVE_util-linux-getopt = "getopt" -ALTERNATIVE_LINK_NAME[getopt] = "${base_bindir}/getopt" - -ALTERNATIVE_util-linux-sulogin = "sulogin" -ALTERNATIVE_LINK_NAME[sulogin] = "${base_sbindir}/sulogin" - -ALTERNATIVE_util-linux-mountpoint = "mountpoint" -ALTERNATIVE_LINK_NAME[mountpoint] = "${base_bindir}/mountpoint" - -BBCLASSEXTEND = "native nativesdk" - -python do_package_prepend () { - if '--enable-su' in d.getVar('EXTRA_OECONF').split(): - d.appendVar(d.expand('ALTERNATIVE_${PN}'), ' su') - d.appendVar(d.expand('ALTERNATIVE_${PN}-doc'), ' su.1') - - d.setVarFlag('ALTERNATIVE_LINK_NAME', "su", d.expand('${base_bindir}/su')) - d.setVarFlag('ALTERNATIVE_LINK_NAME', "su.1", d.expand('${mandir}/man1/su.1')) -} - -python populate_packages_prepend() { - do_split_packages(d, '${base_libdir}', '^lib(.*)\.so\..*$', - output_pattern='util-linux-lib%s', - description='util-linux lib%s', - extra_depends='', prepend=True, allow_links=True) -} - -RDEPENDS_${PN}-bash-completion += "util-linux-lsblk" -RDEPENDS_${PN}-ptest = "bash grep coreutils which util-linux-blkid util-linux-fsck btrfs-tools" - -do_compile_ptest() { - oe_runmake buildtest-TESTS -} - -do_install_ptest() { - mkdir -p ${D}${PTEST_PATH}/tests/ts - find . -name 'test*' -maxdepth 1 -type f -perm -111 -exec cp {} ${D}${PTEST_PATH} \; - find ./.libs -name 'sample*' -maxdepth 1 -type f -perm -111 -exec cp {} ${D}${PTEST_PATH} \; - find ./.libs -name 'test*' -maxdepth 1 -type f -perm -111 -exec cp {} ${D}${PTEST_PATH} \; - - cp ${S}/tests/*.sh ${D}${PTEST_PATH}/tests/ - cp -pR ${S}/tests/expected ${D}${PTEST_PATH}/tests/expected - cp -pR ${S}/tests/ts ${D}${PTEST_PATH}/tests/ - cp ${WORKDIR}/build/config.h ${D}${PTEST_PATH} - - # The original paths of executables to be tested point to a local folder containing - # the executables. We want to test the installed executables, not the local copies. - # So strip the paths, the executables will be located via "which" - sed -i \ - -e '/^TS_CMD/ s|$top_builddir/||g' \ - -e '/^TS_HELPER/ s|$top_builddir|${PTEST_PATH}|g' \ - ${D}${PTEST_PATH}/tests/commands.sh - - # Change 'if [ ! -x "$1" ]' to 'if [ ! -x "`which $1 2>/dev/null`"]' - sed -i -e \ - '/^\tif[[:space:]]\[[[:space:]]![[:space:]]-x[[:space:]]"$1"/s|$1|`which $1 2>/dev/null`|g' \ - ${D}${PTEST_PATH}/tests/functions.sh - - # "kill -L" behaves differently than "/bin/kill -L" so we need an additional fix - sed -i -e \ - '/^TS_CMD_KILL/ s|kill|/bin/kill|g' \ - ${D}${PTEST_PATH}/tests/commands.sh -} +SRC_URI[sha256sum] = "634e6916ad913366c3536b6468e7844769549b99a7b2bf80314de78ab5655b83" diff --git a/meta/recipes-core/util-linux/util-linux/avoid_parallel_tests.patch b/meta/recipes-core/util-linux/util-linux/avoid_parallel_tests.patch index 748b6ef096..f1cbdb3beb 100644 --- a/meta/recipes-core/util-linux/util-linux/avoid_parallel_tests.patch +++ b/meta/recipes-core/util-linux/util-linux/avoid_parallel_tests.patch @@ -1,20 +1,29 @@ +From ee3c7812e1efa6719af68b994804f0e6caceabd8 Mon Sep 17 00:00:00 2001 +From: Tudor Florea <tudor.florea@enea.com> +Date: Mon, 14 Jun 2021 14:00:31 +0200 +Subject: [PATCH] util-linux: Add ptest + Ptest needs buildtest-TESTS and runtest-TESTS targets. serial-tests is required to generate those targets. -Revert run.sh script accordingly to serialize running tests +Revert run.sh script accordingly to serialize running tests Signed-off-by: Tudor Florea <tudor.florea@enea.com> -Upstream-Status: Inappropriate +Upstream-Status: Inappropriate + +--- + configure.ac | 2 +- + 1 file changed, 1 insertion(+), 1 deletion(-) -Index: util-linux-2.32/configure.ac -=================================================================== ---- util-linux-2.32.orig/configure.ac -+++ util-linux-2.32/configure.ac +diff --git a/configure.ac b/configure.ac +index 5664f9f..075ef27 100644 +--- a/configure.ac ++++ b/configure.ac @@ -11,7 +11,7 @@ AC_CONFIG_MACRO_DIR([m4]) dnl AC_USE_SYSTEM_EXTENSIONS must be called before any macros that run - dnl the compiler (like AC_PROG_LIBTOOL) to avoid autoconf errors. + dnl the compiler (like LT_INIT) to avoid autoconf errors. AC_USE_SYSTEM_EXTENSIONS --AM_INIT_AUTOMAKE([-Wall foreign 1.10 tar-pax no-dist-gzip dist-xz subdir-objects]) -+AM_INIT_AUTOMAKE([-Wall foreign 1.10 tar-pax no-dist-gzip dist-xz subdir-objects serial-tests]) +-AM_INIT_AUTOMAKE([-Wall -Wno-portability foreign 1.10 tar-pax no-dist-gzip dist-xz subdir-objects]) ++AM_INIT_AUTOMAKE([-Wall -Wno-portability foreign 1.10 tar-pax no-dist-gzip dist-xz subdir-objects serial-tests]) m4_ifdef([AM_SILENT_RULES], [AM_SILENT_RULES([yes])], [AC_SUBST([AM_DEFAULT_VERBOSITY], [1])]) diff --git a/meta/recipes-core/util-linux/util-linux/ptest.patch b/meta/recipes-core/util-linux/util-linux/ptest.patch index 0537f7d856..ba2bd3f6ac 100644 --- a/meta/recipes-core/util-linux/util-linux/ptest.patch +++ b/meta/recipes-core/util-linux/util-linux/ptest.patch @@ -1,23 +1,24 @@ -Define TESTS variable +From af073c13ef184ca75811df688e0a0a25827b36c3 Mon Sep 17 00:00:00 2001 +From: Tudor Florea <tudor.florea@enea.com> +Date: Thu, 3 Dec 2015 04:08:00 +0100 +Subject: [PATCH] Define TESTS variable Signed-off-by: Tudor Florea <tudor.florea@enea.com> Upstream-Status: Pending + --- Makefile.am | 1 + 1 file changed, 1 insertion(+) diff --git a/Makefile.am b/Makefile.am -index bbaccb1..7d5a6bb 100644 +index 886598d..1cf4346 100644 --- a/Makefile.am +++ b/Makefile.am -@@ -48,6 +48,7 @@ systemdsystemunit_DATA = +@@ -57,6 +57,7 @@ systemdsystemunit_DATA = dist_bashcompletion_DATA = check_PROGRAMS = dist_check_SCRIPTS = +TESTS = $(check_PROGRAMS) PATHFILES = - --- -2.8.3 - + ADOCFILES_COMMON = diff --git a/meta/recipes-core/util-linux/util-linux/run-ptest b/meta/recipes-core/util-linux/util-linux/run-ptest index fbc2f9b56a..3a910be121 100644 --- a/meta/recipes-core/util-linux/util-linux/run-ptest +++ b/meta/recipes-core/util-linux/util-linux/run-ptest @@ -1,25 +1,24 @@ #!/bin/sh -cd tests || exit 1 -comps=$(find ts/ -type f -perm -111 -regex ".*/[^\.~]*" | sort) +# When udevd (from eudev) is running most eject/mount tests will fail because +# of automount. We need to stop udevd before executing util-linux's tests. +# The systemd-udevd daemon doesn't change the outcome of util-linux's tests. +UDEV_PID="`pidof "@base_sbindir@/udevd"`" +if [ "x$UDEV_PID" != "x" ]; then + /etc/init.d/udev stop +fi +current_path=$(readlink -f $0) +export bindir=$(dirname $current_path) +export PATH=$bindir/bin:$PATH -echo -echo "-------------------- util-linux regression tests --------------------" -echo -echo " For development purpose only. " -echo " Don't execute on production system! " -echo - -res=0 -count=0 -for ts in $comps; -do - $ts | sed '{ +./tests/run.sh --use-system-commands --parsable --show-diff | sed -u '{ s/^\(.*\):\(.*\) \.\.\. OK$/PASS: \1:\2/ s/^\(.*\):\(.*\) \.\.\. FAILED \(.*\)$/FAIL: \1:\2 \3/ s/^\(.*\):\(.*\) \.\.\. SKIPPED \(.*\)$/SKIP: \1:\2 \3/ - }' -done + }' +if [ "x$UDEV_PID" != "x" ]; then + /etc/init.d/udev start +fi diff --git a/meta/recipes-core/util-linux/util-linux/util-linux-native-qsort.patch b/meta/recipes-core/util-linux/util-linux/util-linux-native-qsort.patch deleted file mode 100644 index 68bf22de8c..0000000000 --- a/meta/recipes-core/util-linux/util-linux/util-linux-native-qsort.patch +++ /dev/null @@ -1,33 +0,0 @@ -From f220d809be1baa654503bf6ff52f3630b0d7015c Mon Sep 17 00:00:00 2001 -From: Robert Yang <liezhi.yang@windriver.com> -Date: Wed, 26 Mar 2014 01:30:29 +0000 -Subject: [PATCH] sun.c: use qsort() to instead of qsort_r() - -qsort_r() was added to glibc in version 2.8, so there is no qsort_r() on -the host like CentOS 5.x. - -Upstream-Status: Inappropriate [Other] - -Signed-off-by: Robert Yang <liezhi.yang@windriver.com> ---- - libfdisk/src/sun.c | 5 ++--- - 1 file changed, 2 insertions(+), 3 deletions(-) - -Index: util-linux-2.24.2/libfdisk/src/sun.c -=================================================================== ---- util-linux-2.24.2.orig/libfdisk/src/sun.c -+++ util-linux-2.24.2/libfdisk/src/sun.c -@@ -431,10 +431,9 @@ static int sun_verify_disklabel(struct f - } - verify_sun_starts = starts; - -- qsort_r(array,ARRAY_SIZE(array),sizeof(array[0]), -- (int (*)(const void *,const void *,void *)) verify_sun_cmp, -- verify_sun_starts); -- -+ qsort(array,ARRAY_SIZE(array),sizeof(array[0]), -+ (int (*)(const void *,const void *)) verify_sun_cmp); -+ - if (array[0] == -1) { - fdisk_info(cxt, _("No partitions defined.")); - return 0; diff --git a/meta/recipes-core/util-linux/util-linux_2.32.bb b/meta/recipes-core/util-linux/util-linux_2.32.bb deleted file mode 100644 index 55cc98c200..0000000000 --- a/meta/recipes-core/util-linux/util-linux_2.32.bb +++ /dev/null @@ -1,30 +0,0 @@ -MAJOR_VERSION = "2.32" -require util-linux.inc - -# To support older hosts, we need to patch and/or revert -# some upstream changes. Only do this for native packages. -OLDHOST = "" -OLDHOST_class-native = "file://util-linux-native-qsort.patch" - -SRC_URI += "file://configure-sbindir.patch \ - file://runuser.pamd \ - file://runuser-l.pamd \ - ${OLDHOST} \ - file://ptest.patch \ - file://run-ptest \ - file://display_testname_for_subtest.patch \ - file://avoid_parallel_tests.patch \ -" -SRC_URI[md5sum] = "e0d8a25853f88cd15ff557e5d8cb4ea7" -SRC_URI[sha256sum] = "6c7397abc764e32e8159c2e96042874a190303e77adceb4ac5bd502a272a4734" - -CACHED_CONFIGUREVARS += "scanf_cv_alloc_modifier=ms" - -EXTRA_OECONF_class-native = "${SHARED_EXTRA_OECONF} \ - --disable-fallocate \ - --disable-use-tty-group \ -" -EXTRA_OECONF_class-nativesdk = "${SHARED_EXTRA_OECONF} \ - --disable-fallocate \ - --disable-use-tty-group \ -" diff --git a/meta/recipes-core/util-linux/util-linux_2.37.4.bb b/meta/recipes-core/util-linux/util-linux_2.37.4.bb new file mode 100644 index 0000000000..d609c30067 --- /dev/null +++ b/meta/recipes-core/util-linux/util-linux_2.37.4.bb @@ -0,0 +1,320 @@ +require util-linux.inc + +#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 = "libcap-ng ncurses virtual/crypt zlib util-linux-libuuid" + +PACKAGES =+ "${PN}-swaponoff" +PACKAGES += "${@bb.utils.contains('PACKAGECONFIG', 'pylibmount', '${PN}-pylibmount', '', d)}" + +python util_linux_binpackages () { + def pkg_hook(f, pkg, file_regex, output_pattern, modulename): + pn = d.getVar('PN') + d.appendVar('RRECOMMENDS:%s' % pn, ' %s' % pkg) + + if d.getVar('ALTERNATIVE:' + pkg): + return + if d.getVarFlag('ALTERNATIVE_LINK_NAME', modulename): + d.setVar('ALTERNATIVE:' + pkg, modulename) + + bindirs = sorted(list(set(d.expand("${base_sbindir} ${base_bindir} ${sbindir} ${bindir}").split()))) + for dir in bindirs: + do_split_packages(d, root=dir, + file_regex=r'(.*)', output_pattern='${PN}-%s', + description='${PN} %s', + hook=pkg_hook, extra_depends='') + + # There are some symlinks for some binaries which we have ignored + # above. Add them to the package owning the binary they are + # pointing to + extras = {} + dvar = d.getVar('PKGD') + for root in bindirs: + for walkroot, dirs, files in os.walk(dvar + root): + for f in files: + file = os.path.join(walkroot, f) + if not os.path.islink(file): + continue + + pkg = os.path.basename(os.readlink(file)) + extras.setdefault(pkg, []) + extras[pkg].append(file.replace(dvar, '', 1)) + + pn = d.getVar('PN') + for pkg, links in extras.items(): + of = d.getVar('FILES:' + pn + '-' + pkg) + links = of + " " + " ".join(sorted(links)) + d.setVar('FILES:' + pn + '-' + pkg, links) +} + +# we must execute before update-alternatives PACKAGE_PREPROCESS_FUNCS +PACKAGE_PREPROCESS_FUNCS =+ "util_linux_binpackages " + +# skip libuuid as it will be packaged by the util-linux-libuuid recipe +python util_linux_libpackages() { + do_split_packages(d, root=d.getVar('UTIL_LINUX_LIBDIR'), file_regex=r'^lib(?!uuid)(.*)\.so\..*$', + output_pattern='${PN}-lib%s', + description='${PN} lib%s', + extra_depends='', prepend=True, allow_links=True) +} + +PACKAGESPLITFUNCS =+ "util_linux_libpackages" + +PACKAGES_DYNAMIC = "^${PN}-.*" + +CACHED_CONFIGUREVARS += "scanf_cv_alloc_modifier=ms" +UTIL_LINUX_LIBDIR = "${libdir}" +UTIL_LINUX_LIBDIR:class-target = "${base_libdir}" +EXTRA_OECONF = "\ + --enable-libuuid --enable-libblkid \ + \ + --enable-fsck --enable-kill --enable-last --enable-mesg \ + --enable-mount --enable-partx --enable-raw --enable-rfkill \ + --enable-unshare --enable-write \ + \ + --disable-bfs --disable-login \ + --disable-makeinstall-chown --disable-minix --disable-newgrp \ + --disable-use-tty-group --disable-vipw --disable-raw \ + \ + --without-udev \ + \ + usrsbin_execdir='${sbindir}' \ + --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" +EXTRA_OECONF:append = " --disable-hwclock-gplv3" + +# enable pcre2 for native/nativesdk to match host distros +# this helps to keep same expectations when using the SDK or +# build host versions during development +# +PACKAGECONFIG ?= "pcre2" +PACKAGECONFIG:class-target ?= "${@bb.utils.contains('DISTRO_FEATURES', 'pam', 'chfn-chsh pam', '', d)}" +# inherit manpages requires this to be present, however util-linux does not have +# configuration options, and installs manpages always +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 python bindings for libmount +PACKAGECONFIG[pylibmount] = "--with-python=3 --enable-pylibmount,--without-python --disable-pylibmount,python3" +# Readline support +PACKAGECONFIG[readline] = "--with-readline,--without-readline,readline" +# PCRE support in hardlink +PACKAGECONFIG[pcre2] = ",,libpcre2" +PACKAGECONFIG[cryptsetup] = "--with-cryptsetup,--without-cryptsetup,cryptsetup" +PACKAGECONFIG[chfn-chsh] = "--enable-chfn-chsh,--disable-chfn-chsh," + +EXTRA_OEMAKE = "ARCH=${TARGET_ARCH} CPU= CPUOPT= 'OPT=${CFLAGS}'" + +ALLOW_EMPTY:${PN} = "1" +FILES:${PN} = "" +FILES:${PN}-doc += "${datadir}/getopt/getopt-*.*" +FILES:${PN}-dev += "${PYTHON_SITEPACKAGES_DIR}/libmount/pylibmount.la" +FILES:${PN}-mount = "${sysconfdir}/default/mountall" +FILES:${PN}-runuser = "${sysconfdir}/pam.d/runuser*" +FILES:${PN}-su = "${sysconfdir}/pam.d/su-l" +CONFFILES:${PN}-su = "${sysconfdir}/pam.d/su-l" +FILES:${PN}-pylibmount = "${PYTHON_SITEPACKAGES_DIR}/libmount/pylibmount.so \ + ${PYTHON_SITEPACKAGES_DIR}/libmount/__init__.* \ + ${PYTHON_SITEPACKAGES_DIR}/libmount/__pycache__/*" + +# Util-linux' blkid replaces the e2fsprogs one +RCONFLICTS:${PN}-blkid = "${MLPREFIX}e2fsprogs-blkid" +RREPLACES:${PN}-blkid = "${MLPREFIX}e2fsprogs-blkid" + +RRECOMMENDS:${PN}:class-native = "" +RRECOMMENDS:${PN}:class-nativesdk = "" +RDEPENDS:${PN}:class-native = "" +RDEPENDS:${PN}:class-nativesdk = "" + +RDEPENDS:${PN} += " util-linux-libuuid" +RDEPENDS:${PN}-dev += " util-linux-libuuid-dev" + +RPROVIDES:${PN}-dev = "${PN}-libblkid-dev ${PN}-libmount-dev" + +RDEPENDS:${PN}-bash-completion += "${PN}-lsblk" +RDEPENDS:${PN}-ptest += "bash bc btrfs-tools coreutils e2fsprogs findutils grep iproute2 kmod mdadm procps sed socat which xz" +RRECOMMENDS:${PN}-ptest += "kernel-module-scsi-debug kernel-module-sd-mod kernel-module-loop" +RDEPENDS:${PN}-swaponoff = "${PN}-swapon ${PN}-swapoff" +ALLOW_EMPTY:${PN}-swaponoff = "1" + +#SYSTEMD_PACKAGES = "${PN}-uuidd ${PN}-fstrim" +SYSTEMD_SERVICE:${PN}-uuidd = "uuidd.socket uuidd.service" +SYSTEMD_AUTO_ENABLE:${PN}-uuidd = "disable" +SYSTEMD_SERVICE:${PN}-fstrim = "fstrim.timer fstrim.service" +SYSTEMD_AUTO_ENABLE:${PN}-fstrim = "disable" + +do_install () { + # with ccache the timestamps on compiled files may + # end up earlier than on their inputs, this allows + # for the resultant compilation in the install step. + oe_runmake 'CC=${CC}' 'LD=${LD}' \ + 'LDFLAGS=${LDFLAGS}' 'DESTDIR=${D}' install + + mkdir -p ${D}${base_bindir} + + sbinprogs="agetty ctrlaltdel cfdisk vipw vigr" + sbinprogs_a="pivot_root hwclock mkswap losetup swapon swapoff fdisk fsck blkid blockdev fstrim sulogin switch_root nologin" + binprogs_a="dmesg getopt kill more umount mount login su mountpoint" + + if [ "${base_sbindir}" != "${sbindir}" ]; then + mkdir -p ${D}${base_sbindir} + for p in $sbinprogs $sbinprogs_a; do + if [ -f "${D}${sbindir}/$p" ]; then + mv "${D}${sbindir}/$p" "${D}${base_sbindir}/$p" + fi + done + fi + + if [ "${base_bindir}" != "${bindir}" ]; then + mkdir -p ${D}${base_bindir} + for p in $binprogs_a; do + if [ -f "${D}${bindir}/$p" ]; then + mv "${D}${bindir}/$p" "${D}${base_bindir}/$p" + fi + done + fi + + install -d ${D}${sysconfdir}/default/ + echo 'MOUNTALL="-t nonfs,nosmbfs,noncpfs"' > ${D}${sysconfdir}/default/mountall + + rm -f ${D}${bindir}/chkdupexe +} + +do_install:append:class-target () { + if [ "${@bb.utils.filter('PACKAGECONFIG', 'pam', d)}" ]; then + install -d ${D}${sysconfdir}/pam.d + install -m 0644 ${WORKDIR}/runuser.pamd ${D}${sysconfdir}/pam.d/runuser + install -m 0644 ${WORKDIR}/runuser-l.pamd ${D}${sysconfdir}/pam.d/runuser-l + # Required for "su -" aka "su --login" because + # otherwise it uses "other", which has "auth pam_deny.so" + # and thus prevents the operation. + ln -s su ${D}${sysconfdir}/pam.d/su-l + fi +} +# nologin causes a conflict with shadow-native +# kill causes a conflict with coreutils-native (if ${bindir}==${base_bindir}) +do_install:append:class-native () { + rm -f ${D}${base_sbindir}/nologin + rm -f ${D}${base_bindir}/kill +} + +# dm-verity support introduces a circular build dependency, so util-linux-libuuid is split out for target builds +# Need to build libuuid for uuidgen, but then delete it and let the other recipe ship it +do_install:append () { + rm -rf ${D}${includedir}/uuid ${D}${libdir}/pkgconfig/uuid.pc ${D}${libdir}/libuuid* ${D}${base_libdir}/libuuid* +} + +ALTERNATIVE_PRIORITY = "80" + +ALTERNATIVE_LINK_NAME[blkid] = "${base_sbindir}/blkid" +ALTERNATIVE_LINK_NAME[blockdev] = "${base_sbindir}/blockdev" +ALTERNATIVE_LINK_NAME[cal] = "${bindir}/cal" +ALTERNATIVE_LINK_NAME[chfn] = "${bindir}/chfn" +ALTERNATIVE_LINK_NAME[chsh] = "${bindir}/chsh" +ALTERNATIVE_LINK_NAME[chrt] = "${bindir}/chrt" +ALTERNATIVE_LINK_NAME[dmesg] = "${base_bindir}/dmesg" +ALTERNATIVE_LINK_NAME[eject] = "${bindir}/eject" +ALTERNATIVE_LINK_NAME[fallocate] = "${bindir}/fallocate" +ALTERNATIVE_LINK_NAME[fdisk] = "${base_sbindir}/fdisk" +ALTERNATIVE_LINK_NAME[flock] = "${bindir}/flock" +ALTERNATIVE_LINK_NAME[fsck] = "${base_sbindir}/fsck" +ALTERNATIVE_LINK_NAME[fsfreeze] = "${sbindir}/fsfreeze" +ALTERNATIVE_LINK_NAME[fstrim] = "${base_sbindir}/fstrim" +ALTERNATIVE_LINK_NAME[getopt] = "${base_bindir}/getopt" +ALTERNATIVE:${PN}-agetty = "getty" +ALTERNATIVE_LINK_NAME[getty] = "${base_sbindir}/getty" +ALTERNATIVE_TARGET[getty] = "${base_sbindir}/agetty" +ALTERNATIVE_LINK_NAME[hexdump] = "${bindir}/hexdump" +ALTERNATIVE_LINK_NAME[hwclock] = "${base_sbindir}/hwclock" +ALTERNATIVE_LINK_NAME[ionice] = "${bindir}/ionice" +ALTERNATIVE_LINK_NAME[kill] = "${base_bindir}/kill" +ALTERNATIVE:${PN}-last = "last lastb" +ALTERNATIVE_LINK_NAME[last] = "${bindir}/last" +ALTERNATIVE_LINK_NAME[lastb] = "${bindir}/lastb" +ALTERNATIVE_LINK_NAME[logger] = "${bindir}/logger" +ALTERNATIVE_LINK_NAME[losetup] = "${base_sbindir}/losetup" +ALTERNATIVE_LINK_NAME[mesg] = "${bindir}/mesg" +ALTERNATIVE_LINK_NAME[mkswap] = "${base_sbindir}/mkswap" +ALTERNATIVE_LINK_NAME[mcookie] = "${bindir}/mcookie" +ALTERNATIVE_LINK_NAME[more] = "${base_bindir}/more" +ALTERNATIVE_LINK_NAME[mount] = "${base_bindir}/mount" +ALTERNATIVE_LINK_NAME[mountpoint] = "${base_bindir}/mountpoint" +ALTERNATIVE_LINK_NAME[nologin] = "${base_sbindir}/nologin" +ALTERNATIVE_LINK_NAME[nsenter] = "${bindir}/nsenter" +ALTERNATIVE_LINK_NAME[pivot_root] = "${base_sbindir}/pivot_root" +ALTERNATIVE_LINK_NAME[prlimit] = "${bindir}/prlimit" +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[rtcwake] = "${sbindir}/rtcwake" +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" +ALTERNATIVE_LINK_NAME[swapoff] = "${base_sbindir}/swapoff" +ALTERNATIVE_LINK_NAME[swapon] = "${base_sbindir}/swapon" +ALTERNATIVE_LINK_NAME[switch_root] = "${base_sbindir}/switch_root" +ALTERNATIVE_LINK_NAME[taskset] = "${bindir}/taskset" +ALTERNATIVE_LINK_NAME[umount] = "${base_bindir}/umount" +ALTERNATIVE_LINK_NAME[unshare] = "${bindir}/unshare" +ALTERNATIVE_LINK_NAME[utmpdump] = "${bindir}/utmpdump" +ALTERNATIVE_LINK_NAME[uuidgen] = "${bindir}/uuidgen" +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 += "${@bb.utils.contains('PACKAGECONFIG', 'pam', 'su.1', '', d)}" + +ALTERNATIVE_LINK_NAME[blkid.8] = "${mandir}/man8/blkid.8" +ALTERNATIVE_LINK_NAME[eject.1] = "${mandir}/man1/eject.1" +ALTERNATIVE_LINK_NAME[findfs.8] = "${mandir}/man8/findfs.8" +ALTERNATIVE_LINK_NAME[fsck.8] = "${mandir}/man8/fsck.8" +ALTERNATIVE_LINK_NAME[kill.1] = "${mandir}/man1/kill.1" +ALTERNATIVE_LINK_NAME[last.1] = "${mandir}/man1/last.1" +ALTERNATIVE_LINK_NAME[lastb.1] = "${mandir}/man1/lastb.1" +ALTERNATIVE_LINK_NAME[libblkid.3] = "${mandir}/man3/libblkid.3" +ALTERNATIVE_LINK_NAME[logger.1] = "${mandir}/man1/logger.1" +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" +ALTERNATIVE_LINK_NAME[uuid.3] = "${mandir}/man3/uuid.3" +ALTERNATIVE_LINK_NAME[wall.1] = "${mandir}/man1/wall.1" + +BBCLASSEXTEND = "native nativesdk" + +PTEST_BINDIR = "1" +do_compile_ptest() { + oe_runmake buildtest-TESTS +} + +do_install_ptest() { + mkdir -p ${D}${PTEST_PATH}/tests/ts + find . -name 'test*' -maxdepth 1 -type f -perm -111 -exec cp {} ${D}${PTEST_PATH} \; + find ./.libs -name 'sample*' -maxdepth 1 -type f -perm -111 -exec cp {} ${D}${PTEST_PATH} \; + find ./.libs -name 'test*' -maxdepth 1 -type f -perm -111 -exec cp {} ${D}${PTEST_PATH} \; + + cp ${S}/tests/*.sh ${D}${PTEST_PATH}/tests/ + cp -pR ${S}/tests/expected ${D}${PTEST_PATH}/tests/expected + cp -pR ${S}/tests/ts ${D}${PTEST_PATH}/tests/ + cp ${WORKDIR}/build/config.h ${D}${PTEST_PATH} + + sed -i 's|@base_sbindir@|${base_sbindir}|g' ${D}${PTEST_PATH}/run-ptest + + # chfn needs PAM + if ! ${@bb.utils.contains('PACKAGECONFIG', 'pam', 'true', 'false', d)}; then + rm -rf ${D}${PTEST_PATH}/tests/ts/chfn + fi +} |