Files
hakurei/internal/rosa/images.go
Ophestra 37d368a7f9 internal/rosa: initramfs artifact
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>
2026-02-25 16:31:52 +09:00

17 lines
457 B
Go

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 }