Skip to content

Change host config autodetect order

The documentation and code don't seem to express the same thing with regards to the order where hostconfig is looked for.

https://git.glasklar.is/system-transparency/core/stboot/-/blob/main/host/configautodetect.go#L35

// ConfigAutodetect looks for a known host configuration name in following order:
// - inside the initramfs at HostConfigInitrdPath
// - at the efivar filesystem for HostConfigEFIVarName

and a bit further down the code says

	var loadingOrder = []configLoader{
		&efivar{},
		&initramfs{},
		&provision{},
	}

I'm not certain which order is best, but I think that the documentation's got it right: First look at what the initramfs is carrying, and only when that's not found go to efivars.