login-app: warning if not booted UEFI
This commit is contained in:
parent
5a723d2ad6
commit
1ff63190b2
2 changed files with 28 additions and 17 deletions
21
pkg/login-app/cmd/dialog-uefi.go
Normal file
21
pkg/login-app/cmd/dialog-uefi.go
Normal file
|
|
@ -0,0 +1,21 @@
|
|||
package main
|
||||
|
||||
import (
|
||||
"github.com/rivo/tview"
|
||||
)
|
||||
|
||||
func CreateUEFIDialog(app *tview.Application, next func()) {
|
||||
modal := tview.NewModal().
|
||||
SetText("Not UEFI boot\nYou should reboot, enter UEFI Setup (F2) and disable Legacy boot").
|
||||
AddButtons([]string{"Reboot", "Ignore"}).
|
||||
SetDoneFunc(func(buttonIndex int, buttonLabel string) {
|
||||
if buttonLabel == "Reboot" {
|
||||
app.Stop()
|
||||
} else if buttonLabel == "Ignore" {
|
||||
next()
|
||||
}
|
||||
})
|
||||
|
||||
app.SetRoot(modal, true)
|
||||
app.SetFocus(modal)
|
||||
}
|
||||
Reference in a new issue