Slight tweak to the "startup logic"

This fixes #102  (which would also get triggered if you rpi-updated to a specific revision, and then later tried rpi-updating to the latest revision)
This commit is contained in:
Andrew Scheller
2013-08-28 01:13:43 +01:00
parent 1b9a011e7d
commit a8a404c05a

View File

@@ -202,7 +202,7 @@ echo " *** ARM/GPU split is now defined in /boot/config.txt using the gpu_mem op
if [[ ${FW_REV} != "" ]]; then if [[ ${FW_REV} != "" ]]; then
download_rev download_rev
do_update "updated to revision ${FW_REV}" do_update "updated to revision ${FW_REV}"
elif [[ -f "${FW_REPOLOCAL}/.git/config" ]]; then elif [[ -f "${FW_REPOLOCAL}/bootcode.bin" ]]; then
# ask git server version before spending time cloning # ask git server version before spending time cloning
GITREV=$(git ls-remote -h ${REPO_URI} refs/heads/${BRANCH} | awk '{print $1}') GITREV=$(git ls-remote -h ${REPO_URI} refs/heads/${BRANCH} | awk '{print $1}')
if [[ -f "${FW_PATH}/.firmware_revision" ]] && [[ $(cat "${FW_PATH}/.firmware_revision") == "$GITREV" ]]; then if [[ -f "${FW_PATH}/.firmware_revision" ]] && [[ $(cat "${FW_PATH}/.firmware_revision") == "$GITREV" ]]; then
@@ -215,6 +215,10 @@ elif [[ -f "${FW_REPOLOCAL}/.git/config" ]]; then
fi fi
else else
echo " *** We're running for the first time" echo " *** We're running for the first time"
if [[ -d "${FW_REPOLOCAL}" ]]; then
# rpi-update must have errored during the first run
rm -rf "${FW_REPOLOCAL}"
fi
download_repo download_repo
do_backup do_backup
do_update "setup" do_update "setup"