mirror of
https://github.com/raspberrypi/rpi-eeprom.git
synced 2026-01-20 21:13:36 +08:00
rpi-eeprom-update: Add -b flag to output BOOTFS path
Add an API for external scripts to safely determine which the directory the EEPROM image update files will be written to.
This commit is contained in:
@@ -147,6 +147,7 @@ applyRecoveryUpdate()
|
|||||||
[ -n "${BOOTLOADER_UPDATE_IMAGE}" ] || [ -n "${VL805_UPDATE_IMAGE}" ] || die "No update images specified"
|
[ -n "${BOOTLOADER_UPDATE_IMAGE}" ] || [ -n "${VL805_UPDATE_IMAGE}" ] || die "No update images specified"
|
||||||
|
|
||||||
findBootFS
|
findBootFS
|
||||||
|
echo "BOOTFS ${BOOTFS}"
|
||||||
|
|
||||||
# A '.sig' file is created so that recovery.bin can check that the
|
# A '.sig' file is created so that recovery.bin can check that the
|
||||||
# EEPROM image has not been created (e.g. SD card corruption).
|
# EEPROM image has not been created (e.g. SD card corruption).
|
||||||
@@ -388,6 +389,7 @@ retained.
|
|||||||
Options:
|
Options:
|
||||||
-a Automatically install bootloader and USB (VLI) EEPROM updates.
|
-a Automatically install bootloader and USB (VLI) EEPROM updates.
|
||||||
-A Specify which type of EEPROM to automatically update (vl805 or bootloader)
|
-A Specify which type of EEPROM to automatically update (vl805 or bootloader)
|
||||||
|
-b Outputs the path that pending EEPROM updates will be written to.
|
||||||
-d Use the default bootloader config, or if a file is specified using the -f
|
-d Use the default bootloader config, or if a file is specified using the -f
|
||||||
flag use the config in that file. This option only applies when a
|
flag use the config in that file. This option only applies when a
|
||||||
bootloader EEPROM update is needed; if the bootloader EEPROM is up-to-date
|
bootloader EEPROM update is needed; if the bootloader EEPROM is up-to-date
|
||||||
@@ -513,9 +515,7 @@ findBootFS()
|
|||||||
# If BOOTFS is not a directory or doesn't contain any .elf files then
|
# If BOOTFS is not a directory or doesn't contain any .elf files then
|
||||||
# it's probably not the boot partition.
|
# it's probably not the boot partition.
|
||||||
[ -d "${BOOTFS}" ] || die "BOOTFS: \"${BOOTFS}\" is not a directory"
|
[ -d "${BOOTFS}" ] || die "BOOTFS: \"${BOOTFS}\" is not a directory"
|
||||||
if [ "$(find "${BOOTFS}/" -name "*.elf" | wc -l)" -gt 0 ]; then
|
if [ "$(find "${BOOTFS}/" -name "*.elf" | wc -l)" = 0 ]; then
|
||||||
echo "BOOTFS ${BOOTFS}"
|
|
||||||
else
|
|
||||||
echo "WARNING: BOOTFS: \"${BOOTFS}\" contains no .elf files. Please check boot directory"
|
echo "WARNING: BOOTFS: \"${BOOTFS}\" contains no .elf files. Please check boot directory"
|
||||||
fi
|
fi
|
||||||
}
|
}
|
||||||
@@ -700,7 +700,7 @@ MACHINE_OUTPUT=""
|
|||||||
JSON_OUTPUT="no"
|
JSON_OUTPUT="no"
|
||||||
IGNORE_DPKG_CHECKSUMS=$LOCAL_MODE
|
IGNORE_DPKG_CHECKSUMS=$LOCAL_MODE
|
||||||
|
|
||||||
while getopts A:adhilf:m:ju:r option; do
|
while getopts A:abdhilf:m:ju:r option; do
|
||||||
case "${option}" in
|
case "${option}" in
|
||||||
A)
|
A)
|
||||||
if [ "${OPTARG}" = "bootloader" ]; then
|
if [ "${OPTARG}" = "bootloader" ]; then
|
||||||
@@ -714,6 +714,11 @@ while getopts A:adhilf:m:ju:r option; do
|
|||||||
a) AUTO_UPDATE_BOOTLOADER=1
|
a) AUTO_UPDATE_BOOTLOADER=1
|
||||||
AUTO_UPDATE_VL805=1
|
AUTO_UPDATE_VL805=1
|
||||||
;;
|
;;
|
||||||
|
b)
|
||||||
|
findBootFS
|
||||||
|
echo ${BOOTFS}
|
||||||
|
exit 0
|
||||||
|
;;
|
||||||
d) OVERWRITE_CONFIG=1
|
d) OVERWRITE_CONFIG=1
|
||||||
;;
|
;;
|
||||||
f) BOOTLOADER_UPDATE_IMAGE="${OPTARG}"
|
f) BOOTLOADER_UPDATE_IMAGE="${OPTARG}"
|
||||||
|
|||||||
Reference in New Issue
Block a user