From 1361c8fc2993e4bcc656bc3a6e86dc1f172eed29 Mon Sep 17 00:00:00 2001 From: James Nylen Date: Wed, 24 Oct 2012 15:05:43 +0000 Subject: [PATCH] Add option to disable self-updating --- README.md | 7 +++++++ rpi-update | 9 +++++---- 2 files changed, 12 insertions(+), 4 deletions(-) diff --git a/README.md b/README.md index de9ce36..0706593 100644 --- a/README.md +++ b/README.md @@ -50,6 +50,13 @@ To upgrade/downgrade to a specific firmware revision, specify its Git hash There are a number of options for experts you might like to use. These are all environment variables you must set if you wish to use them. +#### `UPDATE_SELF` + +By default, `rpi-update` will attempt to update itself each time it is run. +You can disable this behavior by: + + UPDATE_SELF=0 sudo rpi-update + #### `SKIP_KERNEL` SKIP_KERNEL=1 sudo rpi-update diff --git a/rpi-update b/rpi-update index 2300d10..30e9482 100755 --- a/rpi-update +++ b/rpi-update @@ -5,7 +5,7 @@ set -o errexit REPO_URI="http://github.com/Hexxeh/rpi-firmware" -UPDATE2=${UPDATE2:-1} +UPDATE_SELF=${UPDATE_SELF:-1} UPDATE_URI="https://github.com/Hexxeh/rpi-update/raw/master/rpi-update" if [[ ${BOOT_PATH:-"unset"} == "unset" && ${ROOT_PATH:-"unset"} != "unset" ]] || @@ -44,7 +44,7 @@ function update_self() { #!/bin/bash if mv "${_tempFileName}" "$0"; then rm -- "\$0" - exec env UPDATE2=0 /bin/bash "$0" "${FW_REV}" + exec env UPDATE_SELF=0 /bin/bash "$0" "${FW_REV}" else echo "Failed!" fi @@ -166,8 +166,9 @@ if [[ ${EUID} -ne 0 ]]; then exit 1 fi -if [[ ${UPDATE2} -ne 0 ]]; then - echo "Raspberry Pi firmware updater by Hexxeh, enhanced by AndrewS" +echo "Raspberry Pi firmware updater by Hexxeh, enhanced by AndrewS" + +if [[ ${UPDATE_SELF} -ne 0 ]]; then update_self fi