forked from security/hakurei
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>
This commit is contained in:
16
internal/rosa/images.go
Normal file
16
internal/rosa/images.go
Normal file
@@ -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 }
|
||||
Reference in New Issue
Block a user