1
0
Fork 0
cryptsetup/debian/cryptsetup.preinst
Daniel Baumann 74b680e410
Adding debian version 2:2.7.5-2.
Signed-off-by: Daniel Baumann <daniel.baumann@progress-linux.org>
2025-06-21 10:45:48 +02:00

27 lines
910 B
Bash

#!/bin/sh
set -e
if [ "$1" = install ] && [ ! -f "/etc/crypttab" ]; then
cat <<-EOC >/etc/crypttab
# <target name> <source device> <key file> <options>
EOC
fi
# begin-remove-after: released:forky
if [ "$1" = "upgrade" ] || [ "$1" = install ]; then
if [ "$(dpkg-divert --truename /lib/cryptsetup/askpass)" = /lib/cryptsetup/askpass.cryptsetup ] &&
[ "$(dpkg-divert --listpackage /lib/cryptsetup/askpass)" = cryptsetup-nuke-password ] &&
[ "$(dpkg-divert --truename /usr/lib/cryptsetup/askpass)" = /usr/lib/cryptsetup/askpass ]; then
# A pre-/usr-merge cryptsetup-nuke-password is installed.
echo "Mitigating diversion of /lib/cryptsetup/askpass on behalf of cryptsetup-nuke-password"
dpkg-divert --no-rename --package cryptsetup-nuke-password \
--divert /usr/lib/cryptsetup/askpass.usr-is-merged \
--add /usr/lib/cryptsetup/askpass
fi
fi
# end-remove-after
#DEBHELPER#
exit 0