Skip to content

Commit

Permalink
Disk page in Installer requires pressing Enter two times before switc…
Browse files Browse the repository at this point in the history
…hing to next page

Signed-off-by: Volker Theile <[email protected]>
  • Loading branch information
votdev committed May 21, 2024
1 parent 676630f commit b45ef30
Showing 1 changed file with 20 additions and 3 deletions.
23 changes: 20 additions & 3 deletions pkg/console/install_panels.go
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,7 @@ const (
ErrMsgVLANShouldBeANumberInRange string = "VLAN ID should be a number 1 ~ 4094."
ErrMsgMTUShouldBeANumber string = "MTU should be a number."
NtpSettingName string = "ntp-servers"
ErrMsgNoDefaultRoute string = "No default route found. Please check the router setting on the DHCP server."
ErrMsgNoDefaultRoute string = "No default route found. Please check the router setting on the DHCP server."
)

var (
Expand Down Expand Up @@ -582,6 +582,16 @@ func addDiskPanel(c *Console) error {
}

c.CloseElements(persistentSizePanel)

// Make sure disk settings are correct. Do NOT allow proceeding to
// next field.
if _, err := validateAllDiskSizes(); err != nil {
return err
}

// At this point the disk configuration is valid.
diskConfirmed = true

if systemIsBIOS() {
if err := c.setContentByName(diskNotePanel, forceMBRNote); err != nil {
return err
Expand Down Expand Up @@ -621,6 +631,9 @@ func addDiskPanel(c *Console) error {

c.config.Install.PersistentPartitionSize = persistentSize

// At this point the disk configuration is valid.
diskConfirmed = true

if systemIsBIOS() {
if err := c.setContentByName(diskNotePanel, forceMBRNote); err != nil {
return err
Expand Down Expand Up @@ -668,8 +681,12 @@ func addDiskPanel(c *Console) error {
return updateValidatorMessage("Disk too large for MBR. Must be less than 2TiB")
}
}

c.config.ForceMBR = forceMBR == "yes"
if c.config.ForceMBR != (forceMBR == "yes") {
// Force another `ENTER` hit to proceed to the next page if the
// value is changed.
c.config.ForceMBR = forceMBR == "yes"
return nil
}
return gotoNextPage(g, v)
}
askForceMBRV.KeyBindings = map[gocui.Key]func(*gocui.Gui, *gocui.View) error{
Expand Down

0 comments on commit b45ef30

Please sign in to comment.