diff --git a/cmd/bios.go b/cmd/bios.go index 58748713..3dec4cc0 100644 --- a/cmd/bios.go +++ b/cmd/bios.go @@ -17,17 +17,18 @@ func (h *Hammer) ConfigureBIOS() error { reboot, err := h.Hal.ConfigureBIOS() if err != nil { - log.Warn("BIOS updates for this machine type are intentionally not supported, skipping ConfigureBIOS", "error", err) - return nil + return err } - if reboot { - h.EventEmitter.Emit(event.ProvisioningEventPlannedReboot, "update BIOS configuration, need to reboot") + log.Info("bios", "message", "successfully configured BIOS") - log.Info("bios", "message", "updated BIOS configuration, reboot in 1 sec") + if reboot { + msg := "BIOS configuration requires a reboot" + h.EventEmitter.Emit(event.ProvisioningEventPlannedReboot, msg) + log.Info("bios", msg, "reboot in 1 sec") time.Sleep(1 * time.Second) err = kernel.Reboot() if err != nil { - log.Error("reboot", "error", err) + return err } } @@ -45,7 +46,7 @@ func (h *Hammer) EnsureBootOrder(bootloaderID string) error { if err != nil { return err } - log.Info("bios", "message", "boot order ensured") + log.Info("bios", "message", "successfully ensured boot order") return nil } diff --git a/cmd/root.go b/cmd/root.go index ab89e3ba..a716fbdf 100644 --- a/cmd/root.go +++ b/cmd/root.go @@ -145,7 +145,7 @@ func Run(spec *Specification, hal hal.InBand) (*event.EventEmitter, error) { err = hammer.ConfigureBIOS() if err != nil { - log.Error("failed to update BIOS", "error", err) + log.Error("failed to configure BIOS", "error", err) return eventEmitter, err } @@ -278,15 +278,7 @@ func (h *Hammer) installImage(eventEmitter *event.EventEmitter, m *models.Models err = rep.ReportInstallation() if err != nil { - wait := 10 * time.Second - log.Error("report installation failed", "reboot in", wait, "error", err) - time.Sleep(wait) - if !h.Spec.DevMode { - err = kernel.Reboot() - if err != nil { - log.Error("reboot", "error", err) - } - } + return err } log.Info("installation", "took", time.Since(installationStart))