diff options
Diffstat (limited to 'source/a/procps')
-rw-r--r-- | source/a/procps/procps-3.2.7-ps-cgroup.patch | 65 | ||||
-rw-r--r-- | source/a/procps/procps-3.2.8-ps-cgroup-suppress-root-group.patch | 36 | ||||
-rw-r--r-- | source/a/procps/procps-3.2.8.unknown.hz.value.diff | 32 | ||||
-rwxr-xr-x | source/a/procps/procps.SlackBuild | 46 |
4 files changed, 161 insertions, 18 deletions
diff --git a/source/a/procps/procps-3.2.7-ps-cgroup.patch b/source/a/procps/procps-3.2.7-ps-cgroup.patch new file mode 100644 index 00000000..de5c6b26 --- /dev/null +++ b/source/a/procps/procps-3.2.7-ps-cgroup.patch @@ -0,0 +1,65 @@ +diff -burN procps-3.2.8/ps/output.c procps-3.2.8.cgroups/ps/output.c +--- procps-3.2.8/ps/output.c 2009-05-10 14:24:50.000000000 -0500 ++++ procps-3.2.8.cgroups/ps/output.c 2010-12-04 12:35:56.000000000 -0600 +@@ -1099,6 +1099,39 @@ + return snprintf(outbuf, COLWID, "*"); + } + ++static int pr_cgroup(char *restrict const outbuf, const proc_t *restrict const pp){ ++ char filename[48]; ++ FILE *fd; ++ int counter = 0; ++ int c; ++ int is_cgroup = 0; ++ ++ outbuf[0]='\0'; ++ snprintf(filename, sizeof filename, "/proc/%d/cgroup", pp->tgid); ++ fd = fopen(filename, "r"); ++ if (likely(fd == NULL)) goto fail; ++ while (( (c = fgetc(fd)) != EOF) && (counter<665)) { ++ if (is_cgroup == 0) { ++ if (c == ':') { ++ is_cgroup = 1; ++ if (counter>0) ++ outbuf[counter++]=';'; ++ } ++ }else ++ if ((c == '\n') || (c == '\0')) ++ is_cgroup = 0; ++ else ++ outbuf[counter++]=c; ++ } ++ outbuf[counter]='\0'; ++ close(fd); ++ if (counter>0) ++ return counter; ++fail: ++ outbuf[0] = '-'; ++ outbuf[1] = '\0'; ++ return 1; ++} + + /****************** FLASK & seLinux security stuff **********************/ + // move the bulk of this to libproc sometime +@@ -1293,6 +1326,7 @@ + {"bsdtime", "TIME", pr_bsdtime, sr_nop, 6, 0, LNX, ET|RIGHT}, + {"c", "C", pr_c, sr_pcpu, 2, 0, SUN, ET|RIGHT}, + {"caught", "CAUGHT", pr_sigcatch, sr_nop, 9, 0, BSD, TO|SIGNAL}, /*sigcatch*/ ++{"cgroup", "CGROUP", pr_cgroup, sr_nop, 35, 0, LNX, PO|LEFT}, /* cgroups*/ + {"class", "CLS", pr_class, sr_sched, 3, 0, XXX, TO|LEFT}, + {"cls", "CLS", pr_class, sr_sched, 3, 0, HPU, TO|RIGHT}, /*says HPUX or RT*/ + {"cmaj_flt", "-", pr_nop, sr_cmaj_flt, 1, 0, LNX, AN|RIGHT}, +diff -burN procps-3.2.8/ps/ps.1 procps-3.2.8.cgroups/ps/ps.1 +--- procps-3.2.8/ps/ps.1 2009-05-10 14:38:17.000000000 -0500 ++++ procps-3.2.8.cgroups/ps/ps.1 2010-12-04 12:43:12.000000000 -0600 +@@ -904,6 +904,10 @@ + displayed. (alias\ \fBsig_catch\fR,\ \fBsigcatch\fR). + T} + ++cgroup CGROUP T{ ++display control groups to which the process belongs. ++T} ++ + class CLS T{ + scheduling class of the process. (alias\ \fBpolicy\fR,\ \fBcls\fR). + Field's possible values are: diff --git a/source/a/procps/procps-3.2.8-ps-cgroup-suppress-root-group.patch b/source/a/procps/procps-3.2.8-ps-cgroup-suppress-root-group.patch new file mode 100644 index 00000000..4b192c1f --- /dev/null +++ b/source/a/procps/procps-3.2.8-ps-cgroup-suppress-root-group.patch @@ -0,0 +1,36 @@ +--- procps-3.2.8/ps/output.c 2010-05-18 06:00:18.000000000 +0200 ++++ procps-3.2.8.lennart/ps/output.c 2010-05-18 05:59:46.000000000 +0200 +@@ -1109,7 +1109,7 @@ + static int pr_cgroup(char *restrict const outbuf, const proc_t *restrict const pp){ + char filename[48]; + FILE *fd; +- int counter = 0; ++ int counter = 0, last_begin = 0, slash = 0; + int c; + int is_cgroup = 0; + +@@ -1121,15 +1121,22 @@ + if (is_cgroup == 0) { + if (c == ':') { + is_cgroup = 1; ++ slash = 0; + if (counter>0) + outbuf[counter++]=';'; + } + }else +- if ((c == '\n') || (c == '\0')) +- is_cgroup = 0; ++ if ((c == '\n') || (c == '\0')){ ++ if (slash) /* if the last char was a / this process is in the root cgroup which we should suppress */ ++ counter = last_begin; + else ++ last_begin = counter; ++ is_cgroup = 0; ++ } else { ++ slash = c == '/'; + outbuf[counter++]=c; + } ++ } + outbuf[counter]='\0'; + close(fd); + if (counter>0) diff --git a/source/a/procps/procps-3.2.8.unknown.hz.value.diff b/source/a/procps/procps-3.2.8.unknown.hz.value.diff new file mode 100644 index 00000000..be283814 --- /dev/null +++ b/source/a/procps/procps-3.2.8.unknown.hz.value.diff @@ -0,0 +1,32 @@ +--- procps-3.2.8.orig/proc/sysinfo.c 2008-03-24 04:33:43.000000000 +0000 ++++ procps-3.2.8.orig/proc/sysinfo.c 2011-02-07 18:14:16.476982472 +0000 +@@ -212,6 +212,7 @@ static int check_for_privs(void){ + static void init_libproc(void) __attribute__((constructor)); + static void init_libproc(void){ + have_privs = check_for_privs(); ++ init_Linux_version(); + // ought to count CPUs in /proc/stat instead of relying + // on glibc, which foolishly tries to parse /proc/cpuinfo + // +--- procps-3.2.8.orig/proc/version.c 2003-01-29 01:11:43.000000000 +0000 ++++ procps-3.2.8.orig/proc/version.c 2011-02-07 18:13:12.283649138 +0000 +@@ -33,8 +33,7 @@ void display_version(void) { + + int linux_version_code; + +-static void init_Linux_version(void) __attribute__((constructor)); +-static void init_Linux_version(void) { ++void init_Linux_version(void) { + static struct utsname uts; + int x = 0, y = 0, z = 0; /* cleared in case sscanf() < 3 */ + +--- procps-3.2.8.orig/proc/version.h 2002-12-15 00:08:32.000000000 +0000 ++++ procps-3.2.8.orig/proc/version.h 2011-02-07 18:14:20.263649138 +0000 +@@ -14,6 +14,7 @@ + + EXTERN_C_BEGIN + ++extern void init_Linux_version(void); + extern void display_version(void); /* display suite version */ + extern const char procps_version[]; /* global buf for suite version */ + diff --git a/source/a/procps/procps.SlackBuild b/source/a/procps/procps.SlackBuild index a5163bbc..e5e85ffc 100755 --- a/source/a/procps/procps.SlackBuild +++ b/source/a/procps/procps.SlackBuild @@ -1,6 +1,6 @@ #!/bin/sh -# Copyright 2005-2009 Patrick J. Volkerding, Sebeka, Minnesota, USA +# Copyright 2005-2011 Patrick J. Volkerding, Sebeka, Minnesota, USA # All rights reserved. # # Redistribution and use of this script, with or without modification, is @@ -21,13 +21,22 @@ # ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. -VERSION=3.2.7 +VERSION=3.2.8 # Sometimes this number lags behind... -SOVER=3.2.7 -PSMISCVER=22.3 -ARCH=${ARCH:-x86_64} +SOVER=3.2.8 +PSMISCVER=22.13 BUILD=${BUILD:-3} +# Automatically determine the architecture we're building on: +if [ -z "$ARCH" ]; then + case "$( uname -m )" in + i?86) export ARCH=i486 ;; + arm*) export ARCH=arm ;; + # Unless $ARCH is already set, use uname -m for all other archs: + *) export ARCH=$( uname -m ) ;; + esac +fi + CWD=$(pwd) TMP=${TMP:-/tmp} PKG=$TMP/package-procps @@ -52,8 +61,8 @@ mkdir -p $TMP $PKG cd $TMP rm -rf procps-$VERSION -tar xzvf $CWD/procps-$VERSION.tar.gz -cd procps-$VERSION +tar xvf $CWD/procps-$VERSION.tar.?z* || exit 1 +cd procps-$VERSION || exit 1 chown -R root:root . find . \ \( -perm 777 -o -perm 775 -o -perm 711 -o -perm 555 -o -perm 511 \) \ @@ -62,9 +71,10 @@ find . \ -exec chmod 644 {} \; mkdir -p $PKG/usr/doc/procps-$VERSION -cp -a BUGS COPYING COPYING.LIB NEWS TODO $PKG/usr/doc/procps-$VERSION +cp -a BUGS COPYING* NEWS TODO $PKG/usr/doc/procps-$VERSION chown root:root $PKG/usr/doc/procps-$VERSION/* chmod 644 $PKG/usr/doc/procps-$VERSION/* + # While I don't agree this is a harmful patch, I will defer to the # maintainer's judgement on this one. Besides, I quit using the '-' # with ps years ago. It wasn't that hard to change. @@ -83,7 +93,14 @@ if [ "$ARCH" = "x86_64" ]; then zcat $CWD/procps-3.2.7-ps-eip64.diff.gz | patch -p1 --verbose || exit 1 fi -make OPT="$SLKCFLAGS" +# Add support for cgroups display: +zcat $CWD/procps-3.2.7-ps-cgroup.patch.gz | patch -p1 --verbose || exit 1 +zcat $CWD/procps-3.2.8-ps-cgroup-suppress-root-group.patch.gz | patch -p1 --verbose || exit 1 + +# Init contructors in correct order to avoid "Unknown HZ value!": +zcat $CWD/procps-3.2.8.unknown.hz.value.diff.gz | patch -p1 --verbose || exit 1 + +make OPT="$SLKCFLAGS" || make OPT="$SLKCFLAGS" || exit 1 mkdir -p $PKG/lib${LIBDIRSUFFIX} $PKG/bin $PKG/sbin $PKG/usr/bin cat free > $PKG/bin/free cat ps/ps> $PKG/bin/ps @@ -123,7 +140,7 @@ echo "| psmisc-$PSMISCVER |" echo "+=============+" cd $TMP rm -rf psmisc-$PSMISCVER -tar xzvf $CWD/psmisc-$PSMISCVER.tar.gz +tar xvf $CWD/psmisc-$PSMISCVER.tar.?z* || exit 1 cd psmisc-$PSMISCVER # Maybe we'll turn on NLS when it supports more than # just US English. :) @@ -135,7 +152,7 @@ mkdir -p $PKG/usr/doc/psmisc-$PSMISCVER cp -a AUTHORS COPYING ChangeLog INSTALL NEWS README $PKG/usr/doc/psmisc-$PSMISCVER chmod 644 $PKG/usr/doc/psmisc-$PSMISCVER/* chown root:root $PKG/usr/doc/psmisc-$PSMISCVER/* -make +make || make || exit 1 cd src strip fuser pstree killall cat fuser > $PKG/usr/bin/fuser @@ -182,10 +199,3 @@ cat $CWD/slack-desc > $PKG/install/slack-desc cd $PKG makepkg -l y -c n $TMP/procps-$VERSION-$ARCH-$BUILD.txz -# Clean up the extra stuff: -if [ "$1" = "--cleanup" ]; then - rm -rf $TMP/procps-$VERSION - rm -rf $TMP/procinfo-18 - rm -rf $TMP/psmisc-$PSMISCVER - rm -rf $PKG -fi |