aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorHimbeerserverDE <himbeerserverde@gmail.com>2023-10-05 16:49:05 +0200
committerHimbeerserverDE <himbeerserverde@gmail.com>2023-10-05 16:49:05 +0200
commit4079d7647e9fbf87db7130cdc34ebdaa4bbb0c51 (patch)
tree492e61310e9e0648fd1a42f6e8ccf1c2a648e8b1
parent17c0a547fe2f4297da7079bd75563a71cd0738e0 (diff)
cryptuefiinstall: minimize partition layout for uki booting (includes removing grub prompt)
-rwxr-xr-xcryptuefiinstall41
1 files changed, 12 insertions, 29 deletions
diff --git a/cryptuefiinstall b/cryptuefiinstall
index 5f61243..8b5e43b 100755
--- a/cryptuefiinstall
+++ b/cryptuefiinstall
@@ -15,7 +15,6 @@ pacman -S --needed --noconfirm parted fzf
#
DRIVE=$1
-TARGET=$2
if [ -z "${DRIVE}" ]; then
DRIVE="/dev/$(lsblk | grep disk | fzf --disabled | awk '{print $1}')"
@@ -27,44 +26,29 @@ else
PART_PREFIX="${DRIVE}"
fi
-if [ -z "${TARGET}" ]; then
- TARGET=$(echo "Enter GRUB target (commonly x86_64-efi): " | fzf --disabled --print-query | sed -n '1 p')
-fi
-
-# Needed because otherwise the disk might be overwritten
-# without installing a bootable system.
-if [ -z "${TARGET}" ]; then
- echo -en "\e[1m\e[1;31mGRUB target must not be empty.\e[0m"
- exit 1
-fi
-
#
# Full Disk Encryption
#
parted -s ${DRIVE} mklabel gpt
parted -s -a optimal ${DRIVE} mkpart primary fat32 0% 256MiB
-parted -s -a optimal ${DRIVE} mkpart primary ext4 256MiB 512MiB
-parted -s -a optimal ${DRIVE} mkpart primary ext4 512MiB 100%
+parted -s -a optimal ${DRIVE} mkpart primary ext4 256MiB 100%
echo "artix" | cryptsetup -q --pbkdf pbkdf2 luksFormat ${PART_PREFIX}2
-echo "artix" | cryptsetup -q open ${PART_PREFIX}2 boot_crypt
-
-echo "artix" | cryptsetup -q luksFormat ${PART_PREFIX}3
-echo "artix" | cryptsetup -q open ${PART_PREFIX}3 root_crypt
+echo "artix" | cryptsetup -q open ${PART_PREFIX}2 data_crypt
mkfs.fat -F 32 ${PART_PREFIX}1 && fatlabel ${PART_PREFIX}1 ESP
-mkfs.ext4 -F -L BOOT /dev/mapper/boot_crypt
-mkfs.btrfs -f /dev/mapper/root_crypt
+mkfs.btrfs -f /dev/mapper/data_crypt
mkdir /btrfs
-mount -o compress=zstd /dev/mapper/root_crypt /btrfs
+mount -o compress=zstd /dev/mapper/data_crypt /btrfs
+btrfs subvolume create /btrfs/boot
btrfs subvolume create /btrfs/root
umount /btrfs
-mount -o compress=zstd,subvol=/root /dev/mapper/root_crypt /mnt
+mount -o compress=zstd,subvol=/root /dev/mapper/data_crypt /mnt
mkdir /mnt/boot
-mount /dev/mapper/boot_crypt /mnt/boot
+mount -o compress=zstd,subvol=/boot /mnt/boot
mkdir /mnt/boot/efi
mount ${PART_PREFIX}1 /mnt/boot/efi
@@ -84,13 +68,12 @@ fstabgen -U /mnt >> /mnt/etc/fstab
umount -R /mnt
cryptsetup -q close boot_crypt
-cryptsetup -q close root_crypt
+cryptsetup -q close data_crypt
echo -e "\n\e[1m\e[1;32mArtix has been successfully installed! It is now safe to reboot."
-echo -e "\e[1m\e[1;32mDon't forget to change the root password, disk passwords and hostname."
+echo -e "\e[1m\e[1;32mDon't forget to change the root password, disk password and hostname."
echo -e "\e[1m\e[1;32mSetting up networking is left to you, dhcpcd and wpa_supplicant are installed."
-echo -e "\n\e[1m\e[1;32mRun the following commands to change the disk passwords:"
-echo -e "\e[1m\e[1;32m\t# cryptsetup --pbkdf pbkdf2 luksChangeKey ${PART_PREFIX}2"
-echo -e "\e[1m\e[1;32m\t# cryptsetup luksChangeKey ${PART_PREFIX}3"
-echo -e "\n\e[1m\e[1;32mChoose US compatible passwords as GRUB uses the US keyboard layout."
+echo -e "\n\e[1m\e[1;32mRun the following command to change the disk password:"
+echo -e "\e[1m\e[1;32m\t# cryptsetup luksChangeKey ${PART_PREFIX}2"
+echo -e "\n\e[1m\e[1;32mYour keyboard layout is preserved in the initramfs stage."
echo -en "\e[0m"