Is the AOSP master supported?

@Loic The instructions you linked for building Android don’t work for me.

First, the following doesn’t work, because the address seems to be wrong:

wget http://snapshots.linaro.org/96boards/dragonboard410c/linaro/aosp/kernel/latest/defconfig -P arch/arm64/configs/

I changed it to this:

wget http://snapshots.linaro.org/96boards/dragonboard410c/linaro/aosp-master/latest/ -P arch/arm64/configs/

But when I tried to execute this:

make ARCH=arm64 defconfig

The following error gets spit out many, many, many times, then the build fails:

Makefile:514: recipe for target 'defconfig' failed
make[4992]: *** [defconfig] Error 2

I’m new to Android and Linux. I’m guessing I need to download some different code. Can anyone explain what the error means?

Here are the steps I follow to build aosp:

repo init -u https://android.googlesource.com/platform/manifest -b master
repo sync -j$(nproc) -c

rm -r device/linaro/dragonboard
git clone -b db410c https://android-git.linaro.org/device/linaro/dragonboard410c.git device/linaro/dragonboard

source build/envsetup.sh
lunch db410c
make -j8

Maybe you can also look at this thread fr kernel building: Missing defconfig for Linaro's AOSP port for db410c

@Loic haven’t tried the new link you posted yet, but your steps didn’t work. When I tried to execute

make -j8

I received an error that make was no longer supported. It told me I should use envsetup.sh or soong_ui.bash to build instead. I tried envsetup.sh, and it didn’t do anything. So I tried:

build/soong/soong_ui.bash --make-mode

And it ended up stopping with an error after several hours once it consumed every bit of fixed memory on my system (over 30 GB).

I’ll try the new link you posted, but is there anything you can tell me about why make didn’t work, and what I should do instead?

you need to run

source build/envsetup.sh

before lunch/make.

@Loic I executed the envsetup.sh before make. It returned nothing, but I was able to run make anyway. However, it did the same thing that it did when I executed soon_ui.bash. It spent several hours working and eventually filled up my entire hard drive (over 100 GB), at which point it stopped because it was out of memory.

Are you sure those build steps you provided work properly?

I’ll try the steps in the link you posted.

It has to include “source” as in “source build/envsetup.sh”, or “.” as in “. envsetup.sh” (i.e., “.” followed by <space> followed by “envsetup.sh”), otherwise it WON’T WORK.

@doitright I ran this exact command from android_top:

source build/envsetup.sh

It returned nothing. After that I ran:

lunch db410c

From which I received:

============================================
PLATFORM_VERSION_CODENAME=R
PLATFORM_VERSION=R
TARGET_PRODUCT=db410c
TARGET_BUILD_VARIANT=eng
TARGET_BUILD_TYPE=release
TARGET_ARCH=arm
TARGET_ARCH_VARIANT=armv8-a
TARGET_CPU_VARIANT=cortex-a53
HOST_ARCH=x86_64
HOST_2ND_ARCH=x86
HOST_OS=linux
HOST_OS_EXTRA=Linux-4.15.0-91-generic-x86_64-Ubuntu-18.04.4-LTS
HOST_CROSS_OS=windows
HOST_CROSS_ARCH=x86
HOST_CROSS_2ND_ARCH=x86_64
HOST_BUILD_TYPE=release
BUILD_ID=AOSP.MASTER
OUT_DIR=out
PRODUCT_SOONG_NAMESPACES=external/mesa3d

I then executed:

make -j8

And it did what I described above. Filled my hard drive with millions of files and failed.

What happens when you run these commands?

It looks like some people are mixing these instructions with the instructions found here; https://www.96boards.org/documentation/consumer/dragonboard/guides/aosp/

It is important to understand that trying to follow the instructions at that link will cause a path conflict between the db845c repository and the db410c/db820c repository. In order to follow the “rm, git” instructions, the local manifest must be removed.

Don’t use -j8. That will consume all your RAM and then crash the build. Either leave it out, or use something smaller, like -j2.

Things are working for me and i am able to boot into Android with the steps you have mentioned.
Thank you.
The prebuilt kernel is actually based on the Linux kernel 5.2, where can I find the source code for the prebuilt kernel on which Amit’s patch is based on?

My RAM didn’t fill up, my hard drive filled up. I’ll try -j2 as soon as I finish syncing the repository again anyway.

By “rm,git” instructions, I assume you mean building the kernel for 410c found here:

What exactly do you mean by “the local manifest must be removed?”

Oh, you’re going to need a lot more storage space than that. Figure on around 100 GB.

I just looked it up. Apparently, it’s recommended to have 150 GB. I never imagined it would take near that much space. So there’s the answer to that problem. Looks like I need a bigger hard drive.

Thanks for the help.

Can someone please help with the kernel source and buuild instructions for the prebuilt kernel available?It seems to be based on the Linux kernel version 5.2 ?

I moved on to an Ubuntu virtual machine with 1 terabyte of storage.

I tried the following steps that @Loic specified:

repo init -u https://android.googlesource.com/platform/manifest -b master
repo sync -j$(nproc) -c

rm -r device/linaro/dragonboard
git clone -b db410c https://android-git.linaro.org/device/linaro/dragonboard410c.git device/linaro/dragonboard

source build/envsetup.sh
lunch db410c
make -j2

Note, I changed this:

make -j8

To this:

make -j2

The build failed with the following error:

18:18:41 soong bootstrap failed with: exit status 1
ninja: build stopped: subcommand failed.

#### failed to build some targets (01:22:29 (hh:mm:ss)) ####

Can anyone help with this failure?

Not if you don’t give us the relevant part of the error, which could be a few hundred lines above the part you copied out.

One spot it will probably fail on you is trying to copy the prebuilt kernel, for which you will need to get the appropriate dragonboard-kernel repository.

I figured out the last error (my VM was mis-configured). Here is a new, new error I received after executing make -j2. It looks like a header file might be missing or something:

system/core/libsysutils/src/NetlinkEvent.cpp:532:39: error: use of undeclared identifier 'ND_OPT_CAPTIVE_PORTAL'
    } else if (opthdr->nd_opt_type == ND_OPT_CAPTIVE_PORTAL) {
                                      ^
system/core/libsysutils/src/NetlinkEvent.cpp:534:39: error: use of undeclared identifier 'ND_OPT_PREF64'
    } else if (opthdr->nd_opt_type == ND_OPT_PREF64) {

Can anyone help with this one?

That looks like the typical type of transient errors that crop up in Master while features are in the process of being uploaded. I’d try a repo sync and build again.

FYI: I ran a 410c build on my device and kernel repo starting yesterday, and the build completed successfully. I haven’t booted it, so I can’t say that it actually works, although I suspect it will. I strongly recommend that you start with that; https://gitlab.com/aosp-automotive

Pay attention to the “pinned manifests” repository.

@doitright

I’m trying to following your instructions here:

They don’t work for me (big surprise, I’m sure).

Getting aosproot seemed to go OK. For this line:

repo init -m {pinned}.xml

I just guessed and did this:

repo init -m pinned_020620.xml

For the kernel, I don’t know where you expect things to be, so I made a directory call “kernel” that was parallel to aosproot. Then I executed the following:

cd kernel
git clone https://gitlab.com/aosp-automotive/dragonboard-kernel-src.git

I then created a folder in “kernel” called “toolchain.” and executed the following commands:

cd toolchain
wget https://releases.linaro.org/components/toolchain/binaries/latest-7/aarch64-linux-gnu/gcc-linaro-7.5.0-2019.12-x86_64_aarch64-linux-gnu.tar.xz
tar -xf gcc-linaro-7.5.0-2019.12-x86_64_aarch64-linux-gnu.tar.xz 

That seemed to work. I then executed the following commands:

cd ..
export ARCH=arm64
export CROSS_COMPILE=~/kernel/toolchain/gcc-linaro-7.5.0-2019.12-x86_64_aarch64-linux-gnu/bin/aarch64-linux-gnu-

Neither export command returned anything. When I executed:

make db820c_defconfig

I received:

make: *** No rule to make target 'db820c_defconfig'.  Stop.

I don’t know what you mean by “Pay attention to the ‘pinned manifests’ repository.”

Can you tell me what I’m doing wrong? And what I have to change to build for the 410c?

You don’t have an 820c. You have a 410c. I’m not going to connect every dot for you, if you can’t go part way yourself then what you really need is to find someone to generate and install the builds for you, and that isn’t me or anyone else on this forum.

The last hint I have time to give you today is don’t build the kernel — that’s for the 820c. Use the prebuilt one for the 410c.

And look, I don’t even know if it will boot when you install it. I haven’t tried. The only thing I’ve done is checked that it actually compiles through successfully.

EDIT:
I had the opportunity this morning to test it on an actual 410c and it DID NOT BOOT. However, I added a commit that fixed the issue (not copying the fstab to the correct location, and thus not mounting the userdata partition) and it now boots. Just do a “repo sync” and build it again – don’t “make clean” it, just do a quick build to get the fixed vendor.img (fastboot flash it to the cache partition, which is repurposed as vendor). There is a recurring crash in the logcat related to media swcodec, that I (or you) may work out later, but you now have a known good starting point to work from.