init: cannot execve(‘XXX’):Permission denied问题

      最近在给android 4.3系统进行root时候,一直出现如下的红色权限问题  :
 7.695741] Freeing init memory: 236K
[    8.555286] init: cannot find '/system/bin/dbus-daemon', disabling 'dbus'
[    8.566954] init: cannot execve('/system/etc/install-recovery.sh'): Permission denied
[    8.622915] camera_subdev: disagrees about version of symbol module_layout
[    8.846227] android_usb: already disabled
[    8.850866] mtp_bind_config
但是发现个现象就是,第一次烧机启动都会提示 install-recovery.sh' 无权限执行,但是第二次启动之后就出现如下log:
[    8.358580] init: cannot find '/system/bin/dbus-daemon', disabling 'dbus'
[    8.503838] camera_subdev: disagrees about version of symbol module_layout
[    8.538767] warning: `daemonsu' uses 32-bit capabilities (legacy support in use)
[    8.656285] android_usb: already disabled

说明install-recovery.sh已经得到执行,这时候root就可以成功。因为在init.rc修改过他的权限,第二次才生效。
经过分析,最后终于成功了。解决办法如下:
install-recovery.sh的启动放在init.rc如下:
在前面某个位置增加:
 +   chmod 0755 /system/etc/install-recovery.sh

service wifi_mac /system/bin/sh /system/etc/check_wifi_mac.sh
    class late_start
    oneshot

+ service flash_recovery /system/etc/install-recovery.sh
+    class main
+   oneshot


把init.${ro.hardware}.rc中的
service flash_recovery /system/etc/install-recovery.sh
-    class main
-   oneshot
删掉,
重新编译烧写系统即可实现完美root。

你可能感兴趣的:(android)