replace calamares bootloader-config

This commit is contained in:
Manuel 2023-07-01 02:56:06 +00:00
parent 2bcd23b7f4
commit 3206bb6e43
2 changed files with 6 additions and 18 deletions

12
acorinstaller/bootloader-config Executable file → Normal file
View File

@ -2,26 +2,20 @@
CHROOT=$(mount | grep proc | grep calamares | awk '{print $3}' | sed -e "s#/proc##g") CHROOT=$(mount | grep proc | grep calamares | awk '{print $3}' | sed -e "s#/proc##g")
# Install luks utilities if needed. # Set secure permissions for the initramfs if we're configuring
# Also, set secure permissions for the initramfs if we're configuring
# full-disk-encryption. The initramfs is re-generated later in the # full-disk-encryption. The initramfs is re-generated later in the
# installation process so we only set the permissions snippet without # installation process so we only set the permissions snippet without
# regenerating the initramfs right now: # regenerating the initramfs right now:
if [ "$(mount | grep $CHROOT" " | cut -c -16)" = "/dev/mapper/luks" ]; then if [ "$(mount | grep $CHROOT" " | cut -c -16)" = "/dev/mapper/luks" ]; then
echo "UMASK=0077" > $CHROOT/etc/initramfs-tools/conf.d/initramfs-permissions echo "UMASK=0077" > $CHROOT/etc/initramfs-tools/conf.d/initramfs-permissions
chroot $CHROOT apt-get -y install cryptsetup-initramfs cryptsetup keyutils
fi fi
echo "Running bootloader-config..." echo "Running bootloader-config..."
if [ -d /sys/firmware/efi/efivars ]; then if [ -d /sys/firmware/efi/efivars ]; then
echo " * Installing grub-efi (uefi)..." echo " * Installing grub-efi (uefi)..."
DEBIAN_FRONTEND=noninteractive chroot $CHROOT apt-get -y install grub-efi-amd64 DEBIAN_FRONTEND=noninteractive chroot $CHROOT apt-get -y install grub-efi-amd64 cryptsetup keyutils
else else
echo " * install grub... (bios)" echo " * install grub... (bios)"
DEBIAN_FRONTEND=noninteractive chroot $CHROOT apt-get -y install grub-pc DEBIAN_FRONTEND=noninteractive chroot $CHROOT apt-get -y install grub-pc cryptsetup keyutils
fi fi
# Re-enable os-prober:
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
chroot $CHROOT /usr/sbin/update-grub

12
acorinstaller/bootloader-config-32/bootloader-config Executable file → Normal file
View File

@ -2,26 +2,20 @@
CHROOT=$(mount | grep proc | grep calamares | awk '{print $3}' | sed -e "s#/proc##g") CHROOT=$(mount | grep proc | grep calamares | awk '{print $3}' | sed -e "s#/proc##g")
# Install luks utilities if needed. # Set secure permissions for the initramfs if we're configuring
# Also, set secure permissions for the initramfs if we're configuring
# full-disk-encryption. The initramfs is re-generated later in the # full-disk-encryption. The initramfs is re-generated later in the
# installation process so we only set the permissions snippet without # installation process so we only set the permissions snippet without
# regenerating the initramfs right now: # regenerating the initramfs right now:
if [ "$(mount | grep $CHROOT" " | cut -c -16)" = "/dev/mapper/luks" ]; then if [ "$(mount | grep $CHROOT" " | cut -c -16)" = "/dev/mapper/luks" ]; then
echo "UMASK=0077" > $CHROOT/etc/initramfs-tools/conf.d/initramfs-permissions echo "UMASK=0077" > $CHROOT/etc/initramfs-tools/conf.d/initramfs-permissions
chroot $CHROOT apt-get -y install cryptsetup-initramfs cryptsetup keyutils
fi fi
echo "Running bootloader-config..." echo "Running bootloader-config..."
if [ -d /sys/firmware/efi/efivars ]; then if [ -d /sys/firmware/efi/efivars ]; then
echo " * Installing grub-efi (uefi)..." echo " * Installing grub-efi (uefi)..."
DEBIAN_FRONTEND=noninteractive chroot $CHROOT apt-get -y install grub-efi-ia32 DEBIAN_FRONTEND=noninteractive chroot $CHROOT apt-get -y install grub-efi-ia32 cryptsetup keyutils
else else
echo " * install grub... (bios)" echo " * install grub... (bios)"
DEBIAN_FRONTEND=noninteractive chroot $CHROOT apt-get -y install grub-pc DEBIAN_FRONTEND=noninteractive chroot $CHROOT apt-get -y install grub-pc cryptsetup keyutils
fi fi
# Re-enable os-prober:
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
chroot $CHROOT /usr/sbin/update-grub