f
This commit is contained in:
parent
739c244ec0
commit
b896cf4767
11
gentoo.sh
11
gentoo.sh
@ -38,7 +38,7 @@ ROOT_PASSWORD="123456"
|
||||
WIRELESS_PASSWORD='123456'
|
||||
SSID='123456'
|
||||
DISK_PASSWORD='123456'
|
||||
AUTO_DECRYPT='True'
|
||||
AUTO_DECRYPT='False'
|
||||
WIRELESS_INTERFACE='wlan0'
|
||||
COMPRESSION='compress=zstd:10'
|
||||
FLATPAKS+=()
|
||||
@ -105,9 +105,8 @@ decryptBoot() {
|
||||
echo "Adding new key......"
|
||||
echo
|
||||
printf "$DISK_PASSWORD" | cryptsetup luksAddKey $1 /boot/$KEYFILE
|
||||
echo "install_items+=/boot/$KEYFILE" >>/etc/dracut.conf
|
||||
echo "install_items+=/boot/unlock.sh" >>/etc/dracut.conf
|
||||
sed -i "s/none/\/boot\/$KEYFILE,keyscript=\/boot\/unlock.sh/" /etc/crypttab
|
||||
echo "install_items+=\" /boot/unlock.sh /boot/$KEYFILE \"" >>/etc/dracut.conf
|
||||
sed -i "s/none/luks,\/boot\/$KEYFILE,keyscript=\/boot\/unlock.sh/" /etc/crypttab
|
||||
echo "#!/bin/bash" >/boot/unlock.sh
|
||||
echo "cryptsetup open UUID=$(/sbin/blkid -s UUID -o value ${BTRFS}) --key-file=/boot/$KEYFILE $ROOT_MAPPER_NAME" >>/boot/unlock.sh
|
||||
chmod +x /boot/unlock.sh
|
||||
@ -910,7 +909,6 @@ bootloader() {
|
||||
LOADER_FILE="/boot/loader/entries/$MACHINE_ID-$KERNEL_VERSION.conf"
|
||||
PREVIOUS_LOADER_FILE="/boot/loader/entries/previous.conf"
|
||||
clear
|
||||
echo "$ROOT_MAPPER_NAME UUID=$(/sbin/blkid -s UUID -o value ${BTRFS}) none luks" >/etc/crypttab
|
||||
|
||||
echo 'add_dracutmodules+=" crypt dm rootfs-block "' >/etc/dracut.conf
|
||||
if [[ $SWAP_CHOICE = *y* ]]; then
|
||||
@ -920,7 +918,10 @@ bootloader() {
|
||||
fi
|
||||
|
||||
if [ "$AUTO_DECRYPT" == "True" ]; then
|
||||
echo "$ROOT_MAPPER_NAME UUID=$(/sbin/blkid -s UUID -o value ${BTRFS}) none" >/etc/crypttab
|
||||
decryptBoot "${BTRFS}"
|
||||
else
|
||||
echo "$ROOT_MAPPER_NAME UUID=$(/sbin/blkid -s UUID -o value ${BTRFS}) none luks" >/etc/crypttab
|
||||
fi
|
||||
|
||||
mkdir -p /boot/$MACHINE_ID/$KERNEL_VERSION
|
||||
|
Loading…
Reference in New Issue
Block a user