diff --git a/modify.go b/modify.go index a08dc08..d958dd7 100644 --- a/modify.go +++ b/modify.go @@ -15,15 +15,13 @@ func EmptyRootPassword(prefix string) error { } func EnableSystemRequest(prefix string) error { - //579 # Enable System Request debugging of the kernel - //580 if [ "$SYSRQ" != "" ]; then - //581 echo "= Enabling System Request debugging of the kernel." - //582 cat >> ${PREFIX}/etc/sysctl.d/arm-image-installer-sysrq.conf <<-EOH - //583 # Controls the System Request debugging functionality of the kernel - //584 kernel.sysrq = 1 - //585 EOH - //586 fi - return nil + path := filepath.Join(prefix, "etc/sysctl.d/posadka-sysrq.conf") + + // TODO, might want an append instead? + return WriteToFile( + path, + []byte("kernel.sysrq = 1\n"), + ) } func ShowBoot(prefix string) error { @@ -39,6 +37,4 @@ func ShowBoot(prefix string) error { []byte("rhgb quiet "), []byte(""), ) - - return nil } diff --git a/primitive.go b/primitive.go index 5797c91..3a1f083 100644 --- a/primitive.go +++ b/primitive.go @@ -29,3 +29,7 @@ func ReplaceInFile(path string, a, b []byte) error { return nil } + +func WriteToFile(path string, data []byte) error { + return os.WriteFile(path, data, 0644) +}