Respect enforced SoC. (#582)

pull/589/head
Paul Philippov 2022-11-26 05:29:07 -05:00 committed by GitHub
parent 91df33f194
commit a2e2e7b343
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 11 additions and 9 deletions

View File

@ -3,7 +3,7 @@
# OpenIPC.org | v.20221118
#
scr_version=1.0.15
scr_version=1.0.16
args=" $@"
@ -40,14 +40,16 @@ do_update_kernel() {
echo_c 33 "\nKernel"
echo "Update kernel from $x"
[ ! -f "$x" ] && die "File $x not found"
local ksoc=$(od -j 32 -N 32 -S 1 -A n "$x" | cut -d- -f3)
# FIXME: Ingenic kernels do not include proper SoC identifiers.
case "$soc" in
t31) [ "t" != "$ksoc" ] && die "Wrong SoC!" ;;
t21) [ "" != "$ksoc" ] && die "Wrong SoC!" ;;
*) check_soc "$ksoc"
esac
compare_versions "$kernel_version" "$(get_kernel_version "$x")" && return 0
if [ "1" != "$skip_soc" ]; then
local ksoc=$(od -j 32 -N 32 -S 1 -A n "$x" | cut -d- -f3)
# FIXME: Ingenic kernels do not include proper SoC identifiers.
case "$soc" in
t31) [ "t" != "$ksoc" ] && die "Wrong SoC!" ;;
t21) [ "" != "$ksoc" ] && die "Wrong SoC!" ;;
*) check_soc "$ksoc"
esac
compare_versions "$kernel_version" "$(get_kernel_version "$x")" && return 0
fi
flashcp -v "$x" "$kernel_device"
echo_c 32 "Kernel updated to $(get_kernel_version "$kernel_device")"
}