Skip to content

Commit

Permalink
Remove Viper from PutEveCerts
Browse files Browse the repository at this point in the history
Related to lf-edge#855

Signed-off-by: Pavel Abramov <[email protected]>
  • Loading branch information
uncleDecart committed Oct 11, 2024
1 parent 709af93 commit c22e8a7
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 3 deletions.
4 changes: 2 additions & 2 deletions pkg/eden/eden.go
Original file line number Diff line number Diff line change
Expand Up @@ -523,7 +523,7 @@ func GenerateEveCerts(certsDir, domain, ip, eveIP, uuid, devModel, ssid, arch, p
}

// PutEveCerts function put certs for zedcontrol
func PutEveCerts(certsDir, devModel, ssid, password string) (err error) {
func PutEveCerts(certsDir, devModel, ssid, arch, password string) (err error) {
model, err := models.GetDevModelByName(devModel)
if err != nil {
return fmt.Errorf("GenerateEveCerts: %s", err)
Expand Down Expand Up @@ -591,7 +591,7 @@ func PutEveCerts(certsDir, devModel, ssid, password string) (err error) {
}
}
}
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
if err := os.WriteFile(filepath.Join(certsDir, "grub.cfg"), []byte("set_global dom0_console \"console=ttyAMA0,115200 $dom0_console\""), 0666); err != nil {
return fmt.Errorf("GenerateEveCerts: %s", err)
Expand Down
2 changes: 1 addition & 1 deletion pkg/openevec/eden.go
Original file line number Diff line number Diff line change
Expand Up @@ -381,7 +381,7 @@ func setupConfigDir(cfg EdenSetupArgs, eveConfigDir, softSerial, zedControlURL s
}
log.Info("GenerateEveCerts done")
} else {
if err := eden.PutEveCerts(cfg.Eden.CertsDir, cfg.Eve.DevModel, cfg.Eve.Ssid, wifiPSK); err != nil {
if err := eden.PutEveCerts(cfg.Eden.CertsDir, cfg.Eve.DevModel, cfg.Eve.Ssid, cfg.Eve.Arch, wifiPSK); err != nil {
return fmt.Errorf("cannot GenerateEveCerts: %w", err)
}
log.Info("GenerateEveCerts done")
Expand Down

0 comments on commit c22e8a7

Please sign in to comment.