base-images/standard/initramfs-full.yaml
Joseph Marrero Corchado 1ade0b9de9 standard: Move clevis-pin-tpm2 to arch-specific packages
TPM2 hardware is only on x86_64 and aarch64. Move clevis-pin-tpm2 from
the generic packages list to packages-x86_64 and packages-aarch64.
Make the dracut config conditional on the binary being present.

Ref: https://redhat.atlassian.net/browse/RHEL-138232
Signed-off-by: Joseph Marrero Corchado <jmarrero@redhat.com>
2026-07-28 14:51:19 -04:00

20 lines
695 B
YAML

# Configuration for the initramfs
postprocess:
- |
#!/usr/bin/env bash
set -xeuo pipefail
mkdir -p /usr/lib/dracut/dracut.conf.d
cat > /usr/lib/dracut/dracut.conf.d/30-bootc-standard.conf << 'EOF'
add_dracutmodules+=" lvm crypt fips "
EOF
# Clevis in initramfs for LUKS auto-unlock.
# clevis-pin-tpm2 is only on x86_64/aarch64 (TPM2 hardware arches).
if test -x /usr/bin/clevis-pin-tpm2; then
cat > /usr/lib/dracut/dracut.conf.d/50-bootc-clevis.conf << 'EOF'
add_dracutmodules+=" clevis clevis-pin-tpm2 "
EOF
else
cat > /usr/lib/dracut/dracut.conf.d/50-bootc-clevis.conf << 'EOF'
add_dracutmodules+=" clevis "
EOF
fi