Skip to content

Commit 47b69b8

Browse files
committed
tools/run_guest_kernel: Add option yo set EFI system partition
The property "/chosen/asahi,efi-system-partition" is used to determine the partition to load the firmware from. The firmware archives are device specific and may contain device specific calibration data. Using the same mechanism to load firmware as installed systems ensures that the device specific firmware and calibration data is used and all devices can be tested. Having to specify the partition UUID is not a nice solution so querying the value from the running m1n1 via proxy commands would be a better solution. Signed-off-by: Janne Grunau <[email protected]>
1 parent 648f1c6 commit 47b69b8

1 file changed

Lines changed: 33 additions & 7 deletions

File tree

proxyclient/tools/run_guest_kernel.sh

Lines changed: 33 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -4,14 +4,37 @@ set -e
44
: ${TMPDIR:=$XDG_RUNTIME_DIR}
55
: ${TMPDIR:=/tmp}
66

7-
if [ "$1" == "-k" ]; then
8-
kernel="$(realpath "$2")"
9-
shift 2
10-
fi
7+
show_usage() {
8+
echo "Usage:"
9+
echo " $0 OPTIONS <kernel build root> [kernel commandline] [initramfs]"
10+
echo
11+
echo " -k IMAGE Use $IMAGE as kernel image name (full path)"
12+
echo " -e ESP_PART_UUID Use $ESP_PART_UUID as EFI system partition for fw loading"
13+
echo " -h Print this usage information"
14+
}
15+
16+
while [[ -n "${1}" ]]; do
17+
case "${1}" in
18+
-k|--kernel)
19+
kernel="$(realpath "${2}")"
20+
shift 2
21+
;;
22+
-e|--efi)
23+
esp="${2}"
24+
shift 2
25+
;;
26+
-h|--help)
27+
show_usage
28+
exit 1
29+
;;
30+
*)
31+
break
32+
;;
33+
esac
34+
done
1135

1236
if [ ! -d "$1" ]; then
13-
echo "Usage:"
14-
echo " $0 <kernel build root> [kernel commandline] [initramfs]"
37+
show_usage
1538
exit 1
1639
fi
1740

@@ -21,7 +44,7 @@ initramfs=""
2144
shift 2
2245

2346
if [ "$1" == "--" ]; then
24-
shift
47+
shift
2548
elif [ -n "$1" ]; then
2649
initramfs="$(realpath "$1")"
2750
shift
@@ -38,6 +61,9 @@ cp "$base"/../../build/m1n1.bin "$TMPDIR/m1n1-linux.bin"
3861
if [ -n "$args" ]; then
3962
echo "chosen.bootargs=$args" >>"$TMPDIR/m1n1-linux.bin"
4063
fi
64+
if [ -n "${esp}" ]; then
65+
echo "chosen.asahi,efi-system-partition=${esp}" >>"$TMPDIR/m1n1-linux.bin"
66+
fi
4167

4268
cat "$kernel_base"/arch/arm64/boot/dts/apple/*.dtb >>"$TMPDIR/m1n1-linux.bin"
4369
if [[ "$kernel" == *.gz ]]; then

0 commit comments

Comments
 (0)