summaryrefslogtreecommitdiffstats
path: root/external/poky/meta/recipes-core/util-linux
diff options
context:
space:
mode:
Diffstat (limited to 'external/poky/meta/recipes-core/util-linux')
-rw-r--r--external/poky/meta/recipes-core/util-linux/util-linux.inc403
-rw-r--r--external/poky/meta/recipes-core/util-linux/util-linux/0001-hwclock-fix-for-glibc-2.31-settimeofday.patch112
-rw-r--r--external/poky/meta/recipes-core/util-linux/util-linux/0001-include-cleanup-pidfd-inckudes.patch42
-rw-r--r--external/poky/meta/recipes-core/util-linux/util-linux/0001-kill-include-sys-types.h-before-checking-SYS_pidfd_s.patch64
-rw-r--r--external/poky/meta/recipes-core/util-linux/util-linux/0001-libfdisk-script-accept-sector-size-ignore-unknown-he.patch137
-rw-r--r--external/poky/meta/recipes-core/util-linux/util-linux/run-ptest20
-rw-r--r--external/poky/meta/recipes-core/util-linux/util-linux/util-linux-native-qsort.patch33
-rw-r--r--external/poky/meta/recipes-core/util-linux/util-linux_2.32.1.bb28
-rw-r--r--external/poky/meta/recipes-core/util-linux/util-linux_2.35.1.bb16
9 files changed, 583 insertions, 272 deletions
diff --git a/external/poky/meta/recipes-core/util-linux/util-linux.inc b/external/poky/meta/recipes-core/util-linux/util-linux.inc
index a05c1cab..532cceb9 100644
--- a/external/poky/meta/recipes-core/util-linux/util-linux.inc
+++ b/external/poky/meta/recipes-core/util-linux/util-linux.inc
@@ -6,134 +6,156 @@ disk partitioning, kernel message management, filesystem creation, and system lo
SECTION = "base"
-LICENSE = "GPLv2+ & LGPLv2.1+ & BSD"
+LICENSE = "GPLv2+ & LGPLv2.1+ & BSD-3-Clause & BSD-4-Clause"
-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"
+ 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"
#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"
+inherit autotools gettext manpages pkgconfig systemd update-alternatives python3-dir bash-completion ptest
+DEPENDS = "libcap-ng ncurses virtual/crypt zlib"
-SRC_URI = "${KERNELORG_MIRROR}/linux/utils/util-linux/v${MAJOR_VERSION}/util-linux-${PV}.tar.xz \
+MAJOR_VERSION = "${@'.'.join(d.getVar('PV').split('.')[0:2])}"
+SRC_URI = "${KERNELORG_MIRROR}/linux/utils/${BPN}/v${MAJOR_VERSION}/${BP}.tar.xz \
"
-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 util-linux-unshare"
-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-unshare \
- --enable-libuuid --enable-libblkid --enable-fsck \
- --disable-minix --disable-bfs --without-udev \
- usrsbin_execdir='${sbindir}' \
+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[pkg] = extras.get(pkg, '') + ' ' + file.replace(dvar, '', 1)
+
+ pn = d.getVar('PN')
+ for pkg, links in extras.items():
+ of = d.getVar('FILES_' + pn + '-' + pkg)
+ links = of + links
+ d.setVar('FILES_' + pn + '-' + pkg, links)
+}
+
+# we must execute before update-alternatives PACKAGE_PREPROCESS_FUNCS
+PACKAGE_PREPROCESS_FUNCS =+ "util_linux_binpackages "
+
+python util_linux_libpackages() {
+ do_split_packages(d, root=d.getVar('UTIL_LINUX_LIBDIR'), file_regex=r'^lib(.*)\.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-chfn-chsh --disable-login \
+ --disable-makeinstall-chown --disable-minix --disable-newgrp \
+ --disable-use-tty-group --disable-vipw \
+ \
+ --without-udev \
+ \
+ usrsbin_execdir='${sbindir}' \
+ --libdir='${UTIL_LINUX_LIBDIR}' \
"
-EXTRA_OECONF = "${SHARED_EXTRA_OECONF} --libdir=${base_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.filter('DISTRO_FEATURES', '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_unitdir}/system/, --without-systemd --without-systemdsystemunitdir,systemd"
-
-# Build setpriv requires libcap-ng
-PACKAGECONFIG[libcap-ng] = "--enable-setpriv,--disable-setpriv,libcap-ng,"
-
+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"
-FILES_${PN}-doc += "${datadir}/getopt/getopt-*.*"
+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_util-linux-agetty = "${base_sbindir}/agetty"
-FILES_util-linux-fdisk = "${base_sbindir}/fdisk.${BPN}"
-FILES_util-linux-fstrim = "${base_sbindir}/fstrim.${BPN}"
-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.${BPN}"
-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}"
-FILES_util-linux-unshare = "${bindir}/unshare.${BPN}"
+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
-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"
+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 = ""
-RPROVIDES_${PN}-dev = "util-linux-libblkid-dev util-linux-libmount-dev util-linux-libuuid-dev"
+RPROVIDES_${PN}-dev = "${PN}-libblkid-dev ${PN}-libmount-dev ${PN}-libuuid-dev"
+
+RDEPENDS_${PN}-bash-completion += "${PN}-lsblk"
+RDEPENDS_${PN}-ptest += "bash bc btrfs-tools coreutils e2fsprogs grep iproute2 kmod mdadm procps sed socat which xz"
+RRECOMMENDS_${PN}-ptest += "kernel-module-scsi-debug"
+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"
@@ -141,23 +163,17 @@ 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}' \
+ 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 mkfs.minix fsck.minix losetup swapon swapoff fdisk fsck blkid blockdev fstrim sulogin switch_root nologin"
+ 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
@@ -182,20 +198,19 @@ do_install () {
echo 'MOUNTALL="-t nonfs,nosmbfs,noncpfs"' > ${D}${sysconfdir}/default/mountall
rm -f ${D}${bindir}/chkdupexe
+}
- if [ "${@bb.utils.filter('DISTRO_FEATURES', 'pam', d)}" ]; then
+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
- 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 () {
@@ -205,123 +220,87 @@ do_install_append_class-native () {
ALTERNATIVE_PRIORITY = "80"
-ALTERNATIVE_${PN} = " \
- dmesg kill more mkswap blockdev pivot_root \
- hexdump last lastb logger mesg renice wall \
- setsid chrt flock utmpdump eject nologin taskset fallocate \
- fsfreeze nsenter cal rev \
-"
-
-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[blkid] = "${base_sbindir}/blkid"
ALTERNATIVE_LINK_NAME[blockdev] = "${base_sbindir}/blockdev"
-ALTERNATIVE_LINK_NAME[pivot_root] = "${base_sbindir}/pivot_root"
ALTERNATIVE_LINK_NAME[cal] = "${bindir}/cal"
+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[rev] = "${bindir}/rev"
+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[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[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[wall] = "${bindir}/wall"
-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_${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[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-fstrim = "fstrim"
-ALTERNATIVE_LINK_NAME[fstrim] = "${base_sbindir}/fstrim"
-
-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"
-
-ALTERNATIVE_util-linux-unshare = "unshare"
-ALTERNATIVE_LINK_NAME[unshare] = "${bindir}/unshare"
-
-ALTERNATIVE_util-linux-ionice = "ionice"
-ALTERNATIVE_LINK_NAME[ionice] = "${bindir}/ionice"
+ALTERNATIVE_LINK_NAME[wall.1] = "${mandir}/man1/wall.1"
-ALTERNATIVE_util-linux-switch-root = "switch_root"
-ALTERNATIVE_LINK_NAME[switch_root] = "${base_sbindir}/switch_root"
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"
-
+PTEST_BINDIR = "1"
do_compile_ptest() {
oe_runmake buildtest-TESTS
}
@@ -350,8 +329,12 @@ do_install_ptest() {
'/^\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
+ # Running "kill" without the the complete path would use the shell's built-in kill
sed -i -e \
- '/^TS_CMD_KILL/ s|kill|/bin/kill|g' \
+ '/^TS_CMD_KILL/ s|kill|${PTEST_PATH}/bin/kill|g' \
${D}${PTEST_PATH}/tests/commands.sh
+
+
+ sed -i 's|@base_sbindir@|${base_sbindir}|g' ${D}${PTEST_PATH}/run-ptest
+
}
diff --git a/external/poky/meta/recipes-core/util-linux/util-linux/0001-hwclock-fix-for-glibc-2.31-settimeofday.patch b/external/poky/meta/recipes-core/util-linux/util-linux/0001-hwclock-fix-for-glibc-2.31-settimeofday.patch
new file mode 100644
index 00000000..0672c354
--- /dev/null
+++ b/external/poky/meta/recipes-core/util-linux/util-linux/0001-hwclock-fix-for-glibc-2.31-settimeofday.patch
@@ -0,0 +1,112 @@
+From ee85d3967ea09b215fcea5efdd90bbbf5e74a681 Mon Sep 17 00:00:00 2001
+From: Karel Zak <kzak@redhat.com>
+Date: Wed, 19 Feb 2020 15:50:47 +0100
+Subject: [PATCH] hwclock: fix for glibc 2.31 settimeofday()
+
+glibc announce:
+ ... settimeofday can no longer be used to set the time and the offset
+ simultaneously. If both of its two arguments are non-null, the call
+ will fail (setting errno to EINVAL).
+
+It means we need to call settimeofday(NULL, tz) and settimeofday(tv, NULL).
+
+Unfortunately, settimeofday(NULL, tz) has very special warp-clock
+semantic if used as the very first settimeofday() call. It means we
+have to be sure that we do not touch warp-clock if we need only need
+to modify system TZ. So, let's always call settimeofday(NULL, 0)
+before settimeofday(NULL, tz) for UTC rtc mode when modify system TZ.
+
+Upstream-Status: Backport [https://github.com/karelzak/util-linux/commit/ee85d3967ea09b215fcea5efdd90bbbf5e74a681]
+
+CC: J William Piggott <elseifthen@gmx.com>
+Signed-off-by: Karel Zak <kzak@redhat.com>
+Addresses: https://github.com/karelzak/util-linux/issues/957
+Signed-off-by: Liwei Song <liwei.song@windriver.com>
+---
+ sys-utils/hwclock.c | 49 ++++++++++++++++++++++++++-------------------
+ 1 file changed, 28 insertions(+), 21 deletions(-)
+
+diff --git a/sys-utils/hwclock.c b/sys-utils/hwclock.c
+index e736da7179f8..16576bc186ff 100644
+--- a/sys-utils/hwclock.c
++++ b/sys-utils/hwclock.c
+@@ -658,6 +658,9 @@ display_time(struct timeval hwctime)
+ * PCIL: persistent_clock_is_local, sets the "11 minute mode" timescale.
+ * firsttime: locks the warp_clock function (initialized to 1 at boot).
+ *
++ * Note that very first settimeofday(NULL, tz) modifies warp-clock as well as
++ * system TZ.
++ *
+ * +---------------------------------------------------------------------------+
+ * | op | RTC scale | settimeofday calls |
+ * |---------|-----------|-----------------------------------------------------|
+@@ -675,41 +678,45 @@ set_system_clock(const struct hwclock_control *ctl,
+ struct tm broken;
+ int minuteswest;
+ int rc = 0;
+- const struct timezone tz_utc = { 0 };
+
+ localtime_r(&newtime.tv_sec, &broken);
+ minuteswest = -get_gmtoff(&broken) / 60;
+
+ if (ctl->verbose) {
+- if (ctl->hctosys && !ctl->universal)
+- printf(_("Calling settimeofday(NULL, %d) to set "
+- "persistent_clock_is_local.\n"), minuteswest);
+- if (ctl->systz && ctl->universal)
++ if (ctl->universal)
+ puts(_("Calling settimeofday(NULL, 0) "
+- "to lock the warp function."));
++ "to lock the warp function."));
++ else
++ printf(_("Calling settimeofday(NULL, %d) to set "
++ "persistent_clock_is_local and "
++ "the kernel timezone.\n"), minuteswest);
++
++ if (ctl->universal && minuteswest)
++ printf(_("Calling settimeofday(NULL, %d) to set "
++ "the kernel timezone.\n"), minuteswest);
++
+ if (ctl->hctosys)
+- printf(_("Calling settimeofday(%ld.%06ld, %d)\n"),
+- newtime.tv_sec, newtime.tv_usec, minuteswest);
+- else {
+- printf(_("Calling settimeofday(NULL, %d) "), minuteswest);
+- if (ctl->universal)
+- puts(_("to set the kernel timezone."));
+- else
+- puts(_("to warp System time."));
+- }
++ printf(_("Calling settimeofday(%ld.%06ld, 0) to set "
++ "the kernel time.\n"), newtime.tv_sec, newtime.tv_usec);
+ }
+
+ if (!ctl->testing) {
++ const struct timezone tz_utc = { 0 };
+ const struct timezone tz = { minuteswest };
+
+- if (ctl->hctosys && !ctl->universal) /* set PCIL */
++ /* warp-clock */
++ if (ctl->universal)
++ rc = settimeofday(NULL, &tz_utc); /* lock to UTC */
++ else
++ rc = settimeofday(NULL, &tz); /* set PCIL and TZ */
++
++ /* set timezone */
++ if (!rc && ctl->universal && minuteswest)
+ rc = settimeofday(NULL, &tz);
+- if (ctl->systz && ctl->universal) /* lock warp_clock */
+- rc = settimeofday(NULL, &tz_utc);
++
++ /* set time */
+ if (!rc && ctl->hctosys)
+- rc = settimeofday(&newtime, &tz);
+- else if (!rc)
+- rc = settimeofday(NULL, &tz);
++ rc = settimeofday(&newtime, NULL);
+
+ if (rc) {
+ warn(_("settimeofday() failed"));
+--
+2.17.1
+
diff --git a/external/poky/meta/recipes-core/util-linux/util-linux/0001-include-cleanup-pidfd-inckudes.patch b/external/poky/meta/recipes-core/util-linux/util-linux/0001-include-cleanup-pidfd-inckudes.patch
new file mode 100644
index 00000000..0ef6fb4e
--- /dev/null
+++ b/external/poky/meta/recipes-core/util-linux/util-linux/0001-include-cleanup-pidfd-inckudes.patch
@@ -0,0 +1,42 @@
+From 0a4035ff2e4fd5b5ae0cf8f8665696c2aff53b75 Mon Sep 17 00:00:00 2001
+From: Karel Zak <kzak@redhat.com>
+Date: Tue, 10 Mar 2020 11:43:16 +0100
+Subject: [PATCH] include: cleanup pidfd inckudes
+
+Upstream-Status: Backport [https://github.com/karelzak/util-linux/commit/0a4035ff2e4fd5b5ae0cf8f8665696c2aff53b75]
+
+Signed-off-by: Karel Zak <kzak@redhat.com>
+Signed-off-by: Benjamin Fair <benjaminfair@google.com>
+---
+ include/pidfd-utils.h | 6 +++---
+ 1 file changed, 3 insertions(+), 3 deletions(-)
+
+diff --git a/include/pidfd-utils.h b/include/pidfd-utils.h
+index 0baedd2c9..4a6c3a604 100644
+--- a/include/pidfd-utils.h
++++ b/include/pidfd-utils.h
+@@ -3,10 +3,10 @@
+
+ #if defined(__linux__)
+ # include <sys/syscall.h>
+-# if defined(SYS_pidfd_send_signal)
++# if defined(SYS_pidfd_send_signal) && defined(SYS_pidfd_open)
+ # include <sys/types.h>
+
+-# ifndef HAVE_PIDFD_OPEN
++# ifndef HAVE_PIDFD_SEND_SIGNAL
+ static inline int pidfd_send_signal(int pidfd, int sig, siginfo_t *info,
+ unsigned int flags)
+ {
+@@ -14,7 +14,7 @@ static inline int pidfd_send_signal(int pidfd, int sig, siginfo_t *info,
+ }
+ # endif
+
+-# ifndef HAVE_PIDFD_SEND_SIGNAL
++# ifndef HAVE_PIDFD_OPEN
+ static inline int pidfd_open(pid_t pid, unsigned int flags)
+ {
+ return syscall(SYS_pidfd_open, pid, flags);
+--
+2.26.1.301.g55bc3eb7cb9-goog
+
diff --git a/external/poky/meta/recipes-core/util-linux/util-linux/0001-kill-include-sys-types.h-before-checking-SYS_pidfd_s.patch b/external/poky/meta/recipes-core/util-linux/util-linux/0001-kill-include-sys-types.h-before-checking-SYS_pidfd_s.patch
new file mode 100644
index 00000000..e43e1287
--- /dev/null
+++ b/external/poky/meta/recipes-core/util-linux/util-linux/0001-kill-include-sys-types.h-before-checking-SYS_pidfd_s.patch
@@ -0,0 +1,64 @@
+From 3cfde0370d3a8949df0c5bcf447cec6692910ed2 Mon Sep 17 00:00:00 2001
+From: Sami Kerola <kerolasa@iki.fi>
+Date: Sat, 15 Feb 2020 21:12:50 +0000
+Subject: [PATCH] kill: include sys/types.h before checking
+ SYS_pidfd_send_signal
+
+Including sys/types.h must happen before SYS_pidfd_send_signal is checked,
+because that header defines variable in normal conditions. When sys/types.h
+does not have SYS_pidfd_send_signal then fallback is defined in config.h
+that is included by default, and has therefore worked fine before and after
+this change.
+
+Upstream-Status: Backport [https://github.com/karelzak/util-linux/commit/3cfde0370d3a8949df0c5bcf447cec6692910ed2]
+
+Signed-off-by: Sami Kerola <kerolasa@iki.fi>
+Signed-off-by: Benjamin Fair <benjaminfair@google.com>
+---
+ include/pidfd-utils.h | 18 ++++++++++--------
+ 1 file changed, 10 insertions(+), 8 deletions(-)
+
+diff --git a/include/pidfd-utils.h b/include/pidfd-utils.h
+index 593346576..0baedd2c9 100644
+--- a/include/pidfd-utils.h
++++ b/include/pidfd-utils.h
+@@ -1,26 +1,28 @@
+ #ifndef UTIL_LINUX_PIDFD_UTILS
+ #define UTIL_LINUX_PIDFD_UTILS
+
+-#if defined(__linux__) && defined(SYS_pidfd_send_signal)
+-# include <sys/types.h>
++#if defined(__linux__)
+ # include <sys/syscall.h>
++# if defined(SYS_pidfd_send_signal)
++# include <sys/types.h>
+
+-# ifndef HAVE_PIDFD_OPEN
++# ifndef HAVE_PIDFD_OPEN
+ static inline int pidfd_send_signal(int pidfd, int sig, siginfo_t *info,
+ unsigned int flags)
+ {
+ return syscall(SYS_pidfd_send_signal, pidfd, sig, info, flags);
+ }
+-# endif
++# endif
+
+-# ifndef HAVE_PIDFD_SEND_SIGNAL
++# ifndef HAVE_PIDFD_SEND_SIGNAL
+ static inline int pidfd_open(pid_t pid, unsigned int flags)
+ {
+ return syscall(SYS_pidfd_open, pid, flags);
+ }
+-# endif
++# endif
+
+-# define UL_HAVE_PIDFD 1
++# define UL_HAVE_PIDFD 1
+
+-#endif /* __linux__ && SYS_pidfd_send_signal */
++# endif /* SYS_pidfd_send_signal */
++#endif /* __linux__ */
+ #endif /* UTIL_LINUX_PIDFD_UTILS */
+--
+2.26.1.301.g55bc3eb7cb9-goog
+
diff --git a/external/poky/meta/recipes-core/util-linux/util-linux/0001-libfdisk-script-accept-sector-size-ignore-unknown-he.patch b/external/poky/meta/recipes-core/util-linux/util-linux/0001-libfdisk-script-accept-sector-size-ignore-unknown-he.patch
new file mode 100644
index 00000000..911f70bc
--- /dev/null
+++ b/external/poky/meta/recipes-core/util-linux/util-linux/0001-libfdisk-script-accept-sector-size-ignore-unknown-he.patch
@@ -0,0 +1,137 @@
+From 00e53f17c8462cb34ece08cc10db60a7da29a305 Mon Sep 17 00:00:00 2001
+From: Karel Zak <kzak@redhat.com>
+Date: Tue, 4 Feb 2020 15:11:19 +0100
+Subject: [PATCH] libfdisk: (script) accept sector-size, ignore unknown headers
+
+- add sector-size between supported headers (already in --dump output)
+
+- report unknown headers by -ENOTSUP
+
+- ignore ENOTSUP in sfdisk (but print warning) and in fdisk_script_read_file()
+
+Upstream-Status: Backport [https://github.com/karelzak/util-linux/commit/00e53f17c8462cb34ece08cc10db60a7da29a305]
+
+Addresses: https://github.com/karelzak/util-linux/issues/949
+Signed-off-by: Karel Zak <kzak@redhat.com>
+Signed-off-by: Pierre-Jean Texier <pjtexier@koncepto.io>
+---
+ disk-utils/sfdisk.c | 6 +++++-
+ libfdisk/src/script.c | 49 ++++++++++++++++++++++++++-----------------------
+ 2 files changed, 31 insertions(+), 24 deletions(-)
+
+diff --git a/disk-utils/sfdisk.c b/disk-utils/sfdisk.c
+index bb6e1c6..c0bea70 100644
+--- a/disk-utils/sfdisk.c
++++ b/disk-utils/sfdisk.c
+@@ -1782,7 +1782,11 @@ static int command_fdisk(struct sfdisk *sf, int argc, char **argv)
+ }
+
+ rc = fdisk_script_read_line(dp, stdin, buf, sizeof(buf));
+- if (rc < 0) {
++ if (rc == -ENOTSUP) {
++ buf[sizeof(buf) - 1] = '\0';
++ fdisk_warnx(sf->cxt, _("Unknown script header '%s' -- ignore."), buf);
++ continue;
++ } else if (rc < 0) {
+ DBG(PARSE, ul_debug("script parsing failed, trying sfdisk specific commands"));
+ buf[sizeof(buf) - 1] = '\0';
+ rc = loop_control_commands(sf, dp, buf);
+diff --git a/libfdisk/src/script.c b/libfdisk/src/script.c
+index a21771b..d3e67fa 100644
+--- a/libfdisk/src/script.c
++++ b/libfdisk/src/script.c
+@@ -805,8 +805,12 @@ static inline int is_header_line(const char *s)
+ /* parses "<name>: value", note modifies @s*/
+ static int parse_line_header(struct fdisk_script *dp, char *s)
+ {
+- int rc = -EINVAL;
++ size_t i;
+ char *name, *value;
++ static const char *supported[] = {
++ "label", "unit", "label-id", "device", "grain",
++ "first-lba", "last-lba", "table-length", "sector-size"
++ };
+
+ DBG(SCRIPT, ul_debugobj(dp, " parse header '%s'", s));
+
+@@ -816,7 +820,7 @@ static int parse_line_header(struct fdisk_script *dp, char *s)
+ name = s;
+ value = strchr(s, ':');
+ if (!value)
+- goto done;
++ return -EINVAL;
+ *value = '\0';
+ value++;
+
+@@ -825,32 +829,30 @@ static int parse_line_header(struct fdisk_script *dp, char *s)
+ ltrim_whitespace((unsigned char *) value);
+ rtrim_whitespace((unsigned char *) value);
+
++ if (!*name || !*value)
++ return -EINVAL;
++
++ /* check header name */
++ for (i = 0; i < ARRAY_SIZE(supported); i++) {
++ if (strcmp(name, supported[i]) == 0)
++ break;
++ }
++ if (i == ARRAY_SIZE(supported))
++ return -ENOTSUP;
++
++ /* header specific actions */
+ if (strcmp(name, "label") == 0) {
+ if (dp->cxt && !fdisk_get_label(dp->cxt, value))
+- goto done; /* unknown label name */
++ return -EINVAL; /* unknown label name */
+ dp->force_label = 1;
++
+ } else if (strcmp(name, "unit") == 0) {
+ if (strcmp(value, "sectors") != 0)
+- goto done; /* only "sectors" supported */
+- } else if (strcmp(name, "label-id") == 0
+- || strcmp(name, "device") == 0
+- || strcmp(name, "grain") == 0
+- || strcmp(name, "first-lba") == 0
+- || strcmp(name, "last-lba") == 0
+- || strcmp(name, "table-length") == 0) {
+- ; /* whatever is possible */
+- } else
+- goto done; /* unknown header */
++ return -EINVAL; /* only "sectors" supported */
+
+- if (*name && *value)
+- rc = fdisk_script_set_header(dp, name, value);
+-done:
+- if (rc)
+- DBG(SCRIPT, ul_debugobj(dp, "header parse error: "
+- "[rc=%d, name='%s', value='%s']",
+- rc, name, value));
+- return rc;
++ }
+
++ return fdisk_script_set_header(dp, name, value);
+ }
+
+ /* returns zero terminated string with next token and @str is updated */
+@@ -1363,7 +1365,8 @@ int fdisk_script_set_fgets(struct fdisk_script *dp,
+ *
+ * Reads next line into dump.
+ *
+- * Returns: 0 on success, <0 on error, 1 when nothing to read.
++ * Returns: 0 on success, <0 on error, 1 when nothing to read. For unknown headers
++ * returns -ENOTSUP, it's usually safe to ignore this error.
+ */
+ int fdisk_script_read_line(struct fdisk_script *dp, FILE *f, char *buf, size_t bufsz)
+ {
+@@ -1428,7 +1431,7 @@ int fdisk_script_read_file(struct fdisk_script *dp, FILE *f)
+
+ while (!feof(f)) {
+ rc = fdisk_script_read_line(dp, f, buf, sizeof(buf));
+- if (rc)
++ if (rc && rc != -ENOTSUP)
+ break;
+ }
+
+--
+2.7.4
+
diff --git a/external/poky/meta/recipes-core/util-linux/util-linux/run-ptest b/external/poky/meta/recipes-core/util-linux/util-linux/run-ptest
index fbc2f9b5..e135ee58 100644
--- a/external/poky/meta/recipes-core/util-linux/util-linux/run-ptest
+++ b/external/poky/meta/recipes-core/util-linux/util-linux/run-ptest
@@ -1,5 +1,18 @@
#!/bin/sh
+
+# 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
+
cd tests || exit 1
comps=$(find ts/ -type f -perm -111 -regex ".*/[^\.~]*" | sort)
@@ -16,10 +29,15 @@ res=0
count=0
for ts in $comps;
do
- $ts | sed '{
+ $ts | 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/external/poky/meta/recipes-core/util-linux/util-linux/util-linux-native-qsort.patch b/external/poky/meta/recipes-core/util-linux/util-linux/util-linux-native-qsort.patch
deleted file mode 100644
index 68bf22de..00000000
--- a/external/poky/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/external/poky/meta/recipes-core/util-linux/util-linux_2.32.1.bb b/external/poky/meta/recipes-core/util-linux/util-linux_2.32.1.bb
deleted file mode 100644
index a616d85b..00000000
--- a/external/poky/meta/recipes-core/util-linux/util-linux_2.32.1.bb
+++ /dev/null
@@ -1,28 +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] = "9e5b1b8c1dc99455bdb6b462cf9436d9"
-SRC_URI[sha256sum] = "86e6707a379c7ff5489c218cfaf1e3464b0b95acf7817db0bc5f179e356a67b2"
-
-CACHED_CONFIGUREVARS += "scanf_cv_alloc_modifier=ms"
-
-EXTRA_OECONF_class-native = "${SHARED_EXTRA_OECONF} \
- --disable-use-tty-group \
-"
-EXTRA_OECONF_class-nativesdk = "${SHARED_EXTRA_OECONF} \
- --disable-use-tty-group \
-"
diff --git a/external/poky/meta/recipes-core/util-linux/util-linux_2.35.1.bb b/external/poky/meta/recipes-core/util-linux/util-linux_2.35.1.bb
new file mode 100644
index 00000000..516b7838
--- /dev/null
+++ b/external/poky/meta/recipes-core/util-linux/util-linux_2.35.1.bb
@@ -0,0 +1,16 @@
+require util-linux.inc
+
+SRC_URI += "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 \
+ file://0001-hwclock-fix-for-glibc-2.31-settimeofday.patch \
+ file://0001-libfdisk-script-accept-sector-size-ignore-unknown-he.patch \
+ file://0001-kill-include-sys-types.h-before-checking-SYS_pidfd_s.patch \
+ file://0001-include-cleanup-pidfd-inckudes.patch \
+"
+SRC_URI[md5sum] = "7f64882f631225f0295ca05080cee1bf"
+SRC_URI[sha256sum] = "d9de3edd287366cd908e77677514b9387b22bc7b88f45b83e1922c3597f1d7f9"