Skip to content

Commit

Permalink
[xiaomi] Add support for ubi-loader
Browse files Browse the repository at this point in the history
  • Loading branch information
remittor committed Mar 3, 2024
1 parent ffffbcc commit d0c545b
Show file tree
Hide file tree
Showing 3 changed files with 13 additions and 3 deletions.
4 changes: 2 additions & 2 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -5,8 +5,8 @@
include $(TOPDIR)/rules.mk

PKG_NAME:=facinstall
PKG_VERSION:=1.5
PKG_RELEASE:=20240131
PKG_VERSION:=1.7
PKG_RELEASE:=20240303

PKG_MAINTAINER:=remittor <remittor@gmail.com>
PKG_LICENSE:=MIT
Expand Down
2 changes: 1 addition & 1 deletion files/functions.sh
Original file line number Diff line number Diff line change
Expand Up @@ -226,7 +226,7 @@ fi_get_part_size() {
local part_name=$1
local part
local mtd_size_hex
part=$( grep "\"$part_name\"" < "/proc/mtd" )
part=$( cat /proc/mtd | grep "\"$part_name\"" 2>/dev/null )
if [ -z "$part" ]; then
mtd_size_hex=0
else
Expand Down
10 changes: 10 additions & 0 deletions files/xiaomi.sh
Original file line number Diff line number Diff line change
Expand Up @@ -382,6 +382,7 @@ fi_platform_do_upgrade() {
}

fi_platform_init() {
local krn_size ldr_size
FI_FIT_IMG=
FI_UBI_IMG=
FI_KERNEL_PART=$CI_KERNPART
Expand All @@ -393,6 +394,15 @@ fi_platform_init() {
if [ -n "$CI_ROOT_UBIPART" ]; then
FI_ROOTFS_PART=$CI_ROOT_UBIPART
fi
krn_size=$( fi_get_part_size "$FI_KERNEL_PART" )
if [ "$krn_size" = "0" ]; then
ldr_size=$( fi_get_part_size "ubi-loader" )
if [ "$ldr_size" = "0" ]; then
fierr "cannot find mtd partition for kernel image"
return 1
fi
FI_KERNEL_PART="ubi-loader"
fi
[ -z "$FI_IMAGE_SIZE" ] && return 1
[ "$FI_IMAGE_SIZE" -lt 1000000 ] && return 1
FI_IMG_MODEL=$( fi_get_uint8_at 14 )
Expand Down

0 comments on commit d0c545b

Please sign in to comment.