#!/bin/sh

# If both cryptsetup and console-setup are installed, run
# update-initramfs to make sure one can type the passphrase
# (see #694156, workaround for #696773):
/bin/in-target \
    /bin/sh -c "dpkg-query -s console-setup >/dev/null 2>&1"

#Fix bug keyboard not using the selected layout.
/bin/in-target \
    dpkg-reconfigure -f noninteractive keyboard-configuration

if [ $? = 0 ]; then
    echo "Encrypted LVM detected, refreshing initramfs"
    /bin/in-target update-initramfs -u -k all
fi
