From a933ec64aed85361f18673a14e0a3c30adc5c7b4 Mon Sep 17 00:00:00 2001 From: Richard Hull Date: Fri, 19 Apr 2013 23:35:58 +0100 Subject: [PATCH] BRANCH env variable allows alternate branch to be specified --- README.md | 9 +++++++++ rpi-update | 5 +++-- 2 files changed, 12 insertions(+), 2 deletions(-) diff --git a/README.md b/README.md index 038b3b2..fcce88f 100644 --- a/README.md +++ b/README.md @@ -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 diff --git a/rpi-update b/rpi-update index eb097b0..026e521 100755 --- a/rpi-update +++ b/rpi-update @@ -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