Merge branch 'btrfs_detection_fix' into 'master'

btrfs detection for grub and associated btrfs cleanup

See merge request applications/manjaro-architect!249
merge-requests/273/head
Matti Hyttinen 5 years ago
commit 62484a1b5e

@ -435,7 +435,7 @@ install_grub_uefi() {
[[ -f ${MOUNTPOINT}/usr/bin/grub_installer.sh ]] && rm ${MOUNTPOINT}/usr/bin/grub_installer.sh [[ -f ${MOUNTPOINT}/usr/bin/grub_installer.sh ]] && rm ${MOUNTPOINT}/usr/bin/grub_installer.sh
# If root is on btrfs volume, amend grub # If root is on btrfs volume, amend grub
[[ -e /tmp/.btrfsroot ]] && \ [[ $(findmnt -no FSTYPE ${MOUNTPOINT}) == "btrfs" ]] && \
sed -e '/GRUB_SAVEDEFAULT/ s/^#*/#/' -i ${MOUNTPOINT}/etc/default/grub sed -e '/GRUB_SAVEDEFAULT/ s/^#*/#/' -i ${MOUNTPOINT}/etc/default/grub
# Enble manjaro grub theme # Enble manjaro grub theme
@ -615,7 +615,7 @@ bios_bootloader() {
[[ $(cat /tmp/.luks_dev) != "" ]] && sed -i "s~GRUB_CMDLINE_LINUX=.*~GRUB_CMDLINE_LINUX=\"$(cat /tmp/.luks_dev)\"~g" ${MOUNTPOINT}/etc/default/grub [[ $(cat /tmp/.luks_dev) != "" ]] && sed -i "s~GRUB_CMDLINE_LINUX=.*~GRUB_CMDLINE_LINUX=\"$(cat /tmp/.luks_dev)\"~g" ${MOUNTPOINT}/etc/default/grub
# If root is on btrfs volume, amend grub # If root is on btrfs volume, amend grub
[[ $(lsblk -lno FSTYPE,MOUNTPOINT | awk '/ \/mnt$/ {print $1}') == btrfs ]] && \ [[ $(findmnt -no FSTYPE ${MOUNTPOINT}) == "btrfs" ]] && \
sed -e '/GRUB_SAVEDEFAULT/ s/^#*/#/' -i ${MOUNTPOINT}/etc/default/grub sed -e '/GRUB_SAVEDEFAULT/ s/^#*/#/' -i ${MOUNTPOINT}/etc/default/grub
# Same setting is needed for LVM # Same setting is needed for LVM

@ -1317,17 +1317,15 @@ mount_partitions() {
get_cryptroot get_cryptroot
echo "$LUKS_DEV" > /tmp/.luks_dev echo "$LUKS_DEV" > /tmp/.luks_dev
# If the root partition is btrfs, offer to create subvolumus # If the root partition is btrfs, offer to create subvolumus
if [[ $(lsblk -lno FSTYPE,MOUNTPOINT | awk '/ \/mnt$/ {print $1}') == btrfs ]]; then if [[ $(findmnt -no FSTYPE ${MOUNTPOINT}) == btrfs ]]; then
# Check if there are subvolumes already on the btrfs partition # Check if there are subvolumes already on the btrfs partition
if [[ $(btrfs subvolume list /mnt | wc -l) -gt 1 ]] && DIALOG " The volume has already subvolumes " --yesno "\nFound subvolumes $(btrfs subvolume list /mnt | cut -d" " -f9)\n\nWould you like to mount them? \n " 0 0; then if [[ $(btrfs subvolume list ${MOUNTPOINT} | wc -l) -gt 1 ]] && DIALOG " The volume has already subvolumes " --yesno "\nFound subvolumes $(btrfs subvolume list ${MOUNTPOUNT} | cut -d" " -f9)\n\nWould you like to mount them? \n " 0 0; then
# Pre-existing subvolumes and user wants to mount them # Pre-existing subvolumes and user wants to mount them
mount_existing_subvols mount_existing_subvols
else else
# No subvolumes present. Make some new ones # No subvolumes present. Make some new ones
DIALOG " Your root volume is formatted in btrfs " --yesno "\nWould you like to create subvolumes in it? \n " 0 0 && btrfs_subvolumes && touch /tmp/.btrfsroot DIALOG " Your root volume is formatted in btrfs " --yesno "\nWould you like to create subvolumes in it? \n " 0 0 && btrfs_subvolumes
fi fi
else
[[ -e /tmp/.btrfsroot ]] && rm /tmp/.btrfsroot
fi fi
fi fi

Loading…
Cancel
Save