diff options
author | Zorro Lang <zlang@kernel.org> | 2022-05-25 15:34:26 +0800 |
---|---|---|
committer | Zorro Lang <zlang@kernel.org> | 2022-05-26 18:00:18 +0800 |
commit | 61775fb9e1ab3c1a43435492edf0582e2e7cabae (patch) | |
tree | 0b4aefd701dfed0c1964fa04a2084731279678af /common/config | |
parent | e57024a3058801af69660cae2028972690554b3f (diff) |
common: source base fs specific common file
When tests overlayfs, sometimes we need the underlying fs specific
helpers, e.g. common/rc has:
_filesystem_timestamp_range $OVL_BASE_TEST_DEV $OVL_BASE_FSTYP
So when we source common/overlay, better to source OVL_BASE_FSTYP
too.
Signed-off-by: Zorro Lang <zlang@kernel.org>
Reviewed-by: Amir Goldstein <amir73il@gmail.com>
Diffstat (limited to 'common/config')
-rw-r--r-- | common/config | 59 |
1 files changed, 59 insertions, 0 deletions
diff --git a/common/config b/common/config index c6428f90..558f148b 100644 --- a/common/config +++ b/common/config @@ -481,6 +481,65 @@ _fsck_opts() esac } +# check necessary running dependences then source sepcific fs helpers +_source_specific_fs() +{ + local fs=$1 + + if [ -z "$fs" ];then + fs=$FSTYP + fi + + case "$fs" in + xfs) + [ "$XFS_LOGPRINT_PROG" = "" ] && _fatal "xfs_logprint not found" + [ "$XFS_REPAIR_PROG" = "" ] && _fatal "xfs_repair not found" + [ "$XFS_DB_PROG" = "" ] && _fatal "xfs_db not found" + [ "$MKFS_XFS_PROG" = "" ] && _fatal "mkfs_xfs not found" + [ "$XFS_INFO_PROG" = "" ] && _fatal "xfs_info not found" + + . ./common/xfs + ;; + udf) + [ "$MKFS_UDF_PROG" = "" ] && _fatal "mkfs_udf/mkudffs not found" + ;; + btrfs) + [ "$MKFS_BTRFS_PROG" = "" ] && _fatal "mkfs.btrfs not found" + + . ./common/btrfs + ;; + ext4) + [ "$MKFS_EXT4_PROG" = "" ] && _fatal "mkfs.ext4 not found" + ;; + f2fs) + [ "$MKFS_F2FS_PROG" = "" ] && _fatal "mkfs.f2fs not found" + ;; + nfs) + . ./common/nfs + ;; + cifs) + ;; + 9p) + ;; + ceph) + . ./common/ceph + ;; + glusterfs) + ;; + overlay) + . ./common/overlay + ;; + reiser4) + [ "$MKFS_REISER4_PROG" = "" ] && _fatal "mkfs.reiser4 not found" + ;; + pvfs2) + ;; + ubifs) + [ "$UBIUPDATEVOL_PROG" = "" ] && _fatal "ubiupdatevol not found" + ;; + esac +} + known_hosts() { [ "$HOST_CONFIG_DIR" ] || HOST_CONFIG_DIR=`pwd`/configs |