【Android Debug】 Skipping insecure file …

來源:互聯網
上載者:User

在某個項目的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.

聯繫我們

該頁面正文內容均來源於網絡整理,並不代表阿里雲官方的觀點,該頁面所提到的產品和服務也與阿里云無關,如果該頁面內容對您造成了困擾,歡迎寫郵件給我們,收到郵件我們將在5個工作日內處理。

如果您發現本社區中有涉嫌抄襲的內容,歡迎發送郵件至: info-contact@alibabacloud.com 進行舉報並提供相關證據,工作人員會在 5 個工作天內聯絡您,一經查實,本站將立刻刪除涉嫌侵權內容。

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.