From 23fb846604bc79b0ba57cd24f6bb1fc11ec4923d Mon Sep 17 00:00:00 2001 From: Dom Cobley Date: Mon, 19 Dec 2022 11:58:33 +0000 Subject: [PATCH] rpi-update: Warn if initramfs is configured --- rpi-update | 22 ++++++++++++++++++++++ 1 file changed, 22 insertions(+) diff --git a/rpi-update b/rpi-update index 1d8723b..17373a0 100755 --- a/rpi-update +++ b/rpi-update @@ -339,6 +339,27 @@ function check_partition { fi } +function check_initramfs { + local INITRAMFS="" + if command -v vcgencmd > /dev/null; then + INITRAMFS="$(echo =$(vcgencmd get_config ramfsfile) | cut -d'=' -f3)" + fi + if [ "$INITRAMFS" == "" ]; then + return + fi + if [[ ${SKIP_WARNING} -ne 0 ]]; then + return + fi + echo "Updating a system with initramfs configured is not supported by rpi-update" + echo "This could result in a system that will not boot." + read -p "Would you like to proceed? (y/N)" -n 1 -r -s + echo "" + if ! [[ $REPLY =~ ^[Yy]$ ]]; then + exit 1; + fi +} + + function update_firmware { echo " *** Updating firmware" rm -rf "${FW_PATH}/"start*.elf @@ -446,6 +467,7 @@ function do_update { if [[ ${WANT_PI4} -eq 1 ]]; then check_partition fi + check_initramfs check_eeprom_version show_notice download_rev