Android Automotive


#1

Hello,

I would like to build Android Automotive and use it on Hikey960.
I tried with lunch aosp_car_arm64-userdebug but the build is failing after some times.

Do you know which one will work on the Hikey960 ?

There are the choice I have for Android Car on Master branch of GoogleSource
9. aosp_car_arm-userdebug
10. aosp_car_arm64-userdebug
11. aosp_car_x86-userdebug
12. aosp_car_x86_64-userdebug

Thanks for helping


#2

You’ll need this;
https://github.com/HiKey960-Car

One thing to be aware of with it though; I haven’t re-sync’d with AOSP in quite a while. I’ll probably be doing that soon. Could be some breakage around the edges.


#3

Hello doitright,

I noticed that there was this repo just yesterday.
Could you please provide how to build it correctly ?
I copied the repo (https://github.com/HiKey960-Car/HiKey960-Car) to the master branch in master/device/linaro/hikey, then I was able to see hikey960car_userdebug on lunch.
When I build now I have some errors… I tried to fix some of them but now I have this error


I don’t know if I try to fix them every time I will have a working output.

Thank you very much for your help

#EDIT
I finally compiled successfully everything but I had to modify some things on source code.
Boot is working and system seems to work but keep locked on the splash screen with 4 dots (red, yellow, gree, blue) animated on center :confused:
I can connect via adb and here is the logcat :


Need some help. Thanks !


#4

That repo is the build instructions.

You’ll need to provide a lot more of the log than that. Don’t use screenshots for capturing logs. copy/paste the FULL TEXT and record it in a github gist (see https://gist.github.com/), put the link to the gist here.

And also kernel log would be helpful as well.

And of course, details of all of the changes that you made.


#5

Hello doitright,

Yes, you are right, I’ll put more logs.
Please, can you tell me how to log Kernel ?
I will prepare every change I made. But I think it will be difficult to do it in that forum. Is it possible to have a mail or something like that to transfer you the files I modified?

Thank you


#6

The kernel log is dumped with the command “dmesg”.

If your changes are too extensive to post in the forum, then you should fork the repositories you made changes to into your own github account, create new branches, and commit the changes there. You can then share a link to your repository.

The workflow will be something along these lines;

  1. in github, browse to the repositories you modified, then hit the “fork” button in the upper-right of the screen, and select YOUR github account as a destination.

  2. in your AOSP tree, browse to the path of the repository you modified, run something like this;
    git remote add someeasynameforyourrepo http://path/of/your/repo
    git add -A (or even better, just add the specific files you changed rather than all the extra junk that ends up in there, like editor cache files)
    git commit -m "my changes"
    git branch anameforyournewbranch
    git checkout anameforyournewbranch
    git push someeasynameforyourrepo newbranchname

Note that this process saves the actual changes you’ve made to the repositories and pushes them, rather than forcing you to rewrite or track down your changes the hard way.


#7

Hello doitright,

Thank you for your effort. Hope we will find a solution.
Here is the link of the github repository with my changes. Please note that I created an “EXTRAS” folder with the kernel and logcat logs, this folder contains also some ‘.te’ & a ‘.py’ files (policy) of the google source code that I changed to make it work.

NOTE : I’m building with the Master branch of GoogleSource.
repo init -u https://android.googlesource.com/platform/manifest -b master just so you know.

Thank you again.
Ahmed


#8

Ok, so a quick look at your logs shows a flood of selinux denials. A look at your other changes shows you created a file sepolicy_tests.py, which I’m guessing you found (and modified) at system/sepolicy/tests/. So essentially what you’ve done, is covered up needed updates to the sepolicy rather than making policy updates.

The rest of your changes don’t appear to be meaningful. I cant even begin to guess at why you created the vendor/ tree.


#9

Hello,

The EXTRAS folder is pointing to some files on Android Source Tree yes.
I just commented two lines that causing problems during build, theses 2 tests I commented are not passing. And I have no idea of how to update it. If you can tell me what to do. I’ll do my best.
the vendor/ tree is autogenerated when I launch the extract vendor script (and by the way the error of policy is somewhere there)
Here is the fail :


What is exactly a “flood of selinux denials” ?


#10

If the vendor tree is auto-generated THERE, then you didn’t follow the instructions correctly. You should be running it in the platform root, not the device directory.


#11

Oh yes, sorry it’s a mistake, this vendor is not used… :smile: it was the first time I cloned the repo… I did some mistakes. You can ignore it, I’ll remove them. Vendor is in the platform root. :ok_hand:

I also added the “.te” I modified from the original platform root.


#12

I can’t tell what changes you made to that file. You need to use the same process for all repositories that you fork, it doesn’t help for you to just throw in big files to a repository. I need to be able to see the commit you made to the original repository so that I can see what you changed in it.

In the case of platform/system/sepolicy, you will find that original repository at android.googlesource.com,


#13

Oh yes sorry, I forgot to say that if you look for “Ahmedx6 changes” , you will see where I did the changes.

But i’ll tell you here, it’s very short :

  • for the hal_neverallows.te at line 20 before it was : domain:{ tcp_socket udp_socket rawip_socket } * Now it’s : domain:{ rawip_socket } *;
  • for domain.te at line 1321 before it was : self:capability dac_override;, Now it’s : self:capability dac_read_search;

#14

Ok, so I have some suggestions for you.

First off, I added some comments inline to one of your commits.

Clearly, given what you’ve done to make it compile, you are not an amateur. An amateur would not have been able to make it compile. But there are two predominant places where you need to focus;

First, you don’t make changes just to trick it into compiling. When you need to make a change to make it compile, you need to understand the reason why it isn’t compiling, and understand the code you are working with so that what you do doesn’t actually break it worse (which most of your changes actually do). One of the great thing about compiler errors, is that they actually tell you what is wrong. If you cover that up with something that you only put there to trick it into compiling, then it becomes a hundred times harder to find that problem rather than just fixing it correctly the first time.

Second, you need to get good at using git. It is one of the most important and most powerful tools you will ever know for managing source code.


#15

Thank you very much for your suggestions.
In fact, I have good knowledge on programming language. That permitted me to tricks on the code and make it works.

But now, I just would like to make the system running.
I don’t know if you tried to compile or not with the latest Android Src Tree from Google Source but it won’t work. So that’s why I had to work around just to make it pass. But I know that maybe it would break some features, but I did not think that will break the whole system :frowning:

Will you propose a patch that can build without any problem with the last version of Android Tree ?

Thank you very very much for your patience.

#EDIT
I replied to every comments you did.
I saw your issue opened Update patches for current master. When will we be able to test ?


#16

There is a new default branch in my android_device_linaro_hikey repository.

I’m using that naming convention because it describes when it is valid.

Use that and updated patches from https://github.com/HiKey960-Car/HiKey960-Car/tree/master/patches

Should work.


#17

There are some issues with my kernel at the moment (it boots, but some things aren’t working quite right), so don’t use mine yet. I’ll update the kernel tomorrow.

Edit: Ok, kernel is up to date. Same deal, new branch: android-hikey-linaro-4.9_mar2218


#18

Okaay I’ll try right now thank you I’ll let you know

#EDIT

OK : bluetoothPan is found, same for the MultiSpinner constructor. Android.mk is ok too now.

NOK : I still had an error on the compilation on hal_neverallows.te at line 20 : domain:{ tcp_socket udp_socket rawip_socket }. Had to remove tcp_socket udp_socket
Also the TestVendorTypeViolations of the file sepolicy_tests.py (line 95) is stll not passing.

Result after boot : still stuck at the boot animation (4 dots)

Note : I did not clean the last build I’ve made. I just cloned your branch and tried again with make -j32 Maybe should I clean the out/ before ?

#EDIT 2
I did not recompile the Kernel… Will try with the new Kernel, did not notice you’ve made some changes on the defconfig.
Here are the steps that I’ve made to recompile the Kernel :

  • git clone https://github.com/HiKey960-Car/android_kernel_linaro_hikey.git
  • cd android_kernel_linaro_hikey
  • git checkout -b android-hikey-linaro-4.9_mar2218
  • make ARCH=arm64 hikey960_defconfig
  • make ARCH=arm64 CROSS_COMPILE=aarch64-linux-android- -j24
    Then I copy three output files to the android source tree on the hikey device : Image binary, Image.gz and the .dtb so I have thisScreenshot from 2018-03-23 10-47-08 then I after the extract, the build env & the lunch I just make : make bootimage -j24
    Is that correct ?

#19

If you got that neverallow error then YOU DID NOT APPLY THE PATCH IN THE PATCHES directory.


#20

For your “stuck on boot animation” problem… did you forget to write the userdata.img?