Root i.MX6SabreSD Android 7.1.1

cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 

Root i.MX6SabreSD Android 7.1.1

1,391 Views
tommos23
Contributor III

Hello,

I have a SABRE SD device that I have successfully enabled Flexcan and I can now send and receive CAN messages.

I would like to enable and disable the can bus from user space in a similar way to FlexCAN support in Android: How to invoke a system command in application code? 

The 1st step in the answer is to root the device, the device does not need to be able to pass CTS as I do not require Google Play Services. 

How do I root the device from source and allow "su" commands:

Process suProcess = Runtime.getRuntime().exec("su"); 

Many thanks,

Aaron

Labels (2)
0 Kudos
3 Replies

625 Views
diegoadrian
NXP Employee
NXP Employee

Hello Aaron.

I apologize for the delay.

Unfortunately, we cannot help you with your problem. We do not give support at application level. For that, I recommend you to go with professional service support.

NXP Professional Services|NXP 

I apologize for this inconvenient.

Best Regards,

Diego.

0 Kudos

625 Views
diegoadrian
NXP Employee
NXP Employee

Hello Aaron,

If you want to root your devices. First, you need to create your Android image with user-debug permissions. Instead of using

$ lunch <your sabre board>-user, use $ lunch <your sabre board>-userdebug

After you create the image you need to use ADB to give the root access to your sabre board. If you do not have installed ADB in your computer, you can follow the below document.

https://community.nxp.com/docs/DOC-102514 

Finally, you only need to run the below ADB commands:

adb start-server

adb root.

After that, your board will have root access.

I hope this information can solve your question.

Best regards,

Diego.

0 Kudos

625 Views
tommos23
Contributor III

Hello Diego,

Thank you for the reply.

I have built android as both an eng and a userdebug release and ran "adb start-server", "adb root" on both images. This allows me to run elevated user commands in the "adb shell". However my issue is that I cannot run root commands from within an app or service.

In Java:

Process suProcess = Runtime.getRuntime().exec("su"); 

Or in a C++ Service:

system("su");

My logcat error is:

W system_server: type=1400 audit(0.0:14): avc: denied { execute } for name="sh" dev="mmcblk3p5" ino=340 scontext=u:r:system_server:s0 tcontext=u:object_r:shell_exec:s0 tclass=file permissive=0

Kind regards,

Aaron

0 Kudos