aboutsummaryrefslogtreecommitdiffstats
path: root/meta-webserver/recipes-webadmin/ajenti/ajenti/0002-plugins-hddstat-fix-disk-usage-check-to-work-with-bu.patch
diff options
context:
space:
mode:
authorPaul Eggleton <paul.eggleton@linux.intel.com>2013-02-11 10:16:25 +0000
committerPaul Eggleton <paul.eggleton@linux.intel.com>2013-02-18 09:28:26 +0000
commitdbb905c9786eb4686ebc85d8e5aad1f481591448 (patch)
tree0e307d630757b37955d278bf9c60db865c994b31 /meta-webserver/recipes-webadmin/ajenti/ajenti/0002-plugins-hddstat-fix-disk-usage-check-to-work-with-bu.patch
parentcc00595f68cb8f9530b9f2a723e757e18192ab9f (diff)
downloadmeta-openembedded-dbb905c9786eb4686ebc85d8e5aad1f481591448.tar.gz
ajenti: add new recipe
Add new recipe for the Ajenti web administration interface. This was developed and tested with assistance from Kevin Strasser <kevin.strasser@linux.intel.com> Signed-off-by: Paul Eggleton <paul.eggleton@linux.intel.com>
Diffstat (limited to 'meta-webserver/recipes-webadmin/ajenti/ajenti/0002-plugins-hddstat-fix-disk-usage-check-to-work-with-bu.patch')
-rw-r--r--meta-webserver/recipes-webadmin/ajenti/ajenti/0002-plugins-hddstat-fix-disk-usage-check-to-work-with-bu.patch29
1 files changed, 29 insertions, 0 deletions
diff --git a/meta-webserver/recipes-webadmin/ajenti/ajenti/0002-plugins-hddstat-fix-disk-usage-check-to-work-with-bu.patch b/meta-webserver/recipes-webadmin/ajenti/ajenti/0002-plugins-hddstat-fix-disk-usage-check-to-work-with-bu.patch
new file mode 100644
index 0000000000..48c255dbb1
--- /dev/null
+++ b/meta-webserver/recipes-webadmin/ajenti/ajenti/0002-plugins-hddstat-fix-disk-usage-check-to-work-with-bu.patch
@@ -0,0 +1,29 @@
+From cde811cfffba48c148b60fb1083fe8fd409b8b24 Mon Sep 17 00:00:00 2001
+From: Paul Eggleton <paul.eggleton@linux.intel.com>
+Date: Tue, 13 Mar 2012 01:52:34 +0000
+Subject: [PATCH 1/2] plugins/hddstat: fix disk usage check to work with
+ busybox
+
+busybox df does not have --total, so fake it using awk.
+
+Signed-off-by: Paul Eggleton <paul.eggleton@linux.intel.com>
+---
+ plugins/hddstat/usage.py | 2 +-
+ 1 files changed, 1 insertions(+), 1 deletions(-)
+
+diff --git a/plugins/hddstat/usage.py b/plugins/hddstat/usage.py
+index 3c84181..cf5f037 100644
+--- a/plugins/hddstat/usage.py
++++ b/plugins/hddstat/usage.py
+@@ -7,7 +7,7 @@ class DiskUsageMeter(LinearMeter):
+ transform = 'percent'
+
+ def get_usage(self):
+- u = int(shell('df --total | grep total').split().pop().strip('%'))
++ u = int(round(float(shell("df -P | awk 'NR > 1 {total+=$3+$4 ; used+=$3} END { print used/total*100}'").strip())))
+ return u
+
+ def get_value(self):
+--
+1.7.4.4
+