live-build/share/hooks/normal/0030-enable-cryptsetup.hook...

31 lines
613 B
Plaintext
Raw Normal View History

#!/bin/sh
set -e
# Enable cryptsetup
if [ -e /sbin/cryptsetup ]
then
if [ ! -e /etc/initramfs-tools/conf.d/cryptsetup ]
then
mkdir -p /etc/initramfs-tools/conf.d
2020-04-23 15:46:47 +00:00
cat > /etc/initramfs-tools/conf.d/cryptsetup <<-EOF
# /etc/initramfs-tools/conf.d/cryptsetup
2020-04-23 15:46:47 +00:00
CRYPTSETUP=yes
export CRYPTSETUP
EOF
fi
if [ -e /etc/cryptsetup-initramfs/conf-hook ]; then
if grep -q '^#CRYPTSETUP=' /etc/cryptsetup-initramfs/conf-hook; then
sed -i -e 's/^#CRYPTSETUP=.*/CRYPTSETUP=y/' \
/etc/cryptsetup-initramfs/conf-hook
else
echo "CRYPTSETUP=y" >>/etc/cryptsetup-initramfs/conf-hook
fi
fi
fi