From 1977765d5f358c44fea21990fc0ac93c82ad8dd5 Mon Sep 17 00:00:00 2001 From: zezinho42 Date: Tue, 6 Dec 2016 17:06:02 +0100 Subject: [PATCH 1/2] Follow upstream deprecation According to zram doc, some attributes will be removed for kernel 4.8.11. We must read from mm_stat now. I already get this warning with kernel 4.4.x : zram: 2753 (zramstat) Attribute compr_data_size (and others) will be removed. See zram documentation. REF: http://lxr.free-electrons.com/source/Documentation/blockdev/zram.txt --- zramstat | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/zramstat b/zramstat index 66274c0..c1a8da1 100755 --- a/zramstat +++ b/zramstat @@ -3,8 +3,8 @@ ls /sys/block/zram* > /dev/null 2>&1 || exit 0 for i in /sys/block/zram*; do - compr=$(< $i/compr_data_size) - orig=$(< $i/orig_data_size) + compr=$(cat $i/mm_stat | awk '{ print $2 }') + orig=$(cat $i/mm_stat | awk '{ print $1 }') ratio=0 if [ $compr -gt 0 ]; then ratio=$(echo "scale=2; $orig*100/$compr" | bc -q) From bcf963d6768eb2d685f8194b6183ec0c056bd42e Mon Sep 17 00:00:00 2001 From: zezinho42 Date: Tue, 6 Dec 2016 17:07:00 +0100 Subject: [PATCH 2/2] Create Makefile --- Makefile | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Makefile b/Makefile index a901435..3208321 100644 --- a/Makefile +++ b/Makefile @@ -1,7 +1,7 @@ PREFIX ?= /usr SYSTEMD_UNITDIR ?= $(PREFIX)/lib/systemd/system SYSCONFDIR ?= /etc/sysconfig -VERSION=1.0.1 +VERSION=1.0.2 SRC_FILES=Makefile README.md zram mkzram.service zram.spec zramstart zramstat zramstop install: