Page 1 of 1

Android 10 root build issue

Posted: Sun Sep 20, 2020 2:18 am
by Daitaro
Hello all,

I'm currently building android 10 using the git source available from the wiki for the T4. Everything is successful, and I have fully built the image and deployed it. Now I am trying to go back to the code and add in root plus some other modules. No worries with everything until I get to the root portion. I'm using supersu 2.82 (the same code and method from the last version of android for the rk3399). Everything compiles until it gets to 100% and runs a few last commands. Then it errors out with an overwrite issue. Here is the code.

Code: Select all

[100% 12699/12699] writing build rules ...
FAILED:
build/make/core/Makefile:28: error: overriding commands for target `out/target/product/nanopc-t4/system/xbin/su', previously defined at build/make/core/base_rules.mk:480
20:44:59 ckati failed with: exit status 1


Any ideas? Any leads I could look into with the advice of someone who's been here before? Thanks you guys.

Re: Android 10 root build issue

Posted: Sun Sep 20, 2020 4:25 am
by v8dave

Re: Android 10 root build issue

Posted: Sun Sep 20, 2020 7:50 am
by Daitaro
Technically, no... I had already scoured the internet without much luck there, and seen his post. He's taking his result and just amalgamating that onto the poster's. It seems he's saying to find the .mk file with the command and remove said command, which wouldn't work in this case. It's the root's command I need. Removing it would make the entire process moot. Thanks, though. If you could shed some further insight into how I could interpret his post some other way, I'm all ears.

Re: Android 10 root build issue

Posted: Sun Sep 20, 2020 7:59 am
by v8dave
I am looking at the .mk file and there is a su file in the directory indicated above. Are you trying to copy another su over this? Could that be the issue?

Can you detail the changes you have made and I'll try the same here?

Re: Android 10 root build issue

Posted: Sun Sep 20, 2020 11:58 am
by Daitaro
I've done the exact same details to root 10 as I used for 8 (the previous version FA used). I'll help with the information as much as I can, but the method I use is detailed in my linux partition on this machine. Let me get to that and I can give more details.

Re: Android 10 root build issue

Posted: Sun Sep 20, 2020 12:24 pm
by Daitaro
Here are the steps. Everything successfully compiled before starting this list.

1. Put the root files into /vendor/root (create the root folder and make sure that you also copy the hidden file. The file ".installed_su_daemon" is invisible by default. Make sure it is also present in your directory.)
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)"
7. Copy 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.

Literally follow this to a 't', then without changing a single other thing, execute the build. Then it fails with the message above.

Re: Android 10 root build issue

Posted: Mon Sep 21, 2020 4:34 am
by Daitaro
As I'm trying to add in the correct files and changes to root the device, I should be replacing xbin/su, right? If I delete that command from the .mk file, it won't overwrite the one that's already there... That would cause a root failure, correct?

Obvious to me, yes. But there might be something I don't know.

Re: Android 10 root build issue

Posted: Fri Sep 25, 2020 4:06 am
by v8dave
I've just gotten out of hospital so sorry for the delay.

I'll follow what you did and see what happens to my build.

Are there any files to download for this?

Re: Android 10 root build issue

Posted: Sat Sep 26, 2020 8:41 pm
by Daitaro
Hi Dave,

First off... I sincerely hope everything was fine health-wise! Your own health comes first, so please, don't apologize. I wasn't trying to place any burden on your shoulder to begin with.

Regarding your post, here is the link to the git. I tried searching for updated files, but to no avail.

https://github.com/khadas/supersu

Any help is appreciated.

Re: Android 10 root build issue

Posted: Tue Sep 29, 2020 8:10 am
by v8dave
Thanks for your kind wishes. I am getting better every day and back working from home.

I had a look and have not yet attempted to try and build this into my system. I will get around to this during the rest of the week.

I wanted to check if the binary that is on the SU git page is compatible with the build for your Android 10? I don't know if the build system can check this, but it was the only thing I could think of.

Let's see what happens when I try it this week.

Re: Android 10 root build issue

Posted: Sat Oct 03, 2020 9:36 am
by Daitaro
Yeah I wasn't really sure of update compatibility... I'm not too knowledgeable in that area to just look at it and tell. I was hoping to find some patch notes on updates, but it seems the supersu developer hasn't made it around to it yet. *shrug*

I'm interested in your finding when you try it as well. Please update when you can! :D

Re: Android 10 root build issue

Posted: Sat Oct 03, 2020 12:00 pm
by v8dave
OK, following your instructions and I get the same failure message so not a setup issue.

Now to find out why.

I did notice that there is already an SU file in system/xbin so wondering if that has anything to do with it?

Re: Android 10 root build issue

Posted: Mon Oct 05, 2020 6:52 am
by v8dave
I am still trying to track this down. I can't find the product copy file for the existing su into system/xbin.

Re: Android 10 root build issue

Posted: Tue Oct 06, 2020 9:18 am
by Daitaro
Might you have a lead on where to look? Or any curious thoughts I could help with?

Re: Android 10 root build issue

Posted: Tue Oct 06, 2020 9:57 am
by v8dave
Yes, there is another PRODUCT_COPY_FILES that creates SU into the xbin folder so we need to track that one down and somehow comment it out.

I've been searching for something to override the copy but can't find anything.

Re: Android 10 root build issue

Posted: Wed Oct 07, 2020 2:20 am
by Daitaro
Is there a way to edit the write command of the root file so that it overwrites the file? Would that work?

Re: Android 10 root build issue

Posted: Thu Oct 08, 2020 6:32 am
by v8dave
Some progress has been made.

Rename the Android.mk file in system/extras/su so that it won't be part of the build.

Now I get an error about the PLATFORM.pk8 file missing. I have not yet made copies of these in upper case.

Re: Android 10 root build issue

Posted: Thu Oct 08, 2020 10:33 am
by Daitaro
That is progress! I'm not home yet, but you can bet I'll be trying it as soon as I am.

Re: Android 10 root build issue

Posted: Thu Oct 08, 2020 2:53 pm
by v8dave
I added the capital versions and now it compiles without errors.

I've not installed it on my board as I need 8.1 for the time being.

Let me know how it goes for you and if it works on the T4 etc.

Re: Android 10 root build issue

Posted: Fri Oct 09, 2020 11:46 am
by Daitaro
Well I started from a scratch build that I verified working and performed the root method precisely. Using your tip to rename the Android.mk file, it compiles without error; however... It boot loops. It installs the image completely and once you restart the device, it gets to the erase point, finishes, and boot loops. I've tried messing around with removing the su folder, adding "LOCAL_MODULE_TAGS := optional" to the android.mk file, all to no avail.

I felt like I was so close, lol.

Re: Android 10 root build issue

Posted: Fri Oct 09, 2020 2:15 pm
by v8dave
Do you have a serial debug cable to see what is happening during the boot?

At least then you can find out where in the boot sequence failure is happening.

Re: Android 10 root build issue

Posted: Sat Oct 10, 2020 9:36 am
by Daitaro
Unfortunately not at the moment.

Re: Android 10 root build issue

Posted: Mon Oct 12, 2020 7:08 am
by v8dave
Any cheap USB to TTL 3.3V interface will work for this. Baud rate is 1500000 so need to use putty for this.

It will be the best investment you can make if playing with embedded Linux boards. You'll be able to track down the issue once you see the debug output.

Re: Android 10 root build issue

Posted: Mon Oct 12, 2020 2:25 pm
by Daitaro
Yeah I generally make them manually from protoboards. I'll have to get an official one, lol.

Re: Android 10 root build issue

Posted: Mon Oct 19, 2020 2:32 am
by Daitaro
Just as a curiosity-based question, if I build the image, and then something fails, and I just keep getting failure after failure...

Should I start over? Or will reversing the code and rebuilding be enough? Some times I just redownload and start from scratch. Is that necessary? Dave, you do this much more than me, and it's hard to find answers to those specific questions. Any thoughts? Maybe a make clean and rebuild is enough?

Re: Android 10 root build issue

Posted: Mon Oct 19, 2020 2:40 am
by v8dave
Yeah, remove the code you added and rename that old file and then do a clean and then rebuild. That will get you back to a working system.

By the way, why do you need this SU version? I have found that the T4 build already has SU so you can do root via the debug UART or through ADB SHELL commands.

Is there something in particular that doesn't work that you need this?

I think the only way to get this to work is to find the source for SU and build this as part of the OS. Avoid binary options as you really don't know which build they have used to create the binary.

Re: Android 10 root build issue

Posted: Mon Oct 19, 2020 3:52 am
by Daitaro
In general, I wanted/needed a system that once deployed, can give root to apps just as we're used to with SuperSU. The interface comes up, we can allow or deny access, and it logs it for persistence. I really didn't want to deal with commands later down the road. SuperSU is a glorious way to go about it that doesn't take much once the initial config is done.

Re: Android 10 root build issue

Posted: Mon Oct 19, 2020 4:37 am
by Daitaro
Ok so I got around to just playing around with the whole make clean thing... did I do something I shouldn't have?

I downloaded android 8, followed the wiki and did an initial ./build-nanopc-t4.sh -F -M ... standard stuff. It succeeded. Cool. I literally just typed "make clean" and got the "Entire build directory removed" message. Cool.

I ran the ./build... command again and it failed.

Code: Select all

out/build-nanopc_t4.ninja is missing, regenerating...
opendir failed: external/guava/guava-gwt/test/com/google/common/math: Not a directory
23:31:20 ckati failed with: exit status 1


I know this was not general use-case for make clean, but it was such a clean, simple build with no modifications, I figured it wouldn't be destructive. It was in fact. Nothing changed, rebooted in between (left to do work and came back, so a power off and boot)... nothing crazy. Thoughts?

I really just wanted to "play" around with the command to figure out what to do and not do. Am I misunderstanding "make clean?" Doesn't it just clean the built directories and doesn't touch the base stuff?

Hm.

Re: Android 10 root build issue

Posted: Mon Oct 19, 2020 4:44 am
by v8dave
What is here?

opendir failed: external/guava/guava-gwt/test/com/google/common/math: Not a directory

Re: Android 10 root build issue

Posted: Mon Oct 19, 2020 4:46 am
by Daitaro
math is a text file.

It succeeded to build initially. That was straight from a git download.

Re: Android 10 root build issue

Posted: Mon Oct 19, 2020 4:55 am
by v8dave
Under my 8.1 source, math is a directory.

What is in the text file?

Re: Android 10 root build issue

Posted: Mon Oct 19, 2020 5:00 am
by Daitaro
Strange.

Here it is.

Code: Select all

self.EmitVTrn(16, block[5], block[7], temp[5], temp[7])
      self.EmitVTrn(32, temp[0], temp[4], block[0], block[4])
      self.EmitVTrn(32, temp[1], temp[5], block[1], block[5])
      self.EmitVTrn(32, temp[2], temp[6], block[2], block[6])
      self.EmitVTrn(32, temp[3], temp[7], block[3], block[7])
      registers.FreeRegisters(block)
      return temp



That's it.

Re: Android 10 root build issue

Posted: Tue Oct 20, 2020 3:01 am
by v8dave
What else is in that directory?

This is T4 Android 8.1 from Gitlab?

This is the same directory and math is also a directory within this. Does this match up with your directory structure?

https://gitlab.com/friendlyelec/rk3399- ... gle/common

Re: Android 10 root build issue

Posted: Sat Jan 30, 2021 2:16 pm
by Tiemichael
Hi,
after quite sometime I am back to the NanoPcT4 ...

Have you been able to resolve the boot-issue?

I have tried to install Magisk (which was not working with Android8.1), and besides a failed Safetynet-check it seems work.
At least some 'Root-Checker'-apps show the device is rooted, and these apps also are registered as 'Superuser'

All I did was:
    install Magisk-Manager,
    copy the 'boot.img' to the NanoPc,
    create a patched boot-image,
    copy it back to the PC
    reference the patched boot-image in RKDevTool and flash

Need to do some more tests next week-end ...

Re: Android 10 root build issue

Posted: Tue Apr 06, 2021 2:05 pm
by weber1
Tiemichael wrote:
Hi,
after quite sometime I am back to the NanoPcT4 ...

Have you been able to resolve the boot-issue?

I have tried to install Magisk (which was not working with Android8.1), and besides a failed Safetynet-check it seems work.
At least some 'Root-Checker'-apps show the device is rooted, and these apps also are registered as 'Superuser'

All I did was:
    install Magisk-Manager,
    copy the 'boot.img' to the NanoPc,
    create a patched boot-image,
    copy it back to the PC
    reference the patched boot-image in RKDevTool and flash

Need to do some more tests next week-end ...

I have the same issue, I've been fighting with it all day.

I patched the boot.img with Magisk Manager and flashed it, Magisk Manager show's I'm installed and Root Checker says I'm rooted, I was even able to install Adaway. But i cannot use any root app that needs to mount /System

I tried using Root Uninstaller and it says it has root access but cannot mount /system as R/W

It seems Magisk is only able to partially root on Android 10

I tried this with the Canary version and the standard version of Magisk and the same issue both times

Re: Android 10 root build issue

Posted: Wed Apr 07, 2021 2:36 am
by Tiemichael
weber1 wrote:
I have the same issue, I've been fighting with it all day.

I patched the boot.img with Magisk Manager and flashed it, Magisk Manager show's I'm installed and Root Checker says I'm rooted, I was even able to install Adaway. But i cannot use any root app that needs to mount /System

I tried using Root Uninstaller and it says it has root access but cannot mount /system as R/W

It seems Magisk is only able to partially root on Android 10

I tried this with the Canary version and the standard version of Magisk and the same issue both times


The only problem I face is 'Safety Net' - where I have given up ...
Rooting seems to be fine, and all apps require root-access are working.

There is one more step I included:
Delete ‘su’ from /system/xbin – otherwise Magisk complaints about an extra ‘su’ found
In system/extras/su/Android.mk line 8
change to LOCAL_MODULE:= xxxsu

I receive a message 'Abnormal State' that 'Magisk running as system-app is not supported' , which does not influence the functionality (if I remember correctly this issue is coming from the fact that I 'pre-installed' Magisk-Manager on the ROM)

Currently I am using Magsik 22.0

Maybe you can tell me which app is having problems, and I try it ...

Re: Android 10 root build issue

Posted: Thu Apr 22, 2021 12:05 pm
by weber1
Tiemichael wrote:
weber1 wrote:
I have the same issue, I've been fighting with it all day.

I patched the boot.img with Magisk Manager and flashed it, Magisk Manager show's I'm installed and Root Checker says I'm rooted, I was even able to install Adaway. But i cannot use any root app that needs to mount /System

I tried using Root Uninstaller and it says it has root access but cannot mount /system as R/W

It seems Magisk is only able to partially root on Android 10

I tried this with the Canary version and the standard version of Magisk and the same issue both times


The only problem I face is 'Safety Net' - where I have given up ...
Rooting seems to be fine, and all apps require root-access are working.

There is one more step I included:
Delete ‘su’ from /system/xbin – otherwise Magisk complaints about an extra ‘su’ found
In system/extras/su/Android.mk line 8
change to LOCAL_MODULE:= xxxsu

I receive a message 'Abnormal State' that 'Magisk running as system-app is not supported' , which does not influence the functionality (if I remember correctly this issue is coming from the fact that I 'pre-installed' Magisk-Manager on the ROM)

Currently I am using Magsik 22.0

Maybe you can tell me which app is having problems, and I try it ...

I'm trying to add a prop, which seems like a different need, but will look into it. Was thinking about this, but realized a clean install for every update