import-creds: add support for binary credentials specified on the kernel cmdline

This commit is contained in:
Lennart Poettering
2023-07-04 23:19:48 +02:00
parent 49850c1ee3
commit de70ecb328
7 changed files with 37 additions and 11 deletions
+1
View File
@@ -25,6 +25,7 @@ KERNEL_CREDS=(
"systemd.set_credential=sysctl.extra:kernel.domainname=sysctltest"
"systemd.set_credential=login.motd:hello"
"systemd.set_credential=login.issue:welcome"
"systemd.set_credential_binary=waldi:d29vb29mZmZ3dWZmZnd1ZmYK"
"rd.systemd.import_credentials=no"
)
KERNEL_APPEND="${KERNEL_APPEND:-} ${KERNEL_CREDS[*]}"
+1
View File
@@ -176,6 +176,7 @@ if systemd-detect-virt -q -c ; then
elif [ -d /sys/firmware/qemu_fw_cfg/by_name ]; then
# Verify that passing creds through kernel cmdline works
[ "$(systemd-creds --system cat kernelcmdlinecred)" = "uff" ]
[ "$(systemd-creds --system cat waldi)" = "woooofffwufffwuff" ]
# And that it also works via SMBIOS
[ "$(systemd-creds --system cat smbioscredential)" = "magicdata" ]