Skip to content

Commit

Permalink
Remove Viper from GenerateEveCerts
Browse files Browse the repository at this point in the history
This is related to lf-edge#855

Signed-off-by: Pavel Abramov <[email protected]>
  • Loading branch information
uncleDecart committed Oct 23, 2024
1 parent f81d991 commit a818a46
Show file tree
Hide file tree
Showing 3 changed files with 4 additions and 4 deletions.
2 changes: 1 addition & 1 deletion cmd/certs.go
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ func newCertsCmd(cfg *openevec.EdenSetupArgs) *cobra.Command {
Short: "manage certs",
Long: `Managed certificates for Adam and EVE.`,
Run: func(cmd *cobra.Command, args []string) {
if err := eden.GenerateEveCerts(cfg.Eden.CertsDir, cfg.Adam.CertsDomain, cfg.Adam.CertsIP, cfg.Adam.CertsEVEIP, cfg.Eve.CertsUUID, cfg.Eve.DevModel, cfg.Eve.Ssid, cfg.Eve.Password, grubOptions, cfg.Adam.APIv1); err != nil {
if err := eden.GenerateEveCerts(cfg.Eden.CertsDir, cfg.Adam.CertsDomain, cfg.Adam.CertsIP, cfg.Adam.CertsEVEIP, cfg.Eve.CertsUUID, cfg.Eve.DevModel, cfg.Eve.Ssid, cfg.Eve.Arch, cfg.Eve.Password, grubOptions, cfg.Adam.APIv1); err != nil {
log.Errorf("cannot GenerateEveCerts: %s", err)
} else {
log.Info("GenerateEveCerts done")
Expand Down
4 changes: 2 additions & 2 deletions pkg/eden/eden.go
Original file line number Diff line number Diff line change
Expand Up @@ -385,7 +385,7 @@ func StatusEServer() (status string, err error) {
}

// GenerateEveCerts function generates certs for EVE
func GenerateEveCerts(certsDir, domain, ip, eveIP, uuid, devModel, ssid, password string, grubOptions []string, apiV1 bool) (err error) {
func GenerateEveCerts(certsDir, domain, ip, eveIP, uuid, devModel, ssid, arch, password string, grubOptions []string, apiV1 bool) (err error) {
model, err := models.GetDevModelByName(devModel)
if err != nil {
return fmt.Errorf("GenerateEveCerts: %s", err)
Expand Down Expand Up @@ -495,7 +495,7 @@ func GenerateEveCerts(certsDir, domain, ip, eveIP, uuid, devModel, ssid, passwor
}
}
}
if model.DevModelType() == defaults.DefaultQemuModel && viper.GetString("eve.arch") == "arm64" {
if model.DevModelType() == defaults.DefaultQemuModel && arch == "arm64" {
// we need to properly set console for qemu arm64
grubOptions = append(grubOptions, "set_global dom0_console \"console=ttyAMA0,115200 $dom0_console\"")
}
Expand Down
2 changes: 1 addition & 1 deletion pkg/openevec/eden.go
Original file line number Diff line number Diff line change
Expand Up @@ -376,7 +376,7 @@ func setupConfigDir(cfg EdenSetupArgs, eveConfigDir, softSerial, zedControlURL s
}
if zedControlURL == "" {
if err := eden.GenerateEveCerts(cfg.Eden.CertsDir, cfg.Adam.CertsDomain, cfg.Adam.CertsIP, cfg.Adam.CertsEVEIP, cfg.Eve.CertsUUID,
cfg.Eve.DevModel, cfg.Eve.Ssid, wifiPSK, grubOptions, cfg.Adam.APIv1); err != nil {
cfg.Eve.DevModel, cfg.Eve.Ssid, cfg.Eve.Arch, wifiPSK, grubOptions, cfg.Adam.APIv1); err != nil {
return fmt.Errorf("cannot GenerateEveCerts: %w", err)
}
log.Info("GenerateEveCerts done")
Expand Down

0 comments on commit a818a46

Please sign in to comment.