#!/bin/bash

build() {
    # Add required binaries
    add_binary systemd-measure
    add_binary systemd-cryptenroll
    add_binary tpm2_createprimary
    add_binary tpm2_pcrread
    
    # Add required files
    add_file /usr/lib/systemd/system-generators/systemd-cryptsetup-generator
}

help() {
    cat <<HELPEOF
This hook adds TPM2 PCR signing support for secure boot measurements.
It requires systemd-measure and tpm2-tools to be installed.

Configuration options in mkinitcpio.conf:
  TPM2_PRIVKEY   Path to private signing key
  TPM2_PUBKEY    Path to public signing key
  TPM2_PCRS      Comma-separated list of PCRs to measure
HELPEOF
} 