提交 b3625b13 编写于 作者: T Takashi Iwai 提交者: Greg Kroah-Hartman

selftests: firmware: Use smaller dictionary for XZ compression

The xz -9 option leads to an unnecessarily too large dictionary that
isn't really suitable for the kernel firmware loader.  Pass the
dictionary size explicitly, instead.

While we're at it, make the xz command call defined in $RUN_XZ for
simplicity.

Fixes: 108ae07c ("selftests: firmware: Add compressed firmware tests")
Signed-off-by: NTakashi Iwai <tiwai@suse.de>
Link: https://lore.kernel.org/r/20220421152908.4718-3-tiwai@suse.deSigned-off-by: NGreg Kroah-Hartman <gregkh@linuxfoundation.org>
上级 23cfbc6e
...@@ -11,6 +11,8 @@ TEST_REQS_FW_SET_CUSTOM_PATH="yes" ...@@ -11,6 +11,8 @@ TEST_REQS_FW_SET_CUSTOM_PATH="yes"
TEST_DIR=$(dirname $0) TEST_DIR=$(dirname $0)
source $TEST_DIR/fw_lib.sh source $TEST_DIR/fw_lib.sh
RUN_XZ="xz -C crc32 --lzma2=dict=2MiB"
check_mods check_mods
check_setup check_setup
verify_reqs verify_reqs
...@@ -410,9 +412,9 @@ test_request_firmware_nowait_custom() ...@@ -410,9 +412,9 @@ test_request_firmware_nowait_custom()
RANDOM_FILE_PATH=$(setup_random_file) RANDOM_FILE_PATH=$(setup_random_file)
RANDOM_FILE="$(basename $RANDOM_FILE_PATH)" RANDOM_FILE="$(basename $RANDOM_FILE_PATH)"
if [ "$2" = "both" ]; then if [ "$2" = "both" ]; then
xz -9 -C crc32 -k $RANDOM_FILE_PATH $RUN_XZ -k $RANDOM_FILE_PATH
elif [ "$2" = "xzonly" ]; then elif [ "$2" = "xzonly" ]; then
xz -9 -C crc32 $RANDOM_FILE_PATH $RUN_XZ $RANDOM_FILE_PATH
fi fi
config_set_name $RANDOM_FILE config_set_name $RANDOM_FILE
config_trigger_async config_trigger_async
...@@ -501,7 +503,7 @@ test_request_partial_firmware_into_buf_nofile 2 10 ...@@ -501,7 +503,7 @@ test_request_partial_firmware_into_buf_nofile 2 10
test "$HAS_FW_LOADER_COMPRESS" != "yes" && exit 0 test "$HAS_FW_LOADER_COMPRESS" != "yes" && exit 0
# test with both files present # test with both files present
xz -9 -C crc32 -k $FW $RUN_XZ -k $FW
config_set_name $NAME config_set_name $NAME
echo echo
echo "Testing with both plain and xz files present..." echo "Testing with both plain and xz files present..."
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册