mirror of
https://github.com/systemd/systemd.git
synced 2024-11-23 18:23:32 +08:00
test: correctly process multiline strings in $KERNEL_APPEND
Some tests (like TEST-02) set a multiline string to $KERNEL_APPEND (which is a valid thing to do), unfortunately we'd use only the first line of it and throw the rest away, e.g: ``` $ printf "%s" "$x" hello this is a multiline kernel command line $ read -ra out <<< "$x" $ printf "%s" "${out[@]}" hello ``` Let's use readarray/mapfile instead to avoid this: ``` $ readarray out <<< "$x" $ printf "%s" "${out[@]}" hello this is a multiline kernel command line ```
This commit is contained in:
parent
c06b6d46fd
commit
bea9d62bdb
@ -498,7 +498,7 @@ run_qemu() {
|
||||
|
||||
if [[ -n "${KERNEL_APPEND:=}" ]]; then
|
||||
local user_kernel_append
|
||||
read -ra user_kernel_append <<< "$KERNEL_APPEND"
|
||||
readarray user_kernel_append <<< "$KERNEL_APPEND"
|
||||
kernel_params+=("${user_kernel_append[@]}")
|
||||
fi
|
||||
|
||||
@ -557,7 +557,7 @@ run_nspawn() {
|
||||
|
||||
if [[ -n "${KERNEL_APPEND:=}" ]]; then
|
||||
local user_kernel_append
|
||||
read -ra user_kernel_append <<< "$KERNEL_APPEND"
|
||||
readarray user_kernel_append <<< "$KERNEL_APPEND"
|
||||
kernel_params+=("${user_kernel_append[@]}")
|
||||
fi
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user