mirror of
https://github.com/rwinkhart/cachyos-postinstall-helper.git
synced 2026-08-28 04:46:52 -04:00
Switch to chroot-based usage (run from installer ISO)
This commit is contained in:
+5
-9
@@ -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()
|
||||
|
||||
Reference in New Issue
Block a user