rpi-eeprom: use wrapper to ensure /flash is writeable

This commit is contained in:
MilhouseVH 2019-09-08 17:24:35 +01:00
parent 505df7c788
commit 9e79363e78
3 changed files with 13 additions and 2 deletions

View File

@ -2,4 +2,3 @@
FIRMWARE_ROOT="/usr/lib/kernel-overlays/base/lib/firmware/raspberrypi/bootloader"
FIRMWARE_BACKUP_DIR="/storage/.config/rpifw-backup"
BOOTFS=/flash
USE_FLASHROM=${USE_FLASHROM:-1}

View File

@ -29,7 +29,9 @@ makeinstall_target() {
done
mkdir -p ${INSTALL}/usr/bin
cp -PRv ${PKG_BUILD}/rpi-eeprom-{config,update} ${INSTALL}/usr/bin
cp -PRv ${PKG_DIR}/source/rpi-eeprom-update ${INSTALL}/usr/bin
cp -PRv ${PKG_BUILD}/rpi-eeprom-update ${INSTALL}/usr/bin/.rpi-eeprom-update.real
cp -PRv ${PKG_BUILD}/rpi-eeprom-config ${INSTALL}/usr/bin
mkdir -p ${INSTALL}/etc/default
cp -PRv ${PKG_DIR}/config/* ${INSTALL}/etc/default

View File

@ -0,0 +1,10 @@
#!/bin/sh
# If read-only then mount writeable, and restore read-only on exit
# This means we don't restore read-only if /flash is already writeable
if [ -n "$(grep " /flash " /proc/mounts | grep "[[:space:]]ro[[:space:],]")" ]; then
trap "mount -o remount,ro /flash" EXIT
mount -o remount,rw /flash
fi
sh /usr/bin/.rpi-eeprom-update.real $@