#!/bin/sh

ver_old="$2"

if [ "$(apk version -t "$ver_old" '1.0.0-r0')" = '<' ]; then
	cfgfile="/etc/kernel-hooks.d/secureboot.conf"

	# If the default efistub_file is used, print warning.
	if ! [ -e "$cfgfile" ] \
		|| ! grep -q '^efistub_file=' "$cfgfile" \
		|| grep -Eq "^efistub_file=[\"']?/usr/lib/gummiboot/" "$cfgfile"
	then
		cat >&2 <<-EOF
		*!*!*!*!*!*!*!*!*!*!*!*!*!*!*!*!*!*!*!*!*!*!*!*!*!*!*!*!*!*!*!*!*!*!*!*!*!*
		*! CAUTION: The default EFI stub has been changed! Gummiboot doesn't work
		*! anymore, so you have to install "systemd-efistub" (don't worry, it
		*! provides just the EFI stub files, nothing more).
		*!*!*!*!*!*!*!*!*!*!*!*!*!*!*!*!*!*!*!*!*!*!*!*!*!*!*!*!*!*!*!*!*!*!*!*!*!*
		EOF
	fi
fi

exit 0
