diff options
Diffstat (limited to 'doGui.go')
| -rw-r--r-- | doGui.go | 21 |
1 files changed, 21 insertions, 0 deletions
@@ -38,6 +38,22 @@ func addDrive(devname string, displayDesc string) *Block { return blkpb } +// show the output of parted <dev> print +func showPartitions(blk *Block) { + if blk == nil { + return + } + + log.Info("check if", blk.Name, "is in use") + result, err := shell.RunVerbose([]string{"parted", blk.Name, "print"}) + log.Info("result =", result.Stdout, "err =", err) + out := strings.Join(result.Stdout, "\n") + if err != nil { + out += log.Sprintf("err = %v", err) + } + me.driveInfoBox.SetText(out) +} + func switchDrive(blk *Block) { var inUse bool = false me.currentDev = blk @@ -126,6 +142,11 @@ func drawWindow(win *gadgets.GenericWindow) { return } log.Info("If you got here, gdisk should be safe to run on", me.currentDev.Name) + if err := makeDefaultGPT(me.currentDev.Name); err != nil { + log.Info("PARTITIONING FAILED on", me.currentDev.Name, "with", err) + return + } + showPartitions(me.currentDev) }) grid.NextRow() |
