common: check is_pseudofs or has_fsck more reliably
There might be filesystems we can't cover in common, e.g. out-of-tree ones. Use findmnt / check if the fsck command exists to make it more reliable.
This commit is contained in:
parent
092226862b
commit
e13ce65908
5
common
5
common
@ -436,11 +436,12 @@ dm_name_for_devnode() {
|
||||
}
|
||||
|
||||
fstype_is_pseudofs() {
|
||||
(( pseudofs_types["$1"] ))
|
||||
(( pseudofs_types["$1"] )) || findmnt --pseudo "$1" &>/dev/null
|
||||
}
|
||||
|
||||
fstype_has_fsck() {
|
||||
(( fsck_types["$1"] ))
|
||||
(( fsck_types["$1"] == 0 )) && return 1
|
||||
(( fsck_types["$1"] )) || command -v "fsck.$1" &>/dev/null
|
||||
}
|
||||
|
||||
# vim: et ts=2 sw=2 ft=sh:
|
||||
|
@ -53,7 +53,7 @@ optstring_apply_quirks() {
|
||||
# Prune 'relatime' option for any pseudofs. This seems to be a rampant
|
||||
# default which the kernel often exports even if the underlying filesystem
|
||||
# doesn't support it. Example: https://bugs.archlinux.org/task/54554.
|
||||
if awk -v fstype="$fstype" '$1 == fstype { exit 1 }' /proc/filesystems; then
|
||||
if fstype_is_pseudofs "$fstype"; then
|
||||
optstring_remove_option "$varname" relatime
|
||||
fi
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user