From 2374aa31e0e72e33ee0a59fdebb08bc5a1ac6b97 Mon Sep 17 00:00:00 2001 From: Mike Frysinger Date: Mon, 21 Nov 2011 17:19:19 -0500 Subject: [PATCH] procps: sync latest stable from upstream Gentoo We're seeing some HZ warnings on ARM platforms due to a bug in the internal procps init sequence. This has already been fixed in the upstream Gentoo ebuild, so pull down the latest stable from there. BUG=chromium-os:20777 TEST=`emerge procps` works TEST=`emerge-amd64-generic procps` works TEST=`emerge-arm-generic procps` works TEST=`emerge-x86-generic procps` works TEST=`cbuildbot arm-generic-full` works TEST=`cbuildbot x86-generic-full` works Change-Id: If635416e7e28ede1b60cf8067aa4f77aabb4a4d8 Reviewed-on: https://gerrit.chromium.org/gerrit/12000 Reviewed-by: David James Tested-by: Mike Frysinger Commit-Ready: Mike Frysinger --- .../procps/files/procps-3.2.3-noproc.patch | 15 ++++ .../files/procps-3.2.7-proc-mount.patch | 18 ++++ .../files/procps-3.2.8-r1-forest-prefix.patch | 42 +++++++++ .../files/procps-3.2.8-toprc-fixup.patch | 16 ++++ .../files/procps-mips-define-pagesize.patch | 29 ++++++ .../procps/procps-3.2.8_p11.ebuild | 90 +++++++++++++++++++ 6 files changed, 210 insertions(+) create mode 100644 sdk_container/src/third_party/portage-stable/sys-process/procps/files/procps-3.2.3-noproc.patch create mode 100644 sdk_container/src/third_party/portage-stable/sys-process/procps/files/procps-3.2.7-proc-mount.patch create mode 100644 sdk_container/src/third_party/portage-stable/sys-process/procps/files/procps-3.2.8-r1-forest-prefix.patch create mode 100644 sdk_container/src/third_party/portage-stable/sys-process/procps/files/procps-3.2.8-toprc-fixup.patch create mode 100644 sdk_container/src/third_party/portage-stable/sys-process/procps/files/procps-mips-define-pagesize.patch create mode 100644 sdk_container/src/third_party/portage-stable/sys-process/procps/procps-3.2.8_p11.ebuild diff --git a/sdk_container/src/third_party/portage-stable/sys-process/procps/files/procps-3.2.3-noproc.patch b/sdk_container/src/third_party/portage-stable/sys-process/procps/files/procps-3.2.3-noproc.patch new file mode 100644 index 0000000000..6da48eb44f --- /dev/null +++ b/sdk_container/src/third_party/portage-stable/sys-process/procps/files/procps-3.2.3-noproc.patch @@ -0,0 +1,15 @@ +If /proc isnt mounted, `top` will cause screen corruption ... + +--- procps-3.2.3/top.c ++++ procps-3.2.3/top.c +@@ -3201,6 +3201,10 @@ + { + (void)dont_care_argc; + before(*argv); ++ ++ if (access("/proc/stat", F_OK)) ++ std_err("/proc is not mounted, required for output data"); ++ + // +-------------+ + windows_stage1(); // top (sic) slice + configs_read(); // > spread etc, < diff --git a/sdk_container/src/third_party/portage-stable/sys-process/procps/files/procps-3.2.7-proc-mount.patch b/sdk_container/src/third_party/portage-stable/sys-process/procps/files/procps-3.2.7-proc-mount.patch new file mode 100644 index 0000000000..386dada4f9 --- /dev/null +++ b/sdk_container/src/third_party/portage-stable/sys-process/procps/files/procps-3.2.7-proc-mount.patch @@ -0,0 +1,18 @@ +Slightly prettier error message + +--- proc/readproc.c ++++ proc/readproc.c +@@ -907,3 +907,3 @@ + if(file2str("/proc/self", "stat", sbuf, sizeof sbuf) == -1){ +- fprintf(stderr, "Error, do this: mount -t proc none /proc\n"); ++ fprintf(stderr, "Error, do this: mount -t proc proc /proc\n"); + _exit(47); +--- proc/sysinfo.c ++++ proc/sysinfo.c +@@ -31,4 +31,4 @@ + " To mount /proc at boot you need an /etc/fstab line like:\n" \ +-" /proc /proc proc defaults\n" \ +-" In the meantime, run \"mount /proc /proc -t proc\"\n" ++" proc /proc proc defaults\n" \ ++" In the meantime, run \"mount proc /proc -t proc\"\n" + diff --git a/sdk_container/src/third_party/portage-stable/sys-process/procps/files/procps-3.2.8-r1-forest-prefix.patch b/sdk_container/src/third_party/portage-stable/sys-process/procps/files/procps-3.2.8-r1-forest-prefix.patch new file mode 100644 index 0000000000..cee331e53c --- /dev/null +++ b/sdk_container/src/third_party/portage-stable/sys-process/procps/files/procps-3.2.8-r1-forest-prefix.patch @@ -0,0 +1,42 @@ +avoid gcc warnings like: + +ps/output.c:341:6: warning: the address of ‘forest_prefix’ will always evaluate as ‘true’ + +--- a/ps/output.c ++++ b/ps/output.c +@@ -338,7 +338,7 @@ static int pr_args(char *restrict const + unsigned flags; + int rightward=max_rightward; + +- if(forest_prefix){ ++ if(/*forest_prefix*/1){ + int fh = forest_helper(outbuf); + endp += fh; + rightward -= fh; +@@ -405,7 +405,7 @@ static int pr_cgroup(char *restrict cons + if(pp->cgroup && *pp->cgroup) { + char *endp = outbuf; + int rightward=max_rightward; +- if(forest_prefix){ ++ if(/*forest_prefix*/1){ + int fh = forest_helper(outbuf); + endp += fh; + rightward -= fh; +@@ -365,7 +365,7 @@ static int pr_comm(char *restrict const + unsigned flags; + int rightward=max_rightward; + +- if(forest_prefix){ ++ if(/*forest_prefix*/1){ + int fh = forest_helper(outbuf); + endp += fh; + rightward -= fh; +@@ -390,7 +390,7 @@ static int pr_fname(char *restrict const + char *endp = outbuf; + int rightward = max_rightward; + +- if(forest_prefix){ ++ if(/*forest_prefix*/1){ + int fh = forest_helper(outbuf); + endp += fh; + rightward -= fh; diff --git a/sdk_container/src/third_party/portage-stable/sys-process/procps/files/procps-3.2.8-toprc-fixup.patch b/sdk_container/src/third_party/portage-stable/sys-process/procps/files/procps-3.2.8-toprc-fixup.patch new file mode 100644 index 0000000000..24890b0d13 --- /dev/null +++ b/sdk_container/src/third_party/portage-stable/sys-process/procps/files/procps-3.2.8-toprc-fixup.patch @@ -0,0 +1,16 @@ +X-Gentoo-Bug: 279819 +Upstream-Patch: http://procps.cvs.sourceforge.net/viewvc/procps/procps/top.c?r1=1.132&r2=1.134 +--- top.c 2008/03/24 04:41:26 1.132 ++++ top.c 2009/12/10 11:37:48 1.134 +@@ -2190,7 +2190,10 @@ + // Value a window's name and make the associated group name. + static void win_names (WIN_t *q, const char *name) + { +- sprintf(q->rc.winname, "%.*s", WINNAMSIZ -1, name); ++ // Note that src==dst is illegal in sprintf. ++ // Failure: amd64, glibc 2.9-20081201, gcc 4.3.4 ++ if(q->rc.winname != name) ++ sprintf(q->rc.winname, "%.*s", WINNAMSIZ -1, name); + sprintf(q->grpname, "%d:%.*s", q->winnum, WINNAMSIZ -1, name); + } + diff --git a/sdk_container/src/third_party/portage-stable/sys-process/procps/files/procps-mips-define-pagesize.patch b/sdk_container/src/third_party/portage-stable/sys-process/procps/files/procps-mips-define-pagesize.patch new file mode 100644 index 0000000000..3802f4ccec --- /dev/null +++ b/sdk_container/src/third_party/portage-stable/sys-process/procps/files/procps-mips-define-pagesize.patch @@ -0,0 +1,29 @@ +diff -Naurp procps-3.2.3.orig/minimal.c procps-3.2.3/minimal.c +--- procps-3.2.3.orig/minimal.c 2004-05-04 20:26:14.000000000 -0400 ++++ procps-3.2.3/minimal.c 2004-08-20 02:01:35.868100752 -0400 +@@ -68,8 +68,8 @@ + /////////////////////////////////////////////////////////// + + #ifndef PAGE_SIZE +-#warning PAGE_SIZE not defined, assuming it is 4096 +-#define PAGE_SIZE 4096 ++#warning PAGE_SIZE not defined, using sysconf() to determine correct value ++#define PAGE_SIZE (sysconf(_SC_PAGESIZE)) + #endif + + +diff -Naurp procps-3.2.3.orig/ps/common.h procps-3.2.3/ps/common.h +--- procps-3.2.3.orig/ps/common.h 2004-04-25 17:03:18.000000000 -0400 ++++ procps-3.2.3/ps/common.h 2004-08-20 02:00:59.228670792 -0400 +@@ -16,6 +16,11 @@ + #include "../proc/readproc.h" + #include /* looks safe for glibc, we need PAGE_SIZE */ + ++#ifndef PAGE_SIZE ++#warning PAGE_SIZE not defined, using sysconf() to determine correct value ++#define PAGE_SIZE (sysconf(_SC_PAGESIZE)) ++#endif ++ + #if 0 + #define trace(args...) printf(## args) + #else diff --git a/sdk_container/src/third_party/portage-stable/sys-process/procps/procps-3.2.8_p11.ebuild b/sdk_container/src/third_party/portage-stable/sys-process/procps/procps-3.2.8_p11.ebuild new file mode 100644 index 0000000000..c7a21b3c5e --- /dev/null +++ b/sdk_container/src/third_party/portage-stable/sys-process/procps/procps-3.2.8_p11.ebuild @@ -0,0 +1,90 @@ +# Copyright 1999-2011 Gentoo Foundation +# Distributed under the terms of the GNU General Public License v2 +# $Header: /var/cvsroot/gentoo-x86/sys-process/procps/procps-3.2.8_p11.ebuild,v 1.5 2011/11/13 21:09:29 maekke Exp $ + +EAPI="2" + +inherit flag-o-matic eutils toolchain-funcs multilib + +DEB_VER=${PV#*_p} +MY_PV=${PV%_p*} +MY_P="${PN}-${MY_PV}" +DESCRIPTION="Standard informational utilities and process-handling tools" +HOMEPAGE="http://procps.sourceforge.net/" +SRC_URI="http://procps.sourceforge.net/${MY_P}.tar.gz + mirror://debian/pool/main/p/procps/${PN}_${MY_PV}-${DEB_VER}.debian.tar.gz" + +LICENSE="GPL-2" +SLOT="0" +KEYWORDS="~alpha amd64 arm hppa ~ia64 ~m68k ~mips ~ppc ~ppc64 ~s390 ~sh ~sparc x86" +IUSE="unicode" + +RDEPEND=">=sys-libs/ncurses-5.2-r2[unicode?]" + +S=${WORKDIR}/${MY_P} + +src_prepare() { + local p d="${WORKDIR}"/debian/patches + pushd "${d}" >/dev/null + # makefile_dev_null: this bug is actually in gcc and is already fixed + for p in $(use unicode || echo watch_{unicode,ansi_colour}) makefile_dev_null ; do + rm ${p}.patch || die + sed -i "/^${p}/d" series || die + done + popd >/dev/null + EPATCH_SOURCE="${d}" \ + epatch $(<"${d}"/series) + # fixup debian watch_exec_beep.patch + sed -i '1i#include ' watch.c || die + + epatch "${FILESDIR}"/${PN}-3.2.7-proc-mount.patch + epatch "${FILESDIR}"/${PN}-3.2.3-noproc.patch + epatch "${FILESDIR}"/${PN}-3.2.8-toprc-fixup.patch + epatch "${FILESDIR}"/${PN}-3.2.8-r1-forest-prefix.patch + + # Clean up the makefile + # - we do stripping ourselves + # - punt fugly gcc flags + sed -i \ + -e '/install/s: --strip : :' \ + -e '/ALL_CFLAGS += $(call check_gcc,-fweb,)/d' \ + -e '/ALL_CFLAGS += $(call check_gcc,-Wstrict-aliasing=2,)/s,=2,,' \ + -e "/^lib64/s:=.*:=$(get_libdir):" \ + -e 's:-m64::g' \ + Makefile || die "sed Makefile" + + # mips 2.4.23 headers (and 2.6.x) don't allow PAGE_SIZE to be defined in + # userspace anymore, so this patch instructs procps to get the + # value from sysconf(). + epatch "${FILESDIR}"/${PN}-mips-define-pagesize.patch + + # lame unicode stuff checks glibc defines + sed -i "s:__GNU_LIBRARY__ >= 6:0 == $(use unicode; echo $?):" proc/escape.c || die +} + +src_compile() { + replace-flags -O3 -O2 + emake \ + CC="$(tc-getCC)" \ + CPPFLAGS="${CPPFLAGS}" \ + CFLAGS="${CFLAGS}" \ + LDFLAGS="${LDFLAGS}" \ + || die "make failed" +} + +src_install() { + emake \ + ln_f="ln -sf" \ + ldconfig="true" \ + DESTDIR="${D}" \ + install \ + || die "install failed" + + insinto /usr/include/proc + doins proc/*.h || die + + dodoc sysctl.conf BUGS NEWS TODO ps/HACKING + + # compat symlink so people who shouldnt be using libproc can #170077 + dosym libproc-${MY_PV}.so /$(get_libdir)/libproc.so || die +}