genfstab: disable appending subvol onto options
Options parsed from findmnt may already have the subvol option, so appending the subvol option is unnecessary. Fixes FS#65003 Signed-off-by: Eli Schwartz <eschwartz@archlinux.org>
This commit is contained in:
parent
193c61db31
commit
ca8e8f63ec
28
genfstab.in
28
genfstab.in
@ -163,23 +163,19 @@ findmnt -Recvruno SOURCE,TARGET,FSTYPE,OPTIONS,FSROOT "$root" |
|
||||
pass=0
|
||||
fi
|
||||
|
||||
if [[ $fsroot != / ]]; then
|
||||
if [[ $fstype = btrfs ]]; then
|
||||
opts+=,subvol=${fsroot#/}
|
||||
else
|
||||
# it's a bind mount
|
||||
src=$(findmnt -funcevo TARGET "$src")$fsroot
|
||||
if [[ $src -ef $target ]]; then
|
||||
# hrmm, this is weird. we're probably looking at a file or directory
|
||||
# that was bound into a chroot from the host machine. Ignore it,
|
||||
# because this won't actually be a valid mount. Worst case, the user
|
||||
# just re-adds it.
|
||||
continue
|
||||
fi
|
||||
fstype=none
|
||||
opts+=,bind
|
||||
pass=0
|
||||
if [[ $fsroot != / && $fstype != btrfs ]]; then
|
||||
# it's a bind mount
|
||||
src=$(findmnt -funcevo TARGET "$src")$fsroot
|
||||
if [[ $src -ef $target ]]; then
|
||||
# hrmm, this is weird. we're probably looking at a file or directory
|
||||
# that was bound into a chroot from the host machine. Ignore it,
|
||||
# because this won't actually be a valid mount. Worst case, the user
|
||||
# just re-adds it.
|
||||
continue
|
||||
fi
|
||||
fstype=none
|
||||
opts+=,bind
|
||||
pass=0
|
||||
fi
|
||||
|
||||
# filesystem quirks
|
||||
|
Loading…
Reference in New Issue
Block a user