This commit is contained in:
root 2022-12-01 10:15:56 -07:00
parent c2700574c7
commit 68444a9b0d

15
arch.sh
View File

@ -7,7 +7,7 @@ TARGET='/mnt'
######################################
clear
echo
HARD_DISK=/dev/$(lsblk | cut -d ' ' -f1 | grep -viE 'loop0|sr0|zram' | head -2 | tail -1)
HARD_DISK=$(lsblk | cut -d ' ' -f1 | grep -viE 'loop0|sr0|zram' | head -2 | tail -1)
EFI="/dev/$(lsblk | grep $HARD_DISK | head -2 | tail -1 | cut -c 7-20 | cut -d ' ' -f1)"
BTRFS="/dev/$(lsblk | grep $HARD_DISK | head -3 | tail -1 | cut -c 7-20 | cut -d ' ' -f1)"
ROOT_NAME='arch'
@ -378,12 +378,13 @@ services() {
}
initialize-disk() {
parted $HARD_DISK mklabel gpt
parted $HARD_DISK mkpart primary fat32 1MiB 200MiB
parted $HARD_DISK set 1 esp on
parted $HARD_DISK mkpart P2 ext3 200MiB 100%
printf "$DISK_PASSWORD\n$DISK_PASSWORD" | cryptsetup luksFormat /dev/${lsblk | grep $HARD_DISK | head -3 | tail -1 | cut -c 7-20 | cut -d ' ' -f1}
printf "$DISK_PASSWORD" | cryptsetup open ${BTRFS} root
parted /dev/$HARD_DISK mklabel gpt
parted /dev/$HARD_DISK mkpart primary fat32 1MiB 200MiB
parted /dev/$HARD_DISK set 1 esp on
parted /dev/$HARD_DISK mkpart P2 ext3 200MiB 100%
BTRFS="$(lsblk | grep $HARD_DISK | head -3 | tail -1 | cut -c 7-20 | cut -d ' ' -f1)"
printf "$DISK_PASSWORD\n$DISK_PASSWORD" | cryptsetup luksFormat /dev/${BTRFS}
printf "$DISK_PASSWORD" | cryptsetup open /dev/${BTRFS} root
echo
echo "Formatting....."
echo y | mkfs.btrfs -L arch /dev/mapper/root --force