posadka/modify.go
Simon de Vlieger bea17a4077
setup: start sketching out some bits
Tiny sketch of what we'd like to do. We'll be having an entrypoint,
modifications we can apply to directory structures and some primitives
to support those modifications.

Signed-off-by: Simon de Vlieger <supakeen@redhat.com>
2024-10-28 11:08:27 +01:00

44 lines
962 B
Go

package posadka
import (
"path/filepath"
)
func EmptyRootPassword(prefix string) error {
path := filepath.Join(prefix, "etc/passwd")
return ReplaceInFile(
path,
[]byte("root:x:"),
[]byte("root::"),
)
}
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
}
func ShowBoot(prefix string) error {
path := filepath.Join(prefix, "etc/passwd")
//# remove quiet from kargs
//if [ "$SHOWBOOT" != "" ]; then
// sed -i 's|rhgb quiet ||g' /tmp/boot/loader/entries/*.conf
//fi
return ReplaceInFile(
path,
[]byte("rhgb quiet "),
[]byte(""),
)
return nil
}