internal/rosa: initramfs artifact
All checks were successful
Test / Create distribution (push) Successful in 1m0s
Test / Sandbox (push) Successful in 2m42s
Test / Hakurei (push) Successful in 4m0s
Test / ShareFS (push) Successful in 3m59s
Test / Hpkg (push) Successful in 4m30s
Test / Sandbox (race detector) (push) Successful in 5m7s
Test / Hakurei (race detector) (push) Successful in 5m57s
Test / Flake checks (push) Successful in 1m57s
All checks were successful
Test / Create distribution (push) Successful in 1m0s
Test / Sandbox (push) Successful in 2m42s
Test / Hakurei (push) Successful in 4m0s
Test / ShareFS (push) Successful in 3m59s
Test / Hpkg (push) Successful in 4m30s
Test / Sandbox (race detector) (push) Successful in 5m7s
Test / Hakurei (race detector) (push) Successful in 5m57s
Test / Flake checks (push) Successful in 1m57s
This constructs a single-program initramfs and populates /dev/null so the runtime does not throw if the kernel fails to set up console. Signed-off-by: Ophestra <cat@gensokyo.uk>
This commit is contained in:
@@ -10,7 +10,17 @@ import (
|
|||||||
type PArtifact int
|
type PArtifact int
|
||||||
|
|
||||||
const (
|
const (
|
||||||
ACL PArtifact = iota
|
// ImageInitramfs is the Rosa OS initramfs archive.
|
||||||
|
ImageInitramfs PArtifact = iota
|
||||||
|
|
||||||
|
// Kernel is the generic Rosa OS Linux kernel.
|
||||||
|
Kernel
|
||||||
|
// KernelHeaders is an installation of kernel headers for [Kernel].
|
||||||
|
KernelHeaders
|
||||||
|
// KernelSource is a writable kernel source tree installed to [AbsUsrSrc].
|
||||||
|
KernelSource
|
||||||
|
|
||||||
|
ACL
|
||||||
ArgpStandalone
|
ArgpStandalone
|
||||||
Attr
|
Attr
|
||||||
Autoconf
|
Autoconf
|
||||||
@@ -42,9 +52,6 @@ const (
|
|||||||
Hakurei
|
Hakurei
|
||||||
HakureiDist
|
HakureiDist
|
||||||
IniConfig
|
IniConfig
|
||||||
Kernel
|
|
||||||
KernelHeaders
|
|
||||||
KernelSource
|
|
||||||
Kmod
|
Kmod
|
||||||
LibXau
|
LibXau
|
||||||
Libcap
|
Libcap
|
||||||
@@ -148,6 +155,12 @@ func (t Toolchain) Load(p PArtifact) pkg.Artifact {
|
|||||||
// ResolveName returns a [PArtifact] by name.
|
// ResolveName returns a [PArtifact] by name.
|
||||||
func ResolveName(name string) (p PArtifact, ok bool) {
|
func ResolveName(name string) (p PArtifact, ok bool) {
|
||||||
p, ok = map[string]PArtifact{
|
p, ok = map[string]PArtifact{
|
||||||
|
"initramfs-image": ImageInitramfs,
|
||||||
|
|
||||||
|
"kernel": Kernel,
|
||||||
|
"kernel-headers": KernelHeaders,
|
||||||
|
"kernel-source": KernelSource,
|
||||||
|
|
||||||
"acl": ACL,
|
"acl": ACL,
|
||||||
"argp-standalone": ArgpStandalone,
|
"argp-standalone": ArgpStandalone,
|
||||||
"attr": Attr,
|
"attr": Attr,
|
||||||
@@ -180,9 +193,6 @@ func ResolveName(name string) (p PArtifact, ok bool) {
|
|||||||
"hakurei": Hakurei,
|
"hakurei": Hakurei,
|
||||||
"hakurei-dist": HakureiDist,
|
"hakurei-dist": HakureiDist,
|
||||||
"iniconfig": IniConfig,
|
"iniconfig": IniConfig,
|
||||||
"kernel": Kernel,
|
|
||||||
"kernel-headers": KernelHeaders,
|
|
||||||
"kernel-source": KernelSource,
|
|
||||||
"kmod": Kmod,
|
"kmod": Kmod,
|
||||||
"libXau": LibXau,
|
"libXau": LibXau,
|
||||||
"libcap": Libcap,
|
"libcap": Libcap,
|
||||||
|
|||||||
16
internal/rosa/images.go
Normal file
16
internal/rosa/images.go
Normal file
@@ -0,0 +1,16 @@
|
|||||||
|
package rosa
|
||||||
|
|
||||||
|
import "hakurei.app/internal/pkg"
|
||||||
|
|
||||||
|
func (t Toolchain) newImageInitramfs() pkg.Artifact {
|
||||||
|
return t.New("initramfs", TNoToolchain, []pkg.Artifact{
|
||||||
|
t.Load(Zstd),
|
||||||
|
t.Load(Hakurei),
|
||||||
|
}, nil, nil, `
|
||||||
|
cd "$(mktemp -d)"
|
||||||
|
cp /system/libexec/hakurei/earlyinit init
|
||||||
|
((find . | cpio -R 0:0 -o) && (cd / && echo dev/null | cpio -R 0:0 -o)) | \
|
||||||
|
zstd -19 > /work/initramfs.zst
|
||||||
|
`)
|
||||||
|
}
|
||||||
|
func init() { artifactsF[ImageInitramfs] = Toolchain.newImageInitramfs }
|
||||||
Reference in New Issue
Block a user