Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Disk page in Installer requires pressing Enter two times before switching to next page #650

Merged
merged 1 commit into from
May 23, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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
Loading