forked from raballew/pipxe
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathpatch.sh
More file actions
executable file
·32 lines (23 loc) · 1.06 KB
/
patch.sh
File metadata and controls
executable file
·32 lines (23 loc) · 1.06 KB
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
30
31
32
#!/bin/bash
set -e
target="$1"
echo "Patching target: ${target}"
# Enable GZIP image support
sed -i -e 's|^//#define\s\+IMAGE_GZIP.*$|#define IMAGE_GZIP|' \
-e 's|^//#define\s\+NTP_CMD.*$|#define NTP_CMD|' \
-e 's|^#undef\s\+DOWNLOAD_PROTO_HTTPS.*$|#define DOWNLOAD_PROTO_HTTPS|' \
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