blob: 46248c401be1124eb237ca848b8a10a006b65e22 [file] [log] [blame]
Brad Bishop63ae8782019-10-09 09:56:13 -04001#!/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