From 0162e92ed0bccbd49269e45cfe6cf9247f48d202 Mon Sep 17 00:00:00 2001 From: root Date: Mon, 17 Mar 2025 21:22:01 -0400 Subject: [PATCH] Temporary routine to copy over a few mandatory files. Bug: don't set the pretend flag on apk. --- main.go | 18 +++++++++++++++++- 1 file changed, 17 insertions(+), 1 deletion(-) diff --git a/main.go b/main.go index 6076b2d..ba4f9af 100644 --- a/main.go +++ b/main.go @@ -230,10 +230,26 @@ func main() { } } + // Copy any mandatory configuration files over before continuing. + // TODO: This will be replaced with a full copy later. + { + var err error + + os.Remove("/etc/apk/world") + err = os.Link("/config/etc/apk/world", + "/etc/apk/world") + if err != nil { fmt.Println(err) } + + os.Remove("/etc/caddy/CaddyFile") + err = os.Link("/config/etc/caddy/Caddyfile", + "/etc/caddy/CaddyFile") + if err != nil { fmt.Println(err) } + } + // Install and remove packages { fmt.Println("Installing packages") - args := []string{"add", "-s", "-u", "-l"} + args := []string{"add", "-u", "-l"} out, err := exec.Command("/sbin/apk", args...).CombinedOutput() if err != nil { fmt.Println("===")