mirror of
https://github.com/LibreELEC/LibreELEC.tv.git
synced 2025-07-27 20:56:55 +00:00
Merge pull request #1865 from MilhouseVH/le82_init_fixes
init: fix error handling during get_project_arch [backport]
This commit is contained in:
commit
334025b42c
@ -192,8 +192,11 @@
|
|||||||
error() {
|
error() {
|
||||||
# Display fatal error message
|
# Display fatal error message
|
||||||
# $1:action which caused error, $2:message
|
# $1:action which caused error, $2:message
|
||||||
|
# Send debug_shell output to stderr, in case caller is redirecting/consuming stdout
|
||||||
|
# Return exitcode=1 so that called may detect when an error has occurred
|
||||||
echo "*** Error in $BOOT_STEP: $1: $2 ***" >&2
|
echo "*** Error in $BOOT_STEP: $1: $2 ***" >&2
|
||||||
debug_shell
|
debug_shell >&2
|
||||||
|
return 1
|
||||||
}
|
}
|
||||||
|
|
||||||
break_after() {
|
break_after() {
|
||||||
@ -221,7 +224,8 @@
|
|||||||
|
|
||||||
usleep 1000000
|
usleep 1000000
|
||||||
done
|
done
|
||||||
[ "$ERR_ENV" -ne "0" ] && error "mount_common" "Could not mount $1"
|
[ "$ERR_ENV" -eq "0" ] && return 0
|
||||||
|
error "mount_common" "Could not mount $1"
|
||||||
}
|
}
|
||||||
|
|
||||||
get_iscsistart_options() {
|
get_iscsistart_options() {
|
||||||
@ -356,7 +360,7 @@
|
|||||||
|
|
||||||
# mount the specified SYSTEM file and output arch from /etc/os-release
|
# mount the specified SYSTEM file and output arch from /etc/os-release
|
||||||
get_project_arch() {
|
get_project_arch() {
|
||||||
mount_part "$1" "/sysroot" "ro,loop"
|
mount_part "$1" "/sysroot" "ro,loop" || return
|
||||||
|
|
||||||
if [ -f /sysroot/etc/os-release ]; then
|
if [ -f /sysroot/etc/os-release ]; then
|
||||||
. /sysroot/etc/os-release
|
. /sysroot/etc/os-release
|
||||||
@ -393,8 +397,10 @@
|
|||||||
local update_filename="${1}"
|
local update_filename="${1}"
|
||||||
local old_system="${2}"
|
local old_system="${2}"
|
||||||
local new_system="${3}"
|
local new_system="${3}"
|
||||||
local old_project_arch="$(get_project_arch "${old_system}")"
|
local old_project_arch new_project_arch
|
||||||
local new_project_arch="$(get_project_arch "${new_system}")"
|
|
||||||
|
old_project_arch="$(get_project_arch "${old_system}")" || return
|
||||||
|
new_project_arch="$(get_project_arch "${new_system}")" || return
|
||||||
|
|
||||||
# If old or new project/arch isn't available then could be very old (pre-/etc/os-release) build - have to trust it
|
# If old or new project/arch isn't available then could be very old (pre-/etc/os-release) build - have to trust it
|
||||||
if [ -n "${old_project_arch}" -a -n "${new_project_arch}" ]; then
|
if [ -n "${old_project_arch}" -a -n "${new_project_arch}" ]; then
|
||||||
|
Loading…
x
Reference in New Issue
Block a user