-
Notifications
You must be signed in to change notification settings - Fork 214
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
tools/run_guest_kernel.sh: New utility script
Signed-off-by: Hector Martin <[email protected]>
- Loading branch information
Showing
1 changed file
with
29 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,29 @@ | ||
#!/bin/sh | ||
set -e | ||
|
||
if [ ! -d "$1" ]; then | ||
echo "Usage:" | ||
echo " $0 <kernel build root> [kernel commandline] [initramfs]" | ||
exit 1 | ||
fi | ||
|
||
kernel_base="$(realpath "$1")" | ||
args="$2" | ||
initramfs="" | ||
if [ ! -z "$3" ]; then | ||
initramfs="$(realpath "$3")" | ||
fi | ||
|
||
cd "$(dirname "$0")" | ||
|
||
echo "Creating m1n1+kernel image" | ||
cp ../../build/m1n1.bin /tmp/m1n1-linux.bin | ||
if [ ! -z "$args" ]; then | ||
echo "chosen.bootargs=$args" >>/tmp/m1n1-linux.bin | ||
fi | ||
|
||
cat "$kernel_base"/arch/arm64/boot/dts/apple/*.dtb "$kernel_base"/arch/arm64/boot/Image.gz >>/tmp/m1n1-linux.bin | ||
echo "Chainloading to updated m1n1..." | ||
python chainload.py -r ../../build/m1n1.bin | ||
echo "Starting guest..." | ||
exec python run_guest.py -r /tmp/m1n1-linux.bin |