#!/bin/sh

set -e

is_26() {
	echo $1 | grep -q -E '^2\.6\.'
}

# Remove diversion of kernel loop.o for kernels < 2.6
if [ "$1" = remove ]; then
	if ! is_26 _KVERS_; then
		module=/lib/modules/_KVERS_/kernel/drivers/block/loop.o
		dpkg-divert --remove --rename --package loop-aes-modules-_KVERS_ --divert ${module}-orig ${module}
	fi
fi

#DEBHELPER#
