fix subdir for btrfs on subvolumes

This commit is contained in:
Tobias Powalowski 2021-09-15 12:23:03 +02:00
parent 16548ed65a
commit 145127cf66

View file

@ -3901,8 +3901,16 @@ do_grub_config() {
if [[ "${ROOT_PART_FS_UUID}" == "${BOOT_PART_FS_UUID}" ]]; then
subdir="/boot"
# on btrfs we need to check on subvol
if [[ $(mount "${DESTDIR}/ " | grep btrfs | grep subvol) ]]; then
subdir="$(btrfs subvolume show "${DESTDIR}/" | grep Name | cut -d ":" -f2)"
fi
else
subdir=""
# on btrfs we need to check on subvol
if [[ $(mount "${DESTDIR}/boot" | grep btrfs | grep subvol) ]]; then
subdir="$(btrfs subvolume show "${DESTDIR}/boot" | grep Name | cut -d ":" -f2)"
fi
fi
########