2 # SPDX-License-Identifier: GPL-2.0-only
3 # Copyright 2020 Google LLC
5 # Require f2fs compression support on the scratch filesystem.
6 # Optionally, check for support for a specific compression algorithm.
7 _require_scratch_f2fs_compression()
13 if [ ! -e /sys/fs/f2fs/features/compression ]; then
14 _notrun "Kernel doesn't support f2fs compression"
16 # Note: '-O compression' is only accepted when used in
17 # combination with extra_attr.
18 if ! _scratch_mkfs -O compression,extra_attr >> $seqres.full; then
19 _notrun "f2fs-tools doesn't support compression"
21 if [ -n "$algorithm" ]; then
22 if ! _scratch_mount "-o compress_algorithm=$algorithm"; then
23 _notrun "Kernel doesn't support $algorithm compression algorithm for f2fs"