fix subdir for btrfs on subvolumes

#2
This commit is contained in:
Tobias Powalowski 2021-09-15 12:29:29 +02:00
parent 145127cf66
commit b29ef17fbf

View file

@ -3902,13 +3902,13 @@ 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
if [[ $(mount | grep "${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
if [[ $(mount | "${DESTDIR}/boot " | grep btrfs | grep subvol) ]]; then
subdir="$(btrfs subvolume show "${DESTDIR}/boot" | grep Name | cut -d ":" -f2)"
fi
fi