Update with vl805 support

This commit is contained in:
MilhouseVH 2019-10-17 13:46:32 +01:00
parent 260e26ac4b
commit e14652e9db
3 changed files with 37 additions and 46 deletions

View File

@ -574,10 +574,13 @@ mount_flash() {
cleanup_flash() { cleanup_flash() {
progress "Cleaning up flash (if required)" progress "Cleaning up flash (if required)"
if [ -f /flash/pieeprom.upd ]; then if [ -f /flash/pieeprom.bin -o -f /flash/pieeprom.upd -o -f /flash/vl805.bin ]; then
mount -o remount,rw /flash mount -o remount,rw /flash
rm -f /flash/pieeprom.bin /flash/pieeprom.upd
rm -f /flash/pieeprom.bin /flash/pieeprom.upd /flash/pieeprom.sig
rm -f /flash/vl805.bin /flash/vl805.sig
rm -f /flash/recovery.bin /flash/recovery.[0-9][0-9][0-9] /flash/RECOVERY.[0-9][0-9][0-9] rm -f /flash/recovery.bin /flash/recovery.[0-9][0-9][0-9] /flash/RECOVERY.[0-9][0-9][0-9]
mount -o remount,ro /flash mount -o remount,ro /flash
fi fi
} }

View File

@ -9,51 +9,30 @@ FLAG_FILE="/storage/.rpi_flash_firmware"
hidecursor hidecursor
if ! mount -o remount,rw /flash 2>/dev/null; then
# Remove flag file and bail out
rm -f "${FLAG_FILE}"
sync
echo "ERROR: Unable to mount /flash as a read/write file system."
echo
echo "Aborting Flash update process - please proceed with a manual update."
echo
StartProgress countdown "Rebooting in 15s... " 15 "NOW"
fi
if [ -f "${FLAG_FILE}" ]; then if [ -f "${FLAG_FILE}" ]; then
. ${FLAG_FILE} . ${FLAG_FILE}
rm -f "${FLAG_FILE}"
# Prepare flashing environment if ! mount -o remount,rw /flash 2>/dev/null; then
if [ "${MODE}" = "init" ]; then echo "ERROR: Unable to mount /flash as a read/write file system."
# Install new SPI bootloader files to /flash (if required) echo
if [ "${BOOTLOADER}" = "yes" ]; then echo "Aborting Flash update process - please proceed with a manual update."
USE_FLASHROM=0 /usr/bin/.rpi-eeprom-update.real -a echo
fi
# Bump process to next step StartProgress countdown "Rebooting in 15s... " 15 "NOW"
sed -e 's/^MODE=.*/MODE="update"/' -i "${FLAG_FILE}" reboot -f &>/dev/null
sync fi
else
rm -f "${FLAG_FILE}"
sync
if [ "${MODE}" = "update" ]; then # Install new bootloader and/or USB3 firmware files to /flash
# Display current bootloader status # Firmware flashing will occur during the next boot, after
if [ "${BOOTLOADER}" = "yes" ]; then # which the system will again reboot.
USE_FLASHROM=0 /usr/bin/.rpi-eeprom-update.real # Old firmware files will be automatically removed by init.
fi CMD_ARGS=""
[ "${BOOTLOADER}" = "yes" ] && CMD_ARGS="${CMD_ARGS} -A bootloader"
[ "${VL805}" = "yes" ] && CMD_ARGS="${CMD_ARGS} -A vl805"
# Apply VIA USB3 update if [ -n "${CMD_ARGS}" ]; then
# if [ "${USB3}" = "yes" ]; then USE_FLASHROM=0 /usr/bin/.rpi-eeprom-update.real ${CMD_ARGS}
# /usr/bin/vl805
# fi
sync
echo ""
StartProgress countdown "Rebooting in 15s... " 15 "NOW"
fi
fi fi
sync sync

View File

@ -19,17 +19,26 @@ makeinstall_target() {
_dirs="critical" _dirs="critical"
[ "$LIBREELEC_VERSION" = "devel" ] && _dirs+=" beta" [ "$LIBREELEC_VERSION" = "devel" ] && _dirs+=" beta"
for _dir in ${_dirs}; do for _dir in ${_dirs}; do
if [ -n "$(ls -1 ${PKG_BUILD}/firmware/${_dir}/pieeprom-* 2>/dev/null)" ]; then mkdir -p ${DESTDIR}/${_dir}
mkdir -p ${DESTDIR}/${_dir} cp -PRv ${PKG_BUILD}/firmware/${_dir}/recovery.bin ${DESTDIR}/${_dir}
cp -PRv $(ls -1 ${PKG_BUILD}/firmware/${_dir}/pieeprom-* | tail -1) ${DESTDIR}/${_dir}
cp -PRv ${PKG_BUILD}/firmware/${_dir}/recovery.bin ${DESTDIR}/${_dir} # Bootloader SPI
fi PKG_FW_FILE="$(ls -1 ${PKG_BUILD}/firmware/${_dir}/pieeprom-* 2>/dev/null | tail -1)"
[ -n "${PKG_FW_FILE}" ] && cp -PRv "${PKG_FW_FILE}" ${DESTDIR}/${_dir}
# VIA USB3
if [ -f ${PKG_BUILD}/firmware/${_dir}/vl805.latest ]; then
PKG_FW_FILE="$(tail -1 ${PKG_BUILD}/firmware/${_dir}/vl805.latest)"
cp -PRv ${PKG_BUILD}/firmware/${_dir}/vl805-${PKG_FW_FILE}.bin ${DESTDIR}/${_dir}
cp -PRv ${PKG_BUILD}/firmware/${_dir}/vl805.latest ${DESTDIR}/${_dir}
fi
done done
mkdir -p ${INSTALL}/usr/bin mkdir -p ${INSTALL}/usr/bin
cp -PRv ${PKG_DIR}/source/rpi-eeprom-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-update ${INSTALL}/usr/bin/.rpi-eeprom-update.real
cp -PRv ${PKG_BUILD}/rpi-eeprom-config ${INSTALL}/usr/bin cp -PRv ${PKG_BUILD}/rpi-eeprom-config ${INSTALL}/usr/bin
cp -PRv ${PKG_BUILD}/vl805 ${INSTALL}/usr/bin
mkdir -p ${INSTALL}/etc/default mkdir -p ${INSTALL}/etc/default
cp -PRv ${PKG_DIR}/config/* ${INSTALL}/etc/default cp -PRv ${PKG_DIR}/config/* ${INSTALL}/etc/default