mirror of
https://github.com/raspberrypi/rpi-update.git
synced 2026-01-20 21:13:38 +08:00
Add option to disable self-updating
This commit is contained in:
@@ -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
|
||||
|
||||
@@ -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
|
||||
|
||||
|
||||
Reference in New Issue
Block a user