Switch to chroot-based usage (run from installer ISO)

This commit is contained in:
2025-09-29 23:51:15 -04:00
parent 85b345d54c
commit 9cbabb58c9
12 changed files with 128 additions and 139 deletions
+31 -7
View File
@@ -1,13 +1,18 @@
package main
import (
"fmt"
"os"
"os/user"
"github.com/rwinkhart/go-boilerplate/front"
"github.com/rwinkhart/go-boilerplate/other"
)
const mountPoint = "/mnt/cph"
var username string
var partitionR, partitionB string
// TODO add mode to perform EVERYTHING
func main() {
@@ -19,22 +24,41 @@ func main() {
other.PrintError("This utility must be run as root", 1)
}
partitionR = front.Input("Target root partition (/dev/driveparition):")
partitionB = front.Input("Target boot (efi) partition (/dev/driveparition):")
err = os.MkdirAll("/mnt/cph", 0777)
if err != nil {
other.PrintError("Failed to create mount directory (/mnt/cph)", 1)
}
for {
choice := front.InputMenuGen("Option:", []string{"universal tweaks", "system tweaks", "removals", "applications", "configuration", "cosmic"})
fmt.Println()
choice := front.InputMenuGen("Option:", []string{"pre-mount tweaks", "universal tweaks", "system tweaks", "removals", "applications", "configuration", "cosmic"})
switch choice {
case 1:
universalTweaks()
if partitionIsMounted() {
fmt.Println(partitionR + " is already mounted on " + mountPoint)
} else {
premount()
}
case 2:
system()
mountPartition()
universalTweaks()
case 3:
mountPartition()
system()
case 4:
mountPartition()
removals()
// TODO remove config/data
case 4:
applications()
// TODO remove config/data for replacements
case 5:
configurations()
mountPartition()
applications()
case 6:
mountPartition()
configurations()
case 7:
mountPartition()
cosmic()
// TODO keyboard shortcuts for screenshot/sticky window/terminal
// TODO window decoration position (not yet implemented?)