summaryrefslogtreecommitdiff
path: root/meta/recipes-extended/procps
diff options
context:
space:
mode:
Diffstat (limited to 'meta/recipes-extended/procps')
-rw-r--r--meta/recipes-extended/procps/procps-3.2.8/gnu-kbsd-version.patch44
-rw-r--r--meta/recipes-extended/procps/procps-3.2.8/install.patch39
-rw-r--r--meta/recipes-extended/procps/procps-3.2.8/linux-limits.patch15
-rw-r--r--meta/recipes-extended/procps/procps-3.2.8/pagesz-not-constant.patch24
-rw-r--r--meta/recipes-extended/procps/procps-3.2.8/procmodule.patch38
-rw-r--r--meta/recipes-extended/procps/procps-3.2.8/procps-3.2.8+gmake-3.82.patch19
-rw-r--r--meta/recipes-extended/procps/procps-3.2.8/psmodule.patch23
-rw-r--r--meta/recipes-extended/procps/procps-3.2.8/sysctl.conf64
-rw-r--r--meta/recipes-extended/procps/procps.inc18
-rw-r--r--meta/recipes-extended/procps/procps_3.2.8.bb35
10 files changed, 319 insertions, 0 deletions
diff --git a/meta/recipes-extended/procps/procps-3.2.8/gnu-kbsd-version.patch b/meta/recipes-extended/procps/procps-3.2.8/gnu-kbsd-version.patch
new file mode 100644
index 000000000..2582857e2
--- /dev/null
+++ b/meta/recipes-extended/procps/procps-3.2.8/gnu-kbsd-version.patch
@@ -0,0 +1,44 @@
+Upstream-Status: Inappropriate [not author, no upstream]
+
+Imported from Debian.
+Source: http://anonscm.debian.org/gitweb/?p=collab-maint/procps.git;a=blob;f=debian/patches/gnu-kbsd-version.patch;h=fe5489fc772a3355ff8c0dcf9b953bf0c05aa9f8;hb=b460cfd726b019f8d918b380f78af4c19c5f3e50
+Bugtracker: http://bugs.debian.org/cgi-bin/bugreport.cgi?bug=632749
+
+Stops procps utilities from printing a warning when used with
+kernels having only two digit versions, e.g. 3.0.
+
+Author: <csmall@debian.org>
+Description: Rework version parsing so its ok with other OSes
+--- a/proc/version.c
++++ b/proc/version.c
+@@ -35,15 +35,23 @@
+
+ static void init_Linux_version(void) __attribute__((constructor));
+ static void init_Linux_version(void) {
+- static struct utsname uts;
+- int x = 0, y = 0, z = 0; /* cleared in case sscanf() < 3 */
++ int x = 0, y = 0, z = 0; /* cleared in case sscanf() < 2 */
++ FILE *fp;
++ char buf[256];
+
+- if (uname(&uts) == -1) /* failure implies impending death */
+- exit(1);
+- if (sscanf(uts.release, "%d.%d.%d", &x, &y, &z) < 3)
++ if ( (fp=fopen("/proc/version","r")) == NULL) /* failure implies impending death */
++ exit(1);
++ if (fgets(buf, 256, fp) == NULL) {
++ fprintf(stderr, "Cannot read kernel version from /proc/version\n");
++ fclose(fp);
++ exit(1);
++ }
++ fclose(fp);
++ if (sscanf(buf, "Linux version %d.%d.%d", &x, &y, &z) < 2)
+ fprintf(stderr, /* *very* unlikely to happen by accident */
+ "Non-standard uts for running kernel:\n"
+- "release %s=%d.%d.%d gives version code %d\n",
+- uts.release, x, y, z, LINUX_VERSION(x,y,z));
++ "release %s=%d.%d.%d gives version code %d\n",
++ buf,
++ x, y, z, LINUX_VERSION(x,y,z));
+ linux_version_code = LINUX_VERSION(x, y, z);
+ }
diff --git a/meta/recipes-extended/procps/procps-3.2.8/install.patch b/meta/recipes-extended/procps/procps-3.2.8/install.patch
new file mode 100644
index 000000000..2a59a5ff6
--- /dev/null
+++ b/meta/recipes-extended/procps/procps-3.2.8/install.patch
@@ -0,0 +1,39 @@
+Upstream-Status: Inappropriate [configuration]
+
+diff -ruN procps-3.2.8-orig//Makefile procps-3.2.8/Makefile
+--- procps-3.2.8-orig//Makefile 2011-08-23 22:06:46.471163999 +0800
++++ procps-3.2.8/Makefile 2011-08-23 22:15:01.091163999 +0800
+@@ -29,9 +29,6 @@
+ ln_sf := ln -sf
+ install := install -D --owner 0 --group 0
+
+-# Lame x86-64 /lib64 and /usr/lib64 abomination:
+-lib64 := lib$(shell [ -d /lib64 ] && echo 64)
+-
+ usr/bin := $(DESTDIR)/usr/bin/
+ bin := $(DESTDIR)/bin/
+ sbin := $(DESTDIR)/sbin/
+@@ -39,8 +36,8 @@
+ man1 := $(DESTDIR)/usr/share/man/man1/
+ man5 := $(DESTDIR)/usr/share/man/man5/
+ man8 := $(DESTDIR)/usr/share/man/man8/
+-lib := $(DESTDIR)/$(lib64)/
+-usr/lib := $(DESTDIR)/usr/$(lib64)/
++lib := $(DESTDIR)/$(base_libdir)/
++usr/lib := $(DESTDIR)/$(libdir)/
+ usr/include := $(DESTDIR)/usr/include/
+
+ #SKIP := $(bin)kill $(man1)kill.1
+@@ -222,10 +219,10 @@
+ ###### install
+
+ $(BINFILES) : all
+- $(install) --mode a=rx $(notdir $@) $@
++ $(install) -m 555 $(notdir $@) $@
+
+ $(MANFILES) : all
+- $(install) --mode a=r $(notdir $@) $@
++ $(install) -m 444 $(notdir $@) $@
+
+ install: $(filter-out $(SKIP) $(addprefix $(DESTDIR),$(SKIP)),$(INSTALL))
+ cd $(usr/bin) && $(ln_f) skill snice
diff --git a/meta/recipes-extended/procps/procps-3.2.8/linux-limits.patch b/meta/recipes-extended/procps/procps-3.2.8/linux-limits.patch
new file mode 100644
index 000000000..2ca972482
--- /dev/null
+++ b/meta/recipes-extended/procps/procps-3.2.8/linux-limits.patch
@@ -0,0 +1,15 @@
+Upstream-Status: Pending
+
+diff --git a/pwdx.c b/pwdx.c
+index cb96a52..29ebce2 100644
+--- a/pwdx.c
++++ b/pwdx.c
+@@ -13,7 +13,7 @@
+ #include <stdlib.h>
+ #include <sys/types.h>
+ #include <regex.h>
+-#include <limits.h>
++#include <linux/limits.h>
+ #include <unistd.h>
+ #include <errno.h>
+
diff --git a/meta/recipes-extended/procps/procps-3.2.8/pagesz-not-constant.patch b/meta/recipes-extended/procps/procps-3.2.8/pagesz-not-constant.patch
new file mode 100644
index 000000000..b1418518b
--- /dev/null
+++ b/meta/recipes-extended/procps/procps-3.2.8/pagesz-not-constant.patch
@@ -0,0 +1,24 @@
+Upstream-Status: Pending
+
+Index: procps-3.2.1/proc/devname.c
+===================================================================
+--- procps-3.2.1.orig/proc/devname.c 2004-03-18 05:43:50.000000000 +1100
++++ procps-3.2.1/proc/devname.c 2005-04-02 10:40:17.462138000 +1000
+@@ -227,7 +227,7 @@
+
+ /* number --> name */
+ unsigned dev_to_tty(char *restrict ret, unsigned chop, dev_t dev_t_dev, int pid, unsigned int flags) {
+- static char buf[PAGE_SIZE];
++ static char buf[4096];
+ char *restrict tmp = buf;
+ unsigned dev = dev_t_dev;
+ unsigned i = 0;
+@@ -249,7 +249,7 @@
+ if((flags&ABBREV_TTY) && !strncmp(tmp,"tty", 3) && tmp[3]) tmp += 3;
+ if((flags&ABBREV_PTS) && !strncmp(tmp,"pts/", 4) && tmp[4]) tmp += 4;
+ /* gotta check before we chop or we may chop someone else's memory */
+- if(chop + (unsigned long)(tmp-buf) <= sizeof buf)
++ if(chop + (unsigned long)(tmp-buf) < sizeof buf)
+ tmp[chop] = '\0';
+ /* replace non-ASCII characters with '?' and return the number of chars */
+ for(;;){
diff --git a/meta/recipes-extended/procps/procps-3.2.8/procmodule.patch b/meta/recipes-extended/procps/procps-3.2.8/procmodule.patch
new file mode 100644
index 000000000..2a65c3509
--- /dev/null
+++ b/meta/recipes-extended/procps/procps-3.2.8/procmodule.patch
@@ -0,0 +1,38 @@
+Upstream-Status: Pending
+
+*** procps-3.2.5/proc/module.mk.orig Sun Jul 24 11:53:49 2005
+--- procps-3.2.5/proc/module.mk Sun Jul 24 11:54:32 2005
+***************
+*** 96,102 ****
+ #################### install rules ###########################
+
+ $(lib)$(SOFILE) : proc/$(SONAME)
+! $(install) --mode a=rx $< $@
+
+ ifneq ($(SOLINK),$(SOFILE))
+ .PHONY: $(lib)$(SOLINK)
+--- 96,102 ----
+ #################### install rules ###########################
+
+ $(lib)$(SOFILE) : proc/$(SONAME)
+! $(install) -m 555 $< $@
+
+ ifneq ($(SOLINK),$(SOFILE))
+ .PHONY: $(lib)$(SOLINK)
+***************
+*** 115,121 ****
+ $(ldconfig)
+
+ $(usr/lib)$(ANAME) : proc/$(ANAME)
+! $(install) --mode a=r $< $@
+
+ # Junk anyway... supposed to go in /usr/include/$(NAME)
+ #INSTALL += $(addprefix $(include),$(HDRFILES))
+--- 115,121 ----
+ $(ldconfig)
+
+ $(usr/lib)$(ANAME) : proc/$(ANAME)
+! $(install) -m 444 $< $@
+
+ # Junk anyway... supposed to go in /usr/include/$(NAME)
+ #INSTALL += $(addprefix $(include),$(HDRFILES))
diff --git a/meta/recipes-extended/procps/procps-3.2.8/procps-3.2.8+gmake-3.82.patch b/meta/recipes-extended/procps/procps-3.2.8/procps-3.2.8+gmake-3.82.patch
new file mode 100644
index 000000000..c8cee26ea
--- /dev/null
+++ b/meta/recipes-extended/procps/procps-3.2.8/procps-3.2.8+gmake-3.82.patch
@@ -0,0 +1,19 @@
+Upstream-Status: Backport
+
+Fix for stricter Makefile parser in Make 3.82 take from Gentoo bugzilla:
+http://sources.gentoo.org/cgi-bin/viewvc.cgi/gentoo-x86/sys-process/procps/files/procps-3.2.8%2Bgmake-3.82.patch?revision=1.1
+
+Index: procps-3.2.8/Makefile
+===================================================================
+--- procps-3.2.8.orig/Makefile
++++ procps-3.2.8/Makefile
+@@ -174,7 +174,8 @@ INSTALL := $(BINFILES) $(MANFILES)
+ # want this rule first, use := on ALL, and ALL not filled in yet
+ all: do_all
+
+--include */module.mk
++-include proc/module.mk
++-include ps/module.mk
+
+ do_all: $(ALL)
+
diff --git a/meta/recipes-extended/procps/procps-3.2.8/psmodule.patch b/meta/recipes-extended/procps/procps-3.2.8/psmodule.patch
new file mode 100644
index 000000000..0775eaba2
--- /dev/null
+++ b/meta/recipes-extended/procps/procps-3.2.8/psmodule.patch
@@ -0,0 +1,23 @@
+Upstream-Status: Pending
+
+*** procps-3.2.5/ps/module.mk.orig Sun Jul 24 11:54:40 2005
+--- procps-3.2.5/ps/module.mk Sun Jul 24 11:55:02 2005
+***************
+*** 33,40 ****
+
+
+ $(bin)ps: ps/ps
+! $(install) --mode a=rx $< $@
+
+ $(man1)ps.1 : ps/ps.1
+! $(install) --mode a=r $< $@
+ -rm -f $(DESTDIR)/var/catman/cat1/ps.1.gz $(DESTDIR)/var/man/cat1/ps.1.gz
+--- 33,40 ----
+
+
+ $(bin)ps: ps/ps
+! $(install) -m 555 $< $@
+
+ $(man1)ps.1 : ps/ps.1
+! $(install) -m 444 $< $@
+ -rm -f $(DESTDIR)/var/catman/cat1/ps.1.gz $(DESTDIR)/var/man/cat1/ps.1.gz
diff --git a/meta/recipes-extended/procps/procps-3.2.8/sysctl.conf b/meta/recipes-extended/procps/procps-3.2.8/sysctl.conf
new file mode 100644
index 000000000..34e7488bf
--- /dev/null
+++ b/meta/recipes-extended/procps/procps-3.2.8/sysctl.conf
@@ -0,0 +1,64 @@
+# This configuration file is taken from Debian.
+#
+# /etc/sysctl.conf - Configuration file for setting system variables
+# See sysctl.conf (5) for information.
+#
+
+#kernel.domainname = example.com
+
+# Uncomment the following to stop low-level messages on console
+#kernel.printk = 4 4 1 7
+
+##############################################################3
+# Functions previously found in netbase
+#
+
+# Uncomment the next two lines to enable Spoof protection (reverse-path filter)
+# Turn on Source Address Verification in all interfaces to
+# prevent some spoofing attacks
+net.ipv4.conf.default.rp_filter=1
+net.ipv4.conf.all.rp_filter=1
+
+# Uncomment the next line to enable TCP/IP SYN cookies
+#net.ipv4.tcp_syncookies=1
+
+# Uncomment the next line to enable packet forwarding for IPv4
+#net.ipv4.ip_forward=1
+
+# Uncomment the next line to enable packet forwarding for IPv6
+#net.ipv6.conf.all.forwarding=1
+
+
+###################################################################
+# Additional settings - these settings can improve the network
+# security of the host and prevent against some network attacks
+# including spoofing attacks and man in the middle attacks through
+# redirection. Some network environments, however, require that these
+# settings are disabled so review and enable them as needed.
+#
+# Ignore ICMP broadcasts
+#net.ipv4.icmp_echo_ignore_broadcasts = 1
+#
+# Ignore bogus ICMP errors
+#net.ipv4.icmp_ignore_bogus_error_responses = 1
+#
+# Do not accept ICMP redirects (prevent MITM attacks)
+#net.ipv4.conf.all.accept_redirects = 0
+#net.ipv6.conf.all.accept_redirects = 0
+# _or_
+# Accept ICMP redirects only for gateways listed in our default
+# gateway list (enabled by default)
+# net.ipv4.conf.all.secure_redirects = 1
+#
+# Do not send ICMP redirects (we are not a router)
+#net.ipv4.conf.all.send_redirects = 0
+#
+# Do not accept IP source route packets (we are not a router)
+#net.ipv4.conf.all.accept_source_route = 0
+#net.ipv6.conf.all.accept_source_route = 0
+#
+# Log Martian Packets
+#net.ipv4.conf.all.log_martians = 1
+#
+
+#kernel.shmmax = 141762560
diff --git a/meta/recipes-extended/procps/procps.inc b/meta/recipes-extended/procps/procps.inc
new file mode 100644
index 000000000..ada325762
--- /dev/null
+++ b/meta/recipes-extended/procps/procps.inc
@@ -0,0 +1,18 @@
+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 = "http://procps.sf.net"
+SECTION = "base"
+LICENSE = "GPLv2+ & LGPLv2+"
+LIC_FILES_CHKSUM="file://COPYING;md5=0636e73ff0215e8d672dc4c32c317bb3 \
+ file://COPYING.LIB;md5=6e29c688d912da12b66b73e32b03d812 \
+ file://ps/COPYING;md5=6e29c688d912da12b66b73e32b03d812 \
+ file://proc/COPYING;md5=6e29c688d912da12b66b73e32b03d812"
+DEPENDS = "ncurses"
+
+FILES_${PN} += "${base_libdir}/libproc-*.so"
+
+SRC_URI = "http://procps.sourceforge.net/procps-${PV}.tar.gz \
+ file://install.patch"
+
+inherit autotools
diff --git a/meta/recipes-extended/procps/procps_3.2.8.bb b/meta/recipes-extended/procps/procps_3.2.8.bb
new file mode 100644
index 000000000..dfae0b8f2
--- /dev/null
+++ b/meta/recipes-extended/procps/procps_3.2.8.bb
@@ -0,0 +1,35 @@
+require procps.inc
+
+PR = "r7"
+
+inherit update-alternatives
+
+ALTERNATIVE_LINKS = "${bindir}/top ${bindir}/uptime ${bindir}/free ${bindir}/pkill ${bindir}/pmap \
+ ${base_bindir}/kill ${base_sbindir}/sysctl ${base_bindir}/ps \
+ ${bindir}/pgrep ${bindir}/pwdx ${bindir}/watch"
+ALTERNATIVE_PRIORITY = "110"
+
+SRC_URI += "file://procmodule.patch \
+ file://psmodule.patch \
+ file://linux-limits.patch \
+ file://sysctl.conf \
+ file://procps-3.2.8+gmake-3.82.patch \
+ file://gnu-kbsd-version.patch \
+ "
+
+SRC_URI[md5sum] = "9532714b6846013ca9898984ba4cd7e0"
+SRC_URI[sha256sum] = "11ed68d8a4433b91cd833deb714a3aa849c02aea738c42e6b4557982419c1535"
+
+EXTRA_OEMAKE = "CFLAGS=-I${STAGING_INCDIR} \
+ CPPFLAGS=-I${STAGING_INCDIR} \
+ LDFLAGS="${LDFLAGS}" \
+ CURSES=-lncurses \
+ install='install -D' \
+ ldconfig=echo"
+
+do_install_append () {
+ install -d ${D}${sysconfdir}
+ install -m 0644 ${WORKDIR}/sysctl.conf ${D}${sysconfdir}/sysctl.conf
+}
+
+CONFFILES_${PN} = "${sysconfdir}/sysctl.conf"