aboutsummaryrefslogtreecommitdiffhomepage
path: root/internal/rosa
diff options
context:
space:
mode:
authorOphestra <cat@gensokyo.uk>2026-02-18 14:18:36 +0900
committerOphestra <cat@gensokyo.uk>2026-02-18 14:21:59 +0900
commit58801b44d4fc783984c2fb8800c2f752b7ed06a1 (patch)
tree97cfe2060f50a0dcdb2db05c9573a19468d18bdd /internal/rosa
parente065bbf792b58f18ef4802c6dd7d02d7d6374409 (diff)
internal/rosa: util-linux artifact
This stuff will likely be implemented natively in the final system. For now, it is useful for debugging. Signed-off-by: Ophestra <cat@gensokyo.uk>
Diffstat (limited to 'internal/rosa')
-rw-r--r--internal/rosa/all.go4
-rw-r--r--internal/rosa/util-linux.go49
2 files changed, 52 insertions, 1 deletions
diff --git a/internal/rosa/all.go b/internal/rosa/all.go
index 8edf09b5..8a905825 100644
--- a/internal/rosa/all.go
+++ b/internal/rosa/all.go
@@ -77,7 +77,7 @@ const (
Toybox
toyboxEarly
Unzip
- utilMacros
+ UtilLinux
Wayland
WaylandProtocols
XCB
@@ -88,6 +88,7 @@ const (
Zstd
buildcatrust
+ utilMacros
// gcc is a hacked-to-pieces GCC toolchain meant for use in intermediate
// stages only. This preset and its direct output must never be exposed.
@@ -188,6 +189,7 @@ func ResolveName(name string) (p PArtifact, ok bool) {
"squashfs-tools": SquashfsTools,
"toybox": Toybox,
"unzip": Unzip,
+ "util-linux": UtilLinux,
"wayland": Wayland,
"wayland-protocols": WaylandProtocols,
"xcb": XCB,
diff --git a/internal/rosa/util-linux.go b/internal/rosa/util-linux.go
new file mode 100644
index 00000000..8dc0f292
--- /dev/null
+++ b/internal/rosa/util-linux.go
@@ -0,0 +1,49 @@
+package rosa
+
+import (
+ "strings"
+
+ "hakurei.app/internal/pkg"
+)
+
+func (t Toolchain) newUtilLinux() pkg.Artifact {
+ const (
+ version = "2.41.3"
+ checksum = "gPTd5JJ2ho_Rd0qainuogcLiiWwKSXEZPXN3yCCRl0m0KBgMaqwFuMjYgu9z8zCH"
+ )
+ return t.NewViaMake("util-linux", version, pkg.NewHTTPGetTar(
+ nil, "https://www.kernel.org/pub/linux/utils/util-linux/"+
+ "v"+strings.Join(strings.SplitN(version, ".", 3)[:2], ".")+
+ "/util-linux-"+version+".tar.gz",
+ mustDecode(checksum),
+ pkg.TarGzip,
+ ), &MakeAttr{
+ ScriptEarly: `
+ln -s ../system/bin/bash /bin/
+`,
+
+ Configure: [][2]string{
+ {"disable-use-tty-group"},
+ {"disable-makeinstall-setuid"},
+ {"disable-makeinstall-chown"},
+ {"enable-fs-paths-default", "" +
+ "/system/sbin:" +
+ "/system/sbin/fs.d:" +
+ "/system/sbin/fs"},
+
+ {"disable-su"},
+ {"disable-liblastlog2"},
+ {"disable-pam-lastlog2"},
+ },
+
+ // check script claims:
+ // For development purpose only.
+ // Don't execute on production system!
+ SkipCheck: true,
+ },
+ t.Load(Bash),
+
+ t.Load(KernelHeaders),
+ )
+}
+func init() { artifactsF[UtilLinux] = Toolchain.newUtilLinux }