Merge pull request #2227 from jpwhiting/work/whiting/dontmountemptysubvolume

If a mountPoint has subvolume: "" don't try to mount the subvolume with a wrong "subvol=," argument.
This commit is contained in:
dalto8 2023-11-05 18:55:23 +00:00 committed by GitHub
commit ce1ecdba32
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -298,7 +298,12 @@ def mount_partition(root_mount_point, partition, partitions, mount_options, moun
mount_option_no_subvol = get_mount_options("btrfs_swap", mount_options, partition) mount_option_no_subvol = get_mount_options("btrfs_swap", mount_options, partition)
else: else:
mount_option_no_subvol = get_mount_options(fstype, mount_options, partition) mount_option_no_subvol = get_mount_options(fstype, mount_options, partition)
# Only add subvol= argument if we are not mounting the entire filesystem
if s['subvolume']:
mount_option = f"subvol={s['subvolume']},{mount_option_no_subvol}" mount_option = f"subvol={s['subvolume']},{mount_option_no_subvol}"
else:
mount_option = mount_option_no_subvol
subvolume_mountpoint = mount_point[:-1] + s['mountPoint'] subvolume_mountpoint = mount_point[:-1] + s['mountPoint']
mount_options_list.append({"mountpoint": s['mountPoint'], "option_string": mount_option_no_subvol}) mount_options_list.append({"mountpoint": s['mountPoint'], "option_string": mount_option_no_subvol})
if libcalamares.utils.mount(device, if libcalamares.utils.mount(device,