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
+5 -9
View File
@@ -2,26 +2,22 @@ package main
import (
"os"
"os/exec"
"github.com/rwinkhart/go-boilerplate/other"
)
func universalTweaks() {
// Lock root account
cmd := exec.Command("usermod", "--delete", "root")
cmd.Run()
cmd = exec.Command("usermod", "--lock", "root")
cmd.Run()
chrootCommandRun([]string{"passwd", "--delete", "root"})
chrootCommandRun([]string{"usermod", "--lock", "root"})
// Add user to uucp group for non-root serial console usage
cmd = exec.Command("usermod", "-aG", "uucp", getUsername())
cmd.Run()
chrootCommandRun([]string{"usermod", "-aG", "uucp", getUsername()})
// Force disable kernel watchdog (kernel parameters should do this as well)
f, err := os.Create("/etc/modprobe.d/blacklist.conf")
f, err := os.Create(mountPoint + "/etc/modprobe.d/blacklist.conf")
if err != nil {
other.PrintError("Failed to create /etc/modprobe.d/blacklist.conf", 1)
other.PrintError("Failed to create "+mountPoint+"/etc/modprobe.d/blacklist.conf", 1)
}
f.WriteString("# Disable kernel watchdog\nblacklist iTCO_wdt")
f.Close()