#!/bin/sh
set -e

case "$1" in
	configure)
		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=xz/' /etc/initramfs-tools/initramfs.conf
		fi
		if which update-initramfs >/dev/null && [ -e /etc/initramfs-tools/initramfs.conf ]; then
			update-initramfs -u -k all
		else
			echo 'deepin-fix-init: initramfs missing' >&2
		fi
	;;

	*)
	;;
esac

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

exit 0

