Skip to content

Commit

Permalink
[asus] Add support TRX v2 images
Browse files Browse the repository at this point in the history
  • Loading branch information
remittor committed Mar 17, 2024
1 parent d0c545b commit 912dd52
Show file tree
Hide file tree
Showing 2 changed files with 18 additions and 10 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.7
PKG_RELEASE:=20240303
PKG_VERSION:=1.8
PKG_RELEASE:=20240317

PKG_MAINTAINER:=remittor <remittor@gmail.com>
PKG_LICENSE:=MIT
Expand Down
24 changes: 16 additions & 8 deletions files/asus.sh
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@ FI_KERNEL_VOL="linux"
FI_ROOTFS_VOL="rootfs"
FI_KERNEL_SIZE=
FI_DEL_TRX_HEADER=
FI_TRX_VER=3


fi_get_vol_id_by_name() {
Expand Down Expand Up @@ -174,19 +175,26 @@ fi_platform_check_image() {
fi

if [ "$FI_IMAGE_MAGIC" = "$FI_MAGIC_TRX" ]; then
xx=$( fi_get_hexdump_at 64 4 )
if [ "$xx" != "$FI_MAGIC_FIT" ]; then
fierr "Incorrect stock firmware! FIT image not found!"
return 1
xx=$( fi_get_hexdump_at 60 1 )
if [ "$xx" = "a9" ]; then
FI_TRX_VER=2
else
xx=$( fi_get_hexdump_at 64 4 )
if [ "$xx" != "$FI_MAGIC_FIT" ]; then
fierr "Incorrect stock firmware! FIT image not found!"
return 1
fi
fi
#if [ "$FI_INITRAMFS_MODE" != "1" ]; then
# fierr "TRX images can only be flashed in InitRamFs mode!"
# return 1
#fi
xx=$( grep -c -F "rootfs-1" "$FI_IMAGE" )
if [ "$xx" == "0" ]; then
fierr "Incorrect TRX image! Part 'rootfs-1' not found!"
return 1
if [ "$FI_TRX_VER" = 3 ]; then
xx=$( grep -c -F "rootfs-1" "$FI_IMAGE" )
if [ "$xx" == "0" ]; then
fierr "Incorrect TRX image! Part 'rootfs-1' not found!"
return 1
fi
fi
if [ "$FI_STAGE" != "2" ]; then
err=$( fi_check_uimage_crc $FI_IMAGE 0 )
Expand Down

0 comments on commit 912dd52

Please sign in to comment.