Linaro's AOSP build for Dragonboard 410c

I tried to build Android OS for Dragonboard 410c by following these instructions:

It looks like the repo is constantly changing: ‘repo sync’ fetches new commits
when run every other day and unfortunately some of those new commits break the build.
It also seems the current AOSP is PLATFORM_VERSION=S, and I would assume
that’s a WIP version of Android 12.

My question is: how can I check out a stable branch/snapshot of Linaro’s AOSP
repository? For example how to get the source code of the latest ‘stable’ version of Android 11 or Android 10?
I know that no build is 100% stable, so by ‘stable’ I mean that it can be built
and is working when installed on the device.

Forget about trying to make it work on a stable branch of AOSP. Yes, the master branch is a moving target. More than stable 11, but certainly less than what 12 will be.

What you want to do, is sync up to master branch, then fix it up to work well, then generate a fixed manifest for your working state.

The fixed manifest will ensure that you can get back to your state if you wipe and resync the whole tree.

You create a manifest using this command;
repo manifest -r -o my_fixed_manifest.xml

You can then resync to that manifest using the following;

repo init -u https://android.googlesource.com/platform/manifest -b master
{copy my_fixed_manifest.xml to .repo/}
repo init -m my_fixed_manifest.xml
repo sync

Thank you for your answer. That’s what I suspected. I kind of hoped that Linaro already have a manifest that works with Dragonboard410c.

Thank you, that’s very useful for developing on current (and future) branches.
How can I go backwards and select branches that match certain android release (let’s say Android 11) ? I guess I have to search internet , find a manifest for particular AOSP release and use that as a starting point. Or is there a better way?

There really isn’t much way to do that. These boards have NEVER been supported on release branches.

You could try my pinned from february, but it was master branch;

Note that if you sync that manifest, it should BUILD for db410c successfully, but I’ve never actually booted it since I work mostly with the db820c. In other words, I don’t guarantee that it will work for the 410c without some work on your part. But it might make a decent starting point for you if you want something that is kind-of like Android 10.

Thank you for the manifest. I’ll try that and share my results.

So far I found an alternative approach how to switch to a released AOSP branch . I went into .repo/mainfest directory, then run
git tag

That gave me a list of all tagged manifest branches. I picked one from the list : for example android-11.0.0_r3 and then went back to the root of my AOSP repository, then initialised repo like this:

repo init -u https://android.googlesource.com/platform/manifest -b android-11.0.0_r3

Fortunately the repo does not download everything all over again. Then I did:

repo sync
to change local copes of the files to the target branch (it reverts some commits)

source ./build/envsetup.sh
lunch
and chose 39 for Dragonboard 410c

then
m droid clean
m droid -j6

I could also see the summary printed this:

PLATFORM_VERSION_CODENAME=REL
PLATFORM_VERSION=11
...
BUILD_ID=RP1A.200720.011 

I guess that’s a confirmation the build system recognises the branch is now switched.

Whether it will produce any reasonable result ? I don’t know but at least that’s another way how to experiment with AOSP branches which should hopefully be in a consistent state.

Yes, that will initialize a release branch, but release branches are NOT COMPATIBLE WITH DRAGONBOARD.

I understand that it may not be compatible and there will be a lot of work to combine the Linaro’s changes with that particular AOSP release in order to run it properly on DB410c. But at least that’s a consistent state of the source code - unlike when using the master branch where the build might be broken (and it was for me - the build stopped on errors I had to fix) and it is just a pure luck to ‘repo sync’ to a consistent state at that certain point in time.

I tried to use your manifest, but I could not make it to work. I had to copy it into ./repo/manifests as well (not into ./repo)

Then ‘repo init -m pinned_020620.xml’ resulted in error:

fatal: manifest 'pinned_020620.xml' not available
fatal: remove-project element specifies non-existent project: device/linaro/dragonboard

Any idea how to fix it (the manifest file definitely exists in .repo/manifests though) ? Thanks.

Yes, it goes in .repo/manifests/
First init the master branch, then init the fixed manifest, then sync, then build. Easy.

Thanks for that. I started from scratch, initialised repo in a new directory and then your instructions worked fine. The DB410c AOSP Ver. R was built fine and runs OK-ish on the actual device. There are some flaws though, the biggest one is the graphics is laggy (does not use HW acceleration?) and produces visual artifacts like flashing triangles on the screen and screen flickering. Wifi seems to work, I got an IP address, but the built-in WebView test app can not connect to any site (maybe the WebView app is not working correctly). Apart from that it seem to work OK with kernel 5.2 (no crashes or slowdowns). With kernel 4.16 the USB does not work and there was no way how to navigate the screen (mouse and keyboard don’t work), therefore I could not test it.

BTW. I have also built Version 11 via the branch I previously described ( android-11.0.0_r3). It also runs on DB410c, but the UI stops responding after few minutes, so it is not usable at all (probably runs out of memory). Branch android-10.0.0_r47 does not build - it has an issue with gatekeeper hal service, which I have not figured out how to resolve (it looks like the source code for the gatekeeper is missing). If you have a tip how to fix it (if you had a similar issue on your version S) please let me know. Thanks.

logcat and dmesg around the time it locks up would be helpful in figuring out what is happening.

I’ve noticed your instructions also contain a step to copy kernel modules into
{android root}/device/linaro/dragonboard-kernels/db820c-5.4-modules/

Linaro directory has some precompiled kernels, but no precompiled modules. That’s a bit suspicious, but maybe all drivers are compiled in the kernel itself (no modules). I’ll try to build my kernel and stick the modules as per your instructions to check whether it improves the glitchy things (USB and GFX).

Is there any Android specific config parameters that need to be set in order the kernel to be compatible with Android OS?

Those modules are required based on my kernel and android device configuration for db820c. You’ll need to sort out all the kernel requirements for your 410c on your own.

You can find required kernel configs for Android here; https://android.googlesource.com/kernel/configs/

Thanks for the reply and the documentation link - quite useful. I will recompile my kernel with those Android recommended kernel configs and see how it goes.