aboutsummaryrefslogtreecommitdiffhomepage
diff options
context:
space:
mode:
authorOphestra <cat@gensokyo.uk>2026-03-28 18:21:42 +0900
committerOphestra <cat@gensokyo.uk>2026-03-28 18:22:55 +0900
commit71fcc972bad6abcd6282f7a80ef5935cdfcf172d (patch)
treec83b1cd35a6244d333ff8c35ae4799864d8059b7
parent62002efd08158512f6015d47461d264a14961553 (diff)
cmd/hsu: alternative hsurc path for Rosa OS
Rosa OS does not have /etc. Signed-off-by: Ophestra <cat@gensokyo.uk>
-rw-r--r--cmd/hsu/conf.go7
-rw-r--r--cmd/hsu/config_rosa.go7
-rw-r--r--cmd/hsu/parse.go4
-rw-r--r--internal/rosa/hakurei.go2
4 files changed, 15 insertions, 5 deletions
diff --git a/cmd/hsu/conf.go b/cmd/hsu/conf.go
new file mode 100644
index 00000000..683bdc8a
--- /dev/null
+++ b/cmd/hsu/conf.go
@@ -0,0 +1,7 @@
+//go:build !rosa
+
+package main
+
+// hsuConfPath is an absolute pathname to the hsu configuration file. Its
+// contents are interpreted by parseConfig.
+const hsuConfPath = "/etc/hsurc"
diff --git a/cmd/hsu/config_rosa.go b/cmd/hsu/config_rosa.go
new file mode 100644
index 00000000..30303dba
--- /dev/null
+++ b/cmd/hsu/config_rosa.go
@@ -0,0 +1,7 @@
+//go:build rosa
+
+package main
+
+// hsuConfPath is the pathname to the hsu configuration file, specific to
+// Rosa OS. Its contents are interpreted by parseConfig.
+const hsuConfPath = "/system/etc/hsurc"
diff --git a/cmd/hsu/parse.go b/cmd/hsu/parse.go
index d4f7df43..f9191d9a 100644
--- a/cmd/hsu/parse.go
+++ b/cmd/hsu/parse.go
@@ -84,10 +84,6 @@ func parseConfig(r io.Reader, puid uint32) (userid uint32, ok bool, err error) {
return useridEnd + 1, false, s.Err()
}
-// hsuConfPath is an absolute pathname to the hsu configuration file.
-// Its contents are interpreted by parseConfig.
-const hsuConfPath = "/etc/hsurc"
-
// mustParseConfig calls parseConfig to interpret the contents of hsuConfPath,
// terminating the program if an error is encountered, the syntax is incorrect,
// or the current user is not authorised to use hsu because its uid is missing.
diff --git a/internal/rosa/hakurei.go b/internal/rosa/hakurei.go
index e1dabc25..2d09856a 100644
--- a/internal/rosa/hakurei.go
+++ b/internal/rosa/hakurei.go
@@ -66,7 +66,7 @@ mkdir -p /work/system/libexec/hakurei/
echo '# Building hakurei.'
go generate -v ./...
-go build -trimpath -v -o /work/system/libexec/hakurei -ldflags="-s -w
+go build -trimpath -v -tags=rosa -o /work/system/libexec/hakurei -ldflags="-s -w
-buildid=
-linkmode external
-extldflags=-static