diff --git a/script/ubuntu-kaiten-yaki.sh b/script/ubuntu-kaiten-yaki.sh index 1030fa5..828dfe0 100644 --- a/script/ubuntu-kaiten-yaki.sh +++ b/script/ubuntu-kaiten-yaki.sh @@ -27,7 +27,7 @@ if [ $? -eq 1 ] ; then # "Ubuntu" is not found in the OS name. uname -a cat <> /etc/cryptsetup-initramfs/conf-hook -echo "UMASK=0077" >> /etc/initramfs-tools/initramfs.conf +xbps-install -y lvm2 cryptsetup # Prepare a key file to embed in to the ramfs. echo "...Prepair key file." @@ -288,14 +288,24 @@ printf %s "${PASSPHRASE}" | cryptsetup luksAddKey -d - "${DEV}${CRYPTPARTITION}" echo "...Add LUKS volume info to /etc/crypttab." echo "${CRYPTPARTNAME} UUID=$(blkid -s UUID -o value ${DEV}${CRYPTPARTITION}) /etc/luks/boot_os.keyfile luks,discard" >> /etc/crypttab +echo "...Register key file to the ramfs" +echo 'install_items+=" /etc/luks/boot_os.keyfile /etc/crypttab " ' > /etc/dracut.conf.d/10-crypt.conf + # Finally, update the ramfs initial image with the key file. echo "...Upadte initramfs." -update-initramfs -uk all +xbps-reconfigure -fa +echo "...grub-mkconfig." +grub-mkconfig -o /boot/grub/grub.cfg +echo "...update-grub." +update-grub # Leave chroot -exit HEREDOC +# Unmount all +echo "...Unmount all." +umount -R /mnt/target + # Finishing message cat <