Android展锐fota升级失败排查

文章讲述了在升级展锐设备至Android8.1时遇到的失败问题,主要关注点在于确认SELinux权限设置、检查升级包中的中文资源对编译的影响,并提供了edify_generator.py文件中关于UTF-8编码的修改。
摘要由CSDN通过智能技术生成

此文章仅仅记录工作事宜,若可以帮助到您是我的荣幸,谢谢!

在工作中遇到了展锐Android8.1升级失败的问题

排查方向如下:

1.确认selinux权限是否开启,因为有些挂载点mountpoint的权限是由selinux权限授予的,挂载点挂不上是一定会升级失败的

      1.修改如下:开启selinux权限

      文件路径:./sprd/kernel/arch/arm/configs/sp7731cea_dt_defconfig

index 18e0386..0d2aa6f 100755
--- a/jzhk/driver/mk_config/sp32_31c_172x640_648_extspk_nogps_drv/sp7731cea_dt_defconfig
+++ b/jzhk/driver/mk_config/sp32_31c_172x640_648_extspk_nogps_drv/sp7731cea_dt_defconfig
@@ -2955,7 +2955,7 @@ CONFIG_EXT3_FS_XATTR=y
 # CONFIG_EXT3_FS_SECURITY is not set
 CONFIG_EXT4_FS=y
 # CONFIG_EXT4_FS_POSIX_ACL is not set
-#CONFIG_EXT4_FS_SECURITY is not set
+CONFIG_EXT4_FS_SECURITY=y
 # CONFIG_EXT4_DEBUG is not set
 CONFIG_SDCARD_FS=y
 CONFIG_SDCARD_FS_CI_SEARCH=y
@@ -3248,11 +3248,11 @@ CONFIG_SECURITY_NETWORK=y
 # CONFIG_SECURITY_NETWORK_XFRM is not set
 # CONFIG_SECURITY_PATH is not set
 CONFIG_LSM_MMAP_MIN_ADDR=32768
-#CONFIG_SECURITY_SELINUX is not set
+CONFIG_SECURITY_SELINUX=y
 # CONFIG_SECURITY_SELINUX_BOOTPARAM is not set
-CONFIG_SECURITY_SELINUX_DISABLE=y
-#CONFIG_SECURITY_SELINUX_DEVELOP is not set
-#CONFIG_SECURITY_SELINUX_AVC_STATS is not set
+# CONFIG_SECURITY_SELINUX_DISABLE is not set
+CONFIG_SECURITY_SELINUX_DEVELOP=y
+CONFIG_SECURITY_SELINUX_AVC_STATS=y
 CONFIG_SECURITY_SELINUX_CHECKREQPROT_VALUE=1
 # CONFIG_SECURITY_SELINUX_POLICYDB_VERSION_MAX is not set
 # CONFIG_SECURITY_SMACK is not set

2.升级包里面是否有中文资源

3. 中文资源编译fota失败

4.中文资源导致fota升级失败

         2,3,4 修改如下:

            文件路径:

             sprd\build\tools\releasetools\edify_generator.py

diff --git a/sprd/build/tools/releasetools/edify_generator.py b/sprd/build/tools/releasetools/edify_generator.py
old mode 100644
new mode 100755
index be58989..52a0eb0
--- a/sprd/build/tools/releasetools/edify_generator.py
+++ b/sprd/build/tools/releasetools/edify_generator.py
@@ -15,6 +15,11 @@
 import re

 import common
+
+import sys
+reload(sys)
+sys.setdefaultencoding("utf-8")
+

 class EdifyGenerator(object):
   """Class to generate scripts in the 'edify' recovery script language
@@ -322,8 +327,13 @@ class EdifyGenerator(object):
     else:
       if capabilities is None:
         capabilities = "0x0"
-      cmd = 'set_metadata("%s", "uid", %d, "gid", %d, "mode", 0%o, ' \
-          '"capabilities", %s' % (fn, uid, gid, mode, capabilities)
+      if mode is None:
+          mode = 755
+          cmd = 'set_metadata("%s", "uid", %s, "gid", %s, "mode", 0%d, ' \
+              '"capabilities", %s' % (fn, uid, gid, mode, capabilities)
+      else:
+         cmd = 'set_metadata("%s", "uid", %d, "gid", %d, "mode", 0%o, ' \
+              '"capabilities", %s' % (fn, uid, gid, mode, capabilities)
       if selabel is not None:
         cmd += ', "selabel", "%s"' % selabel
       cmd += ');'
@@ -338,7 +348,7 @@ class EdifyGenerator(object):
     else:
       if capabilities is None:
         capabilities = "0x0"
-      cmd = 'set_metadata_recursive("%s", "uid", %d, "gid", %d, ' \
+      cmd = 'set_metadata_recursive("%s", "uid", %s, "gid", %s, ' \
           '"dmode", 0%o, "fmode", 0%o, "capabilities", %s' \
           % (fn, uid, gid, dmode, fmode, capabilities)
       if selabel is not None:

  • 4
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值