android7.1以太网动态ip,[RK3288][Android7.1] 调试笔记 --- 配置静态IP之后无法开机

Platform: RK3288

OS: Android 7.1

Kernel: v4.4.83

现象:

手动去设置里面配置静态IP,保存后掉电开机,偶发无法进入系统的情况。

Log:

01-24 14:47:55.696 518 518 I EthernetServiceImpl: Creating EthernetConfigStore

01-24 14:47:55.697 518 518 E IpConfigStore: Bad version on IP configuration file, ignore read

01-24 14:47:55.697 518 518 E System : ******************************************

01-24 14:47:55.698 518 518 E System : ************ Failure starting system services

01-24 14:47:55.698 518 518 E System : java.lang.RuntimeException: Failed to create service com.android.server.ethernet.EthernetService: service constructor threw an exception

01-24 14:47:55.698 518 518 E System : at com.android.server.SystemServiceManager.startService(SystemServiceManager.java:104)

01-24 14:47:55.698 518 518 E System : at com.android.server.SystemServiceManager.startService(SystemServiceManager.java:67)

01-24 14:47:55.698 518 518 E System : at com.android.server.SystemServer.startOtherServices(SystemServer.java:880)

01-24 14:47:55.698 518 518 E System : at com.android.server.SystemServer.run(SystemServer.java:343)

01-24 14:47:55.698 518 518 E System : at com.android.server.SystemServer.main(SystemServer.java:225)

01-24 14:47:55.698 518 518 E System : at java.lang.reflect.Method.invoke(Native Method)

01-24 14:47:55.698 518 518 E System : at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:912)

01-24 14:47:55.698 518 518 E System : at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:802)

01-24 14:47:55.698 518 518 E System : Caused by: java.lang.reflect.InvocationTargetException

01-24 14:47:55.698 518 518 E System : at java.lang.reflect.Constructor.newInstance0(Native Method)

01-24 14:47:55.698 518 518 E System : at java.lang.reflect.Constructor.newInstance(Constructor.java:430)

01-24 14:47:55.698 518 518 E System : at com.android.server.SystemServiceManager.startService(SystemServiceManager.java:93)

01-24 14:47:55.698 518 518 E System : ... 7 more

01-24 14:47:55.698 518 518 E System : Caused by: java.lang.NullPointerException: Attempt to invoke virtual method 'int android.util.SparseArray.size()' on a null object reference

01-24 14:47:55.698 518 518 E System : at com.android.server.ethernet.EthernetConfigStore.readIpAndProxyConfigurations(EthernetConfigStore.java:44)

01-24 14:47:55.698 518 518 E System : at com.android.server.ethernet.EthernetServiceImpl.(EthernetServiceImpl.java:64)

01-24 14:47:55.698 518 518 E System : at com.android.server.ethernet.EthernetService.(EthernetService.java:30)

01-24 14:47:55.698 518 518 E System : ... 10 more

01-24 14:47:55.698 518 518 D AndroidRuntime: Shutting down VM

原因:

不能开机是因为以太网服务读到的ipconfig.txt文件异常而一直重启服务,导致系统卡住。

而ipconfig.txt异常是因为系统对文件缓存引起,掉电的时候文件内容还没有完全刷到文件中。

临时方案:

kris@eco:~/rk3288/frameworks/base

diff --git a/services/core/java/com/android/server/net/IpConfigStore.java b/services/core/java/com/an

index a1f12f4..ebad5ff 100644

--- a/services/core/java/com/android/server/net/IpConfigStore.java

+++ b/services/core/java/com/android/server/net/IpConfigStore.java

@@ -186,7 +186,8 @@ public class IpConfigStore {

int version = in.readInt();

if (version != 2 && version != 1) {

loge("Bad version on IP configuration file, ignore read");

- return null;

+ return networks;

}

此方法只能临时解决无法开机的问题,但是ip的缓存问题还需要更好的方法去解决。

关于缓存:

参考:

文件系统FAQ.pdf

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值