소스 검색

procps: import version 3.2.8 of the procps utilities

Signed-off-by: Gergely Kiss <mail.gery@gmail.com>
Tested-by: Gergely Kiss <mail.gery@gmail.com>
Gergely Kiss 10 년 전
부모
커밋
76ba0ac87a
4개의 변경된 파일149개의 추가작업 그리고 0개의 파일을 삭제
  1. 86
    0
      utils/procps/Makefile
  2. 11
    0
      utils/procps/patches/010-make_fix.patch
  3. 41
    0
      utils/procps/patches/020_hz_fix.patch
  4. 11
    0
      utils/procps/patches/030-fix-string-problems.patch

+ 86
- 0
utils/procps/Makefile 파일 보기

@@ -0,0 +1,86 @@
1
+#
2
+# Copyright (C) 2006-2014 OpenWrt.org
3
+#
4
+# This is free software, licensed under the GNU General Public License v2.
5
+# See /LICENSE for more information.
6
+#
7
+
8
+include $(TOPDIR)/rules.mk
9
+
10
+PKG_NAME:=procps
11
+PKG_VERSION:=3.2.8
12
+PKG_RELEASE:=1
13
+PKG_LICENSE:=GPL-2.0
14
+PKG_LICENSE_FILES:=COPYING COPYING.LIB
15
+
16
+PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.gz
17
+PKG_SOURCE_URL:=http://procps.sourceforge.net
18
+PKG_MD5SUM:=9532714b6846013ca9898984ba4cd7e0
19
+
20
+PKG_BUILD_PARALLEL:=1
21
+
22
+include $(INCLUDE_DIR)/package.mk
23
+
24
+PROCPS_APPLETS := \
25
+    ps free pgrep pkill pmap pwdx skill w \
26
+    slabtop snice tload top vmstat watch
27
+
28
+define Package/procps/Default
29
+  SECTION:=utils
30
+  CATEGORY:=Utilities
31
+  DEPENDS:=+libncurses
32
+  TITLE:=proc utilities
33
+  URL:=http://procps.sourceforge.net/
34
+  MAINTAINER:=Gergely Kiss <mail.gery@gmail.com>
35
+endef
36
+
37
+define Package/procps
38
+  $(call Package/procps/Default)
39
+  MENU:=1
40
+endef
41
+
42
+define Package/procps/description
43
+ procps is the package that has a bunch of small useful utilities that give
44
+ information about processes using the /proc filesystem. The package
45
+ includes the programs ps, top, vmstat, w, kill, free, slabtop, and skill.
46
+endef
47
+
48
+define GenPlugin
49
+ define Package/$(1)
50
+   $(call Package/procps/Default)
51
+   DEPENDS:=procps
52
+   TITLE:=Applet $(2) from the procps package
53
+   DEFAULT:=y
54
+ endef
55
+
56
+ define Package/$(1)/description
57
+  Installs the applet $(2).
58
+ endef
59
+endef
60
+
61
+$(foreach a,$(PROCPS_APPLETS),$(eval $(call GenPlugin,procps-$(a),$(a))))
62
+
63
+MAKE_FLAGS += \
64
+	CFLAGS="$(TARGET_CFLAGS)" \
65
+	CPPFLAGS="$(TARGET_CPPFLAGS)" \
66
+	LDFLAGS="$(TARGET_LDFLAGS)" \
67
+
68
+define Package/procps/install
69
+	$(INSTALL_DIR) $(1)/usr/bin
70
+	$(INSTALL_DIR) $(1)/usr/lib
71
+	$(INSTALL_BIN) $(PKG_BUILD_DIR)/proc/libproc-$(PKG_VERSION).so $(1)/usr/lib/
72
+endef
73
+
74
+AUXDIR_ps := "ps/"
75
+
76
+define BuildPlugin
77
+  define Package/$(1)/install
78
+	$(INSTALL_DIR) $$(1)/usr/bin
79
+	$(INSTALL_BIN) $(PKG_BUILD_DIR)/$(AUXDIR_$(2))$(2) $$(1)/usr/bin/
80
+  endef
81
+
82
+  $$(eval $$(call BuildPackage,$(1)))
83
+endef
84
+
85
+$(foreach a,$(PROCPS_APPLETS),$(eval $(call BuildPlugin,procps-$(a),$(a))))
86
+$(eval $(call BuildPackage,procps))

+ 11
- 0
utils/procps/patches/010-make_fix.patch 파일 보기

@@ -0,0 +1,11 @@
1
+--- a/Makefile
2
++++ b/Makefile
3
+@@ -174,7 +174,7 @@ INSTALL := $(BINFILES) $(MANFILES)
4
+ # want this rule first, use := on ALL, and ALL not filled in yet
5
+ all: do_all
6
+ 
7
+--include */module.mk
8
++-include proc/module.mk ps/module.mk 
9
+ 
10
+ do_all:    $(ALL)
11
+ 

+ 41
- 0
utils/procps/patches/020_hz_fix.patch 파일 보기

@@ -0,0 +1,41 @@
1
+--- a/proc/sysinfo.c
2
++++ b/proc/sysinfo.c
3
+@@ -209,7 +209,12 @@ static int check_for_privs(void){
4
+   return !!rc;
5
+ }
6
+ 
7
++#if __GNUC__ < 4 || __GNUC_MINOR__ < 3
8
+ static void init_libproc(void) __attribute__((constructor));
9
++#else
10
++static void init_libproc(void) __attribute__((constructor(200)));
11
++#endif
12
++
13
+ static void init_libproc(void){
14
+   have_privs = check_for_privs();
15
+   // ought to count CPUs in /proc/stat instead of relying
16
+--- a/proc/version.c
17
++++ b/proc/version.c
18
+@@ -33,7 +33,12 @@ void display_version(void) {
19
+ 
20
+ int linux_version_code;
21
+ 
22
++#if __GNUC__ < 4 || __GNUC_MINOR__ < 3
23
+ static void init_Linux_version(void) __attribute__((constructor));
24
++#else
25
++static void init_Linux_version(void) __attribute__((constructor(100)));
26
++#endif
27
++
28
+ static void init_Linux_version(void) {
29
+     static struct utsname uts;
30
+     int x = 0, y = 0, z = 0;	/* cleared in case sscanf() < 3 */
31
+--- a/proc/module.mk
32
++++ b/proc/module.mk
33
+@@ -76,7 +76,7 @@ proc/$(ANAME): $(LIBOBJ)
34
+ 
35
+ #proc/$(SONAME): proc/library.map
36
+ proc/$(SONAME): $(LIBOBJ)
37
+-	$(CC) $(ALL_CFLAGS) $(ALL_LDFLAGS) -shared -Wl,-soname,$(SONAME) -Wl,--version-script=proc/library.map -o $@ $^ -lc
38
++	$(CC) $(ALL_CFLAGS) $(ALL_LDFLAGS) -shared -Wl,-soname,$(SONAME) -Wl,--version-script=proc/library.map -o $@ $(sort $^) -lc
39
+ 
40
+ 
41
+ # AUTOMATIC DEPENDENCY GENERATION -- GCC AND GNUMAKE DEPENDENT

+ 11
- 0
utils/procps/patches/030-fix-string-problems.patch 파일 보기

@@ -0,0 +1,11 @@
1
+--- a/proc/sig.c
2
++++ b/proc/sig.c
3
+@@ -214,7 +214,7 @@ void pretty_print_signals(void){
4
+   while(++i <= number_of_signals){
5
+     int n;
6
+     n = printf("%2d %s", i, signal_number_to_name(i));
7
+-    if(i%7) printf("           \0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" + n);
8
++    if(i%7) printf("%s", "           \0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" + n);
9
+     else printf("\n");
10
+   }
11
+   if((i-1)%7) printf("\n");