forked from security/hakurei
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>
17 lines
457 B
Go
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 }
|