#!/bin/sh
# e2checksum device enable|disable
# enable or disable ext4 checksums in the super block
# temporary until standard e2fsprogs learns about them
# written 2009 by Andi Kleen
DEBUGFS=debugfs
DEV=$1
shift

usage() { 
	cat >&2 <<EOL
e2checksum device enable|disable
enable or disable ext4 checksums in the super block
temporary until standard e2fsprogs learns about them
EOL
	exit 1
}

if [ "$DEV" = "" ] ; then
	usage
fi

set -e
if [ "$1" = "enable" -o "$1" = "" ] ; then
	$DEBUGFS -R "feature +FEATURE_R7" -w $DEV 
elif [ "$1" = "disable" ] ; then
	$DEBUGFS -R "feature -FEATURE_R7" -w $DEV 
else
	usage
fi
