Add option to disable self-updating

This commit is contained in:
James Nylen
2012-10-24 15:05:43 +00:00
parent 4c690228f7
commit 1361c8fc29
2 changed files with 12 additions and 4 deletions

View File

@@ -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

View File

@@ -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"
if [[ ${UPDATE_SELF} -ne 0 ]]; then
update_self
fi