From 37d368a7f9ebdf7aaee60ed7e8be5656e7ccf8ba Mon Sep 17 00:00:00 2001 From: Ophestra Date: Wed, 25 Feb 2026 16:28:57 +0900 Subject: 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 --- internal/rosa/images.go | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) create mode 100644 internal/rosa/images.go (limited to 'internal/rosa/images.go') diff --git a/internal/rosa/images.go b/internal/rosa/images.go new file mode 100644 index 00000000..40398df2 --- /dev/null +++ b/internal/rosa/images.go @@ -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 } -- cgit v1.3.1