From b4e82e68a737380ecbfed15f2e0cd207c94b5ef1 Mon Sep 17 00:00:00 2001 From: Ophestra Date: Sat, 28 Feb 2026 23:04:58 +0900 Subject: [PATCH] internal/rosa/images: initramfs via gen_init_cpio This is much cleaner than hacking around the cpio tool. Signed-off-by: Ophestra --- internal/rosa/images.go | 13 ++++++++----- 1 file changed, 8 insertions(+), 5 deletions(-) diff --git a/internal/rosa/images.go b/internal/rosa/images.go index 40398df..b477309 100644 --- a/internal/rosa/images.go +++ b/internal/rosa/images.go @@ -6,11 +6,14 @@ func (t Toolchain) newImageInitramfs() pkg.Artifact { return t.New("initramfs", TNoToolchain, []pkg.Artifact{ t.Load(Zstd), t.Load(Hakurei), + t.Load(GenInitCPIO), }, 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 -`) +gen_init_cpio -t 4294967295 -c /usr/src/initramfs | zstd > /work/initramfs.zst +`, pkg.Path(AbsUsrSrc.Append("initramfs"), false, pkg.NewFile("initramfs", []byte(` +dir /dev 0755 0 0 +nod /dev/null 0666 0 0 c 1 3 +nod /dev/console 0600 0 0 c 5 1 +file /init /system/libexec/hakurei/earlyinit 0555 0 0 +`)))) } func init() { artifactsF[ImageInitramfs] = Toolchain.newImageInitramfs }