Skip to content

Commit b1d2c1e

Browse files
fix(core): fix import swtpm binaries and missing libs (#953)
Fix import swtpm binaries (PR #922 ) /usr/bin/swtpm_setup --print-capabilities should give the right result # Output { "type": "swtpm_setup", "features": [ "tpm-1.2", "tpm-2.0", "cmdarg-keyfile-fd", "cmdarg-pwdfile-fd", "tpm12-not-need-root", "cmdarg-write-ek-cert-files", "cmdarg-create-config-files", "cmdarg-reconfigure-pcr-banks", "tpm2-rsa-keysize-2048", "tpm2-rsa-keysize-3072", "cmdarg-profile", "cmdarg-profile-remove-disabled" ], "profiles": [ "default-v1", "null", "custom" ], "version": "0.10.0" } --------- Signed-off-by: Nikita Korolev <nikita.korolev@flant.com>
1 parent 835e7a9 commit b1d2c1e

1 file changed

Lines changed: 21 additions & 3 deletions

File tree

images/virt-launcher/werf.inc.yaml

Lines changed: 21 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -146,6 +146,8 @@ binaries:
146146
- /usr/bin/openssl
147147
# Xorriso (Creates an image of an ISO9660 filesystem)
148148
- /usr/bin/xorriso-dd-target /usr/bin/xorrisofs
149+
# Swtpm
150+
- /usr/bin/swtpm /usr/bin/swtpm_bios /usr/bin/swtpm_cert /usr/bin/swtpm_ioctl /usr/bin/swtpm_localca /usr/bin/swtpm_setup
149151
# Dmidecode
150152
- /usr/sbin/biosdecode /usr/sbin/dmidecode
151153
# Numactl
@@ -234,10 +236,12 @@ import:
234236
includePaths:
235237
- node-labeller
236238
- vlctl
239+
237240
- image: packages/binaries/swtpm
238241
add: /swtpm
239-
to: /relocate
240-
after: setup
242+
to: /
243+
before: install
244+
241245
- image: tools/coreutils
242246
add: /
243247
to: /relocate
@@ -258,7 +262,18 @@ shell:
258262
- |
259263
apt-get update && apt-get install -y {{ $virtLauncherDependencies.libs | join " " }} {{ $virtLauncherDependencies.packages | join " " }}
260264
265+
# libtpms libtpms-devel require version 0.10 that in sisyphus repo
266+
cat >/etc/apt/sources.list.d/alt-sisyphus.list<<EOF
267+
rpm [alt] http://ftp.altlinux.org/pub/distributions/ALTLinux/Sisyphus x86_64 classic
268+
rpm [alt] http://ftp.altlinux.org/pub/distributions/ALTLinux/Sisyphus noarch classic
269+
EOF
270+
271+
apt-get update
272+
apt-get install -y libtpms
273+
rm -f /etc/apt/sources.list.d/alt-sisyphus.list
274+
261275
apt-get clean
276+
rm --recursive --force /var/lib/apt/lists/ftp.altlinux.org* /var/cache/apt/*.bin
262277
install:
263278
- |
264279
echo "Create folder hierarchy in VBINS"
@@ -277,7 +292,7 @@ shell:
277292
278293
LIBS="/usr/lib64/libbsd.so* /usr/lib64/libnbd.so* /usr/lib64/libfuse3.so*"
279294
LIBS+=" /usr/lib64/libjson-c.so* /usr/lib64/libssh.so* /usr/lib64/libssh2.so*"
280-
LIBS+=" /usr/lib64/libtpms.so*"
295+
LIBS+=" /usr/lib64/libtpms* /usr/lib64/libjson* /usr/lib64/libfuse*"
281296
LIBS+=" /usr/lib64/libxml2.so* /usr/lib64/libgcc_s*"
282297
283298
echo "Relocate additional libs for files in /VBINS"
@@ -297,6 +312,9 @@ shell:
297312
- |
298313
./relocate_binaries.sh -i "{{ $virtLauncherDependencies.binaries | join " " }}" -o /relocate
299314
315+
echo "Copy additional config swtpm"
316+
cp -a /etc/{swtpm_setup.conf,swtpm-localca.conf,swtpm-localca.options} /relocate/etc/
317+
300318
echo "Copy xattr config"
301319
cp -a /etc/xattr.conf /relocate/etc
302320

0 commit comments

Comments
 (0)