This is a cache of https://discuss.96boards.org/t/missing-defconfig-for-linaros-aosp-port-for-db410c/5753. It is a snapshot of the page at 2024-11-01T13:29:49.496+0000.
Missing defconfig for Linaro's AOSP port for db410c - DragonBoard410c - 96Boards Forum

Missing defconfig for Linaro's AOSP port for db410c

Hi guys. I’m trying to build the kernel from source according to https://www.96boards.org/documentation/consumer/dragonboard/dragonboard410c/guides/aosp.md.html
but the defconfig file is missing ( http://snapshots.linaro.org/96boards/dragonboard410c/linaro/aosp/kernel/latest/defconfig)
So I tried to extact it from /proc/config.gz from a running instance (from the one that works, with the dtb already built in devices/linaro/dragonboard-kernels/). I recompiled the kernel with this defconfig, but the board still does not boot correctly.

Does anyone know where the working defconfig is?

Thank you!!

UPDATE: I tried also using arch/arm64/config/qcom_defconfig (merged with android-base and android-recommended configs). Seems to enter a bootloop.

1 Like

@pundiramit, Is downloading out of tree defconfig still needed to build DB410C kernel ?

1 Like

Sorry I forgot to reply on this. We are working on a common kernel config for dragonboards (db820c|db410c). Hopefully we will be using same kernel image as the next prebuilt image for AOSP boot. I’ll share the CI download link upon confirmation.

Also going forward, yes we do need out of tree Android config fragments to build db410c kernel for AOSP. Plan is to use qcom_defconfig as base config and enable Android config fragments kernel/configs - Git at Google at build time.

Hi,
I am trying to build an Android for Dragonboard 410c for the first time. The above doc page cannot be found and on Coursera the guys are recommending going via Linaro for cross-compilation. When I do as the Building Android Open Source Project (AOSP) for Dragonboard - 96Boards says, I see as above, HOST_CROSS_OS=windows etc. What is the right doc to use for building Android on ubuntu 18.04 for Dragonboard 401c?

Thanks,
Alex

the one you mentioned [1], should work, basically repo-sync + make.

[1] Building Android Open Source Project (AOSP) for Dragonboard - 96Boards

Here are the general steps i use to compile AOSP Master for Dragonboard 410c.

First Download Kernel and a Toolchain

mkdir /root/DB-KERNEL/
cd /root/DB-KERNEL/
git clone Linaro Git Hosting -b release/android/qcomlt-4.14 db410c-kernel
cd /root/DB-KERNEL/db410c-kernel
mkdir /root/DB-KERNEL/Liarno-Toolchain
cd /root/DB-KERNEL/Liarno-Toolchain
wget http://releases.linaro.org/components/toolchain/binaries/7.2-2017.11/aarch64-linux-gnu/gcc-linaro-7.2.1-2017.11-x86_64_aarch64-linux-gnu.tar.xz
tar -xf gcc-linaro-7.2.1-2017.11-x86_64_aarch64-linux-gnu.tar.xz

SETUP TOOLCHAIN

export ARCH=arm64
cd /root/DB-KERNEL/Liarno-Toolchain
export PATH=$(pwd)/gcc-linaro-7.2.1-2017.11-x86_64_aarch64-linux-gnu/bin/:$PATH
export CROSS_COMPILE=$(pwd)/gcc-linaro-7.2.1-2017.11-x86_64_aarch64-linux-gnu/bin/aarch64-linux-gnu-
aarch64-linux-gnu-gcc --version

MAKE KERNEL CONFIG (defconfig)

cd /root/DB-KERNEL/db410c-kernel/kernel/configs/
./android-fetch-configs.sh
cd /root/DB-KERNEL/db410c-kernel
make ARCH=arm64 CROSS_COMPILE=aarch64-linux-gnu- qcom_defconfig android-recommended.config android-recommended-arm64.config android-base.config

THEN BUILD KERNEL
make ARCH=arm64 CROSS_COMPILE=aarch64-linux-gnu- -j16

NEXT DOWNLOAD AOSP SOURCE
mkdir /root/AOSP
cd /root/AOSP

repo init -u https://android.googlesource.com/platform/manifest -b master 
git clone https://android-git.linaro.org/git/platform/manifest.git .repo/local_manifests -b dragonboard

Copy Device tree and kernel to AOSP TREE
cd /root/DB-KERNEL/db410c-kernel
cat /root/DB-KERNEL/db410c-kernel/arch/arm64/boot/Image.gz /root/DB-KERNEL/db410c-kernel/arch/arm64/boot/dts/qcom/apq8016-sbc.dtb > db410c-qcomlt-4.14.gz-dtb
cp /root/AOSP/device/linaro/dragonboard-kernels/db410c-qcomlt-4.14.gz-dtb /root/AOSP/device/linaro/dragonboard-kernels/db410c-qcomlt-4.14.gz-dtb-old
rm -rf /root/AOSP/device/linaro/dragonboard-kernels/db410c-qcomlt-4.14.gz-dtb
cp db410c-qcomlt-4.14.gz-dtb /root/AOSP-DB/device/linaro/dragonboard-kernels/

USE AOSP TOOLCHIN TO BUILD AOSP
cd /root/AOSP/prebuilts/gcc/linux-x86/aarch64/aarch64-linux-android-4.9/
export PATH=$(pwd)/bin/:$PATH
export CROSS_COMPILE=$(pwd)/bin/aarch64-linux-android-

BUILD AOSP
cd /root/AOSP
source build/envsetup.sh
lunch db410c32_only-userdebug
make -j16

2 Likes

Appreciated a lot! This is working solution indeed.
btw, I meet some challenges, again.
You are building AOSP after the Kernel and merge them afterwards.
In my case I have build AOSP first, then Kernel (thanks for your instructions)
Merged as described within here: 96boards/doc/db
but error appear during the bootimage make:

root@w530:~/ANDROID_TOP# make -j8 bootimage
============================================
PLATFORM_VERSION_CODENAME=Q
PLATFORM_VERSION=Q
TARGET_PRODUCT=aosp_arm
TARGET_BUILD_VARIANT=eng
TARGET_BUILD_TYPE=release
TARGET_ARCH=arm
TARGET_ARCH_VARIANT=armv7-a-neon
TARGET_CPU_VARIANT=generic
HOST_ARCH=x86_64
HOST_2ND_ARCH=x86
HOST_OS=linux
HOST_OS_EXTRA=Linux-4.15.0-43-generic-x86_64-ubuntu-16.04.5-LTS
HOST_CROSS_OS=windows
HOST_CROSS_ARCH=x86
HOST_CROSS_2ND_ARCH=x86_64
HOST_BUILD_TYPE=release
BUILD_ID=PI
OUT_DIR=out
============================================
[100% 1/1] out/soong/.bootstrap/bin/soong_build out/soong/build.ninja
FAILED: out/soong/build.ninja
out/soong/.bootstrap/bin/soong_build -t -l out/.module_paths/Android.bp.list -b out/soong -n out -d out/soong/build.ninja.d -globFile out/soong/.bootstrap/build-globs.ninja -o out/soong/build.ninja Android.bp
error: kernel/configs/android-4.14/Android.bp:15:1: module "kernel_config_current_4.14" already defined
       db410c-kernel/kernel/configs/Android.bp:15:1 <-- previous definition here
16:01:44 soong bootstrap failed with: exit status 1
build/make/core/main.mk:21: recipe for target 'run_soong_ui' failed
make: *** [run_soong_ui] Error 1

Do you have the solution Kernel Build after AOSP? Or do I need to start all from the scratch?

You need to follow the method I used.
Build the kernel first.
AOSP Uses a PRE-BUILT Kernel.

It is easier to just build the kernel first then copy the Kernel and the DTB to the AOSP Tree.
This way when you build AOSP the new kernel is used.

Otherwise you need to compile the kernel then copy it to the AOSP Tree the same way.

Copy Device tree and kernel to AOSP TREE
cd /root/DB-KERNEL/db410c-kernel
cat /root/DB-KERNEL/db410c-kernel/arch/arm64/boot/Image.gz /root/DB-KERNEL/db410c-kernel/arch/arm64/boot/dts/qcom/apq8016-sbc.dtb > db410c-qcomlt-4.14.gz-dtb
cp /root/AOSP/device/linaro/dragonboard-kernels/db410c-qcomlt-4.14.gz-dtb /root/AOSP/device/linaro/dragonboard-kernels/db410c-qcomlt-4.14.gz-dtb-old
rm -rf /root/AOSP/device/linaro/dragonboard-kernels/db410c-qcomlt-4.14.gz-dtb
cp db410c-qcomlt-4.14.gz-dtb /root/AOSP-DB/device/linaro/dragonboard-kernels/

And then Build the Boot.img.
You are getting a error simply because the .config already existed.
Basically you are ending up with 2 .config files.

I would recommend to copy the new kernel to aosp.
Reboot the PC to start a fresh session. 
Then

cd /root/AOSP
source build/envsetup.sh
lunch db410c32_only-userdebug
make -j16 bootimage

*************************************************************************************************

Otherwise to make a clean build.
cd /root/AOSP
make clean
make clobber

Follow steps to build KERNEL
Copy KERNEL and DTB to AOSP.
cd /root/AOSP
source build/envsetup.sh
lunch db410c32_only-userdebug
make -j16

If you plan to use a custom KERNEL it is just easier to build the kernel first then build AOSP.

My other recommendation to you is to use a Online Server to build.
I pay for a server from here. You can get a 3 Day free Trial. Some other server rentals give 30 day trial. With the 24 Core Server I can Compile AOSP in less than 1 hour.
https://www.nfoservers.com/
1 Like

Hello All.
Overnight did all required steps.

1)Build Kernel
2)Copy Kernel to AOSP
3)Build AOSP
4)Flashed Images to DB
5)Board started to boot and stacked on the middle (Trying to connect UART debug interface, but I have only 3.3V, insted 1.8V required…)

So the question is:
Have anyone booted with AOSP with Kernel successfully?
I’m still strongly believe that QC DB410 is great product.
We are investigating this actually, is it worth to continue with MSM8016e with our own Hardware development platform.
Looking to hear from you
20190207_130409|690x335

Sorry to jump on only a tiny bit of your question (mostly because I don’t have much to say on the wider bits) but, for the type of work you are doing, I’d really recommend getting the UART working. It’s just so much easier to do web searches for error messages than for symptoms!

It looks like the audio-mezz is back in stock at Arrow (https://www.arrow.com/en/products/114990332/seeed-technology-limited ). It’s not the only way to get a 1.8v UART but AFAIK it is the cheapest off-the-shelf way to get hooked up to the UART on DB410C (so much so that some people buy them for other 96Boards and desolder the Dragonboard specific header :wink: ).

What I found was that prior to roughly 1-17-2019 I could build AOSP and it would boot.
Even though it booted most things did not work right.

I investigated it a bit more and I believe that the New SYSTEM as ROOT is the main issue.
The boot.img is nearly empty. And the errors I was getting were related to missing files that prior to system as root feature would be in the root of the boot image.

I have a build of AOSP Q that will boot. But i could not get adb working.
I can upload it somewhere if you like.

I would also suggest trying to repo a earlier AOSP Tree.
I have only used the master branch but maybe you can use a earlier branch.

At any rate you will need UART for sure. Get that up and running and then you can debug. Without uart it wont be easy.

As i mentioned towards the end of last month i started to get a new error when running LUNCH.
After that point in time my builds would no longer boot.

I am sure there must have been some big updates pushed to AOSP and these updates broke things. If you can sync a tree prior to the updates it will boot.

Here is one of the last builds i ran. I think it will boot but if it don’t let me know and i will have to find a older build. Just be aware that this build was not 100% functional.

I included all the files in the OUT dir. Including the build logs.

1 Like

After git clone, I added repo sync -j16 -c, then your remaining commands. After I typed type last make -j16, fs_config_generator.py failed because it was passed --all-partitions not followed by a comma-separated list (perhaps just a pair of quotes is missing). Any recommendations? I googled a bit without success.

Thanks,
Alex

EDIT: If you make bootimage only, there is 11 times less work to do. I edited out/build-db410c32_only.ninja and added twice '' after --all-partitions; not sure if it helped or that part was not built at all.
EDIT2: All builds with those edits.

By default, aosp has 410c prebuilt kernel blobs. This is an optional step only requested if you want to replace the prebuilt kernel/dtb with your own kernel.

AOSP includes a device/linaro/dragonboard path now, but which supports ONLY the db845c. Following the “build aosp for db410c/db820c” instructions creates a new manifest, which now conflicts with the db845c device path.

The other thread has an additional instruction from @Loic that will conflict with the new manifest added by the “normal” instructions. I will clarify this point in the other thread.

Yeah, that device repo hasn’t been updated in a long time and won’t actually work for Android 10 without some changes.

You should try mine from here: AOSP-Automotive · GitLab

And do yourself a favor and use the pinned manifest in there.

BUT note that I only work with db820c. While it may work with the 410c, I haven’t tried it.

You did not sync the right repo branch for dragonboard, the one I tried on my side is db410c branch:

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

We are going to try fixing the documentation.

@Jimmy23, AFAIK @pundiramit have just fixed some build issues, so if you sync the repo again you should be able to build.

I followed @BigCountry907 guide, but failed with error when I build the kernel

something like:

error: #error New address family defined, please update secclass_map.

Does anyone got clue?

Bellow are the details

CHK scripts/mod/devicetable-offsets.h
In file included from scripts/selinux/mdp/mdp.c:49:
./security/selinux/include/classmap.h:247:2: error: #error New address family defined, please update secclass_map.
247 | #error New address family defined, please update secclass_map.
| ^~~~~
make[3]: *** [scripts/Makefile.host:102: scripts/selinux/mdp/mdp] Error 1
make[2]: *** [scripts/Makefile.build:673: scripts/selinux/mdp] Error 2
UPD scripts/mod/devicetable-offsets.h
make[2]: *** Waiting for unfinished jobs…
HOSTCC scripts/dtc/livetree.o
MKELF scripts/mod/elfconfig.h
HOSTCC scripts/mod/modpost.o
In file included from scripts/selinux/genheaders/genheaders.c:19:
./security/selinux/include/classmap.h:247:2: error: #error New address family defined, please update secclass_map.
247 | #error New address family defined, please update secclass_map.