【Android Debug】 Skipping insecure file ...

在某個項目的bring up階段,有時候會不斷的更新各種文件,config, drivers, kernel image等。

有時候會出現 Skipping insecure file 錯誤,導致device boot失敗。


詳見如下:

詳見system\core\init\util.c---> read_file
    if ((sb.st_mode & 
(S_IWGRP | S_IWOTH)) != 0) {
        ERROR("skipping insecure file '%s'\n", fn);
        goto oops;
    }


這個屬於4.1新特性,更加安全,後續我們研發人員注意:


如筆者所經歷,更新wifi/bt驅動時, 新編譯出來的文件如下:


-rw-r--r-- 1 yangxx yangxx  173140 2013-06-19 07:16 galcore.ko
-rw-r--r-- 1 yangxx yangxx   62088 2013-06-19 07:16 mbt8xxx.ko
-rw-r--r-- 1 yangxx yangxx  277004 2013-06-19 07:16 mlan.ko
-rw-r--r-- 1 yangxx yangxx  358032 2013-06-19 07:16 sd8787.ko
-rw-r--r-- 1 yangxx yangxx 3876608 2013-06-19 07:16 uImage


明顯文件權限是644, push到板子後就變成了777,

步驟如下:

adb root

adb remount

adb push *** /system/lib/modules/

adb shell sync

adb reboot

重啓板子失敗,從串口看這些文件,權限卻變成了777.

研究發下,必須到板子裏面更改權限纔行,如下:

adb root

adb remount

adb shell

# cd /system/lib/modules/

# chmod 644 *.ko

# reboot


然後OK


總結:

[Solution]

1.      EnableBT/BT-HID as attached patch says, recompile kernel and BT drivers.

2.      Pushgalcore.ko  mbt8xxx.ko  mlan.ko  sd8787.ko to/system/lib/modules/

3.      Remountsystem and chmod modules permission to 644 (Wasted much time in thisstep, as push “777” files always in before verification)

[Reason]

Android defines secure file checking mechanismduring devcie boot, those with 777 permission will be regarded as inscure file.

Here, just make drivers matches kernel imagecorresponding, not android system images.





發表評論
所有評論
還沒有人評論,想成為第一個評論的人麼? 請在上方評論欄輸入並且點擊發布.
相關文章