diff options
| author | Jeff Carr <[email protected]> | 2025-08-17 18:02:07 -0500 |
|---|---|---|
| committer | Jeff Carr <[email protected]> | 2025-08-17 22:57:06 -0500 |
| commit | 25f0ec7e2693fdd2bc694adc844aec53c5798e5f (patch) | |
| tree | 8ecf4d691a69a223ef9bf3f5cc3c29a263a9ef1f /doGui.go | |
| parent | 145244f63d2589203b1450af61987f16fb87aff3 (diff) | |
actually made a default boot partition
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() |
