shared: add userspace cpio writer for credentials

Add a small newc-format cpio encoder that builds an archive with each
credential as a file under .extra/system_credentials/<id>.cred and
writes it to a temp file. This mirrors what systemd-stub produces from
ESP credentials, so PID1's import_credentials_boot() picks them up
unchanged via the new /.extra/system_credentials/ initrd path.

Motivated by vmspawn under SEV-SNP, where SMBIOS credentials aren't
covered by the launch measurement and are discarded by PID1 in
confidential guests, so they must be delivered via the measured initrd
instead. The writer lives in src/shared/ so other host-side tooling
can reuse it.

Signed-off-by: Paul Meyer <katexochen0@gmail.com>
This commit is contained in:
Paul Meyer
2026-06-24 12:47:42 +02:00
parent 9e7b8b734f
commit 62fde7bc06
5 changed files with 287 additions and 0 deletions
+1
View File
@@ -103,6 +103,7 @@ shared_sources = files(
'image-policy.c',
'import-util.c',
'in-addr-prefix-util.c',
'initrd-cpio.c',
'install-file.c',
'install-printf.c',
'install.c',