Power & Source of Big Ideas

Why is rooting the NanoPI-T4 Android not more important?

Moderators: chensy, FATechsupport

Hello all!

The title speaks for itself - I am wondering why there isn't a larger move towards rooting this thing? It's a development board; yet there is no root available for this system. Maybe we could research as a whole how to get this done?
Nope... no answers. It's really confusing why this board would have so many features without a way to really tap into its potential.
If you build the source and choose the USERDEBUG version (default), you have full root access.
v8dave wrote:
If you build the source and choose the USERDEBUG version (default), you have full root access.


This does not seem to be true. I have userdebug enabled on my build (I built following the instructions so I have a default build, I also checked in "about this phone, it says userdebug in the build number). None of the apps I have installed that require root seem to think they have root access...
v8dave wrote:
I wonder if this will help you?

https://stackoverflow.com/questions/559 ... -superuser


Unfortunately it didn't help much. Seems like the info is too old to work with Nougat.

You know the odd thing about all this is I can use Magisk just fine to root a FireFly RK3399 based board but it does not recognize the boot image format for the NanoPC. It seem that the NanoPC uses an older format than what RockChip supports now, and the FireFly uses UEFI boot.

Basically friendlyelec needs to modernize the boot process for their boards and follow the new rockchip way of doing things with uefi and things would just work fine...

http://opensource.rock-chips.com/wiki_Boot_option

Unfortunately it does not seem that friendlyelec keeps their code up to date.. So I do not think this will happen any time soon.
To answer your question: Yes, Rooting is very important!

There are many apps which require root-access, and especially for a device like this - a device for (android) developers - this should be a no-brainer!

I have a NanoPC-T4, and just found out ....
Yeah it's actually very disappointing.
Hi guys,

Userdebug only means that you can get root access via adb.

1) Regarding the boot.img:
By default the boot.img does not contain the kernel. Change the targed in "device/rockchip/common/mkimage.sh" to

Code: Select all

TARGET="ota"

to get a boot.img which you can patch with Magisk and flash.

2) To embed SuperSU inside the custom ROM before building I succeeded to obtain root access (using Nougat) by embedding
https://github.com/khadas/supersu into my FriendlyARM ROM.

If you need further help let me know.
Thanks!
This is really good news!

Too bad, somehow I am stuck ..
I compiled a boot-image including kernel, and it works.
When installing Magisk I can create a patched-boot-image, but here my problems start:
How do I install it?
I tried to go into 'fastboot mode' by 'adb reboot bootloader', and by pressing the boot-button when switching on the device, but all I see is a black screen, and fastboot tells me 'waiting for device'.
I tried flashing the patched-boot-image with the RKDevTool, but end up in Recovery mode.

There is no TWRP for the NanoPC-T4, so I am stuck ...

Any idea?
Then try embedding SuperSU instead. That works for sure!

The steps are:
1. Put the downloaded files into /vendor/root (make sure that you also copy the hidden file!)
2. Change root.mk: replace "vendor/amlogic/root" by "vendor/root"
3. Add also the line "vendor/root/su:system/xbin/su \"
4. Add "PRODUCT_PACKAGES += SuperSU" at the end of that file
5. Now go into the folder "SuperSU" and change "LOCAL_CERTIFICATE := PRESIGNED" to "LOCAL_CERTIFICATE := PLATFORM" inside "Android.mk"
6. Modify "/device/rockchip/rk3399/nanopc_t4.mk" by adding "$(call inherit-product-if-exists, vendor/root/root.mk)"

And then recompile (you don't need to clear the entire output directory).
I hope I did not miss anythink.
Great! It's working for Android 8.1!

When compiling there was in issue with: "ninja: error: 'build/target/product/security/PLATFORM.pk8', needed by 'out/target/product/nanopc-t4/obj/APPS/SuperSU_intermediates/package.apk', missing and no known rule to make it". I copied the existing 'build/target/product/security/platform.pk8' to 'build/target/product/security/PLATFORM.pk8'. With the same for PLATFORM.x509.pem and PLATFORM.pem.

After these changes compilation went smoothly.

When running SuperSu it's asking to update the su-binary, which is not working. But this does not cause any problems.

Thank you so much for your help! :D :D :D
You are welcome, glad it works!
We should not expect any support from Friendlyarm ...

This is what I received from techsupport@friendltarm.com when asking about rooting:

"Should not be root, I don't know why you want to root, if you need to access hardware resources, you can actually do it without root, you can check it out here: http://wiki.friendlyarm.com/wiki/index. ... for_RK3399"
and
"Because this violates the rules of android and will make your device unsafe."
You have access to the Andoird and Android Linux source so you can potentially do anything you want right there. You can add in any SU apk and have this as part of the build. Make other changes for security etc.

I recently needed a way to shutdown the Android device from code and I made changes to the source to bypass the security level that only allowed SYSTEM APPS to do this and now I can shutdown the system from a standard app. As the device is for a fixed product, this works well. I also added double tap to wake for Android 5.1 on the Nano PC T3 Plus as part of the Linux kernel.

I've downloaded and can build the RK3399 Android 8 and already making some changes to the OS to support double tap to wake as I did with the above Nano PC t3 Plus.

If you don't know how to build the source, it's not too hard if you follow the instructions on the wiki. I use a laptop with Ubuntu 12.04 but you can also build within a VM running 12.04 too.
raimo wrote:
Then try embedding SuperSU instead. That works for sure!

The steps are:
1. Put the downloaded files into /vendor/root (make sure that you also copy the hidden file!)
2. Change root.mk: replace "vendor/amlogic/root" by "vendor/root"
3. Add also the line "vendor/root/su:system/xbin/su \"
4. Add "PRODUCT_PACKAGES += SuperSU" at the end of that file
5. Now go into the folder "SuperSU" and change "LOCAL_CERTIFICATE := PRESIGNED" to "LOCAL_CERTIFICATE := PLATFORM" inside "Android.mk"
6. Modify "/device/rockchip/rk3399/nanopc_t4.mk" by adding "$(call inherit-product-if-exists, vendor/root/root.mk)"

And then recompile (you don't need to clear the entire output directory).
I hope I did not miss anythink.


You have really led me onto trying this. However, I have some questions.

1. When you say /vendor/root, my "vendor" folder doesn't have root. Do I make the folder? This is a fresh download of the source.
2. When you say copy the hidden file as well, I enabled hidden files and there is no hidden file there. Am I missing something or is there just not one there? I went to SuperSU and downloaded the zip folder and I have the files that extracted from that.

I'll try your responses and ask anything else I need help with.

Thank you so much for your tip on getting root!

Daitaro
Daitaro wrote:
1. When you say /vendor/root, my "vendor" folder doesn't have root. Do I make the folder? This is a fresh download of the source.
- Yes, just create it. You can actually use any folder you want it just has to be referenced correctly inside "/device/rockchip/rk3399/nanopc_t4.mk".

Daitaro wrote:
2. When you say copy the hidden file as well, I enabled hidden files and there is no hidden file there. Am I missing something or is there just not one there? I went to SuperSU and downloaded the zip folder and I have the files that extracted from that.
- The file ".installed_su_daemon" is invisible by default. Make sure it is also present in your directory.

Daitaro wrote:
I'll try your responses and ask anything else I need help with.
Thank you so much for your tip on getting root!
- No problem!
raimo wrote:
- Yes, just create it. You can actually use any folder you want it just has to be referenced correctly inside "/device/rockchip/rk3399/nanopc_t4.mk".


You have been most helpful! Thank you!

- I've made the folder and added the files, but I have another couple of questions (answer them as it's convenient for you, as I'm really extremely grateful).

I've downloaded supersu 2.82. The zip folder from chainfire.

1) You mention being able to make any folder instead of /vendor/root, as long as I reference it in "/device/rockchip/rk3399/nanopc_t4.mk". Does this mean that /vendor/root has to be referenced as well, or is it fine without it as long as I use /vendor/root? I couldn't find it within that file. If so, how would I add it?

2) I'm not sure I'm copying over the correct files, as in my SuperSU folder, there's no Android.mk, as you specify. Also, I have found root.mk under the build/make/core folder. Is this correct? My root.mk is essential empty with a bold caution not to edit the file. Again, this is all off of a fresh android 8.1 image from friendlyelec.

I will do every bit of legwork to get this working, as I originally started this thread. Thank you so much for the help, and I hope you don't mind me piecing more questions in here!
I've downloaded supersu 2.82. The zip folder from chainfire.

The instructions I posted are referring to the SuperSU version from https://github.com/khadas/supersu. There all files I mentioned should be present and you don't need any additional files.

1) You mention being able to make any folder instead of /vendor/root, as long as I reference it in "/device/rockchip/rk3399/nanopc_t4.mk". Does this mean that /vendor/root has to be referenced as well, or is it fine without it as long as I use /vendor/root? I couldn't find it within that file. If so, how would I add it?

The folder does not matter, just the location of the makefile "root.mk". This has to be specified by adding the line "$(call inherit-product-if-exists, vendor/root/root.mk)" to "/device/rockchip/rk3399/nanopc_t4.mk". There you could also adjust the directory.

2) I'm not sure I'm copying over the correct files, as in my SuperSU folder, there's no Android.mk, as you specify. Also, I have found root.mk under the build/make/core folder. Is this correct? My root.mk is essential empty with a bold caution not to edit the file. Again, this is all off of a fresh android 8.1 image from friendlyelec.

If you use the files from the repository mentioned above the "Android.mk" file is inside the folder SuperSU.

Good luck!
Raimo, you are the man. This is *exactly* what I needed! I have root now and everything I set out for is working correctly! Thank you so frikkin much!
Daitaro wrote:
Hello all!

The title speaks for itself - I am wondering why there isn't a larger move towards rooting this thing? It's a development board; yet there is no root available for this system. Maybe we could research as a whole how to get this done?

I can use Magisk just fine to root a FireFly RK3399 based Onlinesbi sudoku incometaxindiaefiling board but it does not recognize the boot image format for the NanoPC. It seem that the NanoPC uses an older format than what RockChip supports now, and the FireFly uses UEFI boot.
[quote="raimo"]Then try embedding SuperSU instead. That works for sure!

5. Now go into the folder "SuperSU" and change "LOCAL_CERTIFICATE := PRESIGNED" to "LOCAL_CERTIFICATE := PLATFORM" inside "Android.mk"

The case of "PLATFORM" is relevant, if you change to "platform" there is no need to duplicate the certificates with an uppercase name. Or, you could change "PLATFORM" to "SuKludge" and then copy the platform* certificates to SuKludge* in /build/target/product/security so that your SuperSu has its (own copy of the platform) certificates.
raimo wrote:
I've downloaded supersu 2.82. The zip folder from chainfire.

The instructions I posted are referring to the SuperSU version from https://hawkbets.com/. There all files I mentioned should be present and you don't need any additional files.

1) You mention being able to make any folder instead of /vendor/root, as long as I reference it in "/device/rockchip/rk3399/nanopc_t4.mk". Does this mean that /vendor/root has to be referenced as well, or is it fine without it as long as I use /vendor/root? I couldn't find it within that file. If so, how would I add it?

The folder does not matter, just the location of the makefile "root.mk". This has to be specified by adding the line "$(call inherit-product-if-exists, vendor/root/root.mk)" to "/device/rockchip/rk3399/nanopc_t4.mk". There you could also adjust the directory.

2) I'm not sure I'm copying over the correct files, as in my SuperSU folder, there's no Android.mk, as you specify. Also, I have found root.mk under the build/make/core folder. Is this correct? My root.mk is essential empty with a bold caution not to edit the file. Again, this is all off of a fresh android 8.1 image from friendlyelec.

If you use the files from the repository mentioned above the "Android.mk" file is inside the folder SuperSU.

Good luck!


Thanks, now i finally find the answer

Who is online

In total there are 3 users online :: 0 registered, 0 hidden and 3 guests (based on users active over the past 5 minutes)
Most users ever online was 5185 on Wed Jan 22, 2020 1:44 pm

Users browsing this forum: No registered users and 3 guests