diff options
author | Kai Kang <kai.kang@windriver.com> | 2016-01-26 14:16:36 +0800 |
---|---|---|
committer | Martin Jansa <Martin.Jansa@gmail.com> | 2016-02-01 15:58:06 +0100 |
commit | 05960f3299f18f394bdf829e52b1b5c0c5ebbe5f (patch) | |
tree | 92ea81021895e93c2445c1ac9bde79e5dac30a36 /meta-oe/recipes-support/atop/atop | |
parent | 668468d59ce1553c60d729d6f37ddda517b2997f (diff) | |
download | meta-openembedded-contrib-05960f3299f18f394bdf829e52b1b5c0c5ebbe5f.tar.gz |
atop: add recipe
Add recipe for atop.
* remove bashisms for scripts
* fix permissions for executable files
* create volatile directory /var/volatile/log/atop
* implement status command in sysvinit script
* drop atopacctd which is excluded from most distribution such as Ubuntu
and Fedora
Signed-off-by: Kai Kang <kai.kang@windriver.com>
Signed-off-by: Martin Jansa <Martin.Jansa@gmail.com>
Diffstat (limited to 'meta-oe/recipes-support/atop/atop')
5 files changed, 114 insertions, 0 deletions
diff --git a/meta-oe/recipes-support/atop/atop/fix-permissions.patch b/meta-oe/recipes-support/atop/atop/fix-permissions.patch new file mode 100644 index 0000000000..ee74199939 --- /dev/null +++ b/meta-oe/recipes-support/atop/atop/fix-permissions.patch @@ -0,0 +1,52 @@ +Update permissions of executable files that remove setuid bit and make everyone +could read. + +Upstream-Status: Inappropriate [embedded specific] + +Signed-off-by: Kai Kang <kai.kang@windriver.com> +--- +diff --git a/Makefile b/Makefile +index a65b9b6..21d9828 100644 +--- a/Makefile ++++ b/Makefile +@@ -66,7 +66,7 @@ systemdinstall: genericinstall + chmod 0644 $(DESTDIR)$(SYSDPATH)/atopacct.service + cp atop.cronsystemd $(DESTDIR)$(CRNPATH)/atop + cp atop-pm.sh $(DESTDIR)$(PMPATHD) +- chmod 0711 $(DESTDIR)$(PMPATHD)/atop-pm.sh ++ chmod 0755 $(DESTDIR)$(PMPATHD)/atop-pm.sh + # + # only when making on target system: + # +@@ -91,11 +91,11 @@ sysvinstall: genericinstall + # + if [ -d $(DESTDIR)$(PMPATH1) ]; \ + then cp 45atoppm $(DESTDIR)$(PMPATH1); \ +- chmod 0711 $(DESTDIR)$(PMPATH1)/45atoppm; \ ++ chmod 0755 $(DESTDIR)$(PMPATH1)/45atoppm; \ + fi + if [ -d $(DESTDIR)$(PMPATH2) ]; \ + then cp 45atoppm $(DESTDIR)$(PMPATH2); \ +- chmod 0711 $(DESTDIR)$(PMPATH2)/45atoppm; \ ++ chmod 0755 $(DESTDIR)$(PMPATH2)/45atoppm; \ + fi + # + # +@@ -139,7 +139,7 @@ genericinstall: atop atopacctd + # + cp atop $(DESTDIR)$(BINPATH)/atop + chown root $(DESTDIR)$(BINPATH)/atop +- chmod 04711 $(DESTDIR)$(BINPATH)/atop ++ chmod 0755 $(DESTDIR)$(BINPATH)/atop + ln -sf atop $(DESTDIR)$(BINPATH)/atopsar + cp atopacctd $(DESTDIR)$(SBINPATH)/atopacctd + chown root $(DESTDIR)$(SBINPATH)/atopacctd +@@ -147,7 +147,7 @@ genericinstall: atop atopacctd + cp atop $(DESTDIR)$(BINPATH)/atop-$(VERS) + ln -sf atop-$(VERS) $(DESTDIR)$(BINPATH)/atopsar-$(VERS) + cp atop.daily $(DESTDIR)$(SCRPATH) +- chmod 0711 $(DESTDIR)$(SCRPATH)/atop.daily ++ chmod 0755 $(DESTDIR)$(SCRPATH)/atop.daily + cp man/atop.1 $(DESTDIR)$(MAN1PATH) + cp man/atopsar.1 $(DESTDIR)$(MAN1PATH) + cp man/atoprc.5 $(DESTDIR)$(MAN5PATH) diff --git a/meta-oe/recipes-support/atop/atop/remove-bashisms.patch b/meta-oe/recipes-support/atop/atop/remove-bashisms.patch new file mode 100644 index 0000000000..f1fcbfed76 --- /dev/null +++ b/meta-oe/recipes-support/atop/atop/remove-bashisms.patch @@ -0,0 +1,33 @@ +Upstream-Status: Inappropriate [embedded specific] + +Signed-off-by: Kai Kang <kai.kang@windriver.com> +--- +diff --git a/atop-pm.sh b/atop-pm.sh +index 7f41a86..3ff4ab5 100755 +--- a/atop-pm.sh ++++ b/atop-pm.sh +@@ -1,4 +1,4 @@ +-#!/bin/bash ++#!/bin/sh + + case "$1" in + pre) /usr/bin/systemctl stop atop +diff --git a/atop.daily b/atop.daily +index 24d33bd..f29bd94 100755 +--- a/atop.daily ++++ b/atop.daily +@@ -1,4 +1,4 @@ +-#!/bin/bash ++#!/bin/sh + + CURDAY=`date +%Y%m%d` + LOGPATH=/var/log/atop +@@ -16,7 +16,7 @@ then + + while ps -p `cat $PIDFILE` > /dev/null + do +- let CNT+=1 ++ CNT=$((CNT+1)) + + if [ $CNT -gt 5 ] + then diff --git a/meta-oe/recipes-support/atop/atop/sysvinit-implement-status.patch b/meta-oe/recipes-support/atop/atop/sysvinit-implement-status.patch new file mode 100644 index 0000000000..5994d3e08e --- /dev/null +++ b/meta-oe/recipes-support/atop/atop/sysvinit-implement-status.patch @@ -0,0 +1,27 @@ +Implement the sub-command status. + +Upstream-Status: Pending + +Signed-off-by: Kai Kang <kai.kang@windriver.com> +--- +diff --git a/atop.init b/atop.init +index 108bdc5..9f89fad 100755 +--- a/atop.init ++++ b/atop.init +@@ -18,6 +18,8 @@ + # Check existance of binaries + [ -f /usr/bin/atop ] || exit 0 + ++[ -f /etc/init.d/functions ] && . /etc/init.d/functions ++ + PIDFILE=/var/run/atop.pid + RETVAL=0 + +@@ -63,6 +65,7 @@ case "$1" in + ;; + + status) ++ status atop + ;; + + reload) diff --git a/meta-oe/recipes-support/atop/atop/volatiles.99_atop b/meta-oe/recipes-support/atop/atop/volatiles.99_atop new file mode 100644 index 0000000000..24ea3f2054 --- /dev/null +++ b/meta-oe/recipes-support/atop/atop/volatiles.99_atop @@ -0,0 +1 @@ +d root root 0755 /var/volatile/log/atop none diff --git a/meta-oe/recipes-support/atop/atop/volatiles.atop.conf b/meta-oe/recipes-support/atop/atop/volatiles.atop.conf new file mode 100644 index 0000000000..2f230004d5 --- /dev/null +++ b/meta-oe/recipes-support/atop/atop/volatiles.atop.conf @@ -0,0 +1 @@ +d /var/volatile/log/atop - - - - |