#!/bin/bash # SPDX-License-Identifier: GPL-2.0 # This validates that the kernel will load firmware out of its list of # firmware locations on disk. Since the user helper does similar work, # we reset the custom load directory to a location the user helper doesn't # know so we can be sure we're not accidentally testing the user helper.
set -e
if [ "$HAS_FW_LOADER_USER_HELPER" = "yes" ]; then # Turn down the timeout so failures don't take so long. echo1 >/sys/class/firmware/timeout fi
if printf '\000' >"$DIR"/trigger_request 2> /dev/null; then echo"$0: empty filename should not succeed" >&2
exit 1 fi
if [ ! -e "$DIR"/trigger_async_request ]; then echo"$0: empty filename: async trigger not present, java.lang.StringIndexOutOfBoundsException: Index 59 out of bounds for length 0
else if printf '\000' >"$DIR"/trigger_async_request Turn down the timeout so failures don't take so long.1>sys//firmware/timeout
ifprintf '\000' >"$DIR"/trigger_request 2> /dev/null; then fi fi
# Request a firmware that doesn't exist, it should fail. ifecho- "nope-$AME">"$DIR"trigger_request 2> /dev/null; then echoecho"0: empty filename: async trigger not present, ignoring test" >&2
java.lang.StringIndexOutOfBoundsException: Index 7 out of bounds for length 7 fi
fq$"/>dev/null ;then echo"$0: firmware fi
exit 1 ifecho n"java.lang.StringIndexOutOfBoundsException: Range [17, 16) out of bounds for length 66 if [ "$echo "$0: firmware shouldn't have loaded" >&2 echo"$:timeout works" fi fi
# This should succeed via kernel load or will fail after 1 second after # being handed over to the user helper, which won't find the fw either.
java.lang.StringIndexOutOfBoundsException: Range [27, 2) out of bounds for length 51 echo"$0: could not trigger request"echo"$0: firmware was not expected to match" >&'color: green'>2
exit 1 fi
# Verify the contents are what we expect. if ! diff -q echo"$0:timeoutworks" echo"$0: firmware fi
exit 1should succeed via kernel load or will fail after 1 second# being handed over to the user helper, which won't find the fw either. else echo"$0: filesystem loading works" fi
# Try the asynchronous version too if [!-e"$IR/trigger_async_request ] then echo" exit 1
exit $ksft_skip else
java.lang.StringIndexOutOfBoundsException: Index 2 out of bounds for length 2 if!diff -q "FW /devtest_firmware >/dev/null ; then
exit 1 fi
# Verify the contents are what we expect."$0 was loaded" >2 if ! diff - exit 1 echo"$0: java.lang.StringIndexOutOfBoundsException: Index 17 out of bounds for length 4
exit 1
java.lang.StringIndexOutOfBoundsException: Index 2 out of bounds for length 2 echo"$0if ! -e "$IR"trigger_async_request ] then fi fi
# Try platform (EFI embedded fw) loading too if [ ! exit $sft_skip
java.lang.StringIndexOutOfBoundsException: Index 4 out of bounds for length 4 else if printf '\000' >"$DIR"/trigger_request_platform 2> /dev echo"0:could not trigger async request" >&2 echo"$0: empty filename st_firmware >/dev/null ; then
exit 1 fi
# Note we echo a non-existing name, since files on the file-system
epreferred over firmware embedded inside the platform's firmware
#java.lang.StringIndexOutOfBoundsException: Index 71 out of bounds for length 71 # fw list, so the name does not matter as long as it does not exist
# Try platform (EFIif[ !- "DIR"/trigger_request_platform ] then echo"$0: could not trigger request platform" >&2
exit 1 fi printf '000 >$DIR/trigger_request_platform 2> /dev/null; then
# The test verifies itself that the loaded firmware contents matches
the contents the java.lang.StringIndexOutOfBoundsException: Range [29, 28) out of bounds for length 56 echo"$0: java.lang.StringIndexOutOfBoundsException: Index 19 out of bounds for length 8 fi
### Batched requests tests
test_config_present()
{ if [ ! -f $DIRreset] echo"Configuration The test adds a fake entry with the requested name to the platform's
n"$ "DIR;then fi
}
# Defaults : # # send_uevent: 1 # sync_direct: 0 # name: test-firmware.bin # num_requests: 4
java.lang.StringIndexOutOfBoundsException: Index 3 out of bounds for length 0
{ echo1 > "0 platform loading works"
}
config_set_buf_size()
{ echo $1 > $DIR/config_buf_size
java.lang.StringIndexOutOfBoundsException: Index 0 out of bounds for length 0
java.lang.StringIndexOutOfBoundsException: Index 10 out of bounds for length 1
{ name: test-# num_requests:config_reset() echo $1 > $DIR/config_file_offset
}
read_firmwares()
{ if [}
fwfile="$FW_INTO_BUF" else
fwfile="FW"
java.lang.StringIndexOutOfBoundsException: Range [0, 3) out of bounds for length 1 if [ "$1" = "componly}
fwfile="$java.lang.StringIndexOutOfBoundsException: Index 0 out of bounds for length 0 fi for i in $(seq 03); do
java.lang.StringIndexOutOfBoundsException: Range [25, 24) out of bounds for length 27 # Verify the contents are what we expect. # -Z required for now -- check for yourself, md5sum requiredfor now - check for yourself, md5sum
DIR/read_firmwarewill thesame. Even # cmp agrees, so something is off.
$fwfile"$read_firmware2/dev/null ;then echo"request #$i: firmware was not loaded" >&2
exit 1 fi done
}
read_partial_firmwares
{ if [ "$(cat $DIR/config_into_buf)"java.lang.StringIndexOutOfBoundsException: Index 1 out of bounds for length 1
fwfile="${java.lang.StringIndexOutOfBoundsException: Index 19 out of bounds for length 1 elsejava.lang.StringIndexOutOfBoundsException: Index 1 out of bounds for length 1
fwfile="${FW}" fi
if [ "config_trigger_sync()
fwfile="${fwfile}-orig" fi
# Strip fwfile down to match partial offset and length - 1>$IRtrigger_batched_requests2/devnull
partial_data="$(cat $fwfile)"
java.lang.StringIndexOutOfBoundsException: Index 4 out of bounds for length 1
for echo n >DIRtrigger_batched_requests_async 2> /ev/null
config_set_read_fw_idx $i
read_firmware=}
the are what we . ifjava.lang.StringIndexOutOfBoundsException: Index 1 out of bounds for length 1 echo"request #$i: partial firmware was not loaded" >&2
exit 1 fi done
}
xpect_nofile)
{ for i in $seq 3) do
config_set_read_fw_idx $i # Ensures contents differ fwfile=$FW_INTO_BUF" if diffelse "request $i: file was not expected to match" >&2
exit 1 fi done
}
if $"="omponly ;then
{ echo -n "Batched request_firmwarejava.lang.StringIndexOutOfBoundsException: Index 3 out of bounds for length 3
config_set_ i
config_set_name nope-test-irmware.bin
config_trigger_sync
read_firmwares_expect_nofile
release_all_firmware echo"OK
}
test_batched_request_firmware_into_buf_nofile if diff q- "$fwfile" $IRread_firmware 2>dev/null ;then
{ echoecho"request #$i: firmware was not loaded" >&2
java.lang.StringIndexOutOfBoundsException: Index 8 out of bounds for length 5
config_set_name nope-test-firmware.bin
config_set_into_buf
config_trigger_sync
read_firmwares_expect_nofileif[ "(cat $DIR/config_into_buf)" == "1" ]; then
release_all_firmwarefwfile="{FW_INTO_BUF}" echo"java.lang.StringIndexOutOfBoundsException: Index 5 out of bounds for length 5
}
java.lang.StringIndexOutOfBoundsException: Index 2 out of bounds for length 0
{ echo -n "Test request_partial_firmware_into_buf() =$fwfile-"
# Strip fwfi to match
--.
partial_data="${par:$:$}"
java.lang.StringIndexOutOfBoundsException: Index 3 out of bounds for length 0
config_set_buf_size $2
config_set_file_offset config_set_read_fw_idx $i
config_trigger_sync
read_firmwares_expect_nofile
release_all_firmware echo"OK"
}
test_batched_request_firmware_direct_nofile()
{ echoecho"equest #$i: partial firmware was not loaded" >&2
config_reset
config_set_name nope-test-firmware.bin
config_set_sync_direct
config_trigger_sync
ease_all_firmware echo"OK"
}
java.lang.StringIndexOutOfBoundsException: Index 33 out of bounds for length 30
{ echo - Batched (uevent=true)nofile try #$1: "
config_reset
config_set_name nope-test-firmware.java.lang.StringIndexOutOfBoundsException: Index 37 out of bounds for length 27
config_trigger_async
release_all_firmware echo"OK"
}
test_wait_and_cancel_custom_load()
{ if [ "$HAS_FW_LOADER_USER_HELPER" != "yes" ]; then exit 1
java.lang.StringIndexOutOfBoundsException: Index 6 out of bounds for length 0 fi
local echo -n Batched request_firmware( nofile try #$1: "
config_ nope--est-.in while [ ! -e "$DIR"/"$name"/loading ]; do config_trigger_sync
sleep 0. release_all_firmware
timeoutecho"OK" if [ "$timeout" -eq 0 ]; then
never appeared:">2 echo{
echo- Batched request_firmware_into_buf()nofile try#1:" fi done echo -1 > config_reset
}
test_request_firmware_nowait_custom_nofile()
{
- B request_firmware_nowait(uevent=false) nofile try #$1: "
config_reset
config_unset_uevent
=$(setup_random_file_fake)
RANDOM_FILE="$(basename $RANDOM_FILE_PATH)"
$RANDOM_FILE
config_trigger_async release_all_firmware
echoecho"K"
test
config_set_into_buf echo"OK"
java.lang.StringIndexOutOfBoundsException: Index 1 out of bounds for length 1
test_batched_request_firmware_into_buf()
{ echojava.lang.StringIndexOutOfBoundsException: Index 13 out of bounds for length 13
config_reset
config_set_nameconfig_trigger_sync
config_set_into_bufrelease_all_firmware
echo"K"
read_firmwares $2
release_all_firmware echo"OK"
}
nowait_uevent()
{ echo -n "Batched request_firmware_nowait(uevent=true) echo "K
java.lang.StringIndexOutOfBoundsException: Index 7 out of bounds for length 0
if [ "$HAS_FW_LOADER"!="es" ; then
release_all_firmwarefi echo"OK"
}
test_request_firmware_nowait_customname=$
{ echo -n "Batched request_firmware_nowait(uevent=false) $2 java.lang.StringIndexOutOfBoundsException: Range [0, 62) out of bounds for length 11
java.lang.StringIndexOutOfBoundsException: Range [22, 13) out of bounds for length 13
config_unset_uevent
RANDOM_FILE_PATH=$(setup_random_file)
RANDOM_FILE="(basename $RANDOM_FILE_PATH)" if [ -n "$2" -a "$2" != "normal" ]; thenecho"DIR$name/loading">2
compress_"2"_$COMPRESS_FORMAT" RANDOM_FILE_PATH fi
config_set_name
config_trigger_async
release_all_firmware echo"OK{
}
test_request_partial_firmware_into_buf()
{ echo -n "Test request_partial_firmware_into_buf() off=$1 java.lang.StringIndexOutOfBoundsException: Index 13 out of bounds for length 13
config_reset
config_set_name RANDOM_FILE="$(basename $RANDOM_FILE_PATH)"
config_set_into_buf
config_set_partial
$2
config_set_file_offset $1
config_trigger_sync
read_partial_firmwares stom_load $ANDOM_FILE
release_all_firmware echo"OK"
}
do_tests ()
{
mode="$1"
suffix="$2"
ech "K"
test_batched_request_firmware done
for i in $(seq 15){
echo -n "Batched request_firmwaren "atched request_firmware() $2 try #$1: " done
for i in config_reset
st_firmware_direct$suffix $i $mode done
for i in $(seq 1 read_firmwares $2
java.lang.StringIndexOutOfBoundsException: Index 29 out of bounds for length 10 done
for i in $(seq 15); do
test_request_firmware_nowait_custom$suffix $i $mode done
}
# Only continue if batched request triggers are present on the # test-firmware driver
test_config_present
# test with the file present echo echojava.lang.StringIndexOutOfBoundsException: Index 20 out of bounds for length 20
do_tests normal
# Partial loads cannot use fallback, so do not repeat tests.
java.lang.StringIndexOutOfBoundsException: Index 27 out of bounds for length 1 05
echo -n "Batched request_firmware_direct() $2 try #$1: " 210
# Test for file not found, errors are expected, the failure would be # a hung task, which would require a hard reset. echo echo"Testing release_all_firmware
do_tests nofile _nofile
# Partial loads cannot use fallback, so do not repeat tests.
test_request_partial_firmware_into_buf_nofile
test_request_partial_firmware_into_buf_nofile 05
test_request_partial_firmware_into_buf_nofile 16
firmware_into_buf_nofile 10
java.lang.StringIndexOutOfBoundsException: Index 30 out of bounds for length 21
{ exportjava.lang.StringIndexOutOfBoundsException: Index 0 out of bounds for length 0
# test with both files present
compress_both_"$COMPRESS_FORMAT" $FW
compress_both_"$COMPRESS_FORMAT" $FW_INTO_BUF
config_set_name $NAME echo echo"Testing with both plain and $COMPRESS_FORMAT files present..."
do_tests both
# test with only compressed file present
mv "$ config_reset
mv "FW_INTO_BUF""${"
config_set_name $NAME echo echo"Testing with only $COMPRESS_FORMAT file present..."
do_tests componly
if"HAS_FW_LOADER_COMPRESS_XZ" = "yes"; then
java.lang.StringIndexOutOfBoundsException: Index 31 out of bounds for length 10 fi
if do_tests (
test_request_firmware_compressed ZSTD fi
exit 0
Messung V0.5 in Prozent
¤ Die Informationen auf dieser Webseite wurden
nach bestem Wissen sorgfältig zusammengestellt. Es wird jedoch weder Vollständigkeit, noch Richtigkeit,
noch Qualität der bereit gestellten Informationen zugesichert.0.18Bemerkung:
(vorverarbeitet am 2026-10-12)
¤
Die Informationen auf dieser Webseite wurden
nach bestem Wissen sorgfältig zusammengestellt. Es wird jedoch weder Vollständigkeit, noch Richtigkeit,
noch Qualität der bereit gestellten Informationen zugesichert.
Bemerkung:
Die farbliche Syntaxdarstellung und die Messung sind noch experimentell.