aboutsummaryrefslogtreecommitdiffhomepage
path: root/internal/rosa/images.go
diff options
context:
space:
mode:
authorOphestra <cat@gensokyo.uk>2026-02-25 16:28:57 +0900
committerOphestra <cat@gensokyo.uk>2026-02-25 16:31:52 +0900
commit37d368a7f9ebdf7aaee60ed7e8be5656e7ccf8ba (patch)
tree01f476e31877c0c87c5c524ec63b1b97ed98e5d4 /internal/rosa/images.go
parent2aeac7f582f1f03f9cca5251ec4bc275437ae64c (diff)
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>
Diffstat (limited to 'internal/rosa/images.go')
-rw-r--r--internal/rosa/images.go16
1 files changed, 16 insertions, 0 deletions
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 }