From 972dcfcdbfe75dcfeb777150c136576cf1a71e99 Mon Sep 17 00:00:00 2001 From: Tudor Florea Date: Fri, 9 Oct 2015 22:59:03 +0200 Subject: initial commit for Enea Linux 5.0 arm Signed-off-by: Tudor Florea --- meta/recipes-core/util-linux/util-linux.inc | 276 +++++++++++++++++++++ .../util-linux/util-linux/CVE-2014-9114.patch | 176 +++++++++++++ meta/recipes-core/util-linux/util-linux/MCONFIG | 223 +++++++++++++++++ .../util-linux/avoid_parallel_tests.patch | 18 ++ .../util-linux/avoid_unsupported_find_opts.patch | 38 +++ .../util-linux/avoid_unsupported_grep_opts.patch | 57 +++++ .../util-linux/avoid_unsupported_sleep_param.patch | 20 ++ .../util-linux/util-linux/configure-sbindir.patch | 23 ++ meta/recipes-core/util-linux/util-linux/defines.h | 10 + .../util-linux/display_testname_for_subtest.patch | 17 ++ .../util-linux/util-linux/fix-configure.patch | 20 ++ .../util-linux/util-linux/fix-parallel-build.patch | 35 +++ .../util-linux/util-linux/make_include | 17 ++ .../recipes-core/util-linux/util-linux/ptest.patch | 16 ++ meta/recipes-core/util-linux/util-linux/run-ptest | 10 + meta/recipes-core/util-linux/util-linux/swapargs.h | 3 + .../util-linux/uclibc-__progname-conflict.patch | 32 +++ ...ensure-the-existence-of-directory-for-PAT.patch | 34 +++ .../util-linux/util-linux-native-qsort.patch | 33 +++ .../util-linux/util-linux/util-linux-native.patch | 73 ++++++ .../util-linux-ng-2.16-mount_lock_path.patch | 27 ++ .../util-linux-ng-replace-siginterrupt.patch | 27 ++ meta/recipes-core/util-linux/util-linux_2.24.2.bb | 36 +++ 23 files changed, 1221 insertions(+) create mode 100644 meta/recipes-core/util-linux/util-linux.inc create mode 100644 meta/recipes-core/util-linux/util-linux/CVE-2014-9114.patch create mode 100644 meta/recipes-core/util-linux/util-linux/MCONFIG create mode 100644 meta/recipes-core/util-linux/util-linux/avoid_parallel_tests.patch create mode 100644 meta/recipes-core/util-linux/util-linux/avoid_unsupported_find_opts.patch create mode 100644 meta/recipes-core/util-linux/util-linux/avoid_unsupported_grep_opts.patch create mode 100644 meta/recipes-core/util-linux/util-linux/avoid_unsupported_sleep_param.patch create mode 100644 meta/recipes-core/util-linux/util-linux/configure-sbindir.patch create mode 100644 meta/recipes-core/util-linux/util-linux/defines.h create mode 100644 meta/recipes-core/util-linux/util-linux/display_testname_for_subtest.patch create mode 100644 meta/recipes-core/util-linux/util-linux/fix-configure.patch create mode 100644 meta/recipes-core/util-linux/util-linux/fix-parallel-build.patch create mode 100644 meta/recipes-core/util-linux/util-linux/make_include create mode 100644 meta/recipes-core/util-linux/util-linux/ptest.patch create mode 100644 meta/recipes-core/util-linux/util-linux/run-ptest create mode 100644 meta/recipes-core/util-linux/util-linux/swapargs.h create mode 100644 meta/recipes-core/util-linux/util-linux/uclibc-__progname-conflict.patch create mode 100644 meta/recipes-core/util-linux/util-linux/util-linux-ensure-the-existence-of-directory-for-PAT.patch create mode 100644 meta/recipes-core/util-linux/util-linux/util-linux-native-qsort.patch create mode 100644 meta/recipes-core/util-linux/util-linux/util-linux-native.patch create mode 100644 meta/recipes-core/util-linux/util-linux/util-linux-ng-2.16-mount_lock_path.patch create mode 100644 meta/recipes-core/util-linux/util-linux/util-linux-ng-replace-siginterrupt.patch create mode 100644 meta/recipes-core/util-linux/util-linux_2.24.2.bb (limited to 'meta/recipes-core/util-linux') diff --git a/meta/recipes-core/util-linux/util-linux.inc b/meta/recipes-core/util-linux/util-linux.inc new file mode 100644 index 0000000000..dbc6a2856f --- /dev/null +++ b/meta/recipes-core/util-linux/util-linux.inc @@ -0,0 +1,276 @@ +SUMMARY = "A suite of basic system administration utilities" +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" + +LIC_FILES_CHKSUM = "file://README.licensing;md5=1715f5ee3e01203ca1e1e0b9ee65918c \ + 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" + +inherit autotools gettext pkgconfig systemd ptest +DEPENDS = "zlib ncurses" +DEPENDS_append_class-native = " lzo-native" +DEPENDS_append_class-nativesdk = " lzo-native" + +SRC_URI = "${KERNELORG_MIRROR}/linux/utils/util-linux/v${MAJOR_VERSION}/util-linux-${PV}.tar.xz \ + file://MCONFIG \ + file://defines.h \ + file://make_include \ + file://swapargs.h \ + file://ptest.patch \ + file://run-ptest \ + file://avoid_unsupported_find_opts.patch \ + file://avoid_unsupported_grep_opts.patch \ + file://avoid_unsupported_sleep_param.patch \ + file://display_testname_for_subtest.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-libblkid \ + util-linux-libmount util-linux-libuuid util-linux-uuidd \ + util-linux-uuidgen util-linux-lscpu util-linux-fsck util-linux-blkid \ + util-linux-mkfs util-linux-mcookie util-linux-reset \ + util-linux-mkfs.cramfs util-linux-fsck.cramfs util-linux-fstrim \ + util-linux-partx ${PN}-bash-completion util-linux-hwclock \ + util-linux-findfs" + +SHARED_EXTRA_OECONF = "--disable-use-tty-group \ + --disable-makeinstall-chown \ + --enable-kill --enable-last --enable-mesg --enable-partx \ + --enable-raw --enable-reset --disable-login \ + --disable-vipw --disable-newgrp --disable-chfn-chsh \ + --enable-write --enable-mount \ + --enable-libuuid --enable-libblkid --enable-fsck --without-udev \ + usrsbin_execdir='${sbindir}' \ +" + +EXTRA_OECONF = "${SHARED_EXTRA_OECONF} --libdir=${base_libdir}" + +PACKAGECONFIG_class-target ?= "${@bb.utils.contains('DISTRO_FEATURES', 'pam', 'pam', '', d)} \ + ${@bb.utils.contains('DISTRO_FEATURES', 'systemd', 'systemd', '', d)} " +PACKAGECONFIG[pam] = "--enable-su --enable-runuser,--disable-su --disable-runuser, libpam," + +# Respect the systemd feature for uuidd +PACKAGECONFIG[systemd] = "--enable-socket-activation --with-systemdsystemunitdir=${systemd_unitdir}/system/, --disable-socket-activation --without-systemdsystemunitdir" + +# Build setpriv requires libcap-ng +PACKAGECONFIG[libcap-ng] = "--enable-setpriv,--disable-setpriv,libcap-ng," + +FILES_${PN}-bash-completion += "${datadir}/bash-completion" +FILES_${PN}-doc += "${datadir}/getopt/getopt-*.*" + +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 = "${base_sbindir}/readprofile.${BPN}" +FILES_util-linux-uuidgen = "${bindir}/uuidgen" +FILES_util-linux-uuidd = "${sbindir}/uuidd" +FILES_util-linux-reset = "${base_bindir}/reset" +FILES_util-linux-partx = "${sbindir}/partx" +FILES_util-linux-hwclock = "${base_sbindir}/hwclock.${BPN}" +FILES_util-linux-findfs = "${sbindir}/findfs" + +FILES_util-linux-libblkid = "${base_libdir}/libblkid.so.*" +FILES_util-linux-libmount = "${base_libdir}/libmount.so.*" +FILES_util-linux-libuuid = "${base_libdir}/libuuid.so.*" +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" + + +# 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" + +# reset calls 'tput' +RDEPENDS_util-linux-reset += "ncurses" + +RDEPENDS_${PN} = "util-linux-umount util-linux-swaponoff util-linux-losetup" +RRECOMMENDS_${PN} = "util-linux-fdisk util-linux-cfdisk util-linux-sfdisk util-linux-mount util-linux-readprofile util-linux-mkfs " + +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" +SYSTEMD_SERVICE_${PN}-uuidd = "uuidd.service" + +do_compile () { + set -e + install ${WORKDIR}/MCONFIG ${S}/MCONFIG + install ${WORKDIR}/make_include ${S}/make_include + install ${WORKDIR}/swapargs.h ${S}/mount-deprecated/swapargs.h + install ${WORKDIR}/defines.h ${S}/defines.h + 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 readprofile fsck blkid blockdev fstrim sulogin switch_root" + usrbinprogs_a="chfn chsh hexdump last logger mesg newgrp renice utmpdump wall setsid chrt flock getopt" + binprogs_a="dmesg kill more umount mount login reset su" + + 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 +} + +inherit update-alternatives + +ALTERNATIVE_PRIORITY = "100" + +ALTERNATIVE_${PN} = "dmesg kill more mkswap blockdev pivot_root switch_root" +ALTERNATIVE_${PN} += "mkfs.minix hexdump last logger mesg renice wall" +ALTERNATIVE_${PN} += "setsid chrt flock utmpdump eject getopt sulogin" + +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[mkfs.minix] = "${base_sbindir}/mkfs.minix" +ALTERNATIVE_LINK_NAME[eject] = "${bindir}/eject" +ALTERNATIVE_LINK_NAME[getopt] = "${base_bindir}/getopt" +ALTERNATIVE_LINK_NAME[sulogin] = "${base_sbindir}/sulogin" +ALTERNATIVE_TARGET[getopt] = "${bindir}/getopt" + +ALTERNATIVE_${PN}-doc = "mountpoint.1 last.1 mesg.1 wall.1 sulogin.8 utmpdump.1 reset.1" + +ALTERNATIVE_LINK_NAME[last.1] = "${mandir}/man1/last.1" +ALTERNATIVE_LINK_NAME[mesg.1] = "${mandir}/man1/mesg.1" +ALTERNATIVE_LINK_NAME[mountpoint.1] = "${mandir}/man1/mountpoint.1" +ALTERNATIVE_LINK_NAME[reset.1] = "${mandir}/man1/reset.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_util-linux-hwclock = "hwclock" +# There seems to be problem, atleast on nslu2, with these, untill they are +# fixed the busybox ones have higher priority +ALTERNATIVE_PRIORITY[hwclock] = "10" +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] = "${base_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.minix fsck" +ALTERNATIVE_LINK_NAME[fsck.minix] = "${base_sbindir}/fsck.minix" +ALTERNATIVE_LINK_NAME[fsck] = "${base_sbindir}/fsck" + +ALTERNATIVE_util-linux-blkid = "blkid" +ALTERNATIVE_LINK_NAME[blkid] = "${base_sbindir}/blkid" + +ALTERNATIVE_util-linux-reset = "reset" +ALTERNATIVE_LINK_NAME[reset] = "${bindir}/reset" +ALTERNATIVE_TARGET[reset] = "${base_bindir}/reset" + +BBCLASSEXTEND = "native nativesdk" + +python do_package_prepend () { + if '--enable-su' in d.getVar('EXTRA_OECONF', True).split(): + alt_name = "su" + d.setVarFlag('ALTERNATIVE_LINK_NAME', alt_name, '%s/%s' % (d.getVar('base_bindir', True), alt_name)) + d.appendVar('ALTERNATIVE_%s' % (d.getVar('PN', True)), ' ' + alt_name) +} + +do_compile_ptest() { + oe_runmake buildtest-TESTS +} + +do_install_ptest() { + mkdir -p ${D}${PTEST_PATH}/tests/ts + find . -maxdepth 1 -type f -perm -111 -exec cp {} ${D}${PTEST_PATH} \; + cp ${S}/tests/functions.sh ${D}${PTEST_PATH}/tests/ + cp ${S}/tests/commands.sh ${D}${PTEST_PATH}/tests/ + cp ${S}/tests/run.sh ${D}${PTEST_PATH}/tests/ + cp -pR ${S}/tests/expected ${D}${PTEST_PATH}/tests/expected + + list="bitops build-sys cal col colrm column dmesg fsck hexdump hwclock ipcs isosize login look lscpu md5 misc more namei paths schedutils script swapon tailf utmpdump" + # The following tests are not installed yet: + # blkid scsi_debug module dependent + # cramfs gcc dependent + # eject gcc dependent + # fdisk scsi_debug module and gcc dependent + # libmount uuidgen dependent + # mount gcc dependant + # partx blkid dependant + for d in $list; do + cp -pR ${S}/tests/ts/$d ${D}${PTEST_PATH}/tests/ts/ + done +} diff --git a/meta/recipes-core/util-linux/util-linux/CVE-2014-9114.patch b/meta/recipes-core/util-linux/util-linux/CVE-2014-9114.patch new file mode 100644 index 0000000000..46c5e8ecb7 --- /dev/null +++ b/meta/recipes-core/util-linux/util-linux/CVE-2014-9114.patch @@ -0,0 +1,176 @@ +Upstream-Status: Backport + +This patch is for CVE-2014-9114. +This patch should be removed once util-linux is upgraded to 2.26. + +Signed-off-by: Chen Qi + +From 89e90ae7b2826110ea28c1c0eb8e7c56c3907bdc Mon Sep 17 00:00:00 2001 +From: Karel Zak +Date: Thu, 27 Nov 2014 13:39:35 +0100 +Subject: [PATCH] libblkid: care about unsafe chars in cache + +The high-level libblkid API uses /run/blkid/blkid.tab cache to +store probing results. The cache format is + + devname + +and unfortunately the cache code does not escape quotation marks: + + # mkfs.ext4 -L 'AAA"BBB' + + # cat /run/blkid/blkid.tab + ... + /dev/sdb1 + +such string is later incorrectly parsed and blkid(8) returns +nonsenses. And for use-cases like + + # eval $(blkid -o export /dev/sdb1) + +it's also insecure. + +Note that mount, udevd and blkid -p are based on low-level libblkid +API, it bypass the cache and directly read data from the devices. + +The current udevd upstream does not depend on blkid(8) output at all, +it's directly linked with the library and all unsafe chars are encoded by +\x notation. + + # mkfs.ext4 -L 'X"`/tmp/foo` "' /dev/sdb1 + # udevadm info --export-db | grep LABEL + ... + E: ID_FS_LABEL=X__/tmp/foo___ + E: ID_FS_LABEL_ENC=X\x22\x60\x2ftmp\x2ffoo\x60\x20\x22 + +Signed-off-by: Karel Zak +--- + libblkid/src/read.c | 21 ++++++++++++++++++--- + libblkid/src/save.c | 22 +++++++++++++++++++++- + misc-utils/blkid.8 | 5 ++++- + misc-utils/blkid.c | 4 ++-- + 4 files changed, 45 insertions(+), 7 deletions(-) + +Index: util-linux-2.24.2/libblkid/src/save.c +=================================================================== +--- util-linux-2.24.2.orig/libblkid/src/save.c ++++ util-linux-2.24.2/libblkid/src/save.c +@@ -26,6 +26,21 @@ + + #include "blkidP.h" + ++ ++static void save_quoted(const char *data, FILE *file) ++{ ++ const char *p; ++ ++ fputc('"', file); ++ for (p = data; p && *p; p++) { ++ if ((unsigned char) *p == 0x22 || /* " */ ++ (unsigned char) *p == 0x5c) /* \ */ ++ fputc('\\', file); ++ ++ fputc(*p, file); ++ } ++ fputc('"', file); ++} + static int save_dev(blkid_dev dev, FILE *file) + { + struct list_head *p; +@@ -43,9 +58,14 @@ static int save_dev(blkid_dev dev, FILE + + if (dev->bid_pri) + fprintf(file, " PRI=\"%d\"", dev->bid_pri); ++ + list_for_each(p, &dev->bid_tags) { + blkid_tag tag = list_entry(p, struct blkid_struct_tag, bit_tags); +- fprintf(file, " %s=\"%s\"", tag->bit_name,tag->bit_val); ++ ++ fputc(' ', file); /* space between tags */ ++ fputs(tag->bit_name, file); /* tag NAME */ ++ fputc('=', file); /* separator between NAME and VALUE */ ++ save_quoted(tag->bit_val, file); /* tag "VALUE" */ + } + fprintf(file, ">%s\n", dev->bid_name); + +Index: util-linux-2.24.2/misc-utils/blkid.8 +=================================================================== +--- util-linux-2.24.2.orig/misc-utils/blkid.8 ++++ util-linux-2.24.2/misc-utils/blkid.8 +@@ -193,7 +193,10 @@ partitions. This output format is \fBDE + .TP + .B export + print key=value pairs for easy import into the environment; this output format +-is automatically enabled when I/O Limits (\fB-i\fR option) are requested ++is automatically enabled when I/O Limits (\fB-i\fR option) are requested. ++ ++The non-printing characters are encoded by ^ and M- notation and all ++potentially unsafe characters are escaped. + .RE + .TP + .BI \-O " offset" +Index: util-linux-2.24.2/misc-utils/blkid.c +=================================================================== +--- util-linux-2.24.2.orig/misc-utils/blkid.c ++++ util-linux-2.24.2/misc-utils/blkid.c +@@ -306,7 +306,7 @@ static void print_value(int output, int + printf("DEVNAME=%s\n", devname); + fputs(name, stdout); + fputs("=", stdout); +- safe_print(value, valsz, NULL); ++ safe_print(value, valsz, " \\\"'$`<>"); + fputs("\n", stdout); + + } else { +@@ -314,7 +314,7 @@ static void print_value(int output, int + printf("%s: ", devname); + fputs(name, stdout); + fputs("=\"", stdout); +- safe_print(value, valsz, "\""); ++ safe_print(value, valsz, "\"\\"); + fputs("\" ", stdout); + } + } +Index: util-linux-2.24.2/libblkid/src/read.c +=================================================================== +--- util-linux-2.24.2.orig/libblkid/src/read.c ++++ util-linux-2.24.2/libblkid/src/read.c +@@ -252,8 +252,23 @@ static int parse_token(char **name, char + *value = skip_over_blank(*value + 1); + + if (**value == '"') { +- end = strchr(*value + 1, '"'); +- if (!end) { ++ char *p = end = *value + 1; ++ ++ /* convert 'foo\"bar' to 'foo"bar' */ ++ while (*p) { ++ if (*p == '\\') { ++ p++; ++ *end = *p; ++ } else { ++ *end = *p; ++ if (*p == '"') ++ break; ++ } ++ p++; ++ end = ++p; ++ } ++ ++ if (*end != '"') { + DBG(READ, blkid_debug("unbalanced quotes at: %s", *value)); + *cp = *value; + return -BLKID_ERR_CACHE; +@@ -261,11 +276,11 @@ static int parse_token(char **name, char + (*value)++; + *end = '\0'; + end++; ++ end = ++p; + } else { + end = skip_over_word(*value); + if (*end) { + *end = '\0'; +- end++; + } + } + *cp = end; diff --git a/meta/recipes-core/util-linux/util-linux/MCONFIG b/meta/recipes-core/util-linux/util-linux/MCONFIG new file mode 100644 index 0000000000..3fea2c02d7 --- /dev/null +++ b/meta/recipes-core/util-linux/util-linux/MCONFIG @@ -0,0 +1,223 @@ +# MCONFIG -- Configuration stuff for util-linux +# Created: Sat Feb 4 15:50:30 1995 +# Copyright 1995 Rickard E. Faith (faith@cs.unc.edu) + +# For a user-mode install, make (at least) three changes: +# - remove the `-o root' part in INSTALLSUID +# - set USE_TTY_GROUP=no +# - define DESTDIR + +# Select for ARCH one of intel, alpha, sparc, arm, m68k, mips +# Select for CPU i386 if the binaries must be able to run on an intel 386 +# (by default i486 code is generated, see below) +CPU=$(shell uname -m) +ARCH=$(shell echo $(CPU) | sed 's/i.86/intel/;s/arm.*/arm/') + +# If HAVE_PAM is set to "yes", then login, chfn, chsh, and newgrp +# will use PAM for authentication. Additionally, passwd will not be +# installed as it is not PAM aware. +HAVE_PAM=no + +# If HAVE_SHADOW is set to "yes", then login, chfn, chsh, newgrp, passwd, +# and vipw will not be built or installed from the login-utils +# subdirectory. +HAVE_SHADOW=yes + +# If HAVE_PASSWD is set to "yes", then passwd will not be built or +# installed from the login-utils subdirectory (but login, chfn, chsh, +# newgrp, and vipw *will* be installed). +HAVE_PASSWD=no + +# If you use chfn and chsh from this package, REQUIRE_PASSWORD will require +# non-root users to enter the account password before updating /etc/passwd. +REQUIRE_PASSWORD=yes +#REQUIRE_PASSWORD=no + +# If you use chsh from this package, ONLY_LISTED_SHELLS will require that +# the selected shell be listed in /etc/shells -- otherwise only a warning is +# printed. This prevents someone from setting their shell to /bin/false. +ONLY_LISTED_SHELLS=yes +#ONLY_LISTED_SHELLS=no + + +# If HAVE_SYSVINIT is set to "yes", then simpleinit and shutdown will not +# be built or installed from the login-utils subdirectory. (The shutdown +# and halt that come with the SysVinit package should be used with the init +# found in that package.) +HAVE_SYSVINIT=no + +# If HAVE_SYSVINIT_UTILS is set to "yes", then last, mesg, and wall will +# not be built or installed from the login-utils subdirectory. (The +# shutdown and init from the SysVinit package do not depend on the last, +# mesg, and wall from that package.) +HAVE_SYSVINIT_UTILS=no + +# If HAVE_WRITE is set to "yes", then write will not be built or +# installed from the misc-utils subdirectory. +# (There is a network aware write in netwrite from NetKit 0.16 or later.) +HAVE_WRITE=no + +# If HAVE_GETTY is set to "yes", then agetty will not be built or +# installed from the login-utils subdirectory. Note that agetty can +# co-exist with other gettys, so this option should never be used. +HAVE_GETTY=no + +# If USE_TTY_GROUP is set to "yes", then wall and write will be installed +# setgid to the "tty" group, and mesg will only set the group write bit. +# Note that this is only useful if login/xterm/etc. change the group of the +# user's tty to "tty" [The login in util-linux does this correctly, and +# xterm will do it correctly if X is compiled with USE_TTY_GROUP set +# properly.] +USE_TTY_GROUP=no + +# If HAVE_KILL is set to "yes", then kill will not be built or +# installed from the misc-utils subdirectory. +# (There is also a kill in the procps package.) +HAVE_KILL=no + +# If ALLOW_VCS_USE is set to "yes", then login will chown /dev/vcsN +# to the current user, allowing her to make a screendump and do other +# nifty things on the console, but also allowing him to keep an open +# file descriptor after logging out to trick the next user. +ALLOW_VCS_USE=yes + +# If HAVE_RESET is set to "yes", then reset won't be installed. The version +# of reset that comes with the ncurses package is less aggressive. +HAVE_RESET=yes + +# If HAVE_SLN is set to "yes", then sln won't be installed +# (but the man page sln.8 will be installed anyway). +# sln also comes with libc and glibc. +HAVE_SLN=no + +# If HAVE_FDUTILS is set to "yes", then setfdprm won't be installed. +HAVE_FDUTILS=no + +# If SILENT_PG is set to "yes", then pg will not ring the bell +# when an invalid key is pressed +SILENT_PG=no + +# If configure decides that Native Language Support (NLS) is available, +# it sets MAY_ENABLE_NLS in defines.h. If you don't want NLS, set +# DISABLE_NLS to "yes". +DISABLE_NLS=no + +# Different optimizations for different cpus. +# gcc 3.0 likes options -mcpu=i486 instead of -m486 +ifeq "$(ARCH)" "intel" + ifeq "$(HAVE_OLD_GCC)" "yes" + CPUHEAD=-m + else + CPUHEAD=-mcpu=i + endif + ifeq "$(CPU)" "i386" + CPUTAIL=386 + else + CPUTAIL=486 + endif + CPUOPT= $(CPUHEAD)$(CPUTAIL) + OPT= -pipe -O2 $(CPUOPT) -fomit-frame-pointer +else + ifeq "$(ARCH)" "arm" + OPT= -pipe -O2 -fsigned-char -fomit-frame-pointer + else + OPT= -O2 -fomit-frame-pointer + endif +endif + +WARNFLAGS = -Wall -Wmissing-prototypes -Wstrict-prototypes + +LIB=../lib + +ERR_O=$(LIB)/err.o + +# Set HAVE_SLANG to yes if you have slang (and prefer to use that for cfdisk) +# (If neither HAVE_NCURSES nor HAVE_SLANG is defined, cfdisk is not made.) +# HAVE_SLANG=yes +# There is a subdirectory /usr/include/slang containing slcurses.h +# SLANGFLAGS=-I/usr/include/slang +# No such subdirectory - slcurses.h lives in /usr/include +# (no extra definition required). +LIBSLANG=-lslang + +# +# Paths used for compilation (not all are actually used, see CFLAGS below) +# +DEV_DIR= /dev +ETC_DIR= /etc +SBIN_DIR= /sbin +USRSBIN_DIR= /usr/sbin +USRLIB_DIR= /usr/lib +USRBIN_DIR= /usr/bin +USRGAMES_DIR= /usr/games +USRSHAREMISC_DIR=/usr/share/misc +LOCALE_DIR= /usr/share/locale +BIN_DIR= /bin +VAR_PATH= /var +LOG_DIR= /var/log +MAN_DIR= /usr/share/man +INFO_DIR= /usr/share/info + +# +# Paths used for install +# +DEVDIR= $(DESTDIR)$(DEV_DIR) +ETCDIR= $(DESTDIR)$(ETC_DIR) +SBINDIR= $(DESTDIR)$(SBIN_DIR) +USRSBINDIR= $(DESTDIR)$(USRSBIN_DIR) +USRLIBDIR= $(DESTDIR)$(USRLIB_DIR) +USRBINDIR= $(DESTDIR)$(USRBIN_DIR) +USRGAMESDIR= $(DESTDIR)$(USRGAMES_DIR) +USRSHAREMISCDIR=$(DESTDIR)$(USRSHAREMISC_DIR) +LOCALEDIR= $(DESTDIR)$(LOCALE_DIR) +BINDIR= $(DESTDIR)$(BIN_DIR) +VARPATH= $(DESTDIR)$(VAR_PATH) +LOGDIR= $(DESTDIR)$(LOG_DIR) +MANDIR= $(DESTDIR)$(MAN_DIR) +MAN1DIR= $(MANDIR)/man1 +MAN3DIR= $(MANDIR)/man3 +MAN5DIR= $(MANDIR)/man5 +MAN6DIR= $(MANDIR)/man6 +MAN8DIR= $(MANDIR)/man8 +INFODIR= $(DESTDIR)$(INFO_DIR) + +# Directory for shutdown, halt, reboot, etc. +SHUTDOWNDIR= $(SBINDIR) + +# Modes +DIRMODE= 755 +BINMODE= 755 +MANMODE= 644 +DATMODE= 644 +INFOMODE= 644 +SUIDMODE= 4755 + +CHMOD= chmod +INSTALL= install +INSTALLDIR= $(INSTALL) -d -m $(DIRMODE) +INSTALLBIN= $(INSTALL) -m $(BINMODE) +INSTALLMAN= $(INSTALL) -m $(MANMODE) +INSTALLDAT= $(INSTALL) -m $(DATMODE) +INSTALLSUID= $(INSTALL) -m $(SUIDMODE) + +ifeq "$(DISABLE_NLS)" "yes" +NLSFLAGS = -DDISABLE_NLS +endif + +CFLAGS := $(OPT) -I$(LIB) $(WARNFLAGS) \ + $(CURSESFLAGS) $(SLANGFLAGS) $(NLSFLAGS) \ + -D_FILE_OFFSET_BITS=64 \ + -DSBINDIR=\"$(SBIN_DIR)\" \ + -DUSRSBINDIR=\"$(USRSBIN_DIR)\" \ + -DLOGDIR=\"$(LOG_DIR)\" \ + -DVARPATH=\"$(VAR_PATH)\" \ + -DLOCALEDIR=\"$(LOCALE_DIR)\" \ + $(CFLAGS) + + +%.o: %.c + $(CC) -c $(CFLAGS) $< -o $@ + +%: %.cc + $(CXX) $(CFLAGS) $< -o $@ + 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 new file mode 100644 index 0000000000..889ed43978 --- /dev/null +++ b/meta/recipes-core/util-linux/util-linux/avoid_parallel_tests.patch @@ -0,0 +1,18 @@ +ptest needs buildtest-TESTS and runtest-TESTS targets. +serial-tests is required to generate those targets. + +Signed-off-by: Alexandra Safta +Upstream-Status: Pending + +diff -ruN a/configure.ac b/configure.ac +--- a/configure.ac 2014-05-27 12:37:42.119772658 +0200 ++++ b/configure.ac 2014-05-27 12:41:46.225573272 +0200 +@@ -10,7 +10,7 @@ + dnl AC_USE_SYSTEM_EXTENSIONS must be called before any macros that run + dnl the compiler (like AC_PROG_LIBTOOL) to avoid autoconf errors. + AC_USE_SYSTEM_EXTENSIONS +-AM_INIT_AUTOMAKE([-Wall foreign 1.10 tar-pax dist-bzip2 no-dist-gzip dist-xz -Wno-portability subdir-objects]) ++AM_INIT_AUTOMAKE([-Wall foreign 1.10 tar-pax dist-bzip2 no-dist-gzip dist-xz -Wno-portability 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/avoid_unsupported_find_opts.patch b/meta/recipes-core/util-linux/util-linux/avoid_unsupported_find_opts.patch new file mode 100644 index 0000000000..13dc7ddaa1 --- /dev/null +++ b/meta/recipes-core/util-linux/util-linux/avoid_unsupported_find_opts.patch @@ -0,0 +1,38 @@ +Avoid unsupported find options + +Signed-off-by: Tudor Florea +Upstream-Status: Pending + +diff -ruN a/tests/run.sh b/tests/run.sh +--- a/tests/run.sh 2013-08-26 23:48:48.868279097 +0200 ++++ b/tests/run.sh 2013-08-27 00:14:35.646730004 +0200 +@@ -91,7 +91,7 @@ + # selected tests only + for s in $SUBTESTS; do + if [ -d "$top_srcdir/tests/ts/$s" ]; then +- co=$(find $top_srcdir/tests/ts/$s -type f -perm /a+x -regex ".*/[^\.~]*" | sort) ++ co=$(find $top_srcdir/tests/ts/$s -type f -perm -111 -regex ".*/[^\.~]*" | sort) + comps="$comps $co" + else + echo "Unknown test component '$s'" +@@ -104,7 +104,7 @@ + exit 1 + fi + +- comps=$(find $top_srcdir/tests/ts/ -type f -perm /a+x -regex ".*/[^\.~]*" | sort) ++ comps=$(find $top_srcdir/tests/ts/ -type f -perm -111 -regex ".*/[^\.~]*" | sort) + fi + + +diff -ruN a/tests/ts/build-sys/config b/tests/ts/build-sys/config +--- a/tests/ts/build-sys/config 2013-08-26 23:50:26.800131581 +0200 ++++ b/tests/ts/build-sys/config 2013-08-27 00:10:02.806302850 +0200 +@@ -32,7 +32,7 @@ + ./configure $opts &> /dev/null + make -j &> /dev/null + +- bins=$(find . -type f -perm /a+x | sort) ++ bins=$(find . -type f -perm -111 | sort) + for b in $bins; do + libs=$(readelf --dynamic $b 2> /dev/null | \ + awk '/NEEDED/ { print $5 }' | \ diff --git a/meta/recipes-core/util-linux/util-linux/avoid_unsupported_grep_opts.patch b/meta/recipes-core/util-linux/util-linux/avoid_unsupported_grep_opts.patch new file mode 100644 index 0000000000..a0d5efad0f --- /dev/null +++ b/meta/recipes-core/util-linux/util-linux/avoid_unsupported_grep_opts.patch @@ -0,0 +1,57 @@ +Avoid unsupported grep options + +Signed-off-by: Tudor Florea +Upstream-Status: Pending + +diff -ruN a/ts/ipcs/headers b/ts/ipcs/headers +--- a/tests/ts/ipcs/headers 2013-09-04 11:03:36.118613250 +0200 ++++ b/teste/ts/ipcs/headers 2013-09-04 11:03:27.906958437 +0200 +@@ -22,35 +22,35 @@ + ts_init "$*" + + ts_log "test: shm headers" +-$TS_CMD_IPCS -m -t | grep --after-context=1 "^---" >> $TS_OUTPUT +-$TS_CMD_IPCS -m -p | grep --after-context=1 "^---" >> $TS_OUTPUT +-$TS_CMD_IPCS -m -c | grep --after-context=1 "^---" >> $TS_OUTPUT ++$TS_CMD_IPCS -m -t | grep -A 1 "^---" >> $TS_OUTPUT ++$TS_CMD_IPCS -m -p | grep -A 1 "^---" >> $TS_OUTPUT ++$TS_CMD_IPCS -m -c | grep -A 1 "^---" >> $TS_OUTPUT + $TS_CMD_IPCS -m -l | grep "^---" >> $TS_OUTPUT + $TS_CMD_IPCS -m -u | grep "^---" >> $TS_OUTPUT + echo >> $TS_OUTPUT + + ts_log "test: mesg headers" +-$TS_CMD_IPCS -q -t | grep --after-context=1 "^---" >> $TS_OUTPUT +-$TS_CMD_IPCS -q -p | grep --after-context=1 "^---" >> $TS_OUTPUT +-$TS_CMD_IPCS -q -c | grep --after-context=1 "^---" >> $TS_OUTPUT ++$TS_CMD_IPCS -q -t | grep -A 1 "^---" >> $TS_OUTPUT ++$TS_CMD_IPCS -q -p | grep -A 1 "^---" >> $TS_OUTPUT ++$TS_CMD_IPCS -q -c | grep -A 1 "^---" >> $TS_OUTPUT + $TS_CMD_IPCS -q -l | grep "^---" >> $TS_OUTPUT + $TS_CMD_IPCS -q -u | grep "^---" >> $TS_OUTPUT + echo >> $TS_OUTPUT + + ts_log "test: sem headers" +-$TS_CMD_IPCS -s -t | grep --after-context=1 "^---" >> $TS_OUTPUT +-$TS_CMD_IPCS -s -p | grep --after-context=1 "^---" >> $TS_OUTPUT +-$TS_CMD_IPCS -s -c | grep --after-context=1 "^---" >> $TS_OUTPUT ++$TS_CMD_IPCS -s -t | grep -A 1 "^---" >> $TS_OUTPUT ++$TS_CMD_IPCS -s -p | grep -A 1 "^---" >> $TS_OUTPUT ++$TS_CMD_IPCS -s -c | grep -A 1 "^---" >> $TS_OUTPUT + $TS_CMD_IPCS -s -l | grep "^---" >> $TS_OUTPUT + $TS_CMD_IPCS -s -u | grep "^---" >> $TS_OUTPUT + echo >> $TS_OUTPUT + + ts_log "test: all headers" +-$TS_CMD_IPCS -a | grep --after-context=1 "^---" >> $TS_OUTPUT ++$TS_CMD_IPCS -a | grep -A 1 "^---" >> $TS_OUTPUT + +-$TS_CMD_IPCS -a -t | grep --after-context=1 "^---" >> $TS_OUTPUT +-$TS_CMD_IPCS -a -p | grep --after-context=1 "^---" >> $TS_OUTPUT +-$TS_CMD_IPCS -a -c | grep --after-context=1 "^---" >> $TS_OUTPUT ++$TS_CMD_IPCS -a -t | grep -A 1 "^---" >> $TS_OUTPUT ++$TS_CMD_IPCS -a -p | grep -A 1 "^---" >> $TS_OUTPUT ++$TS_CMD_IPCS -a -c | grep -A 1 "^---" >> $TS_OUTPUT + $TS_CMD_IPCS -a -l | grep "^---" >> $TS_OUTPUT + $TS_CMD_IPCS -a -u | grep "^---" >> $TS_OUTPUT + diff --git a/meta/recipes-core/util-linux/util-linux/avoid_unsupported_sleep_param.patch b/meta/recipes-core/util-linux/util-linux/avoid_unsupported_sleep_param.patch new file mode 100644 index 0000000000..3a6206704a --- /dev/null +++ b/meta/recipes-core/util-linux/util-linux/avoid_unsupported_sleep_param.patch @@ -0,0 +1,20 @@ +Avoid unsupported sleep parameter + +Signed-off-by: Tudor Florea +Upstream-Status: Pending + +diff -ruN a/simple b/simple +--- a/tests/ts/tailf/simple 2013-09-04 11:34:49.971817130 +0200 ++++ b/tests/ts/tailf/simple 2013-09-04 11:34:37.876325128 +0200 +@@ -25,9 +25,9 @@ + + $TS_CMD_TAILF $INPUT > $TS_OUTPUT 2>&1 & + +-sleep 0.1 ++sleep 1 + echo {0..9} >> $INPUT +-sleep 0.1 ++sleep 1 + + rm -f $INPUT + diff --git a/meta/recipes-core/util-linux/util-linux/configure-sbindir.patch b/meta/recipes-core/util-linux/util-linux/configure-sbindir.patch new file mode 100644 index 0000000000..a5b1ff12e5 --- /dev/null +++ b/meta/recipes-core/util-linux/util-linux/configure-sbindir.patch @@ -0,0 +1,23 @@ +util-linux: take ${sbindir} from the environment if it is set there +fix the test, the [ ] syntax was getting eaten by autoconf + +Signed-off-by: Phil Blundell +Signed-off-by: Saul Wold +Upstream-Status: Pending + +diff -ruN a/functions.sh b/functions.sh +--- a/tests/functions.sh 2013-09-04 12:41:07.625488953 +0200 ++++ b/tests/functions.sh 2013-09-04 17:33:02.402802957 +0200 +@@ -209,7 +209,7 @@ + [ $TS_NSUBTESTS -eq 0 ] && echo + TS_NSUBTESTS=$(( $TS_NSUBTESTS + 1 )) + +- printf "%16s: %-27s ..." "" "$TS_SUBNAME" ++ printf "%13s: %-30s ..." "$TS_COMPONENT" "$TS_SUBNAME" + } + + function ts_init { diff --git a/meta/recipes-core/util-linux/util-linux/fix-configure.patch b/meta/recipes-core/util-linux/util-linux/fix-configure.patch new file mode 100644 index 0000000000..cefae97e9c --- /dev/null +++ b/meta/recipes-core/util-linux/util-linux/fix-configure.patch @@ -0,0 +1,20 @@ +The userlib_execdir was not getting set correctly, the quoting +was wrong as these quoted items were not getting expanded correctly. + +Upstream-Status: Pending + +Signed-off-by: Saul Wold + +Index: util-linux-2.24.1/configure.ac +=================================================================== +--- util-linux-2.24.1.orig/configure.ac ++++ util-linux-2.24.1/configure.ac +@@ -76,7 +76,7 @@ fi + AC_SUBST([usrsbin_execdir]) + + AS_CASE([$libdir], +- ['${exec_prefix}/'* | '${prefix}/'* | /usr/*], ++ [${exec_prefix}/* | ${prefix}/* | /usr/*], + [usrlib_execdir=$libdir], + [usrlib_execdir='${exec_prefix}'$libdir] + ) diff --git a/meta/recipes-core/util-linux/util-linux/fix-parallel-build.patch b/meta/recipes-core/util-linux/util-linux/fix-parallel-build.patch new file mode 100644 index 0000000000..adb271ce0d --- /dev/null +++ b/meta/recipes-core/util-linux/util-linux/fix-parallel-build.patch @@ -0,0 +1,35 @@ +From 774f55f9dd22c01e4041a183d8dff14811f29114 Mon Sep 17 00:00:00 2001 +From: Robert Yang +Date: Fri, 4 Apr 2014 17:33:04 +0800 +Subject: [PATCH] sys-utils/Makemodule.am: fix parallel build issue + +The rule SETARCH_MAN_LINKS is used for the files under the sys-utils +dir, for example: + +echo ".so man8/setarch.8" > sys-utils/linux32.8 + +but it depends on nothing so that the sys-utils dir may not exist, we +can create the sys-utils dir to fix problem. + +Upstream-Status: Pending + +Signed-off-by: Robert Yang +--- + sys-utils/Makemodule.am | 1 + + 1 file changed, 1 insertion(+) + +diff --git a/sys-utils/Makemodule.am b/sys-utils/Makemodule.am +index 6265282..62ead37 100644 +--- a/sys-utils/Makemodule.am ++++ b/sys-utils/Makemodule.am +@@ -124,6 +124,7 @@ man_MANS += $(SETARCH_MAN_LINKS) + CLEANFILES += $(SETARCH_MAN_LINKS) + + $(SETARCH_MAN_LINKS): ++ $(MKDIR_P) sys-utils + $(AM_V_GEN)echo ".so man8/setarch.8" > $@ + + install-exec-hook-setarch: +-- +1.8.2.1 + diff --git a/meta/recipes-core/util-linux/util-linux/make_include b/meta/recipes-core/util-linux/util-linux/make_include new file mode 100644 index 0000000000..e6abcd91f7 --- /dev/null +++ b/meta/recipes-core/util-linux/util-linux/make_include @@ -0,0 +1,17 @@ +VERSION=2.12 +CC=gcc +CFLAGS= +LDFLAGS= +HAVE_OLD_GCC=yes +HAVE_RAW_H=yes +HAVE_NCURSES=yes +CURSESFLAGS=-DNCH=1 +LIBCURSES=-lncurses +HAVE_TERMCAP=no +NEED_LIBCRYPT=yes +FOREIGN = --foreign-user +HAVE_XGETTEXT=yes +HAVE_OPENPTY=yes +HAVE_PIVOT_ROOT=yes +HAVE_GOOD_RPC=yes +HAVE_ZLIB=yes diff --git a/meta/recipes-core/util-linux/util-linux/ptest.patch b/meta/recipes-core/util-linux/util-linux/ptest.patch new file mode 100644 index 0000000000..e9adc90a21 --- /dev/null +++ b/meta/recipes-core/util-linux/util-linux/ptest.patch @@ -0,0 +1,16 @@ +Define TESTS variable + +Signed-off-by: Tudor Florea +Upstream-Status: Pending + +diff -ruN a/Makefile.am b/Makefile.am +--- a/Makefile.am 2013-08-26 16:29:42.151429221 +0200 ++++ b/Makefile.am 2013-08-26 17:52:31.013898120 +0200 +@@ -43,7 +43,7 @@ + dist_usrbin_exec_SCRIPTS = + systemdsystemunit_DATA = + check_PROGRAMS = +-TESTS = ++TESTS = $(check_PROGRAMS) + + PATHFILES = diff --git a/meta/recipes-core/util-linux/util-linux/run-ptest b/meta/recipes-core/util-linux/util-linux/run-ptest new file mode 100644 index 0000000000..b04f14a835 --- /dev/null +++ b/meta/recipes-core/util-linux/util-linux/run-ptest @@ -0,0 +1,10 @@ +#!/bin/sh + +cd tests || exit 1 +sh ./run.sh 2>&1 | { + sed '{ + s/^\(.*\):\(.*\) \.\.\. OK$/PASS: \1:\2/ + s/^\(.*\):\(.*\) \.\.\. FAILED \(.*\)$/FAIL: \1:\2 \3/ + s/^\(.*\):\(.*\) \.\.\. IGNORE \(.*\)$/SKIP: \1:\2 \3/ + }' +} diff --git a/meta/recipes-core/util-linux/util-linux/swapargs.h b/meta/recipes-core/util-linux/util-linux/swapargs.h new file mode 100644 index 0000000000..e960eef05f --- /dev/null +++ b/meta/recipes-core/util-linux/util-linux/swapargs.h @@ -0,0 +1,3 @@ +#define SWAPON_HAS_TWO_ARGS +#include +#include diff --git a/meta/recipes-core/util-linux/util-linux/uclibc-__progname-conflict.patch b/meta/recipes-core/util-linux/util-linux/uclibc-__progname-conflict.patch new file mode 100644 index 0000000000..5031a7313e --- /dev/null +++ b/meta/recipes-core/util-linux/util-linux/uclibc-__progname-conflict.patch @@ -0,0 +1,32 @@ +configure should include errno.h instead of argp.h when +checking for presence of program_invocation_short_name +uclibc defines this to be const char* unlike util-linux-ng +which defines this to be char* so this error goes unnoticed +on glibc/eglibc systems. + +here is the error it fixes + +in file included from mountP.h:14:0, + from cache.c:29: +/home/kraj/work/slugos/build/tmp-slugos-uclibc/sysroots/nslu2le/usr/include/errno.h:55:46: error: conflicting types for '__progname' +../../../include/c.h:118:14: note: previous declaration of '__progname' was here +make[3]: *** [cache.lo] Error 1 + + +Signed-off-by: Khem Raj +Signed-off-by: Jonathan Liu + +Upstream-Status: Pending +Index: util-linux-2.22.1/configure.ac +=================================================================== +--- util-linux-2.22.1.orig/configure.ac ++++ util-linux-2.22.1/configure.ac +@@ -372,7 +372,7 @@ esac + + AC_MSG_CHECKING([whether program_invocation_short_name is defined]) + AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[ +- #include ++ #include + ]], [[ + program_invocation_short_name = "test"; + ]])], [ diff --git a/meta/recipes-core/util-linux/util-linux/util-linux-ensure-the-existence-of-directory-for-PAT.patch b/meta/recipes-core/util-linux/util-linux/util-linux-ensure-the-existence-of-directory-for-PAT.patch new file mode 100644 index 0000000000..8f26451aa8 --- /dev/null +++ b/meta/recipes-core/util-linux/util-linux/util-linux-ensure-the-existence-of-directory-for-PAT.patch @@ -0,0 +1,34 @@ +Upstream-Status: Pending + +util-linux: ensure the existence of directory for PATHFILES + +When compiling util-linux, it's possible to encounter the following error. + /bin/sh: line 2:: misc-utils/uuidd.8.tmp: No such file or directory + +This is because that the misc-utils directory doesn't exist when trying to write to +misc-utils/uuidd.8.tmp. + +When generating misc-utils/uuidd.8 (or anything in PATHFILES), its directory +may not have been created yet. So we need to ensure the existence of the directory +to avoid the compilation error. + +Signed-off-by: Chen Qi +--- + Makefile.am | 1 + + 1 file changed, 1 insertion(+) + +diff --git a/Makefile.am b/Makefile.am +index 17f4c33..ca3dc0f 100644 +--- a/Makefile.am ++++ b/Makefile.am +@@ -123,6 +123,7 @@ EXTRA_DIST += $(PATHFILES:=.in) + + $(PATHFILES): Makefile + @ rm -f $@ $@.tmp ++ @ mkdir -p `dirname $@` + $(AM_V_GEN) srcdir=''; \ + test -f ./$@.in || srcdir=$(srcdir)/; \ + $(edit_cmd) $${srcdir}$@.in >$@.tmp +-- +1.7.9.5 + 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 new file mode 100644 index 0000000000..68bf22de8c --- /dev/null +++ b/meta/recipes-core/util-linux/util-linux/util-linux-native-qsort.patch @@ -0,0 +1,33 @@ +From f220d809be1baa654503bf6ff52f3630b0d7015c Mon Sep 17 00:00:00 2001 +From: Robert Yang +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 +--- + 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/util-linux-native.patch b/meta/recipes-core/util-linux/util-linux/util-linux-native.patch new file mode 100644 index 0000000000..afe543c6e8 --- /dev/null +++ b/meta/recipes-core/util-linux/util-linux/util-linux-native.patch @@ -0,0 +1,73 @@ +Support older hosts with latest util-linux-native + +mkostemp is not defined on older machines. So we detect this and +provide a define that uses mkstemp instead. + +O_CLOEXEC is not defined on older machines. It is however defined +in the 'c.h' header. Fix up the users to include 'c.h'. + +fdisks/fdisksunlabel.c was modified to use qsort_r, however +this is not defined on older hosts. Revert: + commit c69bbca9c1f6645097bd20fe3a21f5a99a2a0698 + fdisk: (sun): use ask API, remove global variable + +Upstream-Status: Inappropriate [other] +Patches revert upstream changes in order to support older +machines. + +Signed-off-by: Mark Hatle + +Index: util-linux-2.24.1/configure.ac +=================================================================== +--- util-linux-2.24.1.orig/configure.ac ++++ util-linux-2.24.1/configure.ac +@@ -302,6 +302,7 @@ AC_CHECK_FUNCS([ \ + llseek \ + lseek64 \ + mempcpy \ ++ mkostemp \ + nanosleep \ + personality \ + posix_fadvise \ +Index: util-linux-2.24.1/include/c.h +=================================================================== +--- util-linux-2.24.1.orig/include/c.h ++++ util-linux-2.24.1/include/c.h +@@ -236,6 +236,13 @@ static inline int dirfd(DIR *d) + #endif + + /* ++ * mkostemp replacement ++ */ ++#ifndef HAVE_MKOSTEMP ++#define mkostemp(template, flags) mkstemp(template) ++#endif ++ ++/* + * MAXHOSTNAMELEN replacement + */ + static inline size_t get_hostname_max(void) +Index: util-linux-2.24.1/lib/randutils.c +=================================================================== +--- util-linux-2.24.1.orig/lib/randutils.c ++++ util-linux-2.24.1/lib/randutils.c +@@ -16,6 +16,7 @@ + #include + + #include "randutils.h" ++#include "c.h" + + #ifdef HAVE_TLS + #define THREAD_LOCAL static __thread +Index: util-linux-2.24.1/lib/wholedisk.c +=================================================================== +--- util-linux-2.24.1.orig/lib/wholedisk.c ++++ util-linux-2.24.1/lib/wholedisk.c +@@ -10,6 +10,7 @@ + + #include "blkdev.h" + #include "wholedisk.h" ++#include "c.h" + + int is_whole_disk_fd(int fd, const char *name) + { diff --git a/meta/recipes-core/util-linux/util-linux/util-linux-ng-2.16-mount_lock_path.patch b/meta/recipes-core/util-linux/util-linux/util-linux-ng-2.16-mount_lock_path.patch new file mode 100644 index 0000000000..5773d7ea1b --- /dev/null +++ b/meta/recipes-core/util-linux/util-linux/util-linux-ng-2.16-mount_lock_path.patch @@ -0,0 +1,27 @@ +Upstream-Status: Inappropriate [embedded specific] + +The FHS indicates that /etc must be capable of being mounted R/O. + +The FHS also indicates that lock files belong in /var/lock, and /var must +be R/W as soon as possible during boot. + +This patch moves the mtab lock file from the potentially R/O /etc, to the +R/W /var/lock area. This lock file is used when mounting disks and making +other mount adjustments. The _PATH_MOUNTED_TMP is not adjusted, as failing +to write to this file does not cause any functional limitations. + +(Note, if /etc is R/O, then /etc/mtab should be a symlink to /proc/mounts) + +Signed-off-by: Mark Hatle + +--- util-linux-ng-2.16/include/pathnames.h.orig ++++ util-linux-ng-2.16/include/pathnames.h +@@ -90,7 +90,7 @@ + # endif + #endif + +-#define _PATH_MOUNTED_LOCK _PATH_MOUNTED "~" ++#define _PATH_MOUNTED_LOCK "/var/lock/mtab~" + #define _PATH_MOUNTED_TMP _PATH_MOUNTED ".tmp" + + #ifndef _PATH_DEV diff --git a/meta/recipes-core/util-linux/util-linux/util-linux-ng-replace-siginterrupt.patch b/meta/recipes-core/util-linux/util-linux/util-linux-ng-replace-siginterrupt.patch new file mode 100644 index 0000000000..f131b763ca --- /dev/null +++ b/meta/recipes-core/util-linux/util-linux/util-linux-ng-replace-siginterrupt.patch @@ -0,0 +1,27 @@ +Upstream-Status: Pending + +Index: util-linux-2.22.1/login-utils/login.c +=================================================================== +--- util-linux-2.22.1.orig/login-utils/login.c ++++ util-linux-2.22.1/login-utils/login.c +@@ -1239,6 +1239,8 @@ int main(int argc, char **argv) + char *buff; + int childArgc = 0; + int retcode; ++ struct sigaction act; ++ + + char *pwdbuf = NULL; + struct passwd *pwd = NULL, _pwd; +@@ -1252,7 +1254,10 @@ int main(int argc, char **argv) + timeout = (unsigned int)getlogindefs_num("LOGIN_TIMEOUT", LOGIN_TIMEOUT); + + signal(SIGALRM, timedout); +- siginterrupt(SIGALRM, 1); /* we have to interrupt syscalls like ioclt() */ ++ (void) sigaction(SIGALRM, NULL, &act); ++ act.sa_flags &= ~SA_RESTART; ++ sigaction(SIGALRM, &act, NULL); ++ + alarm(timeout); + signal(SIGQUIT, SIG_IGN); + signal(SIGINT, SIG_IGN); diff --git a/meta/recipes-core/util-linux/util-linux_2.24.2.bb b/meta/recipes-core/util-linux/util-linux_2.24.2.bb new file mode 100644 index 0000000000..81e719058b --- /dev/null +++ b/meta/recipes-core/util-linux/util-linux_2.24.2.bb @@ -0,0 +1,36 @@ +MAJOR_VERSION = "2.24" +require util-linux.inc +PR = "r1" + +# 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.patch \ + file://util-linux-native-qsort.patch \ + " + +SRC_URI += "file://util-linux-ng-replace-siginterrupt.patch \ + file://util-linux-ng-2.16-mount_lock_path.patch \ + file://uclibc-__progname-conflict.patch \ + file://configure-sbindir.patch \ + file://fix-configure.patch \ + file://fix-parallel-build.patch \ + file://util-linux-ensure-the-existence-of-directory-for-PAT.patch \ + file://avoid_parallel_tests.patch \ + file://CVE-2014-9114.patch \ + ${OLDHOST} \ +" + +SRC_URI[md5sum] = "3f191727a0d28f7204b755cf1b6ea0aa" +SRC_URI[sha256sum] = "1243d6c07f1c5b38aa4c3814c81a71c24cba7dafe08942916bf216a90a460ff0" + +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 \ +" + +RDEPENDS_${PN}-ptest += " bash" -- cgit v1.2.3-54-g00ecf