| 1 |
#!/bin/bash |
| 2 |
|
| 3 |
CHROOT=$(mount | grep proc | grep calamares | awk '{print $3}' | sed -e "s#/proc##g") |
| 4 |
|
| 5 |
# Install luks utilities if needed. |
| 6 |
# Also, set secure permissions for the initramfs if we're configuring |
| 7 |
# full-disk-encryption. The initramfs is re-generated later in the |
| 8 |
# installation process so we only set the permissions snippet without |
| 9 |
# regenerating the initramfs right now: |
| 10 |
if [ "$(mount | grep $CHROOT" " | cut -c -16)" = "/dev/mapper/luks" ]; then |
| 11 |
echo "UMASK=0077" > $CHROOT/etc/initramfs-tools/conf.d/initramfs-permissions |
| 12 |
chroot $CHROOT apt-get -y install cryptsetup-initramfs cryptsetup keyutils |
| 13 |
fi |
| 14 |
|
| 15 |
echo "Running bootloader-config..." |
| 16 |
|
| 17 |
if [ -d /sys/firmware/efi/efivars ]; then |
| 18 |
echo " * Installing grub-efi (uefi)..." |
| 19 |
DEBIAN_FRONTEND=noninteractive chroot $CHROOT apt-get -y install grub-efi |
| 20 |
else |
| 21 |
echo " * install grub... (bios)" |
| 22 |
DEBIAN_FRONTEND=noninteractive chroot $CHROOT apt-get -y install grub-pc |
| 23 |
fi |
| 24 |
|
| 25 |
# Re-enable os-prober: |
| 26 |
sed -i "s/#GRUB_DISABLE_OS_PROBER=false/# OS_PROBER re-enabled by Debian Calamares installation:\nGRUB_DISABLE_OS_PROBER=false/g" $CHROOT/etc/default/grub |
| 27 |
chroot $CHROOT /usr/sbin/update-grub |