summaryrefslogtreecommitdiff
path: root/doGui.go
diff options
context:
space:
mode:
authorJeff Carr <[email protected]>2025-08-17 18:02:07 -0500
committerJeff Carr <[email protected]>2025-08-17 22:57:06 -0500
commit25f0ec7e2693fdd2bc694adc844aec53c5798e5f (patch)
tree8ecf4d691a69a223ef9bf3f5cc3c29a263a9ef1f /doGui.go
parent145244f63d2589203b1450af61987f16fb87aff3 (diff)
actually made a default boot partition
Diffstat (limited to 'doGui.go')
-rw-r--r--doGui.go21
1 files changed, 21 insertions, 0 deletions
diff --git a/doGui.go b/doGui.go
index 8263587..e6dd625 100644
--- a/doGui.go
+++ b/doGui.go
@@ -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()