#!/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 $@
