Skip to content

Commit

Permalink
tui: Disable console messages
Browse files Browse the repository at this point in the history
Fixes: #300

Attempt to disable console messages before launching the TUI,
and re-enable upon completion.

Signed-off-by: Mark D Horn <[email protected]>
  • Loading branch information
mdhorn committed Apr 25, 2019
1 parent 3945c9a commit 13ca315
Showing 1 changed file with 14 additions and 0 deletions.
14 changes: 14 additions & 0 deletions tui/tui.go
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@ import (
"strings"

"github.com/clearlinux/clr-installer/args"
"github.com/clearlinux/clr-installer/cmd"
"github.com/clearlinux/clr-installer/errors"
"github.com/clearlinux/clr-installer/log"
"github.com/clearlinux/clr-installer/model"
Expand Down Expand Up @@ -86,6 +87,19 @@ func lookupThemeDir() (string, error) {

// Run is part of the Frontend interface implementation and is the tui frontend main entry point
func (tui *Tui) Run(md *model.SystemInstall, rootDir string, options args.Args) (bool, error) {
// First disable console messages
err := cmd.RunAndLog("dmesg", "--console--off")
if err != nil {
log.Warning("Failed to disable dmesg on console: %v", err)
}
// Defer enabling console messages
defer func() {
err := cmd.RunAndLog("dmesg", "--console--on")
if err != nil {
log.Warning("Failed to enable dmesg on console: %v", err)
}
}()

clui.InitLibrary()
defer clui.DeinitLibrary()

Expand Down

0 comments on commit 13ca315

Please sign in to comment.