Skip to contentSkip to conversation

atop: add recipe

PATCH New [email protected] 1 participant 1 message Jan 26, 2016

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 atop: add recipe

From: Kai Kang <[email protected]>

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

---
 .../atop/atop/fix-permissions.patch                | 52 ++++++++++++++++++
 .../atop/atop/remove-bashisms.patch                | 33 ++++++++++++
 .../atop/atop/sysvinit-implement-status.patch      | 27 ++++++++++
 .../recipes-support/atop/atop/volatiles.99_atop    |  1 +
 .../recipes-support/atop/atop/volatiles.atop.conf  |  1 +
 meta-oe/recipes-support/atop/atop_2.2.3.bb         | 62 ++++++++++++++++++++++
 6 files changed, 176 insertions(+)
 create mode 100644 meta-oe/recipes-support/atop/atop/fix-permissions.patch
 create mode 100644 meta-oe/recipes-support/atop/atop/remove-bashisms.patch
 create mode 100644 meta-oe/recipes-support/atop/atop/sysvinit-implement-status.patch
 create mode 100644 meta-oe/recipes-support/atop/atop/volatiles.99_atop
 create mode 100644 meta-oe/recipes-support/atop/atop/volatiles.atop.conf
 create mode 100644 meta-oe/recipes-support/atop/atop_2.2.3.bb
meta-oe/recipes-support/atop/atop/fix-permissions.patch new file +52 -0
new file mode 100644
index 0000000..ee74199
@@ -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 <[email protected]>
+---
+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)
meta-oe/recipes-support/atop/atop/remove-bashisms.patch new file +33 -0
new file mode 100644
index 0000000..f1fcbfe
@@ -0,0 +1,33 @@
+Upstream-Status: Inappropriate [embedded specific]
+
+Signed-off-by: Kai Kang <[email protected]>
+---
+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
meta-oe/recipes-support/atop/atop/sysvinit-implement-status.patch new file +27 -0
new file mode 100644
index 0000000..5994d3e
@@ -0,0 +1,27 @@
+Implement the sub-command status.
+
+Upstream-Status: Pending
+
+Signed-off-by: Kai Kang <[email protected]>
+---
+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)
meta-oe/recipes-support/atop/atop/volatiles.99_atop new file +1 -0
new file mode 100644
index 0000000..24ea3f2
@@ -0,0 +1 @@
+d root root 0755 /var/volatile/log/atop none
meta-oe/recipes-support/atop/atop/volatiles.atop.conf new file +1 -0
new file mode 100644
index 0000000..2f23000
@@ -0,0 +1 @@
+d               /var/volatile/log/atop               -       -       -       -
meta-oe/recipes-support/atop/atop_2.2.3.bb new file +62 -0

62 lines not on this page · raw message

Signature · 1 line
2.6.1