Configuring your Raspberry Pi to work with pi-top [4] (EEPROM configuration)

Avoid power off problems with your pi-top [4] DIY Edition

If you are installing your own 1GB, 2GB or 4GB Raspberry Pi (such as with the DIY Edition), you will likely need to update the Raspberry Pi’s behaviour to shut down correctly with pi-top [4]. For more information on what the Raspberry Pi EEPROM is and how to work with it, see here.
To do this, boot up your pi-top [4] with the Raspberry Pi installed, open the terminal application, and enter the following commands:
Get the latest EEPROM files from Raspberry Pi
sudo apt update
sudo apt install rpi-eeprom -y
Modify the configuration of the latest EEPROM file
cp /lib/firmware/raspberrypi/bootloader/critical/pieeprom-2020-09-03.bin pieeprom.bin
rpi-eeprom-config pieeprom.bin > bootconf.txt
sed -i 's/^WAKE_ON_GPIO=1$/WAKE_ON_GPIO=0/1' bootconf.txt
sed -i 's/^POWER_OFF_ON_HALT=0$/POWER_OFF_ON_HALT=1/1' bootconf.txt
rpi-eeprom-config --out pieeprom-new.bin --config bootconf.txt pieeprom.bin
Install modified EEPROM to Raspberry Pi
(pi-topOS only)
sudo BOOTFS="/recovery" rpi-eeprom-update -d -f ./pieeprom-new.bin
(Raspberry Pi OS only)
sudo rpi-eeprom-update -d -f ./pieeprom-new.bin
Clean up and reboot
rm ./bootconf.txt ./pieeprom.bin ./pieeprom-new.bin
sudo reboot