From: Harald Hoyer Date: Thu, 15 Aug 2013 10:23:04 +0000 (+0200) Subject: dracut-functions.sh: add find_mp_fsopts X-Git-Tag: 032~15 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=bbc9bfe16eeec91f127fdb37d642f6f97f5aa39e;p=platform%2Fupstream%2Fdracut.git dracut-functions.sh: add find_mp_fsopts --- diff --git a/dracut-functions.sh b/dracut-functions.sh index 1cd8e473..7ee45877 100755 --- a/dracut-functions.sh +++ b/dracut-functions.sh @@ -441,6 +441,22 @@ find_dev_fstype() { return 1 } +# find_mp_fsopts +# Echo the filesystem options for a given mountpoint. +# /proc/self/mountinfo is taken as the primary source of information +# and /etc/fstab is used as a fallback. +# No newline is appended! +# Example: +# $ find_mp_fsopts /;echo +# rw,relatime,discard,data=ordered +find_mp_fsopts() { + if [[ $use_fstab != yes ]]; then + findmnt -e -v -n -o 'OPTIONS' --target "$1" 2>/dev/null && return 0 + fi + + findmnt --fstab -e -v -n -o 'OPTIONS' --target "$1" +} + # find_dev_fsopts # Echo the filesystem options for a given device. # /proc/self/mountinfo is taken as the primary source of information