Modify

Opened 10 years ago

Closed 10 years ago

Last modified 7 years ago

#649 closed enhancement (fixed)

New packages: procps, psmisc

Reported by: leo <mleina1@…> Owned by: florian
Priority: normal Milestone: 0.9/rc6
Component: packages Version:
Keywords: psmisc procps package Cc:

Description

Got sick of busybox's ps version.. here's the standard ps and associated tools.

Am I supposed to include the basic changes to package/Config.in and package/Makefile needed to add these packages? Ok to just paste it in here?
Lemme know if it breaks or if I should've done something differently.

###############procps##################

diff -ruN package/psmisc.orig/Config.in package/procps/Config.in
--- package/psmisc.orig/Config.in       1969-12-31 18:00:00.000000000 -0600
+++ package/procps/Config.in    2006-07-22 04:11:36.000000000 -0500
@@ -0,0 +1,102 @@
+config BR2_PACKAGE_PROCPS
+       prompt "Basic /proc utilities"
+       tristate
+       default m if CONFIG_DEVEL
+       help
+       procps is a package that has many small useful utilities that
+       give information about processes using the /proc filesystem. The
+       package includes the programs ps, vmstat, top, w, kill, free, slabtop,
+       skill, and others.
+
+       Note that versions of many of these programs are included in BusyBox.
+       This package will replace many of them.
+
+       http://procps.sourceforge.net/
+
+config BR2_PACKAGE_PROCPS_PS
+       prompt "ps - report a snapshot of the current processes."
+       bool
+       default y if CONFIG_DEVEL
+       depends BR2_PACKAGE_PROCPS
+
+config BR2_PACKAGE_PROCPS_VMSTAT
+       prompt "vmstat - Report virtual memory statistics"
+       bool
+       default y if CONFIG_DEVEL
+       depends BR2_PACKAGE_PROCPS
+
+config BR2_PACKAGE_PROCPS_TOP
+       prompt "top (requires libncurses) - display Linux tasks"
+       bool
+       default y if CONFIG_DEVEL
+       depends BR2_PACKAGE_PROCPS
+       select BR2_PACKAGE_LIBNCURSES
+       depends BR2_PACKAGE_LIBNCURSES
+
+config BR2_PACKAGE_PROCPS_SLABTOP
+        prompt "slabtop (requires libncurses) - display kernel slab cache info"+        bool
+        default y if CONFIG_DEVEL
+        depends BR2_PACKAGE_PROCPS
+       depends BR2_PACKAGE_LIBNCURSES
+       select BR2_PACKAGE_LIBNCURSES
+
+config BR2_PACKAGE_PROCPS_PMAP
+        prompt "pmap - report memory map of a process"
+        bool
+        default y if CONFIG_DEVEL
+        depends BR2_PACKAGE_PROCPS
+
+config BR2_PACKAGE_PROCPS_PWDX
+        prompt "pwdx - report current working directory of a process"
+        bool
+        default y if CONFIG_DEVEL
+        depends BR2_PACKAGE_PROCPS
+
+config BR2_PACKAGE_PROCPS_W
+       prompt "w - Show who is logged on and what they are doing"
+       bool
+       default y if CONFIG_DEVEL
+       depends BR2_PACKAGE_PROCPS
+
+config BR2_PACKAGE_PROCPS_KILL
+        prompt "kill - terminate a process"
+        bool
+        default y if CONFIG_DEVEL
+        depends BR2_PACKAGE_PROCPS
+
+config BR2_PACKAGE_PROCPS_SKILL
+        prompt "skill, snice - send a signal or report process status"
+        bool
+        default y if CONFIG_DEVEL
+        depends BR2_PACKAGE_PROCPS
+
+config BR2_PACKAGE_PROCPS_PGREP
+       prompt "pgrep, pkill - lookup or signal processes based on name or other attributes"
+       bool
+       default y if CONFIG_DEVEL
+       depends BR2_PACKAGE_PROCPS
+
+config BR2_PACKAGE_PROCPS_FREE
+        prompt "free - display system memory information"
+        bool
+        default y if CONFIG_DEVEL
+        depends BR2_PACKAGE_PROCPS
+
+config BR2_PACKAGE_PROCPS_SYSCTL
+        prompt "sysctl - configure kernel parameters at runtime"
+        bool
+        default y if CONFIG_DEVEL
+        depends BR2_PACKAGE_PROCPS
+
+config BR2_PACKAGE_PROCPS_TLOAD
+       prompt "tload - graphic representation of system load average"
+       bool
+       default y if CONFIG_DEVEL
+       depends BR2_PACKAGE_PROCPS
+
+config BR2_PACKAGE_PROCPS_WATCH
+       prompt "watch - execute a program periodically with fullscreen output"
+       bool
+       default y if CONFIG_DEVEL
+       depends BR2_PACKAGE_PROCPS
diff -ruN package/psmisc.orig/ipkg/procps.control package/procps/ipkg/procps.control
--- package/psmisc.orig/ipkg/procps.control     1969-12-31 18:00:00.000000000 -0600
+++ package/procps/ipkg/procps.control  2006-07-22 00:43:33.000000000 -0500
@@ -0,0 +1,3 @@
+Package: procps
+Priority: optional
+Section: admin
diff -ruN package/psmisc.orig/ipkg/procps.postinst package/procps/ipkg/procps.postinst
--- package/psmisc.orig/ipkg/procps.postinst    1969-12-31 18:00:00.000000000 -0600
+++ package/procps/ipkg/procps.postinst 2006-07-21 19:13:45.000000000 -0500
@@ -0,0 +1,15 @@
+#!/bin/sh
+
+if [ -f /usr/bin/skill ]
+then
+    echo "Hard linking snice to skill"
+    ln /usr/bin/skill /usr/bin/snice
+fi
+
+if [ -f /usr/bin/pgrep ]
+then
+    echo "Hard linking pkill to pgrep"
+    ln /usr/bin/pgrep /usr/bin/snice
+fi
+
+exit 0
diff -ruN package/psmisc.orig/ipkg/procps.postrm package/procps/ipkg/procps.postrm
--- package/psmisc.orig/ipkg/procps.postrm      1969-12-31 18:00:00.000000000 -0600
+++ package/procps/ipkg/procps.postrm   2006-07-21 19:13:08.000000000 -0500
@@ -0,0 +1,19 @@
+#!/bin/sh
+
+BINS="/usr/bin/free /bin/kill /usr/bin/pgrep /usr/bin/pkill /usr/bin/pmap \
+/usr/bin/skill /usr/bin/pwdx /usr/bin/slabtop /usr/bin/snice /sbin/sysctl \
+/usr/bin/tload /usr/bin/top /usr/bin/uptime /usr/bin/vmstat /usr/bin/w \
+/usr/bin/watch /bin/ps"
+
+echo "Recreating original BusyBox links: "
+
+for bin in $BINS
+do
+    if busybox 2>&1 | grep ${bin##/*/} >/dev/null
+    then
+         echo "$bin "
+         ln -sf /bin/busybox $bin
+    fi
+done
+
+exit 0
diff -ruN package/psmisc.orig/ipkg/procps.preinst package/procps/ipkg/procps.preinst
--- package/psmisc.orig/ipkg/procps.preinst     1969-12-31 18:00:00.000000000 -0600
+++ package/procps/ipkg/procps.preinst  2006-07-21 19:55:33.000000000 -0500
@@ -0,0 +1,24 @@
+#!/bin/sh
+
+echo "Removing symbolic links to BusyBox: "
+for bin in $BUILT
+do
+    if [ -h $bin ]
+    then
+        echo "$bin "
+        rm -f $bin
+    elif [ -e $bin ]
+    then
+        echo -e "$bin exists but is not a symbolic link.\nRe-creating BusyBox links and aborting..."
+        for bin in $BUILT
+        do
+            if busybox 2>&1 | grep ${bin##/*/} >/dev/null && [ ! -e $bin ]
+            then
+                ln -s /bin/busybox $bin
+            fi
+        done
+        exit 1
+    fi
+done
+
+exit 0
diff -ruN package/psmisc.orig/ipkg/procps.prerm package/procps/ipkg/procps.prerm--- package/psmisc.orig/ipkg/procps.prerm       1969-12-31 18:00:00.000000000 -0600
+++ package/procps/ipkg/procps.prerm    2006-07-21 19:14:02.000000000 -0500
@@ -0,0 +1,15 @@
+#!/bin/sh
+
+if [ -f /usr/bin/pkill ]
+then
+    echo "Removing hard link from pkill to pgrep"
+    rm -f /usr/bin/pkill
+fi
+
+if [ -f /usr/bin/snice ]
+then
+    echo "Removing hard link from snice to skill"
+    rm -f /usr/bin/skill
+fi
+
+exit 0
diff -ruN package/psmisc.orig/Makefile package/procps/Makefile
--- package/psmisc.orig/Makefile        1969-12-31 18:00:00.000000000 -0600
+++ package/procps/Makefile     2006-07-22 00:53:24.000000000 -0500
@@ -0,0 +1,151 @@
+include $(TOPDIR)/rules.mk
+
+PKG_NAME:=procps
+PKG_VERSION:=3.2.7
+PKG_RELEASE:=1
+PKG_MD5SUM:=f490bca772b16472962c7b9f23b1e97d
+
+PKG_SOURCE_URL:=http://procps.sourceforge.net/
+PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.gz
+PKG_CAT:=zcat
+
+PKG_BUILD_DIR:=$(BUILD_DIR)/$(PKG_NAME)-$(PKG_VERSION)
+PKG_INSTALL_DIR:=$(PKG_BUILD_DIR)/ipkg-install
+
+include $(TOPDIR)/package/rules.mk
+
+$(eval $(call PKG_template,PROCPS,$(PKG_NAME),$(PKG_VERSION)-$(PKG_RELEASE),$(ARCH)))
+
+$(PKG_BUILD_DIR)/.configured: $(PKG_BUILD_DIR)/.prepared
+       touch $@
+
+APPS:=
+
+ifneq ($(BR2_PACKAGE_PROCPS_PS),)
+APPS += /bin/ps
+endif
+ifneq ($(BR2_PACKAGE_PROCPS_VMSTAT),)
+APPS += /usr/bin/vmstat
+endif
+ifneq ($(BR2_PACKAGE_PROCPS_TOP),)
+APPS += /usr/bin/top
+endif
+ifneq ($(BR2_PACKAGE_PROCPS_SLABTOP),)
+APPS += /usr/bin/slabtop
+endif
+ifneq ($(BR2_PACKAGE_PROCPS_PMAP),)
+APPS += /usr/bin/pmap
+endif
+ifneq ($(BR2_PACKAGE_PROCPS_PWDX),)
+APPS += /usr/bin/pwdx
+endif
+ifneq ($(BR2_PACKAGE_PROCPS_W),)
+APPS += /usr/bin/w
+endif
+ifneq ($(BR2_PACKAGE_PROCPS_KILL),)
+APPS += /bin/kill
+endif
+ifneq ($(BR2_PACKAGE_PROCPS_SKILL),)
+APPS += /usr/bin/skill
+endif
+ifneq ($(BR2_PACKAGE_PROCPS_PKILL),)
+APPS += /usr/bin/pkill
+endif
+ifneq ($(BR2_PACKAGE_PROCPS_FREE),)
+APPS += /usr/bin/free
+endif
+ifneq ($(BR2_PACKAGE_PROCPS_SNICE),)
+APPS += /usr/bin/snice
+endif
+ifneq ($(BR2_PACKAGE_PROCPS_SYSCTL),)
+APPS += /sbin/sysctl
+endif
+ifneq ($(BR2_PACKAGE_PROCPS_TLOAD),)
+APPS += /usr/bin/tload
+endif
+ifneq ($(BR2_PACKAGE_PROCPS_WATCH),)
+APPS += /usr/bin/watch
+endif
+ifneq ($(BR2_PACKAGE_PROCPS_PGREP),)
+APPS += /usr/bin/pgrep
+endif
+
+$(PKG_BUILD_DIR)/.built:
+       rm -rf $(PKG_INSTALL_DIR)
+       mkdir -p $(PKG_INSTALL_DIR)/usr/bin
+       mkdir -p $(PKG_INSTALL_DIR)/bin
+       mkdir -p $(PKG_INSTALL_DIR)/lib
+       mkdir -p $(PKG_INSTALL_DIR)/sbin
+       #Note here that we pass cross-compiler as default compiler to use
+       $(MAKE) -C $(PKG_BUILD_DIR) \
+               CC=$(TARGET_CC) \
+               CPPFLAGS="-I$(STAGING_DIR)/usr/include" \
+               LD="$(TARGET_CC)" \
+               LDFLAGS="-L$(STAGING_DIR)/usr/lib" \
+               $(TARGET_CONFIGURE_OPTS) \
+               prefix="$(PKG_INSTALL_DIR)/" \
+               ps/ps $(notdir $(APPS))
+
+       if [ -n "$(BR2_PACKAGE_PROCPS_PS)" ];then $(CP) $(PKG_BUILD_DIR)/ps/ps $(PKG_INSTALL_DIR)/bin/; fi
+       if [ -n "$(BR2_PACKAGE_PROCPS_VMSTAT)" ];then $(CP) $(PKG_BUILD_DIR)/vmstat $(PKG_INSTALL_DIR)/usr/bin; fi
+       if [ -n "$(BR2_PACKAGE_PROCPS_TOP)" ];then $(CP) $(PKG_BUILD_DIR)/top $(PKG_INSTALL_DIR)/usr/bin;fi
+       if [ -n "$(BR2_PACKAGE_PROCPS_SLABTOP)" ];then $(CP) $(PKG_BUILD_DIR)/slabtop $(PKG_INSTALL_DIR)/usr/bin;fi
+       if [ -n "$(BR2_PACKAGE_PROCPS_PMAP)" ];then $(CP) $(PKG_BUILD_DIR)/pmap $(PKG_INSTALL_DIR)/usr/bin;fi
+       if [ -n "$(BR2_PACKAGE_PROCPS_PWDX)" ];then $(CP) $(PKG_BUILD_DIR)/pwdx $(PKG_INSTALL_DIR)/usr/bin;fi
+       if [ -n "$(BR2_PACKAGE_PROCPS_W)" ];then $(CP) $(PKG_BUILD_DIR)/w $(PKG_INSTALL_DIR)/usr/bin;fi
+       if [ -n "$(BR2_PACKAGE_PROCPS_KILL)" ];then $(CP) $(PKG_BUILD_DIR)/kill $(PKG_INSTALL_DIR)/bin;fi
+       if [ -n "$(BR2_PACKAGE_PROCPS_SKILL)" ];then $(CP) $(PKG_BUILD_DIR)/skill $(PKG_INSTALL_DIR)/usr/bin;fi
+       if [ -n "$(BR2_PACKAGE_PROCPS_FREE)" ];then $(CP) $(PKG_BUILD_DIR)/free $(PKG_INSTALL_DIR)/usr/bin;fi
+       if [ -n "$(BR2_PACKAGE_PROCPS_SYSCTL)" ];then $(CP) $(PKG_BUILD_DIR)/sysctl $(PKG_INSTALL_DIR)/sbin;fi
+       if [ -n "$(BR2_PACKAGE_PROCPS_TLOAD)" ];then $(CP) $(PKG_BUILD_DIR)/tload $(PKG_INSTALL_DIR)/usr/bin;fi
+       if [ -n "$(BR2_PACKAGE_PROCPS_WATCH)" ];then $(CP) $(PKG_BUILD_DIR)/watch $(PKG_INSTALL_DIR)/usr/bin;fi
+       if [ -n "$(BR2_PACKAGE_PROCPS_PGREP)" ];then $(CP) $(PKG_BUILD_DIR)/pgrep $(PKG_INSTALL_DIR)/usr/bin;fi
+
+       $(CP) $(PKG_BUILD_DIR)/proc/libproc-$(PKG_VERSION).so $(PKG_INSTALL_DIR)/lib
+
+       touch $@
+
+$(IPKG_PROCPS):
+       install -d -m0755 $(IDIR_PROCPS)/usr/bin
+       install -d -m0755 $(IDIR_PROCPS)/bin
+       install -d -m0755 $(IDIR_PROCPS)/sbin
+       install -d -m0755 $(IDIR_PROCPS)/lib
+
+       if [ -n "$(BR2_PACKAGE_PROCPS_PS)" ];then $(CP) $(PKG_INSTALL_DIR)/bin/ps $(IDIR_PROCPS)/bin/;fi
+       if [ -n "$(BR2_PACKAGE_PROCPS_VMSTAT)" ];then $(CP) $(PKG_INSTALL_DIR)/usr/bin/vmstat $(IDIR_PROCPS)/usr/bin;fi
+       if [ -n "$(BR2_PACKAGE_PROCPS_TOP)" ];then $(CP) $(PKG_INSTALL_DIR)/usr/bin/top $(IDIR_PROCPS)/usr/bin;fi
+       if [ -n "$(BR2_PACKAGE_PROCPS_SLABTOP)" ];then $(CP) $(PKG_INSTALL_DIR)/usr/bin/slabtop $(IDIR_PROCPS)/usr/bin;fi
+       if [ -n "$(BR2_PACKAGE_PROCPS_PMAP)" ];then $(CP) $(PKG_INSTALL_DIR)/usr/bin/pmap $(IDIR_PROCPS)/usr/bin;fi
+       if [ -n "$(BR2_PACKAGE_PROCPS_PWDX)" ];then $(CP) $(PKG_INSTALL_DIR)/usr/bin/pwdx $(IDIR_PROCPS)/usr/bin;fi
+       if [ -n "$(BR2_PACKAGE_PROCPS_W)" ];then $(CP) $(PKG_INSTALL_DIR)/usr/bin/w $(IDIR_PROCPS)/usr/bin;fi
+       if [ -n "$(BR2_PACKAGE_PROCPS_KILL)" ];then $(CP) $(PKG_INSTALL_DIR)/bin/kill $(IDIR_PROCPS)/bin;fi
+       if [ -n "$(BR2_PACKAGE_PROCPS_SKILL)" ];then $(CP) $(PKG_INSTALL_DIR)/usr/bin/skill $(IDIR_PROCPS)/usr/bin;fi
+       if [ -n "$(BR2_PACKAGE_PROCPS_FREE)" ];then $(CP) $(PKG_INSTALL_DIR)/usr/bin/free $(IDIR_PROCPS)/usr/bin;fi
+       if [ -n "$(BR2_PACKAGE_PROCPS_SYSCTL)" ];then $(CP) $(PKG_INSTALL_DIR)/sbin/sysctl $(IDIR_PROCPS)/sbin;fi
+       if [ -n "$(BR2_PACKAGE_PROCPS_TLOAD)" ];then $(CP) $(PKG_INSTALL_DIR)/usr/bin/tload $(IDIR_PROCPS)/usr/bin;fi
+       if [ -n "$(BR2_PACKAGE_PROCPS_WATCH)" ];then $(CP) $(PKG_INSTALL_DIR)/usr/bin/watch $(IDIR_PROCPS)/usr/bin;fi
+       if [ -n "$(BR2_PACKAGE_PROCPS_PGREP)" ];then $(CP) $(PKG_INSTALL_DIR)/usr/bin/pgrep $(IDIR_PROCPS)/usr/bin;fi
+
+       $(CP) $(PKG_INSTALL_DIR)/lib/libproc-$(PKG_VERSION).so $(IDIR_PROCPS)/lib
+       $(RSTRIP) $(IDIR_PROCPS)
+
+       # Insert BUILT variable into preinst script
+       grep -v -e ^BUILT -e /bin/sh $(PKG_INSTALL_DIR)/../ipkg/$(PKG_NAME)/CONTROL/preinst > $(PKG_INSTALL_DIR)/../ipkg/$(PKG_NAME)/CONTROL/preinst.tmp
+       rm $(PKG_INSTALL_DIR)/../ipkg/$(PKG_NAME)/CONTROL/preinst
+       echo -e "#!/bin/sh\nBUILT='$(APPS)'\n" > $(PKG_INSTALL_DIR)/../ipkg/$(PKG_NAME)/CONTROL/preinst
+       cat $(PKG_INSTALL_DIR)/../ipkg/$(PKG_NAME)/CONTROL/preinst.tmp >> $(PKG_INSTALL_DIR)/../ipkg/$(PKG_NAME)/CONTROL/preinst
+       rm $(PKG_INSTALL_DIR)/../ipkg/$(PKG_NAME)/CONTROL/preinst.tmp
+
+       # Insert ncurses dependancy if top or slabtop was selected
+       if [ -n "$(BR2_PACKAGE_PROCPS_TOP)" ] || \
+               [ -n "$(BR2_PACKAGE_PROCPS_SLABTOP)" ]; then\
+       echo "Depends: libncurses" >> $(PKG_INSTALL_DIR)/../ipkg/$(PKG_NAME)/CONTROL/control; fi
+
+       # Insert built apps to ipkg description
+       echo "Description: /proc utilities: $(notdir $(APPS))" >>  $(PKG_INSTALL_DIR)/../ipkg/$(PKG_NAME)/CONTROL/control
+
+       $(IPKG_BUILD) $(IDIR_PROCPS) $(PACKAGE_DIR)
+
+mostlyclean:
+       make -C $(PKG_BUILD_DIR) clean
+       rm $(PKG_BUILD_DIR)/.built

#####################psmisc########################

diff -ruN package/psmisc.orig/Config.in package/psmisc/Config.in
--- package/psmisc.orig/Config.in       1969-12-31 18:00:00.000000000 -0600
+++ package/psmisc/Config.in    2006-07-22 04:12:26.000000000 -0500
@@ -0,0 +1,29 @@
+config BR2_PACKAGE_PSMISC
+       prompt "Misc /proc utilities"
+       tristate
+       default m if CONFIG_DEVEL
+       help
+       PSmisc package is a set of additional small useful utilities that use
+       the proc filesystem: fuser, killall, pstree, and pidof
+
+       http://psmisc.sourceforge.net/
+
+config BR2_PACKAGE_PSMISC_FUSER
+       prompt "fuser - identify processes using files or sockets"
+       bool
+       default y if CONFIG_DEVEL
+       depends BR2_PACKAGE_PSMISC
+
+config BR2_PACKAGE_PSMISC_KILLALL
+       prompt "killall - kill process by name, pidof - find PIDs by name"
+       bool
+       default y if CONFIG_DEVEL
+       depends BR2_PACKAGE_PSMISC
+
+config BR2_PACKAGE_PSMISC_PSTREE
+       prompt "pstree (requires libncurses) - display a tree of processes"
+       bool
+       default y if CONFIG_DEVEL
+       depends BR2_PACKAGE_PSMISC
+       select BR2_PACKAGE_LIBNCURSES
+       depends BR2_PACKAGE_PSMISC
diff -ruN package/psmisc.orig/ipkg/psmisc.control package/psmisc/ipkg/psmisc.control
--- package/psmisc.orig/ipkg/psmisc.control     1969-12-31 18:00:00.000000000 -0600
+++ package/psmisc/ipkg/psmisc.control  2006-07-22 00:43:17.000000000 -0500
@@ -0,0 +1,3 @@
+Package: psmisc
+Priority: optional
+Section: admin
diff -ruN package/psmisc.orig/ipkg/psmisc.postinst package/psmisc/ipkg/psmisc.postinst
--- package/psmisc.orig/ipkg/psmisc.postinst    1969-12-31 18:00:00.000000000 -0600
+++ package/psmisc/ipkg/psmisc.postinst 2006-07-22 02:06:55.000000000 -0500
@@ -0,0 +1,9 @@
+#!/bin/sh
+
+if [ -f /usr/bin/killall ]
+then
+    echo "Hard linking pidof to killall"
+    ln /usr/bin/killall /bin/pidof
+fi
+
+exit 0
diff -ruN package/psmisc.orig/ipkg/psmisc.postrm package/psmisc/ipkg/psmisc.postrm
--- package/psmisc.orig/ipkg/psmisc.postrm      1969-12-31 18:00:00.000000000 -0600
+++ package/psmisc/ipkg/psmisc.postrm   2006-07-22 01:55:06.000000000 -0500
@@ -0,0 +1,15 @@
+#!/bin/sh
+
+BINS="/sbin/fuser /usr/bin/killall /usr/bin/pstree /bin/pidof"
+echo "Recreating original BusyBox links: "
+
+for bin in $BINS
+do
+    if busybox 2>&1 | grep ${bin##/*/} >/dev/null
+    then
+         echo "$bin "
+         ln -sf /bin/busybox $bin
+    fi
+done
+
+exit 0
diff -ruN package/psmisc.orig/ipkg/psmisc.preinst package/psmisc/ipkg/psmisc.preinst
--- package/psmisc.orig/ipkg/psmisc.preinst     1969-12-31 18:00:00.000000000 -0600
+++ package/psmisc/ipkg/psmisc.preinst  2006-07-21 20:27:06.000000000 -0500
@@ -0,0 +1,24 @@
+#!/bin/sh
+
+echo "Removing symbolic links to BusyBox: "
+for bin in $BUILT
+do
+    if [ -h $bin ]
+    then
+        echo "$bin "
+        rm -f $bin
+    elif [ -e $bin ]
+    then
+        echo -e "$bin exists but is not a symbolic link.\nRe-creating BusyBox links and aborting..."
+        for bin in $BUILT
+        do
+            if busybox 2>&1 | grep ${bin##/*/} >/dev/null && [ ! -e $bin ]
+            then
+                ln -s /bin/busybox $bin
+            fi
+        done
+        exit 1
+    fi
+done
+
+exit 0
diff -ruN package/psmisc.orig/ipkg/psmisc.prerm package/psmisc/ipkg/psmisc.prerm--- package/psmisc.orig/ipkg/psmisc.prerm       1969-12-31 18:00:00.000000000 -0600
+++ package/psmisc/ipkg/psmisc.prerm    2006-07-22 01:02:43.000000000 -0500
@@ -0,0 +1,9 @@
+#!/bin/sh
+
+if [ -f /sbin/pidof ]
+then
+    echo "Removing hard link from pidof to killall"
+    rm -f /sbin/pidof
+fi
+
+exit 0
diff -ruN package/psmisc.orig/Makefile package/psmisc/Makefile
--- package/psmisc.orig/Makefile        1969-12-31 18:00:00.000000000 -0600
+++ package/psmisc/Makefile     2006-07-22 03:39:19.000000000 -0500
@@ -0,0 +1,98 @@
+include $(TOPDIR)/rules.mk
+
+PKG_NAME:=psmisc
+PKG_VERSION:=22.2
+PKG_RELEASE:=1
+PKG_MD5SUM:=77737c817a40ef2c160a7194b5b64337
+
+PKG_SOURCE_URL:=@SF/psmisc
+PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.gz
+PKG_CAT:=zcat
+
+PKG_BUILD_DIR:=$(BUILD_DIR)/$(PKG_NAME)-$(PKG_VERSION)
+PKG_INSTALL_DIR:=$(PKG_BUILD_DIR)/ipkg-install
+
+include $(TOPDIR)/package/rules.mk
+
+$(eval $(call PKG_template,PSMISC,$(PKG_NAME),$(PKG_VERSION)-$(PKG_RELEASE),$(ARCH)))
+
+$(PKG_BUILD_DIR)/.configured: $(PKG_BUILD_DIR)/.prepared
+       (cd $(PKG_BUILD_DIR); \
+               $(TARGET_CONFIGURE_OPTS) \
+               CFLAGS="$(TARGET_CFLAGS)" \
+               CPPFLAGS="-I$(STAGING_DIR)/usr/include -I$(STAGING_DIR)/include" \
+               LDFLAGS="-L$(STAGING_DIR)/usr/lib -L$(STAGING_DIR)/lib" \
+               ./configure \
+                       --target=$(GNU_TARGET_NAME) \
+                       --host=$(GNU_TARGET_NAME) \
+                       --build=$(GNU_HOST_NAME) \
+                       --prefix=$(PKG_INSTALL_DIR) \
+                       --without-libiconv-prefix \
+                       --without-libintl-prefix \
+                       --disable-nls \
+                       --disable-ipv6 \
+                       --disable-largefile\
+       );
+
+       touch $@
+
+APPS:=
+
+ifneq ($(BR2_PACKAGE_PSMISC_FUSER),)
+APPS += /sbin/fuser
+endif
+ifneq ($(BR2_PACKAGE_PSMISC_KILLALL),)
+APPS += /usr/bin/killall /bin/pidof
+endif
+ifneq ($(BR2_PACKAGE_PSMISC_PSTREE),)
+APPS += /usr/bin/pstree
+endif
+
+$(PKG_BUILD_DIR)/.built:
+       rm -rf $(PKG_INSTALL_DIR)
+       mkdir -p $(PKG_INSTALL_DIR)/usr/bin
+       mkdir -p $(PKG_INSTALL_DIR)/sbin
+       mkdir -p $(PKG_INSTALL_DIR)/bin
+       #Note here that we pass cross-compiler as default compiler to use
+       $(MAKE) -C $(PKG_BUILD_DIR) \
+               CC=$(TARGET_CC) \
+               CPPFLAGS="-I$(STAGING_DIR)/usr/include" \
+               LD="$(TARGET_CC)" \
+               LDFLAGS="-L$(STAGING_DIR)/usr/lib" \
+               $(TARGET_CONFIGURE_OPTS) \
+               prefix="$(PKG_INSTALL_DIR)"
+
+       if [ -n "$(BR2_PACKAGE_PSMISC_KILLALL)" ];then $(CP) $(PKG_BUILD_DIR)/src/killall $(PKG_INSTALL_DIR)/usr/bin;fi
+       if [ -n "$(BR2_PACKAGE_PSMISC_FUSER)" ];then $(CP) $(PKG_BUILD_DIR)/src/fuser $(PKG_INSTALL_DIR)/sbin;fi
+       if [ -n "$(BR2_PACKAGE_PSMISC_PSTREE)" ];then $(CP) $(PKG_BUILD_DIR)/src/pstree $(PKG_INSTALL_DIR)/usr/bin;fi
+
+       touch $@
+
+$(IPKG_PSMISC):
+       install -d -m0755 $(IDIR_PSMISC)/usr/bin
+       install -d -m0755 $(IDIR_PSMISC)/sbin
+       install -d -m0755 $(IDIR_PSMISC)/bin
+
+       if [ -n "$(BR2_PACKAGE_PSMISC_KILLALL)" ];then $(CP) $(PKG_INSTALL_DIR)/usr/bin/killall $(IDIR_PSMISC)/usr/bin;fi
+       if [ -n "$(BR2_PACKAGE_PSMISC_FUSER)" ];then $(CP) $(PKG_INSTALL_DIR)/sbin/fuser $(IDIR_PSMISC)/sbin;fi
+       if [ -n "$(BR2_PACKAGE_PSMISC_PSTREE)" ];then $(CP) $(PKG_INSTALL_DIR)/usr/bin/pstree $(IDIR_PSMISC)/usr/bin;fi
+
+       $(RSTRIP) $(IDIR_PSMISC)
+
+       # Insert BUILT variable into preinst script
+       grep -v -e ^BUILT -e /bin/sh $(PKG_INSTALL_DIR)/../ipkg/$(PKG_NAME)/CONTROL/preinst > $(PKG_INSTALL_DIR)/../ipkg/$(PKG_NAME)/CONTROL/preinst.tmp
+       rm $(PKG_INSTALL_DIR)/../ipkg/$(PKG_NAME)/CONTROL/preinst
+       echo -e "#!/bin/sh\nBUILT='$(APPS)'\n" > $(PKG_INSTALL_DIR)/../ipkg/$(PKG_NAME)/CONTROL/preinst
+       cat $(PKG_INSTALL_DIR)/../ipkg/$(PKG_NAME)/CONTROL/preinst.tmp >> $(PKG_INSTALL_DIR)/../ipkg/$(PKG_NAME)/CONTROL/preinst
+       rm $(PKG_INSTALL_DIR)/../ipkg/$(PKG_NAME)/CONTROL/preinst.tmp
+
+       if [ -n "$(BR2_PACKAGE_PSMISC_PSTREE)" ] || \
+               [ -n "$(BR2_PACKAGE_PSMISC_PSTREE)" ]; then\
+       echo "Depends: libncurses" >> $(PKG_INSTALL_DIR)/../ipkg/$(PKG_NAME)/CONTROL/control; fi
+       echo "Description: Extra /proc utils: $(notdir $(APPS))" >>  \$(PKG_INSTALL_DIR)/../ipkg/$(PKG_NAME)/CONTROL/control
+
+       $(IPKG_BUILD) $(IDIR_PSMISC) $(PACKAGE_DIR)
+
+mostlyclean:
+       make -C $(PKG_BUILD_DIR) clean
+       rm $(PKG_BUILD_DIR)/.built

Attachments (2)

procps-3.2.7-1.patch (12.6 KB) - added by leo <mleina1@…> 10 years ago.
psmisc-22.2-1.patch (7.1 KB) - added by leo <mleina1@…> 10 years ago.

Download all attachments as: .zip

Change History (9)

comment:1 Changed 10 years ago by leo <mleina1@…>

Made against Whiterussian branch rev 4202.

Changed 10 years ago by leo <mleina1@…>

Changed 10 years ago by leo <mleina1@…>

comment:2 Changed 10 years ago by leo <mleina1@…>

Oops... found the attach button. sorry.

comment:3 Changed 10 years ago by florian

  • Milestone changed from 1.0-rc6 to 2.0

Whiterussian is currently feature freeze for the moment.

comment:4 Changed 10 years ago by mbm

  • Milestone changed from Kamikaze to 0.9/rc6

This belongs under whiterussian, not kamikaze.

comment:5 Changed 10 years ago by florian

  • Owner changed from developers to florian
  • Status changed from new to assigned

Fixed in [4744] and [4745]

comment:6 Changed 10 years ago by florian

  • Resolution set to fixed
  • Status changed from assigned to closed

Fixed in [4744] and [4745]

comment:7 Changed 7 years ago by moo <moo.tinys@…>

can someone port psmisc to new buildroot?

Add Comment

Modify Ticket

Action
as closed .
The resolution will be deleted. Next status will be 'reopened'.
Author


E-mail address and user name can be saved in the Preferences.

 
Note: See TracTickets for help on using tickets.