From a36fc722968ff528e7feb8be23cfdd727b3c8db1 Mon Sep 17 00:00:00 2001 From: Alexander Kanavin Date: Thu, 9 Mar 2023 16:19:35 +0100 Subject: procps: update 3.3.17 -> 4.0.3 Drop patches as upstream refactored the code. Add a compatibility patch to igt-gpu-tools. Add a musl compatibility patch. (From OE-Core rev: 631eba02d64f1a42514e0ae4361bbecc5cce5fa7) Signed-off-by: Alexander Kanavin Signed-off-by: Alexandre Belloni Signed-off-by: Richard Purdie --- .../procps/0001-src-w.c-use-utmp.h-only.patch | 65 +++++++++++++ .../procps/0001-w.c-correct-musl-builds.patch | 44 --------- .../0002-proc-escape.c-add-missing-include.patch | 23 ----- meta/recipes-extended/procps/procps_3.3.17.bb | 107 --------------------- meta/recipes-extended/procps/procps_4.0.3.bb | 102 ++++++++++++++++++++ 5 files changed, 167 insertions(+), 174 deletions(-) create mode 100644 meta/recipes-extended/procps/procps/0001-src-w.c-use-utmp.h-only.patch delete mode 100644 meta/recipes-extended/procps/procps/0001-w.c-correct-musl-builds.patch delete mode 100644 meta/recipes-extended/procps/procps/0002-proc-escape.c-add-missing-include.patch delete mode 100644 meta/recipes-extended/procps/procps_3.3.17.bb create mode 100644 meta/recipes-extended/procps/procps_4.0.3.bb (limited to 'meta/recipes-extended') diff --git a/meta/recipes-extended/procps/procps/0001-src-w.c-use-utmp.h-only.patch b/meta/recipes-extended/procps/procps/0001-src-w.c-use-utmp.h-only.patch new file mode 100644 index 0000000000..23c91ec775 --- /dev/null +++ b/meta/recipes-extended/procps/procps/0001-src-w.c-use-utmp.h-only.patch @@ -0,0 +1,65 @@ +From c41b3be62fbb78e0939fddaebad519360cbd8702 Mon Sep 17 00:00:00 2001 +From: Alexander Kanavin +Date: Mon, 6 Mar 2023 09:27:57 +0100 +Subject: [PATCH] src/w.c: use only utmpx + +Nowadays this works both on musl and glibc systems, however on musl +utmp.h is also needed to avoid the following failure: + +| ../git/src/w.c: In function 'print_from': +| ../git/src/w.c:73:28: error: '__UT_HOSTSIZE' undeclared (first use in this function); did you mean 'UT_HOSTSIZE'? +| 73 | # define UT_HOSTSIZE __UT_HOSTSIZE +| | ^~~~~~~~~~~~~ +| ../git/src/w.c:233:64: note: in expansion of macro 'UT_HOSTSIZE' +| 233 | print_display_or_interface(u->ut_host, UT_HOSTSIZE, fromlen - len); +| | ^~~~~~~~~~~ +| + +It is caused by including utmpx.h, but not utmp.h, which (on musl) +lacks the needed definitions. + +I have verified that both musl and glibc based builds continue to work. + +Upstream-Status: Submitted [https://gitlab.com/procps-ng/procps/-/merge_requests/171] +Signed-off-by: Alexander Kanavin + +--- + src/w.c | 17 ++--------------- + 1 file changed, 2 insertions(+), 15 deletions(-) + +diff --git a/src/w.c b/src/w.c +index 5e878f04..912c5df3 100644 +--- a/src/w.c ++++ b/src/w.c +@@ -46,11 +46,8 @@ + #include + #include + #include +-#ifdef HAVE_UTMPX_H +-# include +-#else +-# include +-#endif ++#include ++#include + #include + + #include "c.h" +@@ -63,17 +60,7 @@ + static int ignoreuser = 0; /* for '-u' */ + static int oldstyle = 0; /* for '-o' */ + +-#ifdef HAVE_UTMPX_H + typedef struct utmpx utmp_t; +-#else +-typedef struct utmp utmp_t; +-#endif +- +-#if !defined(UT_HOSTSIZE) || defined(__UT_HOSTSIZE) +-# define UT_HOSTSIZE __UT_HOSTSIZE +-# define UT_LINESIZE __UT_LINESIZE +-# define UT_NAMESIZE __UT_NAMESIZE +-#endif + + #ifdef W_SHOWFROM + # define FROM_STRING "on" diff --git a/meta/recipes-extended/procps/procps/0001-w.c-correct-musl-builds.patch b/meta/recipes-extended/procps/procps/0001-w.c-correct-musl-builds.patch deleted file mode 100644 index c92ad28e4f..0000000000 --- a/meta/recipes-extended/procps/procps/0001-w.c-correct-musl-builds.patch +++ /dev/null @@ -1,44 +0,0 @@ -From 22f8d25567b8d64bdbab0fb0b4915b4362561d9b Mon Sep 17 00:00:00 2001 -From: Alexander Kanavin -Date: Wed, 24 Feb 2021 21:14:31 +0000 -Subject: [PATCH] w.c: correct musl builds - -No need to redefine UT_ stuff to something that does not exist. - -UT_ is already provided in musl but via utmp.h header, so include -it always. - -Upstream-Status: Submitted [https://gitlab.com/procps-ng/procps/-/merge_requests/126] -Signed-off-by: Alexander Kanavin ---- - w.c | 9 +-------- - 1 file changed, 1 insertion(+), 8 deletions(-) - -diff --git a/w.c b/w.c -index 9d07ac9..d10639b 100644 ---- a/w.c -+++ b/w.c -@@ -57,9 +57,8 @@ - #include - #ifdef HAVE_UTMPX_H - # include --#else --# include - #endif -+#include - #include - - static int ignoreuser = 0; /* for '-u' */ -@@ -72,12 +71,6 @@ typedef struct utmpx utmp_t; - typedef struct utmp utmp_t; - #endif - --#if !defined(UT_HOSTSIZE) || defined(__UT_HOSTSIZE) --# define UT_HOSTSIZE __UT_HOSTSIZE --# define UT_LINESIZE __UT_LINESIZE --# define UT_NAMESIZE __UT_NAMESIZE --#endif -- - #ifdef W_SHOWFROM - # define FROM_STRING "on" - #else diff --git a/meta/recipes-extended/procps/procps/0002-proc-escape.c-add-missing-include.patch b/meta/recipes-extended/procps/procps/0002-proc-escape.c-add-missing-include.patch deleted file mode 100644 index 5fa1ac9d78..0000000000 --- a/meta/recipes-extended/procps/procps/0002-proc-escape.c-add-missing-include.patch +++ /dev/null @@ -1,23 +0,0 @@ -From 4f964821398dff7ab21fec63da15e1e00b2e9277 Mon Sep 17 00:00:00 2001 -From: Alexander Kanavin -Date: Wed, 24 Feb 2021 21:16:14 +0000 -Subject: [PATCH] proc/escape.c: add missing include - -Upstream-Status: Submitted [https://gitlab.com/procps-ng/procps/-/merge_requests/126] -Signed-off-by: Alexander Kanavin ---- - proc/escape.c | 1 + - 1 file changed, 1 insertion(+) - -diff --git a/proc/escape.c b/proc/escape.c -index 2e8fb7d..e1f4612 100644 ---- a/proc/escape.c -+++ b/proc/escape.c -@@ -21,6 +21,7 @@ - #include - #include - #include -+#include - #include "procps.h" - #include "escape.h" - #include "readproc.h" diff --git a/meta/recipes-extended/procps/procps_3.3.17.bb b/meta/recipes-extended/procps/procps_3.3.17.bb deleted file mode 100644 index 59ad89d326..0000000000 --- a/meta/recipes-extended/procps/procps_3.3.17.bb +++ /dev/null @@ -1,107 +0,0 @@ -SUMMARY = "System and process monitoring utilities" -DESCRIPTION = "Procps contains a set of system utilities that provide system information about processes using \ -the /proc filesystem. The package includes the programs ps, top, vmstat, w, kill, and skill." -HOMEPAGE = "https://gitlab.com/procps-ng/procps" -SECTION = "base" -LICENSE = "GPL-2.0-or-later & LGPL-2.0-or-later" -LIC_FILES_CHKSUM = "file://COPYING;md5=b234ee4d69f5fce4486a80fdaf4a4263 \ - file://COPYING.LIB;md5=4cf66a4984120007c9881cc871cf49db \ - " - -DEPENDS = "ncurses" - -inherit autotools gettext pkgconfig update-alternatives - -SRC_URI = "git://gitlab.com/procps-ng/procps.git;protocol=https;branch=master \ - file://sysctl.conf \ - file://0001-w.c-correct-musl-builds.patch \ - file://0002-proc-escape.c-add-missing-include.patch \ - " -SRCREV = "19a508ea121c0c4ac6d0224575a036de745eaaf8" -# 4.x version is an API incompatible rewrite -# until procps consumers are transitioned to it we need to stick with 3.x -# https://gitlab.com/procps-ng/procps/-/issues/239 -UPSTREAM_CHECK_GITTAGREGEX = "(?P3(\.\d+)+)" - -S = "${WORKDIR}/git" - -# Upstream has a custom autogen.sh which invokes po/update-potfiles as they -# don't ship a po/POTFILES.in (which is silly). Without that file gettext -# doesn't believe po/ is a gettext directory and won't generate po/Makefile. -do_configure:prepend() { - ( cd ${S} && po/update-potfiles ) -} - -EXTRA_OECONF = "--enable-skill --disable-modern-top" - -PACKAGECONFIG ??= "${@bb.utils.filter('DISTRO_FEATURES', 'systemd', d)}" -PACKAGECONFIG[systemd] = "--with-systemd,--without-systemd,systemd" - -do_install:append () { - install -d ${D}${base_bindir} - [ "${bindir}" != "${base_bindir}" ] && for i in ${base_bindir_progs}; do mv ${D}${bindir}/$i ${D}${base_bindir}/$i; done - install -d ${D}${base_sbindir} - [ "${sbindir}" != "${base_sbindir}" ] && for i in ${base_sbindir_progs}; do mv ${D}${sbindir}/$i ${D}${base_sbindir}/$i; done - if [ "${base_sbindir}" != "${sbindir}" ]; then - rmdir ${D}${sbindir} - fi - - install -d ${D}${sysconfdir} - install -m 0644 ${WORKDIR}/sysctl.conf ${D}${sysconfdir}/sysctl.conf - if ${@bb.utils.contains('DISTRO_FEATURES','systemd','true','false',d)}; then - install -d ${D}${sysconfdir}/sysctl.d - ln -sf ../sysctl.conf ${D}${sysconfdir}/sysctl.d/99-sysctl.conf - fi -} - -CONFFILES:${PN} = "${sysconfdir}/sysctl.conf" - -bindir_progs = "free pkill pmap pgrep pwdx skill snice top uptime w" -base_bindir_progs += "kill pidof ps watch" -base_sbindir_progs += "sysctl" - -ALTERNATIVE_PRIORITY = "200" -ALTERNATIVE_PRIORITY[pidof] = "150" - -ALTERNATIVE:${PN} = "${bindir_progs} ${base_bindir_progs} ${base_sbindir_progs}" - -ALTERNATIVE:${PN}-doc = "kill.1 uptime.1" -ALTERNATIVE_LINK_NAME[kill.1] = "${mandir}/man1/kill.1" -ALTERNATIVE_LINK_NAME[uptime.1] = "${mandir}/man1/uptime.1" - -python __anonymous() { - for prog in d.getVar('base_bindir_progs').split(): - d.setVarFlag('ALTERNATIVE_LINK_NAME', prog, '%s/%s' % (d.getVar('base_bindir'), prog)) - - for prog in d.getVar('base_sbindir_progs').split(): - d.setVarFlag('ALTERNATIVE_LINK_NAME', prog, '%s/%s' % (d.getVar('base_sbindir'), prog)) -} - -# 'ps' isn't suitable for use as a security tool so whitelist this CVE. -# https://bugzilla.redhat.com/show_bug.cgi?id=1575473#c3 -CVE_CHECK_IGNORE += "CVE-2018-1121" - -PROCPS_PACKAGES = "${PN}-lib \ - ${PN}-ps \ - ${PN}-sysctl" - -PACKAGE_BEFORE_PN = "${PROCPS_PACKAGES}" -RDEPENDS:${PN} += "${PROCPS_PACKAGES}" - -RDEPENDS:${PN}-ps += "${PN}-lib" -RDEPENDS:${PN}-sysctl += "${PN}-lib" - -FILES:${PN}-lib = "${libdir}" -FILES:${PN}-ps = "${base_bindir}/ps.${BPN}" -FILES:${PN}-sysctl = "${base_sbindir}/sysctl.${BPN} ${sysconfdir}/sysctl.conf ${sysconfdir}/sysctl.d" - -ALTERNATIVE:${PN}:remove = "ps" -ALTERNATIVE:${PN}:remove = "sysctl" - -ALTERNATIVE:${PN}-ps = "ps" -ALTERNATIVE_TARGET[ps] = "${base_bindir}/ps" -ALTERNATIVE_LINK_NAME[ps] = "${base_bindir}/ps" - -ALTERNATIVE:${PN}-sysctl = "sysctl" -ALTERNATIVE_TARGET[sysctl] = "${base_sbindir}/sysctl" -ALTERNATIVE_LINK_NAME[sysctl] = "${base_sbindir}/sysctl" diff --git a/meta/recipes-extended/procps/procps_4.0.3.bb b/meta/recipes-extended/procps/procps_4.0.3.bb new file mode 100644 index 0000000000..cc3420df4e --- /dev/null +++ b/meta/recipes-extended/procps/procps_4.0.3.bb @@ -0,0 +1,102 @@ +SUMMARY = "System and process monitoring utilities" +DESCRIPTION = "Procps contains a set of system utilities that provide system information about processes using \ +the /proc filesystem. The package includes the programs ps, top, vmstat, w, kill, and skill." +HOMEPAGE = "https://gitlab.com/procps-ng/procps" +SECTION = "base" +LICENSE = "GPL-2.0-or-later & LGPL-2.0-or-later" +LIC_FILES_CHKSUM = "file://COPYING;md5=b234ee4d69f5fce4486a80fdaf4a4263 \ + file://COPYING.LIB;md5=4cf66a4984120007c9881cc871cf49db \ + " + +DEPENDS = "ncurses" + +inherit autotools gettext pkgconfig update-alternatives + +SRC_URI = "git://gitlab.com/procps-ng/procps.git;protocol=https;branch=master \ + file://sysctl.conf \ + file://0001-src-w.c-use-utmp.h-only.patch \ + " +SRCREV = "806eb270f217ff7e1e745c7bda2b002b5be74be4" + +S = "${WORKDIR}/git" + +# Upstream has a custom autogen.sh which invokes po/update-potfiles as they +# don't ship a po/POTFILES.in (which is silly). Without that file gettext +# doesn't believe po/ is a gettext directory and won't generate po/Makefile. +do_configure:prepend() { + ( cd ${S} && po/update-potfiles ) +} + +EXTRA_OECONF = "--enable-skill --disable-modern-top" + +PACKAGECONFIG ??= "${@bb.utils.filter('DISTRO_FEATURES', 'systemd', d)}" +PACKAGECONFIG[systemd] = "--with-systemd,--without-systemd,systemd" + +do_install:append () { + install -d ${D}${base_bindir} + [ "${bindir}" != "${base_bindir}" ] && for i in ${base_bindir_progs}; do mv ${D}${bindir}/$i ${D}${base_bindir}/$i; done + install -d ${D}${base_sbindir} + [ "${sbindir}" != "${base_sbindir}" ] && for i in ${base_sbindir_progs}; do mv ${D}${sbindir}/$i ${D}${base_sbindir}/$i; done + if [ "${base_sbindir}" != "${sbindir}" ]; then + rmdir ${D}${sbindir} + fi + + install -d ${D}${sysconfdir} + install -m 0644 ${WORKDIR}/sysctl.conf ${D}${sysconfdir}/sysctl.conf + if ${@bb.utils.contains('DISTRO_FEATURES','systemd','true','false',d)}; then + install -d ${D}${sysconfdir}/sysctl.d + ln -sf ../sysctl.conf ${D}${sysconfdir}/sysctl.d/99-sysctl.conf + fi +} + +CONFFILES:${PN} = "${sysconfdir}/sysctl.conf" + +bindir_progs = "free pkill pmap pgrep pwdx skill snice top uptime w" +base_bindir_progs += "kill pidof ps watch" +base_sbindir_progs += "sysctl" + +ALTERNATIVE_PRIORITY = "200" +ALTERNATIVE_PRIORITY[pidof] = "150" + +ALTERNATIVE:${PN} = "${bindir_progs} ${base_bindir_progs} ${base_sbindir_progs}" + +ALTERNATIVE:${PN}-doc = "kill.1 uptime.1" +ALTERNATIVE_LINK_NAME[kill.1] = "${mandir}/man1/kill.1" +ALTERNATIVE_LINK_NAME[uptime.1] = "${mandir}/man1/uptime.1" + +python __anonymous() { + for prog in d.getVar('base_bindir_progs').split(): + d.setVarFlag('ALTERNATIVE_LINK_NAME', prog, '%s/%s' % (d.getVar('base_bindir'), prog)) + + for prog in d.getVar('base_sbindir_progs').split(): + d.setVarFlag('ALTERNATIVE_LINK_NAME', prog, '%s/%s' % (d.getVar('base_sbindir'), prog)) +} + +# 'ps' isn't suitable for use as a security tool so whitelist this CVE. +# https://bugzilla.redhat.com/show_bug.cgi?id=1575473#c3 +CVE_CHECK_IGNORE += "CVE-2018-1121" + +PROCPS_PACKAGES = "${PN}-lib \ + ${PN}-ps \ + ${PN}-sysctl" + +PACKAGE_BEFORE_PN = "${PROCPS_PACKAGES}" +RDEPENDS:${PN} += "${PROCPS_PACKAGES}" + +RDEPENDS:${PN}-ps += "${PN}-lib" +RDEPENDS:${PN}-sysctl += "${PN}-lib" + +FILES:${PN}-lib = "${libdir}" +FILES:${PN}-ps = "${base_bindir}/ps.${BPN}" +FILES:${PN}-sysctl = "${base_sbindir}/sysctl.${BPN} ${sysconfdir}/sysctl.conf ${sysconfdir}/sysctl.d" + +ALTERNATIVE:${PN}:remove = "ps" +ALTERNATIVE:${PN}:remove = "sysctl" + +ALTERNATIVE:${PN}-ps = "ps" +ALTERNATIVE_TARGET[ps] = "${base_bindir}/ps" +ALTERNATIVE_LINK_NAME[ps] = "${base_bindir}/ps" + +ALTERNATIVE:${PN}-sysctl = "sysctl" +ALTERNATIVE_TARGET[sysctl] = "${base_sbindir}/sysctl" +ALTERNATIVE_LINK_NAME[sysctl] = "${base_sbindir}/sysctl" -- cgit v1.2.3-54-g00ecf