fix: mkinitcpio hooks

master
phga 3 years ago
parent 1b4498b24a
commit 3c4f30fc07
Signed by: phga
GPG Key ID: 5249548AA705F019

@ -120,6 +120,7 @@ ROOT_UUID=$(blkid | grep -Po '/dev/'"${DEV}${suffix}"'3.* UUID="\K[0-9a-f-]+')
if [ "$ENC" == true ]; then
mount /dev/mapper/root /mnt
KERNEL_OPTIONS='cryptdevice=UUID='"$ROOT_UUID"':root root=/dev/mapper/root'
MKINIT_HOOKS='HOOKS=(base udev autodetect modconf block keyboard keymap consolefont encrypt fsck filesystems)'
else
mount -L P_ROOT /mnt
KERNEL_OPTIONS='root=LABEL=P_ROOT rw resume=LABEL=P_SWAP'
@ -142,7 +143,8 @@ cat <<EOF > /mnt/root/bootstrap2.sh
#!/bin/bash
if [ $ENC == true ]; then
sed -i 's/\(^HOOKS.*block\)/\1 encrypt/' /etc/mkinitcpio.conf
sed -i 's/^HOOKS.*$/$MKINIT_HOOKS/' /etc/mkinitcpio.conf
# sed -i 's/\(^HOOKS.*block\)/\1 encrypt/' /etc/mkinitcpio.conf
echo "swap LABEL=cryptswap /dev/urandom swap,offset=2048,cipher=aes-xts-plain64,size=512" >> /etc/crypttab
echo "/dev/mapper/swap none swap defaults 0 0" >> /etc/fstab
fi

Loading…
Cancel
Save