diff options
author | Amir Goldstein <amir73il@gmail.com> | 2023-12-04 20:58:57 +0200 |
---|---|---|
committer | Zorro Lang <zlang@kernel.org> | 2023-12-16 01:57:16 +0800 |
commit | 400ed0ed69d64f73b9e33bdf56b6008feae556ee (patch) | |
tree | b900a37318692960bd1b546c862503876d109e7c /common | |
parent | f0f8f248dd0b7f0c384ad3f1550174d34c7507e4 (diff) |
overlay: prepare for new lowerdir+,datadir+ tests
In preparation to forking tests for new lowerdir+,datadir+ mount options,
prepare a helper to test kernel support and pass datadirs into mount
helpers in overlay/079 test.
Signed-off-by: Amir Goldstein <amir73il@gmail.com>
Reviewed-by: Zorro Lang <zlang@redhat.com>
Signed-off-by: Zorro Lang <zlang@kernel.org>
Diffstat (limited to 'common')
-rw-r--r-- | common/overlay | 15 |
1 files changed, 15 insertions, 0 deletions
diff --git a/common/overlay b/common/overlay index 8f275228..ea1eb7b1 100644 --- a/common/overlay +++ b/common/overlay @@ -247,6 +247,21 @@ _require_scratch_overlay_lowerdata_layers() _scratch_unmount } +# Check kernel support for lowerdir+=<lowerdir>,datadir+=<lowerdatadir> format +_require_scratch_overlay_lowerdir_add_layers() +{ + local lowerdir="$OVL_BASE_SCRATCH_MNT/$OVL_UPPER" + local datadir="$OVL_BASE_SCRATCH_MNT/$OVL_LOWER" + + _scratch_mkfs > /dev/null 2>&1 + $MOUNT_PROG -t overlay $OVL_BASE_SCRATCH_MNT $SCRATCH_MNT \ + -o"lowerdir+=$lowerdir,datadir+=$datadir" \ + -o"redirect_dir=follow,metacopy=on" > /dev/null 2>&1 || \ + _notrun "overlay lowerdir+,datadir+ not supported on ${SCRATCH_DEV}" + + _scratch_unmount +} + # Helper function to check underlying dirs of overlay filesystem _overlay_fsck_dirs() { |