mirror of
https://github.com/raspberrypi/rpi-update.git
synced 2026-01-20 21:13:38 +08:00
Test if BOOT_PATH and ROOT_PATH are unset rather than their default values, fixes hexxeh/rpi-update#11
This commit is contained in:
12
rpi-update
12
rpi-update
@@ -6,6 +6,12 @@ set -o errexit
|
|||||||
UPDATE=${UPDATE:-1}
|
UPDATE=${UPDATE:-1}
|
||||||
UPDATE_URI="https://github.com/Hexxeh/rpi-update/raw/master/rpi-update"
|
UPDATE_URI="https://github.com/Hexxeh/rpi-update/raw/master/rpi-update"
|
||||||
|
|
||||||
|
if [[ ${BOOT_PATH:-"unset"} == "unset" && ${ROOT_PATH:-"unset"} != "unset" ]] ||
|
||||||
|
[[ ${BOOT_PATH:-"unset"} != "unset" && ${ROOT_PATH:-"unset"} == "unset" ]]; then
|
||||||
|
echo "You need to specify both ROOT_PATH and BOOT_PATH, or neither"
|
||||||
|
exit 1
|
||||||
|
fi
|
||||||
|
|
||||||
ROOT_PATH=${ROOT_PATH:-"/"}
|
ROOT_PATH=${ROOT_PATH:-"/"}
|
||||||
BOOT_PATH=${BOOT_PATH:-"/boot"}
|
BOOT_PATH=${BOOT_PATH:-"/boot"}
|
||||||
SKIP_KERNEL=${SKIP_KERNEL:-0}
|
SKIP_KERNEL=${SKIP_KERNEL:-0}
|
||||||
@@ -167,12 +173,6 @@ if [[ ${UPDATE} -ne 0 ]]; then
|
|||||||
update_self
|
update_self
|
||||||
fi
|
fi
|
||||||
|
|
||||||
if [[ ( "${ROOT_PATH}" == "/" && "${BOOT_PATH}" != "/boot" ) ]] ||
|
|
||||||
[[ ( "${BOOT_PATH}" == "/boot" && "${ROOT_PATH}" != "/" ) ]]; then
|
|
||||||
echo "You need to specify both ROOT_PATH and BOOT_PATH, or neither"
|
|
||||||
exit 1
|
|
||||||
fi
|
|
||||||
|
|
||||||
if [[ ! -d "${FW_PATH}" ]]; then
|
if [[ ! -d "${FW_PATH}" ]]; then
|
||||||
echo "${FW_PATH} doesn't exist"
|
echo "${FW_PATH} doesn't exist"
|
||||||
exit 1
|
exit 1
|
||||||
|
|||||||
Reference in New Issue
Block a user