forked from ipxe/pipxe
-
-
Notifications
You must be signed in to change notification settings - Fork 2
/
Copy pathpatch.sh
executable file
·29 lines (20 loc) · 950 Bytes
/
patch.sh
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
#!/bin/bash
set -e
target="$1"
echo "Patching target: ${target}"
# Enable GZIP image support
sed -i 's/\/\/#define.*IMAGE_GZIP.*/#define IMAGE_GZIP/' ipxe/src/config/general.h
case $target in
RPi3)
echo "No patch required"
;;
RPi4)
# Set RAMLimit to >3GB, requires OS patched for DMA (e.g. Linux kernel >5.8)
sed -i 's/gRaspberryPiTokenSpaceGuid.PcdRamLimitTo3GB|L"RamLimitTo3GB"|gConfigDxeFormSetGuid|0x0|1/gRaspberryPiTokenSpaceGuid.PcdRamLimitTo3GB|L"RamLimitTo3GB"|gConfigDxeFormSetGuid|0x0|0/g' edk2-platforms/Platform/RaspberryPi/RPi4/RPi4.dsc
# Use device tree system table mode for GPIO support
sed -i 's/gRaspberryPiTokenSpaceGuid.PcdSystemTableMode|L"SystemTableMode"|gConfigDxeFormSetGuid|0x0|0/gRaspberryPiTokenSpaceGuid.PcdSystemTableMode|L"SystemTableMode"|gConfigDxeFormSetGuid|0x0|2/g' edk2-platforms/Platform/RaspberryPi/RPi4/RPi4.dsc
;;
*)
echo "Target unknown. Aborting."
;;
esac