forked from rosa/hakurei
internal/rosa: key metadata by string
For upcoming azalea integration. The API is quite ugly right now to ease migration. Signed-off-by: Ophestra <cat@gensokyo.uk>
This commit is contained in:
@@ -6,12 +6,12 @@ import (
|
||||
)
|
||||
|
||||
func init() {
|
||||
artifactsM[EarlyInit] = Metadata{
|
||||
native.MustRegister(&Artifact{
|
||||
Name: "earlyinit",
|
||||
Description: "Rosa OS initramfs init program",
|
||||
|
||||
f: func(t Toolchain) (pkg.Artifact, string) {
|
||||
return t.newHakurei("-early-init", `
|
||||
f: func(t Toolchain, s *S) (pkg.Artifact, string) {
|
||||
return s.newHakurei(t, "-early-init", `
|
||||
mkdir -p /work/system/libexec/hakurei/
|
||||
|
||||
echo '# Building earlyinit.'
|
||||
@@ -24,15 +24,14 @@ go build -trimpath -v -o /work/system/libexec/hakurei -ldflags="-s -w
|
||||
echo
|
||||
`, false), Unversioned
|
||||
},
|
||||
}
|
||||
})
|
||||
}
|
||||
|
||||
func (t Toolchain) newImageSystem() (pkg.Artifact, string) {
|
||||
return t.New("system.img", TNoToolchain, t.AppendPresets(nil,
|
||||
func (t Toolchain) newImageSystem(s *S) (pkg.Artifact, string) {
|
||||
return s.New(t, "system.img", TNoToolchain, s.AppendPresets(t, nil,
|
||||
SquashfsTools,
|
||||
), nil, nil, `
|
||||
mksquashfs /mnt/system /work/system.img
|
||||
`, pkg.Path(fhs.AbsRoot.Append("mnt"), false, t.AppendPresets(nil,
|
||||
`, pkg.Path(fhs.AbsRoot.Append("mnt"), false, s.AppendPresets(t, nil,
|
||||
Musl,
|
||||
Mksh,
|
||||
Toybox,
|
||||
@@ -43,16 +42,15 @@ mksquashfs /mnt/system /work/system.img
|
||||
)...)), Unversioned
|
||||
}
|
||||
func init() {
|
||||
artifactsM[ImageSystem] = Metadata{
|
||||
native.MustRegister(&Artifact{
|
||||
Name: "system-image",
|
||||
Description: "Rosa OS system image",
|
||||
|
||||
f: Toolchain.newImageSystem,
|
||||
}
|
||||
})
|
||||
}
|
||||
|
||||
func (t Toolchain) newImageInitramfs() (pkg.Artifact, string) {
|
||||
return t.New("initramfs", TNoToolchain, t.AppendPresets(nil,
|
||||
func (t Toolchain) newImageInitramfs(s *S) (pkg.Artifact, string) {
|
||||
return s.New(t, "initramfs", TNoToolchain, s.AppendPresets(t, nil,
|
||||
Zstd,
|
||||
EarlyInit,
|
||||
GenInitCPIO,
|
||||
@@ -66,10 +64,10 @@ file /init /system/libexec/hakurei/earlyinit 0555 0 0
|
||||
`)))), Unversioned
|
||||
}
|
||||
func init() {
|
||||
artifactsM[ImageInitramfs] = Metadata{
|
||||
native.MustRegister(&Artifact{
|
||||
Name: "initramfs-image",
|
||||
Description: "Rosa OS initramfs image",
|
||||
|
||||
f: Toolchain.newImageInitramfs,
|
||||
}
|
||||
})
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user