mirror of
https://github.com/AsahiLinux/m1n1
synced 2024-12-18 09:53:04 +00:00
tools/run_guest_kernel.sh: Support concatenated initramfs images
This allows booting a kernel with the firmware cpio and a cpio containing matching modules. The modules initramfs can be prepared from the kernel source directory with: `make dir-pkg && usr/gen_initramfs.sh -o initramfs_mod.cpio -u squash -g squash ./tar-install/lib/` The modules are available in /modules/$(uname -r) and the initramfs can handle modules in the same way as the vendor firmware to make them available for itself and the main OS. Signed-off-by: Janne Grunau <j@jannau.net>
This commit is contained in:
parent
a2b4a7479a
commit
0069ea213e
1 changed files with 8 additions and 0 deletions
|
@ -47,6 +47,14 @@ else
|
|||
fi
|
||||
|
||||
if [ -n "$initramfs" ]; then
|
||||
initramfs_size=$(stat --printf='%s' "$initramfs")
|
||||
python - << EOF >>"$TMPDIR/m1n1-linux.bin"
|
||||
import os, sys
|
||||
|
||||
magic = b'm1n1_initramfs'
|
||||
size = int(${initramfs_size}).to_bytes(4, byteorder='little')
|
||||
os.write(sys.stdout.fileno(), magic + size)
|
||||
EOF
|
||||
cat "$initramfs" >>"$TMPDIR/m1n1-linux.bin"
|
||||
fi
|
||||
|
||||
|
|
Loading…
Reference in a new issue