Ticket #649: procps-3.2.7-1.patch

File procps-3.2.7-1.patch, 12.6 KB (added by leo <mleina1@…>, 12 years ago)
  • Config.in

    diff -ruN package/psmisc.orig/Config.in package/procps/Config.in
    old new  
     1config BR2_PACKAGE_PROCPS 
     2        prompt "Basic /proc utilities" 
     3        tristate 
     4        default m if CONFIG_DEVEL 
     5        help 
     6        procps is a package that has many small useful utilities that  
     7        give information about processes using the /proc filesystem. The  
     8        package includes the programs ps, vmstat, top, w, kill, free, slabtop,  
     9        skill, and others. 
     10 
     11        Note that versions of many of these programs are included in BusyBox. 
     12        This package will replace many of them. 
     13 
     14        http://procps.sourceforge.net/ 
     15 
     16config BR2_PACKAGE_PROCPS_PS 
     17        prompt "ps - report a snapshot of the current processes." 
     18        bool 
     19        default y if CONFIG_DEVEL 
     20        depends BR2_PACKAGE_PROCPS 
     21 
     22config BR2_PACKAGE_PROCPS_VMSTAT 
     23        prompt "vmstat - Report virtual memory statistics" 
     24        bool 
     25        default y if CONFIG_DEVEL 
     26        depends BR2_PACKAGE_PROCPS 
     27 
     28config BR2_PACKAGE_PROCPS_TOP 
     29        prompt "top (requires libncurses) - display Linux tasks" 
     30        bool 
     31        default y if CONFIG_DEVEL 
     32        depends BR2_PACKAGE_PROCPS 
     33        select BR2_PACKAGE_LIBNCURSES 
     34        depends BR2_PACKAGE_LIBNCURSES 
     35 
     36config BR2_PACKAGE_PROCPS_SLABTOP 
     37        prompt "slabtop (requires libncurses) - display kernel slab cache info" 
     38        bool 
     39        default y if CONFIG_DEVEL 
     40        depends BR2_PACKAGE_PROCPS 
     41        depends BR2_PACKAGE_LIBNCURSES 
     42        select BR2_PACKAGE_LIBNCURSES 
     43 
     44config BR2_PACKAGE_PROCPS_PMAP 
     45        prompt "pmap - report memory map of a process" 
     46        bool 
     47        default y if CONFIG_DEVEL 
     48        depends BR2_PACKAGE_PROCPS 
     49 
     50config BR2_PACKAGE_PROCPS_PWDX 
     51        prompt "pwdx - report current working directory of a process" 
     52        bool 
     53        default y if CONFIG_DEVEL 
     54        depends BR2_PACKAGE_PROCPS 
     55 
     56config BR2_PACKAGE_PROCPS_W 
     57        prompt "w - Show who is logged on and what they are doing" 
     58        bool 
     59        default y if CONFIG_DEVEL 
     60        depends BR2_PACKAGE_PROCPS 
     61 
     62config BR2_PACKAGE_PROCPS_KILL 
     63        prompt "kill - terminate a process" 
     64        bool 
     65        default y if CONFIG_DEVEL 
     66        depends BR2_PACKAGE_PROCPS 
     67 
     68config BR2_PACKAGE_PROCPS_SKILL 
     69        prompt "skill, snice - send a signal or report process status" 
     70        bool 
     71        default y if CONFIG_DEVEL 
     72        depends BR2_PACKAGE_PROCPS 
     73 
     74config BR2_PACKAGE_PROCPS_PGREP 
     75        prompt "pgrep, pkill - lookup or signal processes based on name or other attributes" 
     76        bool 
     77        default y if CONFIG_DEVEL 
     78        depends BR2_PACKAGE_PROCPS 
     79 
     80config BR2_PACKAGE_PROCPS_FREE 
     81        prompt "free - display system memory information" 
     82        bool 
     83        default y if CONFIG_DEVEL 
     84        depends BR2_PACKAGE_PROCPS 
     85 
     86config BR2_PACKAGE_PROCPS_SYSCTL 
     87        prompt "sysctl - configure kernel parameters at runtime" 
     88        bool 
     89        default y if CONFIG_DEVEL 
     90        depends BR2_PACKAGE_PROCPS 
     91 
     92config BR2_PACKAGE_PROCPS_TLOAD 
     93        prompt "tload - graphic representation of system load average" 
     94        bool 
     95        default y if CONFIG_DEVEL 
     96        depends BR2_PACKAGE_PROCPS 
     97 
     98config BR2_PACKAGE_PROCPS_WATCH 
     99        prompt "watch - execute a program periodically with fullscreen output" 
     100        bool 
     101        default y if CONFIG_DEVEL 
     102        depends BR2_PACKAGE_PROCPS 
  • ipkg/procps.control

    diff -ruN package/psmisc.orig/ipkg/procps.control package/procps/ipkg/procps.control
    old new  
     1Package: procps 
     2Priority: optional 
     3Section: admin 
  • ipkg/procps.postinst

    diff -ruN package/psmisc.orig/ipkg/procps.postinst package/procps/ipkg/procps.postinst
    old new  
     1#!/bin/sh 
     2 
     3if [ -f /usr/bin/skill ] 
     4then 
     5    echo "Hard linking snice to skill" 
     6    ln /usr/bin/skill /usr/bin/snice 
     7fi 
     8 
     9if [ -f /usr/bin/pgrep ] 
     10then 
     11    echo "Hard linking pkill to pgrep" 
     12    ln /usr/bin/pgrep /usr/bin/snice 
     13fi 
     14 
     15exit 0 
  • ipkg/procps.postrm

    diff -ruN package/psmisc.orig/ipkg/procps.postrm package/procps/ipkg/procps.postrm
    old new  
     1#!/bin/sh 
     2 
     3BINS="/usr/bin/free /bin/kill /usr/bin/pgrep /usr/bin/pkill /usr/bin/pmap \ 
     4/usr/bin/skill /usr/bin/pwdx /usr/bin/slabtop /usr/bin/snice /sbin/sysctl \ 
     5/usr/bin/tload /usr/bin/top /usr/bin/uptime /usr/bin/vmstat /usr/bin/w \ 
     6/usr/bin/watch /bin/ps" 
     7 
     8echo "Recreating original BusyBox links: " 
     9 
     10for bin in $BINS 
     11do 
     12    if busybox 2>&1 | grep ${bin##/*/} >/dev/null 
     13    then 
     14         echo "$bin " 
     15         ln -sf /bin/busybox $bin 
     16    fi 
     17done 
     18 
     19exit 0 
  • ipkg/procps.preinst

    diff -ruN package/psmisc.orig/ipkg/procps.preinst package/procps/ipkg/procps.preinst
    old new  
     1#!/bin/sh 
     2 
     3echo "Removing symbolic links to BusyBox: " 
     4for bin in $BUILT 
     5do 
     6    if [ -h $bin ] 
     7    then 
     8        echo "$bin " 
     9        rm -f $bin 
     10    elif [ -e $bin ] 
     11    then 
     12        echo -e "$bin exists but is not a symbolic link.\nRe-creating BusyBox links and aborting..." 
     13        for bin in $BUILT 
     14        do 
     15            if busybox 2>&1 | grep ${bin##/*/} >/dev/null && [ ! -e $bin ] 
     16            then 
     17                ln -s /bin/busybox $bin 
     18            fi 
     19        done 
     20        exit 1 
     21    fi 
     22done 
     23 
     24exit 0 
  • ipkg/procps.prerm

    diff -ruN package/psmisc.orig/ipkg/procps.prerm package/procps/ipkg/procps.prerm
    old new  
     1#!/bin/sh 
     2 
     3if [ -f /usr/bin/pkill ] 
     4then 
     5    echo "Removing hard link from pkill to pgrep" 
     6    rm -f /usr/bin/pkill 
     7fi 
     8 
     9if [ -f /usr/bin/snice ] 
     10then 
     11    echo "Removing hard link from snice to skill" 
     12    rm -f /usr/bin/skill 
     13fi 
     14 
     15exit 0 
  • Makefile

    diff -ruN package/psmisc.orig/Makefile package/procps/Makefile
    old new  
     1include $(TOPDIR)/rules.mk 
     2 
     3PKG_NAME:=procps 
     4PKG_VERSION:=3.2.7 
     5PKG_RELEASE:=1 
     6PKG_MD5SUM:=f490bca772b16472962c7b9f23b1e97d 
     7 
     8PKG_SOURCE_URL:=http://procps.sourceforge.net/ 
     9PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.gz 
     10PKG_CAT:=zcat 
     11 
     12PKG_BUILD_DIR:=$(BUILD_DIR)/$(PKG_NAME)-$(PKG_VERSION) 
     13PKG_INSTALL_DIR:=$(PKG_BUILD_DIR)/ipkg-install 
     14 
     15include $(TOPDIR)/package/rules.mk 
     16 
     17$(eval $(call PKG_template,PROCPS,$(PKG_NAME),$(PKG_VERSION)-$(PKG_RELEASE),$(ARCH))) 
     18 
     19$(PKG_BUILD_DIR)/.configured: $(PKG_BUILD_DIR)/.prepared 
     20        touch $@ 
     21 
     22APPS:= 
     23 
     24ifneq ($(BR2_PACKAGE_PROCPS_PS),) 
     25APPS += /bin/ps 
     26endif 
     27ifneq ($(BR2_PACKAGE_PROCPS_VMSTAT),) 
     28APPS += /usr/bin/vmstat 
     29endif 
     30ifneq ($(BR2_PACKAGE_PROCPS_TOP),) 
     31APPS += /usr/bin/top 
     32endif 
     33ifneq ($(BR2_PACKAGE_PROCPS_SLABTOP),) 
     34APPS += /usr/bin/slabtop 
     35endif 
     36ifneq ($(BR2_PACKAGE_PROCPS_PMAP),) 
     37APPS += /usr/bin/pmap 
     38endif 
     39ifneq ($(BR2_PACKAGE_PROCPS_PWDX),) 
     40APPS += /usr/bin/pwdx 
     41endif 
     42ifneq ($(BR2_PACKAGE_PROCPS_W),) 
     43APPS += /usr/bin/w 
     44endif 
     45ifneq ($(BR2_PACKAGE_PROCPS_KILL),) 
     46APPS += /bin/kill 
     47endif 
     48ifneq ($(BR2_PACKAGE_PROCPS_SKILL),) 
     49APPS += /usr/bin/skill 
     50endif 
     51ifneq ($(BR2_PACKAGE_PROCPS_PKILL),) 
     52APPS += /usr/bin/pkill 
     53endif 
     54ifneq ($(BR2_PACKAGE_PROCPS_FREE),) 
     55APPS += /usr/bin/free 
     56endif 
     57ifneq ($(BR2_PACKAGE_PROCPS_SNICE),) 
     58APPS += /usr/bin/snice 
     59endif 
     60ifneq ($(BR2_PACKAGE_PROCPS_SYSCTL),) 
     61APPS += /sbin/sysctl 
     62endif 
     63ifneq ($(BR2_PACKAGE_PROCPS_TLOAD),) 
     64APPS += /usr/bin/tload 
     65endif 
     66ifneq ($(BR2_PACKAGE_PROCPS_WATCH),) 
     67APPS += /usr/bin/watch 
     68endif 
     69ifneq ($(BR2_PACKAGE_PROCPS_PGREP),) 
     70APPS += /usr/bin/pgrep 
     71endif 
     72 
     73$(PKG_BUILD_DIR)/.built: 
     74        rm -rf $(PKG_INSTALL_DIR) 
     75        mkdir -p $(PKG_INSTALL_DIR)/usr/bin 
     76        mkdir -p $(PKG_INSTALL_DIR)/bin 
     77        mkdir -p $(PKG_INSTALL_DIR)/lib 
     78        mkdir -p $(PKG_INSTALL_DIR)/sbin 
     79        #Note here that we pass cross-compiler as default compiler to use 
     80        $(MAKE) -C $(PKG_BUILD_DIR) \ 
     81                CC=$(TARGET_CC) \ 
     82                CPPFLAGS="-I$(STAGING_DIR)/usr/include" \ 
     83                LD="$(TARGET_CC)" \ 
     84                LDFLAGS="-L$(STAGING_DIR)/usr/lib" \ 
     85                $(TARGET_CONFIGURE_OPTS) \ 
     86                prefix="$(PKG_INSTALL_DIR)/" \ 
     87                ps/ps $(notdir $(APPS)) 
     88 
     89        if [ -n "$(BR2_PACKAGE_PROCPS_PS)" ];then $(CP) $(PKG_BUILD_DIR)/ps/ps $(PKG_INSTALL_DIR)/bin/; fi 
     90        if [ -n "$(BR2_PACKAGE_PROCPS_VMSTAT)" ];then $(CP) $(PKG_BUILD_DIR)/vmstat $(PKG_INSTALL_DIR)/usr/bin; fi 
     91        if [ -n "$(BR2_PACKAGE_PROCPS_TOP)" ];then $(CP) $(PKG_BUILD_DIR)/top $(PKG_INSTALL_DIR)/usr/bin;fi 
     92        if [ -n "$(BR2_PACKAGE_PROCPS_SLABTOP)" ];then $(CP) $(PKG_BUILD_DIR)/slabtop $(PKG_INSTALL_DIR)/usr/bin;fi 
     93        if [ -n "$(BR2_PACKAGE_PROCPS_PMAP)" ];then $(CP) $(PKG_BUILD_DIR)/pmap $(PKG_INSTALL_DIR)/usr/bin;fi 
     94        if [ -n "$(BR2_PACKAGE_PROCPS_PWDX)" ];then $(CP) $(PKG_BUILD_DIR)/pwdx $(PKG_INSTALL_DIR)/usr/bin;fi 
     95        if [ -n "$(BR2_PACKAGE_PROCPS_W)" ];then $(CP) $(PKG_BUILD_DIR)/w $(PKG_INSTALL_DIR)/usr/bin;fi 
     96        if [ -n "$(BR2_PACKAGE_PROCPS_KILL)" ];then $(CP) $(PKG_BUILD_DIR)/kill $(PKG_INSTALL_DIR)/bin;fi 
     97        if [ -n "$(BR2_PACKAGE_PROCPS_SKILL)" ];then $(CP) $(PKG_BUILD_DIR)/skill $(PKG_INSTALL_DIR)/usr/bin;fi 
     98        if [ -n "$(BR2_PACKAGE_PROCPS_FREE)" ];then $(CP) $(PKG_BUILD_DIR)/free $(PKG_INSTALL_DIR)/usr/bin;fi 
     99        if [ -n "$(BR2_PACKAGE_PROCPS_SYSCTL)" ];then $(CP) $(PKG_BUILD_DIR)/sysctl $(PKG_INSTALL_DIR)/sbin;fi 
     100        if [ -n "$(BR2_PACKAGE_PROCPS_TLOAD)" ];then $(CP) $(PKG_BUILD_DIR)/tload $(PKG_INSTALL_DIR)/usr/bin;fi 
     101        if [ -n "$(BR2_PACKAGE_PROCPS_WATCH)" ];then $(CP) $(PKG_BUILD_DIR)/watch $(PKG_INSTALL_DIR)/usr/bin;fi 
     102        if [ -n "$(BR2_PACKAGE_PROCPS_PGREP)" ];then $(CP) $(PKG_BUILD_DIR)/pgrep $(PKG_INSTALL_DIR)/usr/bin;fi 
     103 
     104        $(CP) $(PKG_BUILD_DIR)/proc/libproc-$(PKG_VERSION).so $(PKG_INSTALL_DIR)/lib 
     105 
     106        touch $@ 
     107 
     108$(IPKG_PROCPS): 
     109        install -d -m0755 $(IDIR_PROCPS)/usr/bin 
     110        install -d -m0755 $(IDIR_PROCPS)/bin 
     111        install -d -m0755 $(IDIR_PROCPS)/sbin 
     112        install -d -m0755 $(IDIR_PROCPS)/lib 
     113         
     114        if [ -n "$(BR2_PACKAGE_PROCPS_PS)" ];then $(CP) $(PKG_INSTALL_DIR)/bin/ps $(IDIR_PROCPS)/bin/;fi 
     115        if [ -n "$(BR2_PACKAGE_PROCPS_VMSTAT)" ];then $(CP) $(PKG_INSTALL_DIR)/usr/bin/vmstat $(IDIR_PROCPS)/usr/bin;fi 
     116        if [ -n "$(BR2_PACKAGE_PROCPS_TOP)" ];then $(CP) $(PKG_INSTALL_DIR)/usr/bin/top $(IDIR_PROCPS)/usr/bin;fi 
     117        if [ -n "$(BR2_PACKAGE_PROCPS_SLABTOP)" ];then $(CP) $(PKG_INSTALL_DIR)/usr/bin/slabtop $(IDIR_PROCPS)/usr/bin;fi 
     118        if [ -n "$(BR2_PACKAGE_PROCPS_PMAP)" ];then $(CP) $(PKG_INSTALL_DIR)/usr/bin/pmap $(IDIR_PROCPS)/usr/bin;fi 
     119        if [ -n "$(BR2_PACKAGE_PROCPS_PWDX)" ];then $(CP) $(PKG_INSTALL_DIR)/usr/bin/pwdx $(IDIR_PROCPS)/usr/bin;fi 
     120        if [ -n "$(BR2_PACKAGE_PROCPS_W)" ];then $(CP) $(PKG_INSTALL_DIR)/usr/bin/w $(IDIR_PROCPS)/usr/bin;fi 
     121        if [ -n "$(BR2_PACKAGE_PROCPS_KILL)" ];then $(CP) $(PKG_INSTALL_DIR)/bin/kill $(IDIR_PROCPS)/bin;fi 
     122        if [ -n "$(BR2_PACKAGE_PROCPS_SKILL)" ];then $(CP) $(PKG_INSTALL_DIR)/usr/bin/skill $(IDIR_PROCPS)/usr/bin;fi 
     123        if [ -n "$(BR2_PACKAGE_PROCPS_FREE)" ];then $(CP) $(PKG_INSTALL_DIR)/usr/bin/free $(IDIR_PROCPS)/usr/bin;fi 
     124        if [ -n "$(BR2_PACKAGE_PROCPS_SYSCTL)" ];then $(CP) $(PKG_INSTALL_DIR)/sbin/sysctl $(IDIR_PROCPS)/sbin;fi 
     125        if [ -n "$(BR2_PACKAGE_PROCPS_TLOAD)" ];then $(CP) $(PKG_INSTALL_DIR)/usr/bin/tload $(IDIR_PROCPS)/usr/bin;fi 
     126        if [ -n "$(BR2_PACKAGE_PROCPS_WATCH)" ];then $(CP) $(PKG_INSTALL_DIR)/usr/bin/watch $(IDIR_PROCPS)/usr/bin;fi 
     127        if [ -n "$(BR2_PACKAGE_PROCPS_PGREP)" ];then $(CP) $(PKG_INSTALL_DIR)/usr/bin/pgrep $(IDIR_PROCPS)/usr/bin;fi 
     128         
     129        $(CP) $(PKG_INSTALL_DIR)/lib/libproc-$(PKG_VERSION).so $(IDIR_PROCPS)/lib 
     130        $(RSTRIP) $(IDIR_PROCPS) 
     131         
     132        # Insert BUILT variable into preinst script 
     133        grep -v -e ^BUILT -e /bin/sh $(PKG_INSTALL_DIR)/../ipkg/$(PKG_NAME)/CONTROL/preinst > $(PKG_INSTALL_DIR)/../ipkg/$(PKG_NAME)/CONTROL/preinst.tmp 
     134        rm $(PKG_INSTALL_DIR)/../ipkg/$(PKG_NAME)/CONTROL/preinst 
     135        echo -e "#!/bin/sh\nBUILT='$(APPS)'\n" > $(PKG_INSTALL_DIR)/../ipkg/$(PKG_NAME)/CONTROL/preinst 
     136        cat $(PKG_INSTALL_DIR)/../ipkg/$(PKG_NAME)/CONTROL/preinst.tmp >> $(PKG_INSTALL_DIR)/../ipkg/$(PKG_NAME)/CONTROL/preinst 
     137        rm $(PKG_INSTALL_DIR)/../ipkg/$(PKG_NAME)/CONTROL/preinst.tmp 
     138 
     139        # Insert ncurses dependancy if top or slabtop was selected 
     140        if [ -n "$(BR2_PACKAGE_PROCPS_TOP)" ] || \ 
     141                [ -n "$(BR2_PACKAGE_PROCPS_SLABTOP)" ]; then\ 
     142        echo "Depends: libncurses" >> $(PKG_INSTALL_DIR)/../ipkg/$(PKG_NAME)/CONTROL/control; fi 
     143 
     144        # Insert built apps to ipkg description 
     145        echo "Description: /proc utilities: $(notdir $(APPS))" >>  $(PKG_INSTALL_DIR)/../ipkg/$(PKG_NAME)/CONTROL/control 
     146 
     147        $(IPKG_BUILD) $(IDIR_PROCPS) $(PACKAGE_DIR) 
     148 
     149mostlyclean: 
     150        make -C $(PKG_BUILD_DIR) clean 
     151        rm $(PKG_BUILD_DIR)/.built