【Android O】 Service AAA does not have a SELinux domain defined

來源:互聯網
上載者:User

標籤:str   start   context   注意   linu   image   devices   disable   board   

在init.AAA.rc裡面添加了一個指令碼啟動的服務:

service AAA /vendor/bin/sh /vendor/etc/AAA_spec.sh
user root
group root
disabled
oneshot

on post-fs-data
start AAA

在系統啟動時通過dmesg | grep init查看發現出現:Service AAA does not have a SELinux domain defined

解決方案:

1.在devices/vendorxxx/sepolicy/common/目錄下新增AAA.te檔案,內容如下:

type AAA, domain; 

type AAA_exec, exec_type, vendor_file_type,file_type; 

init_daemon_domain(AAA)

allow AAA vendor_shell_exec:file { entrypoint };

2.在devices/vendorxxx/sepolicy/Android.mk檔案中添加:

BOARD_SEPOLICY_DIRS += devices/vendorxxx/sepolicy/common/

3.在devices/vendorxxx/sepolicy/common/file_contexts中添加:

##add for AAA file permission##
/(vendor|system/vendor)/etc/AAA_spec\.sh u:object_r:AAA_exec:s0

4.在init.AAA.rc裡面對應的service裡面添加:

service AAA /vendor/bin/sh /vendor/etc/AAA_spec.sh
user root
group root
disabled
oneshot
seclabel u:r:carrier_switcher:s0

5.編譯並燒錄bootimage,若編譯報錯注意解決neverallow衝突

6.系統起來時如發現avc則逐一添加allow策略語句

 

【Android O】 Service AAA does not have a SELinux domain defined

相關文章

聯繫我們

該頁面正文內容均來源於網絡整理,並不代表阿里雲官方的觀點,該頁面所提到的產品和服務也與阿里云無關,如果該頁面內容對您造成了困擾,歡迎寫郵件給我們,收到郵件我們將在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.