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 https://android.googlesource.com/kernel/configs/ at build time.
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 https://www.96boards.org/documentation/consumer/dragonboard/guides/aosp 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?
the one you mentioned , should work, basically repo-sync + make.
Here are the general steps i use to compile AOSP Master for Dragonboard 410c.
First Download Kernel and a Toolchain
git clone http://git.linaro.org/landing-teams/working/qualcomm/kernel -b release/android/qcomlt-4.14 db410c-kernel
tar -xf gcc-linaro-7.2.1-2017.11-x86_64_aarch64-linux-gnu.tar.xz
MAKE KERNEL CONFIG (defconfig)
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
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
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/
Overnight did all required steps.
2)Copy Kernel to 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
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 ).
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.
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.
EDIT: If you
make bootimage only, there is 11 times less work to do. I edited
out/build-db410c32_only.ninja and added twice
--all-partitions; not sure if it helped or that part was not built at all.
EDIT2: All builds with those edits.
I’m trying to follow @BigCountry907 instruction above. I’m stuck at:
Copy Device tree and kernel to AOSP TREE
I thought that was just the title of what comes next, but it looks like I’m suppose to copy some files and folders from DB-KERNEL to AOSP.
What exactly am I supposed to copy where?
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.
@Loic in that case, the following step fails:
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
All I have in my AOSP folder is the .repo folder. The device folder, and everything inside it, does not exist in AOSP.
Where is the device folder and everything inside of it supposed to come from?
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.
I added the following to linaro.xml:
<remove-project name="device/linaro/dragonboard" /> <remove-project name="device/linaro/dragonboard-kernel" />
Then I was able to execute:
repo sync -j$(nproc) -c
I also assume this was a type-o:
cp db410c-qcomlt-4.14.gz-dtb /root/AOSP-DB/device/linaro/dragonboard-kernels/
So I changed it to this:
cp db410c-qcomlt-4.14.gz-dtb /root/AOSP/device/linaro/dragonboard-kernels/
I was finally able to download the repository and build, but it failed with the following brand new error:
FAILED: external/mesa3d/Android.mk:40: error: external/mesa3d must be in PRODUCT_SOONG_NAMESPACES. 14:06:43 ckati failed with: exit status 1 #### failed to build some targets (04:21 (mm:ss)) ####
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: https://gitlab.com/aosp-automotive
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.
Can either of you give me another hint?