genfstab: make -p default behavior, add -P as inverse
This should be the default, as you generally don't want to include pseudofs mounts in your /etc/fstab.
This commit is contained in:
parent
e44af861eb
commit
67dcb08f4b
12
genfstab.in
12
genfstab.in
@ -68,7 +68,8 @@ usage: ${0##*/} [options] root
|
|||||||
|
|
||||||
Options:
|
Options:
|
||||||
-L Use labels for source identifiers (shortcut for -t LABEL)
|
-L Use labels for source identifiers (shortcut for -t LABEL)
|
||||||
-p Avoid printing pseudofs mounts
|
-p Exclude pseudofs mounts (default behavior)
|
||||||
|
-P Include printing mounts
|
||||||
-t TAG Use TAG for source identifiers
|
-t TAG Use TAG for source identifiers
|
||||||
-U Use UUIDs for source identifiers (shortcut for -t UUID)
|
-U Use UUIDs for source identifiers (shortcut for -t UUID)
|
||||||
|
|
||||||
@ -85,7 +86,7 @@ if [[ -z $1 || $1 = @(-h|--help) ]]; then
|
|||||||
exit $(( $# ? 0 : 1 ))
|
exit $(( $# ? 0 : 1 ))
|
||||||
fi
|
fi
|
||||||
|
|
||||||
while getopts ':Lpt:U' flag; do
|
while getopts ':LPpt:U' flag; do
|
||||||
case $flag in
|
case $flag in
|
||||||
L)
|
L)
|
||||||
bytag=LABEL
|
bytag=LABEL
|
||||||
@ -93,8 +94,11 @@ while getopts ':Lpt:U' flag; do
|
|||||||
U)
|
U)
|
||||||
bytag=UUID
|
bytag=UUID
|
||||||
;;
|
;;
|
||||||
|
P)
|
||||||
|
pseudofs=1
|
||||||
|
;;
|
||||||
p)
|
p)
|
||||||
nopseudofs=1
|
pseudofs=0
|
||||||
;;
|
;;
|
||||||
t)
|
t)
|
||||||
bytag=${OPTARG^^}
|
bytag=${OPTARG^^}
|
||||||
@ -119,7 +123,7 @@ fi
|
|||||||
# handle block devices
|
# handle block devices
|
||||||
findmnt -Recvruno SOURCE,TARGET,FSTYPE,OPTIONS,FSROOT "$root" |
|
findmnt -Recvruno SOURCE,TARGET,FSTYPE,OPTIONS,FSROOT "$root" |
|
||||||
while read -r src target fstype opts fsroot; do
|
while read -r src target fstype opts fsroot; do
|
||||||
if (( nopseudofs )) && fstype_is_pseudofs "$fstype"; then
|
if (( !pseudofs )) && fstype_is_pseudofs "$fstype"; then
|
||||||
continue
|
continue
|
||||||
fi
|
fi
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user