internal/rosa: pass stage alongside state

This cleans up many function signatures.

Signed-off-by: Ophestra <cat@gensokyo.uk>
This commit is contained in:
2026-05-17 16:44:13 +09:00
parent 30eb0d6a61
commit 38bc2c7508
89 changed files with 563 additions and 558 deletions

View File

@@ -10,8 +10,8 @@ func init() {
Name: "earlyinit",
Description: "Rosa OS initramfs init program",
f: func(t Toolchain, s *S) (pkg.Artifact, string) {
return s.newHakurei(t, "-early-init", `
f: func(t Toolchain) (pkg.Artifact, string) {
return t.newHakurei("-early-init", `
mkdir -p /work/system/libexec/hakurei/
echo '# Building earlyinit.'
@@ -26,12 +26,12 @@ echo
},
})
}
func (t Toolchain) newImageSystem(s *S) (pkg.Artifact, string) {
return s.New(t, "system.img", TNoToolchain, s.AppendPresets(t, nil,
func (t Toolchain) newImageSystem() (pkg.Artifact, string) {
return t.New("system.img", TNoToolchain, t.Append(nil,
SquashfsTools,
), nil, nil, `
mksquashfs /mnt/system /work/system.img
`, pkg.Path(fhs.AbsRoot.Append("mnt"), false, s.AppendPresets(t, nil,
`, pkg.Path(fhs.AbsRoot.Append("mnt"), false, t.Append(nil,
Musl,
Mksh,
Toybox,
@@ -49,8 +49,8 @@ func init() {
f: Toolchain.newImageSystem,
})
}
func (t Toolchain) newImageInitramfs(s *S) (pkg.Artifact, string) {
return s.New(t, "initramfs", TNoToolchain, s.AppendPresets(t, nil,
func (t Toolchain) newImageInitramfs() (pkg.Artifact, string) {
return t.New("initramfs", TNoToolchain, t.Append(nil,
Zstd,
EarlyInit,
GenInitCPIO,