Skip to content

Commit 82a7e56

Browse files
committed
tools/run_guest_kernel.sh: New utility script
Signed-off-by: Hector Martin <[email protected]>
1 parent 60b59e9 commit 82a7e56

1 file changed

Lines changed: 29 additions & 0 deletions

File tree

Lines changed: 29 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,29 @@
1+
#!/bin/sh
2+
set -e
3+
4+
if [ ! -d "$1" ]; then
5+
echo "Usage:"
6+
echo " $0 <kernel build root> [kernel commandline] [initramfs]"
7+
exit 1
8+
fi
9+
10+
kernel_base="$(realpath "$1")"
11+
args="$2"
12+
initramfs=""
13+
if [ ! -z "$3" ]; then
14+
initramfs="$(realpath "$3")"
15+
fi
16+
17+
cd "$(dirname "$0")"
18+
19+
echo "Creating m1n1+kernel image"
20+
cp ../../build/m1n1.bin /tmp/m1n1-linux.bin
21+
if [ ! -z "$args" ]; then
22+
echo "chosen.bootargs=$args" >>/tmp/m1n1-linux.bin
23+
fi
24+
25+
cat "$kernel_base"/arch/arm64/boot/dts/apple/*.dtb "$kernel_base"/arch/arm64/boot/Image.gz >>/tmp/m1n1-linux.bin
26+
echo "Chainloading to updated m1n1..."
27+
python chainload.py -r ../../build/m1n1.bin
28+
echo "Starting guest..."
29+
exec python run_guest.py -r /tmp/m1n1-linux.bin

0 commit comments

Comments
 (0)