1#!/bin/sh 2set -e 3 4device=$1 5if [ "$device" = "" ]; then 6 echo "Usage: zram-swap-deinit <device>" 7 exit 1 8fi 9 10sysblockdev=/sys/block/$(basename $device) 11if [ ! -d $sysblockdev ]; then 12 echo "Block device not found in sysfs" 13 exit 1 14fi 15 16# zramctl -r is not suitable as it also removes the actual device. Recreating 17# it is non-trivial, especially if not /dev/zram0 is used... 18echo 1 > ${sysblockdev}/reset 19 20