Android Automotive

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

1 Like

Youā€™ll need this;

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.

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 !

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.

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

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.

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

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.

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ā€ ?

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.

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.

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,

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;

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.

1 Like

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 ?

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.

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

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 ?

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

For your ā€œstuck on boot animationā€ problemā€¦ did you forget to write the userdata.img?