swtpm_bios(8)

πŸ’– swtpm_bios(8) β€” the BIOS-simulator bestie πŸ’–

Okay so picture this: it's swtpm_bios, the manual page, and she's here to explain the tool that does the BIOS's little TPM warm-up routine. Iykyk.

✨ NAME ✨

swtpm_bios β€” a BIOS simulation tool for swtpm, fr fr 🌸

πŸŽ€ SYNOPSIS πŸŽ€

swtpm_bios [OPTIONS]

πŸ¦‹ DESCRIPTION πŸ¦‹

So swtpm_bios is that girl πŸ’… β€” she sends the exact commands to the TPM (that's the swtpm program) that the BIOS typically uses to initialize the TPM. And you get options, bestie β€” several command line options β€” to pick which state you want the TPM set to. Choose your fighter. ✨

Heads up, queen πŸ‘‘: this command requires the environment variable TCSD_USE_TCP_DEVICE to be set if you're communicating via TCP. No variable, no TCP. Periodt.

If you're not doing TCP, it'll use the device set in the environment variable TPM_DEVICE, or fall back to /dev/tpm0 for sending the commands. Slight "we'll figure it out" energy, but okay.

In TCP mode, the environment variable TCSD_TCP_DEVICE_HOSTNAME tells it which host to send the commands to. Default assumption is localhost. And the default TCP port is 6545 β€” unless the environment variable TCSD_TCP_DEVICE_PORT says otherwise. πŸ’«

🌈 Return codes (vibe check) 🌈

  • 0 β€” success, we ate πŸ“
  • 128 β€” a TPM error was encountered 😭
  • 255 β€” communication failure πŸ’€
  • 129 β€” the TPM needs to be reset to become activated πŸ™ˆ

🌸 The command sequence it sends 🌸

This command will send the following sequence of commands to the TPM:

TPM_Startup(chosen mode) -- startup TPM
TSC_PhysicalPresence(0x20) -- PhysicalPresenceCMDEnable
TSC_PhysicalPresence(0x08) -- turn on physical presence
TPM_GetCapability -- get permanent flags
TPM_PhysicalEnable -- enable the TPM
TPM_PhysicalSetDeactivated(0x0) -- activate TPM
TPM_ContinueSelfTest -- continue self test
TSC_PhysicalPresence(0x20) -- PhysicalPresenceCMDEnable
TSC_PhysicalPresence(0x14) -- turn off physical presence & lock it

Lowkey iconic lineup. πŸ”₯


πŸ’œ OPTIONS πŸ’œ

The following options are supported:

  • --tpm-device <device> β€” use the given device instead of the default /dev/tpm0. This one overrides the TPM_DEVICE environment variable, so she's got main character energy over that env var. πŸŽ€
  • --tcp <server>:<port> β€” connect to the given server and port. No server given? Then 127.0.0.1 is used. No port given? Then the default port 6545 is used. Flexible queen. ✨
  • --unix <path> β€” connect to the given UnixIO path. πŸ¦‹
  • -tpm2 β€” the device is a TPM 2. Noted, bestie.
  • -c β€” send TPM_Startup(ST_CLEAR) (default). This instructs the TPM to start with clear state. Fresh start, clean slate, we love it. 🌸
  • -s β€” send TPM_Startup(ST_STATE). This instructs the TPM to start by restoring previously saved state. Nostalgic era. πŸ’«
  • -d β€” send TPM_Startup(ST_DEACTIVATED). This instructs the TPM to start in deactivated mode. ⚠️ This option has no effect on a TPM 2 β€” so don't come for her if nothing happens.
  • -n β€” don't send a TPM_Startup command. Skipping it, respectfully. πŸ™ˆ
  • -o β€” only send the startup command and nothing else. Minimalist icon. πŸ’…
  • -ea β€” make sure that the TPM is activated; if the TPM requires a reset, the program will exist and return a return code of 129. πŸ’€ (That's exactly how the original words it β€” "the program will exist" β€” so yes, you read that right.)
  • -cs β€” send a TPM_ContinueSelfTest command to a TPM 1.2 and a TPM2_IncrementalSelfTest command to a TPM 2. Knows both dialects, bilingual legend. 🌈
  • -u β€” give up physical presence on a TPM 1.2. In case of a TPM 2, set the platform hierarchy to a random password. Random password era πŸ”βœ¨
  • -v β€” display version and exit. Bye bestie πŸ‘‹
  • -h β€” display the help screen and exit. 🫢

πŸ‘€ SEE ALSO πŸ‘€

(Yeah… the original leaves this one empty. Nothing to see here. Moving on. πŸ’€)

πŸ› REPORTING BUGS πŸ›

Report bugs to Stefan Berger <stefanb@linux.vnet.ibm.com> β€” be nice, be specific, include the deets. 🫢


Mwah πŸ’– that's the whole page! This lil swtpm_bios(8) situation comes from the swtpm source, dated 2026-08-23 β€” go forth and initialize those TPMs, bestie. βœ¨πŸŽ€πŸ¦‹

πŸ“¦ where this page comes from