/*
* SysDeck - Firmware Panel
* Author: Jeremy Anderson (https://dcos.net)
*
* Uses fwupdmgr to enumerate firmware devices and tpm2_pcrread to dump
* the first PCR register (boot chain proof). Both calls fail closed
* with informative cards when the underlying tools are absent.
*/
export async function mount(panel, { bridge, EventBus }) {
panel.innerHTML = renderSkeleton();
const [devices, tpmPcr0] = await Promise.allSettled([
bridge.firmware.devices(),
bridge.firmware.tpmInfo(),
]);
const deviceList = devices.value?.Devices ?? [];
panel.innerHTML = `
fwupd + TPM 2.0Firmware Control
| Name | Vendor | Version | Flags |
|---|---|---|---|
| ${d.Name} | ${d.Vendor ?? '—'} | ${d.Version ?? '—'} | ${(d.Flags ?? []).join(', ') || '—'} |
| No fwupd devices. | |||
${escapeHtml(tpmPcr0.value ?? 'tpm2-tools not installed')}