Mellanox / bfscripts

Collection of scripts used for BlueField SoC system management.
BSD 2-Clause "Simplified" License
17 stars 27 forks source link

bfcfg: add capsule support for MFG programing #196

Closed kblaiech closed 9 months ago

kblaiech commented 9 months ago

The 'bfcfg' command is used to program the MFG and configure the UEFI settings and other parameters. As of today the MFG is programed through sysfs interfaces. Once programed, the data is SW protected against writes and can only be reset through UEFI. Hence a method is then required to re-program the MFG data which can be safely initiated by 'bcfg'.

For this puprose, an EFI Capsule is generated and may contain MFG data, MFG extension data and other configuration dependencies such as the UEFI system attributes and the Redfish parameters.

This commit implements the following:

Note that the capsule file generated to program the MFG and its dependenices must be processed first. Thus it has a static name, expected '.bfcfg-mfg.cap'. The UEFI Capsule Runtime DXE sorts the capsule files by name; since the 'bfcfg' can also apply EnrollKeysCap to enable UEFI secure boot, the unsigned capsule file '.bfcfg-mfg.cap' won't be processed after the PK is enrolled.

Also note that the MFG reprograming is limited by the state of the UEFI Secure Boot and whether the PK is configured or not.