Skip to content

Commit

Permalink
Enables 'fdo.di_mfg_string_type_mac_iface' variable passing
Browse files Browse the repository at this point in the history
Makes necessary changes for 'fdo.di_mfg_string_type_mac_iface' variable to be passed to manufacturing-client.service when the manufacturing-client is run via the simplified-installer.
  • Loading branch information
djach7 authored and achilleas-k committed Dec 12, 2023
1 parent d63f557 commit 5641637
Show file tree
Hide file tree
Showing 3 changed files with 11 additions and 6 deletions.
5 changes: 3 additions & 2 deletions pkg/blueprint/customizations.go
Original file line number Diff line number Diff line change
Expand Up @@ -45,8 +45,9 @@ type FDOCustomization struct {
DiunPubKeyInsecure string `json:"diun_pub_key_insecure,omitempty" toml:"diun_pub_key_insecure,omitempty"`
// This is the output of:
// echo "sha256:$(openssl x509 -fingerprint -sha256 -noout -in diun_cert.pem | cut -d"=" -f2 | sed 's/://g')"
DiunPubKeyHash string `json:"diun_pub_key_hash,omitempty" toml:"diun_pub_key_hash,omitempty"`
DiunPubKeyRootCerts string `json:"diun_pub_key_root_certs,omitempty" toml:"diun_pub_key_root_certs,omitempty"`
DiunPubKeyHash string `json:"diun_pub_key_hash,omitempty" toml:"diun_pub_key_hash,omitempty"`
DiunPubKeyRootCerts string `json:"diun_pub_key_root_certs,omitempty" toml:"diun_pub_key_root_certs,omitempty"`
DiMfgStringTypeMacIface string `json:"di_mfg_string_type_mac_iface,omitempty" toml:"di_mfg_string_type_mac_iface,omitempty"`
}

type KernelCustomization struct {
Expand Down
9 changes: 5 additions & 4 deletions pkg/customizations/fdo/fdo.go
Original file line number Diff line number Diff line change
Expand Up @@ -3,10 +3,11 @@ package fdo
import "github.com/osbuild/images/pkg/blueprint"

type Options struct {
ManufacturingServerURL string
DiunPubKeyInsecure string
DiunPubKeyHash string
DiunPubKeyRootCerts string
ManufacturingServerURL string
DiunPubKeyInsecure string
DiunPubKeyHash string
DiunPubKeyRootCerts string
DiMfgStringTypeMacIface string
}

func FromBP(bpFDO blueprint.FDOCustomization) *Options {
Expand Down
3 changes: 3 additions & 0 deletions pkg/image/ostree_simplified_installer.go
Original file line number Diff line number Diff line change
Expand Up @@ -127,6 +127,9 @@ func (img *OSTreeSimplifiedInstaller) InstantiateManifest(m *manifest.Manifest,
if img.FDO.DiunPubKeyRootCerts != "" {
kernelOpts = append(kernelOpts, "fdo.diun_pub_key_root_certs=/fdo_diun_pub_key_root_certs.pem")
}
if img.FDO.DiMfgStringTypeMacIface != "" {
kernelOpts = append(kernelOpts, "fdo.di_mfg_string_type_mac_iface="+img.FDO.DiMfgStringTypeMacIface)
}
}

bootTreePipeline.KernelOpts = kernelOpts
Expand Down

0 comments on commit 5641637

Please sign in to comment.