Fix btrfs issue (#728)

This commit is contained in:
JEEVITHA KANNAN K S 2024-11-01 01:17:24 +05:30 committed by GitHub
parent 2837f9291a
commit dd10565d8f
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

View File

@ -386,33 +386,36 @@ fi
if [[ "${FS}" == "btrfs" ]]; then
mkfs.vfat -F32 -n "EFIBOOT" "${partition2}"
mkfs.btrfs -L ROOT "${partition3}" -f
mkfs.btrfs -f "${partition3}"
mount -t btrfs "${partition3}" /mnt
subvolumesetup
elif [[ "${FS}" == "ext4" ]]; then
mkfs.vfat -F32 -n "EFIBOOT" "${partition2}"
mkfs.ext4 -L ROOT "${partition3}"
mkfs.ext4 "${partition3}"
mount -t ext4 "${partition3}" /mnt
elif [[ "${FS}" == "luks" ]]; then
mkfs.vfat -F32 -n "EFIBOOT" "${partition2}"
mkfs.vfat -F32 "${partition2}"
# enter luks password to cryptsetup and format root partition
echo -n "${LUKS_PASSWORD}" | cryptsetup -y -v luksFormat "${partition3}" -
# open luks container and ROOT will be place holder
echo -n "${LUKS_PASSWORD}" | cryptsetup open "${partition3}" ROOT -
# now format that container
mkfs.btrfs -L ROOT "${partition3}"
mkfs.btrfs "${partition3}"
# create subvolumes for btrfs
mount -t btrfs "${partition3}" /mnt
subvolumesetup
ENCRYPTED_PARTITION_UUID=$(blkid -s UUID -o value "${partition3}")
fi
BOOT_UUID=$(blkid -s UUID -o value "${partition2}")
sync
if ! mountpoint -q /mnt; then
echo "ERROR! Failed to mount ${partition3} to /mnt after multiple attempts."
exit 1
fi
mkdir -p /mnt/boot/efi
mount -t vfat -L EFIBOOT /mnt/boot/
mount -t vfat -U "${BOOT_UUID}" /mnt/boot/
if ! grep -qs '/mnt' /proc/mounts; then
echo "Drive is not mounted can not continue"
@ -435,7 +438,7 @@ fi
echo "keyserver hkp://keyserver.ubuntu.com" >> /mnt/etc/pacman.d/gnupg/gpg.conf
cp /etc/pacman.d/mirrorlist /mnt/etc/pacman.d/mirrorlist
genfstab -L /mnt >> /mnt/etc/fstab
genfstab -U /mnt >> /mnt/etc/fstab
echo "
Generated /etc/fstab:
"