subtree updates

meta-openembedded: 7d8115d550..098dc606f9:
  Alex Kiernan (2):
        c-ares: Filter out "Live" tests
        ptest-packagelists-meta-oe.inc Add c-ares to PTESTS_SLOW_META_OE

  Alexander Kanavin (25):
        fontforge: add a readline PACKAGECONFIG
        volume-key: disable python bindings
        audit: disable python bindings as incompatible with python 3.12
        cmpi-bindings: update 1.0.1 -> 1.0.4
        libpwquality: backport a python 3.12 compatibility patch
        mycroft: do not depend on python3-xmlrunner
        python3-xmlrunner: remove the recipe
        system-config-printer: rely on setuptools to obtain distutils copy
        python3-gmpy2: fix python 3.12 issues
        python3-custom-inherit: fix python 3.12 builds
        python3-jsonrpcserver: remove
        python3-oslash: remove
        nmap: disable ndiff
        wireshark: update 4.0.10 -> 4.2.0
        openipmi: update 2.0.32 -> 2.0.34
        libsigrokdecode: add python 3.12 support
        cockpit: add setuptools dependency to bring in distutils copy
        mongodb: skip until python 3.12 fixes are available.
        mercurial: ensure setuptools is present as distutils is no longer (mercurial tries both)
        rwmem: fix python modules packaging
        upm: get disutils copy via setuptools
        python3-kmod: remove the recipe
        hplip: provide setuptools for the distutils copy
        audit: reenable python bindings and bring in distutils via setuptools (needed with python 3.12)
        python3-h5py: backport a cython 3.x compatibility patch

  Christophe Vu-Brugier (1):
        nvme-cli: upgrade 2.6 -> 2.7.1

  Enrico Scholz (1):
        krb5: use PACKAGE_BEFORE_PN

  Fabio Estevam (2):
        i2cdev_git: Remove AUTHOR field
        picocom: Update to 2023-04

  Ilya A. Kriveshko (1):
        srecord: fix install prefix

  Jordan Crouse (2):
        collectd: Remove rrdtool from DEPENDS
        keepalived: Move the sample configuration files to a separate package

  Jose Quaresma (1):
        layer.conf: Add libdevmapper-native PREFERRED_RPROVIDER

  Khem Raj (8):
        mraa: Update to latest tip of trunk
        libcppkafka: Update to tip of trunk
        python3-pydantic-core: Rename the cpython module on musl
        libtinyxml2: Package needed resources to run ptests
        python3-pylint: Ignore failing ptests
        libconfig-general-perl: Enable on musl targets
        tgt: Fix build with musl
        kernel-selftest: remove Wno-alloc-size-larger-than from scripts/Makefile.extrawarn

  Leon Anavi (5):
        ssd1306_git.bb: Add ssd1306_linux
        ssd1306: Update and remove patch
        python3-webargs: Upgrade 8.3.0 -> 8.4.0
        python3-wtforms: Upgrade 3.1.1 -> 3.1.2
        python3-kivy: Upgrade 2.2.1 -> 2.3.0

  Markus Volk (9):
        luajit: upgrade 2.1beta -> 2.1
        gnome-terminal: fix search_provider build
        libplist: make sure rm doesn't fail on nonexistent file
        imagemagick: upgrade 7.1.1-8 -> 7.1.1.26
        mutter: update 45.1 -> 45.3
        gnome-shell: update 45.1 -> 45.3
        gnome-control-center: update 45.1 -> 45.2
        gnome-software: update 45.1 -> 45.3
        gnome-shell-extensions: update 45.1 -> 45.2

  Martin Jansa (1):
        libpwquality: respect PYTHONSITEDIR

  Michael Haener (1):
        mdio-tools: upgrade 1.3.0 -> 1.3.1

  Mingli Yu (2):
        usleep: Make the version consistent
        ipmitool: Make the version consistent

  Peter Marko (1):
        protobuf-c: upgrade 1.4.1 -> 1.5.0

  Richard Leitner (1):
        python3-pytest-cov: add missing python3-coverage dependency

  Robert Yang (1):
        v4l-utils: Add PACKAGECONFIG for v4l2-tracer to fix determinstic build

  Wang Mingyu (52):
        cglm: upgrade 0.9.1 -> 0.9.2
        ctags: upgrade 6.0.20231224.0 -> 6.1.20231231.0
        exiftool: upgrade 12.71 -> 12.72
        feh: upgrade 3.10.1 -> 3.10.2
        libssh: upgrade 0.10.5 -> 0.10.6
        squid: upgrade 6.5 -> 6.6
        imapfilter: upgrade 2.8.1 -> 2.8.2
        redis-plus-plus: upgrade 1.3.10 -> 1.3.11
        python3-netaddr: upgrade 0.9.0 -> 0.10.0
        plocate: upgrade 1.1.19 -> 1.1.20
        python3-cantools: upgrade 39.4.1 -> 39.4.2
        python3-coverage: upgrade 7.3.4 -> 7.4.0
        python3-flask: upgrade 2.3.3 -> 3.0.0
        python3-gspread: upgrade 5.12.3 -> 5.12.4
        python3-pydot: upgrade 1.4.2 -> 2.0.0
        qpdf: upgrade 11.6.4 -> 11.7.0
        thingsboard-gateway: upgrade 3.4.3.1 -> 3.4.4
        python3-pydantic-core: upgrade 2.14.5 -> 2.14.6
        libtinyxml2: upgrade 9.0.0 -> 10.0.0
        adw-gtk3: upgrade 5.1 -> 5.2
        dialog: upgrade 1.3-20231002 -> 1.3-20240101
        ghex: upgrade 45.0 -> 45.1
        jwt-cpp: upgrade 0.6.0 -> 0.7.0
        libcloudproviders: upgrade 0.3.4 -> 0.3.5
        libgedit-gtksourceview: upgrade 299.0.4 -> 299.0.5
        libjcat: upgrade 0.1.14 -> 0.2.0
        libraw: upgrade 0.21.1 -> 0.21.2
        libsass: upgrade 3.6.5 -> 3.6.6
        chrony: upgrade 4.4 -> 4.5
        tgt: upgrade 1.0.83 -> 1.0.90
        lapack: upgrade 3.10.1 -> 3.12.0
        libio-pty-perl: upgrade 1.17 -> 1.20
        webkitgtk3: upgrade 2.42.3 -> 2.42.4
        xmlsec1: upgrade 1.3.2 -> 1.3.3
        python3-argh: upgrade 0.30.5 -> 0.31.0
        python3-cvxopt: upgrade 1.2.7 -> 1.3.2
        python3-sqlalchemy: upgrade 2.0.24 -> 2.0.25
        python3-aiohttp-jinja2: upgrade 1.5.1 -> 1.6
        python3-bitarray: upgrade 2.9.1 -> 2.9.2
        python3-google-api-python-client: upgrade 2.111.0 -> 2.112.0
        python3-google-auth: upgrade 2.25.2 -> 2.26.1
        python3-lz4: upgrade 4.3.2 -> 4.3.3
        python3-pdm: upgrade 2.11.1 -> 2.11.2
        python3-pyflakes: upgrade 3.1.0 -> 3.2.0
        python3-pymisp: upgrade 2.4.182 -> 2.4.183
        python3-pytest-asyncio: upgrade 0.23.2 -> 0.23.3
        python3-traitlets: upgrade 5.14.0 -> 5.14.1
        traceroute: upgrade 2.1.3 -> 2.1.5
        wolfssl: upgrade 5.6.4 -> 5.6.6
        xerces-c: upgrade 3.2.4 -> 3.2.5
        zenity: upgrade 4.0.0 -> 4.0.1
        daq: Fix install conflict when enable multilib.

  Yi Zhao (6):
        vsomeip: upgrade 3.3.8 -> 3.4.10
        libtdb: upgrade 1.4.8 -> 1.4.9
        libtalloc: upgrade 2.4.0 -> 2.4.1
        libtevent: upgrade 0.14.1 -> 0.16.0
        libldb: upgrade 2.7.2 -> 2.8.0
        samba: upgrade 4.18.9 -> 4.19.3

  alperak (10):
        libnvme: upgrade 1.6 -> 1.7.1
        libpaper: upgrade 2.1.0 -> 2.1.2
        onig: upgrade 6.9.8 -> 6.9.9
        clinfo: upgrade 3.0.21.02.21 -> 3.0.23.01.25
        opensc: upgrade 0.23.0 -> 0.24.0
        pcsc-lite: upgrade 2.0.0 -> 2.0.1
        pcsc-tools: upgrade 1.6.2 -> 1.7.1
        wavpack: upgrade 5.1.0 -> 5.6.0
        nginx: fix CVE-2023-44487
        grpc: upgrade 1.59.2 -> 1.60.0

meta-arm: 4d22f982bc..5712422011:
  Emekcan Aras (1):
        arm-bsp/linux-yocto: corstone1000: bump to v6.6%

  Jon Mason (8):
        arm-bsp/trusted-firmware-m: update libmetal and open-amp to a release
        arm-bsp/trusted-firmware-m: update libmetal and open-amp to 2023.04.0
        arm: modify patches to have email headers and correct date fields
        arm-bsp/optee-os: remove unused 3.18 files
        arm/optee-os: use sysroot in CFLAGS
        arm/optee-os: remove unneeded clang patches
        arm/scp-firmware: update git repository to new location
        arm-bsp/u-boot: rebase patches for v2024.01

  Ross Burton (1):
        arm-bsp/linux-yocto: add linux-yocto 6.5 temporarily

meta-raspberrypi: 4c033eb074..b859bc3eca:
  Leon Anavi (1):
        bcm2835: update 1.71 -> 1.73

poky: 4675bbb757..61182659c2:
  Adrian Freihofer (1):
        ref-manual: document cmake-qemu class

  Alassane Yattara (7):
        bitbake: toaster/tests: Bug-fix on TestProjectConfigTab::test_image_recipe_show_rows
        bitbake: toaster/tests: Bug-fix element click intercepted
        bitbake: toaster/tests: Delay driver first action on create new project page
        bitbake: toaster/tests: Setup delay after driver action self.get(url)
        bitbake: toaster/tests: bug-fix "#hint-error-project-name" should be visible
        bitbake: toaster/tests: Bug-fix "element not interactable" in TestLayerDetailsPage::test_edit_layerdetails
        bitbake: toaster/tests: Bug-fix ToasterTable show_rows testcases

  Alexander Kanavin (16):
        speexdsp: enable native variant
        devtool/standard: correctly escape \
        bitbake: fetch/checkstatus(): do not print the URI twice in FetchError exception
        bitbake: fetch/wget/checkstatus(): include the URL in debugging output about status check failure
        bitbake: bitbake/runqueue: rework 'bitbake -S printdiff' logic
        selftest/sstatetests: fix up printdiff test to match rework of printdiff logic
        selftest/sstatetest: re-enable gcc printdiff test
        python3-pyyaml: make compatible with cython 3.x
        python3-cython: update 0.29.36 -> 3.0.7
        taglib: fix upstream version check
        libpcre2: fix upstream version check
        icon-naming-utils: take tarball from debian
        selftest/sstatetests: include fetcher diagnostics into CDN test failure message
        selftest/SStatePrintdiff: ensure all base signatures are present in sstate in test_image_minimal_vs_base_do_configure
        shadow: update 4.13 -> 4.14.2
        shadow: link executables statically for -native variant

  Chen Qi (5):
        gawk: upgrade from 5.2.2 to 5.3.0
        systemd-bootchart: upgrade from 234 to 235
        dbus-wait: bump srcrev
        sudo: upgrade from 1.9.15p2 to 1.9.15p5
        util-linux/util-linux-libuuid: ugprade from 2.39.2 to 2.39.3

  Corentin Guillevic (1):
        systemd: add udev-bash-completion package

  Enguerrand de Ribaucourt (1):
        manuals: document VSCode extension

  Fabio Estevam (5):
        libusb1: Do not match on -rc versions
        usbutils: Update to version 017
        u-boot: Upgrade to 2024.01
        kmscube: Change header file to <GLES3/gl3.h>
        kmscube: Add package version

  Ilya A. Kriveshko (1):
        dev-manual: update license manifest path

  Jamin Lin (1):
        devtool: modify: fix exception

  Joshua Watt (1):
        syslinux: Allow mtools to be optional

  Jörg Sommer (1):
        documentation: Add UBOOT_BINARY, extend UBOOT_CONFIG

  Khem Raj (6):
        connman: Fix build with musl
        rpm: Fix build with musl
        gawk: Add coreutils to rdeps for ptests package
        tcl: Fix prepending to run-ptest script
        coreutils: Ignore line-bytes.sh and no-allocate tests on musl
        opkg-utils: Backport fix to drop --numeric-owner parameter

  Lee Chee Yang (1):
        migration-guide: add release notes for 4.3.2

  Mark Asselstine (2):
        bitbake: server/process: catch and expand multiprocessing connection exceptions
        bitbake: ui/knotty: properly handle exceptions when calling runCommand()

  Maxin B. John (1):
        ref-manual: classes: remove insserv bbclass

  Michael Opdenacker (2):
        contributor-guide: use "apt" instead of "aptitude"
        ref-manual: update tested and supported distros

  Mikko Rapeli (1):
        oeqa systemd.py: settle() using "running" or "degraded" state

  Ming Liu (1):
        qemu.bbclass: fix a python TypeError

  Mingli Yu (2):
        openssh: Add PACKAGECONFIG option to customize sshd mode
        gptfdisk: Make the version consistent

  Richard Purdie (2):
        bitbake: ast: Fix EXPORT_FUNCTIONS bug
        bitbake: runqueue: Fix runall all bug

  Robert Yang (2):
        bitbake: bitbake: event: Inject empty lines to make code match lineno in filename
        bitbake: bitbake: tests/event: Add test_lineno_in_eventhandler

  Rodrigo M. Duarte (1):
        linux-firmware: Fix the linux-firmware-bcm4373 FILES variable

  Ross Burton (12):
        glib-2.0: no need to depend on target gtk-doc
        autotools: append to EXTRA_AUTORECONF
        autotools: don't exclude gtkdocize
        gtk-doc: fix DEPENDS
        gtk-doc: remove obsolete logic
        gtk-doc: don't use docdir set in environment in gtkdocize
        gtk-doc: don't manually call gtkdocize
        kmod: fix configure with autopoint calling gtkdocize
        util-linux: enable gtk-doc
        meson: use pkg-config in the cross files
        cairo: upgrade to 1.18.0
        xmlcatalog: limit to native recipes only

  Simone Weiß (2):
        dev-manual: start.rst: update use of Download page
        glibc: Set status for CVE-2023-5156 & CVE-2023-0687

  Tim Orling (2):
        python3-bcrypt: upgrade 4.1.1 -> 4.1.2
        python3-attrs: enable ptest

  Wang Mingyu (13):
        ffmpeg: upgrade 6.1 -> 6.1.1
        meson: upgrade 1.3.0 -> 1.3.1
        ccache: upgrade 4.8.3 -> 4.9
        mesa: upgrade 23.3.1 -> 23.3.2
        subversion: upgrade 1.14.2 -> 1.14.3
        python3-dbusmock: upgrade 0.30.1 -> 0.30.2
        python3-hatch-fancy-pypi-readme: upgrade 23.1.0 -> 24.1.0
        python3-hypothesis: upgrade 6.92.1 -> 6.92.2
        python3-pycryptodome: upgrade 3.19.0 -> 3.19.1
        python3-pycryptodomex: upgrade 3.19.0 -> 3.19.1
        python3-pytest: upgrade 7.4.3 -> 7.4.4
        python3-attrs: upgrade 22.1.0 -> 23.2.0
        python3-lxml: upgrade 4.9.4 -> 45.0.0

  William Lyu (1):
        elfutils: Update license information

  Yang Xu (1):
        rootfs.py: check depmodwrapper execution result

  Yi Zhao (2):
        libcap-ng: upgrade 0.8.3 -> 0.8.4
        libcap-ng-python: upgrade 0.8.3 -> 0.8.4

  david d zuhn (1):
        rng-tools: remove obsolete build time dependency on sysfsutils

Change-Id: I43eda44bb889eedb45fae65caf2e5ed8d2c9de39
Signed-off-by: Patrick Williams <patrick@stwcx.xyz>
diff --git a/poky/meta/recipes-core/util-linux/util-linux_2.39.3.bb b/poky/meta/recipes-core/util-linux/util-linux_2.39.3.bb
new file mode 100644
index 0000000..9fd3a5f
--- /dev/null
+++ b/poky/meta/recipes-core/util-linux/util-linux_2.39.3.bb
@@ -0,0 +1,337 @@
+require util-linux.inc
+
+inherit autotools gettext manpages pkgconfig systemd update-alternatives python3-dir bash-completion ptest gtk-doc
+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}-.*"
+
+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-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,"
+PACKAGECONFIG[selinux] = "--with-selinux,--without-selinux,libselinux"
+
+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 procps sed socat which xz"
+RRECOMMENDS:${PN}-ptest += "kernel-module-scsi-debug kernel-module-sd-mod kernel-module-loop kernel-module-algif-hash"
+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[findfs] = "${sbindir}/findfs"
+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[ipcrm] = "${bindir}/ipcrm"
+ALTERNATIVE_LINK_NAME[ipcs] = "${bindir}/ipcs"
+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
+    # remove raid tests, known failures and avoid dependency on mdadm therefore
+    # See https://github.com/util-linux/util-linux/commit/7519c3edab120b14623931d5ddb16fdc6e7cad5d
+    rm -rf ${D}${PTEST_PATH}/tests/ts/blkid/md-raid0-whole
+    rm -rf ${D}${PTEST_PATH}/tests/ts/blkid/md-raid1-part
+    rm -rf ${D}${PTEST_PATH}/tests/ts/blkid/md-raid1-whole
+    rm -rf ${D}${PTEST_PATH}/tests/ts/fdisk/align-512-4K-md
+}
+
+# Delete tests not working on musl
+do_install_ptest:append:libc-musl() {
+    for t in tests/ts/col/multibyte \
+            tests/ts/lib/timeutils \
+            tests/ts/dmesg/limit; do
+        rm -rf ${D}${PTEST_PATH}/$t
+    done
+}