BRANCH env variable allows alternate branch to be specified

This commit is contained in:
Richard Hull
2013-04-19 23:35:58 +01:00
parent fc31bc780a
commit a933ec64ae
2 changed files with 12 additions and 2 deletions

View File

@@ -63,6 +63,15 @@ are not currently booted from. Useful for installing firmware/kernel to a
non-RPI customised image. Be careful, you must specify both options or neither.
Specifying only one will not work.
#### `BRANCH`
By default, clones the firmware files from the master branch, else uses the files
from the specified branch, eg:
sudo BRANCH=next rpi-update
will use the 'next' branch.
#### Troubleshooting
There are two possible problems related to SSL certificates that may prevent

View File

@@ -14,6 +14,7 @@ if [[ ${BOOT_PATH:-"unset"} == "unset" && ${ROOT_PATH:-"unset"} != "unset" ]] ||
exit 1
fi
BRANCH=${BRANCH:-"master"}
ROOT_PATH=${ROOT_PATH:-"/"}
BOOT_PATH=${BOOT_PATH:-"/boot"}
SKIP_KERNEL=${SKIP_KERNEL:-0}
@@ -106,7 +107,7 @@ function finalise {
ldconfig -r "${ROOT_PATH}"
if [[ ${FW_REV} == "" ]]; then
echo " *** Storing current firmware revision"
eval ${GITCMD} rev-parse master > "${FW_PATH}/.firmware_revision"
eval ${GITCMD} rev-parse ${BRANCH} > "${FW_PATH}/.firmware_revision"
else
echo ${FW_REV} > "${FW_PATH}/.firmware_revision"
fi
@@ -118,7 +119,7 @@ function download_repo {
echo " *** Setting up firmware (this may take a few minutes)"
mkdir -p "${FW_REPOLOCAL}"
set +e
git clone "${FW_REPO}" "${FW_REPOLOCAL}" --depth=1
git clone "${FW_REPO}" "${FW_REPOLOCAL}" --depth=1 --branch ${BRANCH}
RETVAL=$?
set -e
if [[ ${RETVAL} -ne 0 ]]; then