Skip to content

Commit

Permalink
configure the firmware to not limit the ram to 3GB
Browse files Browse the repository at this point in the history
  • Loading branch information
rgl committed Jun 9, 2023
1 parent ad34f3b commit 2a85b3d
Show file tree
Hide file tree
Showing 3 changed files with 30 additions and 0 deletions.
9 changes: 9 additions & 0 deletions build-ipxe.sh
Original file line number Diff line number Diff line change
Expand Up @@ -75,6 +75,15 @@ RPI4_UEFI_IPXE_IMG_ZIP_PATH="$PWD/rpi4-uefi-ipxe.img.zip"
pushd "$RPI4_UEFI_PATH"
install -d efi/boot
install "$IPXE_PATH/src/bin-arm64-efi/ipxe.efi" efi/boot/bootaa64.efi
if [ -d /vagrant ]; then
virt-fw-vars \
--input RPI_EFI.fd \
--output RPI_EFI.fd \
--set-json /vagrant/fw-vars.json
virt-fw-vars \
--input RPI_EFI.fd \
--print
fi
rm -f "$RPI4_UEFI_IPXE_ZIP_PATH"
zip -9 --no-dir-entries -r "$RPI4_UEFI_IPXE_ZIP_PATH" .
unzip -l "$RPI4_UEFI_IPXE_ZIP_PATH"
Expand Down
11 changes: 11 additions & 0 deletions fw-vars.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
{
"version": 2,
"variables": [
{
"name": "RamLimitTo3GB",
"guid": "cd7cc258-31db-22e6-9f22-63b0b8eed6b5",
"attr": 7,
"data": "00000000"
}
]
}
10 changes: 10 additions & 0 deletions provision-dependencies.sh
Original file line number Diff line number Diff line change
@@ -1,9 +1,19 @@
#!/bin/bash
set -euxo pipefail

# virt-firmware.
# see https://pypi.org/project/virt-firmware
# see https://gitlab.com/kraxel/virt-firmware
VIRT_FIRMWARE_PIP_INSTALL_SPEC='virt-firmware==23.5'
VIRT_FIRMWARE_PIP_INSTALL_SPEC='git+https://gitlab.com/kraxel/virt-firmware.git@bf0912128c38684a19a0c530c18d6219a5f60ed9' # 2023-06-01T11:59:02Z

# install the dependencies.
# see https://github.com/pftf/RPi4/blob/v1.35/.github/workflows/linux_edk2.yml
apt-get install -y \
acpica-tools gcc-aarch64-linux-gnu python3-distutils uuid-dev \
build-essential dos2unix unzip zip
ln -fs /usr/bin/python{3,} # symlink python to python3.

# install virt-firmware.
apt-get install -y python3-pip
python3 -m pip install $VIRT_FIRMWARE_PIP_INSTALL_SPEC

0 comments on commit 2a85b3d

Please sign in to comment.