#!/bin/sh
set -e

case "$1" in
	purge|remove)
		if ischroot; then
			echo "not update initramfs by deepin-fix-init in chroot"
			exit 0
		fi

		ARCH=`uname -m`
		if [ x"${ARCH}" = "xmips64" ]; then
			sed  -i "s/COMPRESS=.*$/COMPRESS=lz4/" /etc/initramfs-tools/initramfs.conf
		fi

		if which update-initramfs >/dev/null && [ -e /etc/initramfs-tools/initramfs.conf ] ; then
			update-initramfs -u -k all
		fi
	;;

	*)
	;;
esac

# dh_installdeb will replace this with shell code automatically
# generated by other debhelper scripts.
#DEBHELPER#

exit 0
