Build kernel image for dragon board


#1

hi

i would like to build kernel for dragon board
from the scratch
can you give me a link or document for same


#2

well, it really depends which ‘version’ you are looking for… If you are interested in the Linaro Debian builds for DB410c, then have a look at the release notes:

http://builds.96boards.org/releases/dragonboard410c/linaro/debian/latest/


#3

96Boards Wiki has instructions.

Note that that seems to literally be from source.

96Boards has both Android and ‘Ubuntu’ distro and includes a working kernel sources. The instructions on how to build from those trees are: Dragonboard Linux build guide. I suggest going this route since it will build an entire distribution for you and then you can modify/compile the kernel easily.

I’m curious, how come you couldn’t find the documents? Maybe 96boards needs a better documentation gateway… (We downloaded all the documents from Qualcomm and 96boards into a network share and I just search through them locally).


#4

Hi Jaime,

Thanks,

I was this link

This looks very breif.
I will follow the commands mentioned in the release notes and get back.


#5

Hi

I m facing issue when compiling kernel. I m using below command

"
Additionally, you might want or need to compile the kernel modules:

make -j4 modules KERNELRELEASE=4.4.9-linaro-lt-qcom

Below is the error

root@sobin-HP-Pavilion-dv4-Notebook-PC:/home/sobin/dragon_board/kernel# make -j4 modules KERNELRELEASE=4.4.9-linaro-lt-qcom
CHK include/config/kernel.release
CHK include/generated/uapi/linux/version.h
CHK include/generated/utsrelease.h
CHK include/generated/timeconst.h
CHK include/generated/bounds.h
CHK include/generated/asm-offsets.h
CALL scripts/checksyscalls.sh
Building modules, stage 2.
MODPOST 160 modules
WARNING: drivers/media/v4l2-core/videobuf2-core: ‘vb2_core_queue_release’ exported twice. Previous export was in vmlinux
WARNING: drivers/media/v4l2-core/videobuf2-core: ‘vb2_core_queue_init’ exported twice. Previous export was in vmlinux
WARNING: drivers/media/v4l2-core/videobuf2-core: ‘vb2_mmap’ exported twice. Previous export was in vmlinux
WARNING: drivers/media/v4l2-core/videobuf2-core: ‘vb2_core_expbuf’ exported twice. Previous export was in vmlinux
WARNING: drivers/media/v4l2-core/videobuf2-core: ‘vb2_core_streamoff’ exported twice. Previous export was in vmlinux
WARNING: drivers/media/v4l2-core/videobuf2-core: ‘vb2_queue_error’ exported twice. Previous export was in vmlinux
WARNING: drivers/media/v4l2-core/videobuf2-core: ‘vb2_core_streamon’ exported twice. Previous export was in vmlinux
WARNING: drivers/media/v4l2-core/videobuf2-core: ‘vb2_core_dqbuf’ exported twice. Previous export was in vmlinux
WARNING: drivers/media/v4l2-core/videobuf2-core: ‘vb2_wait_for_all_buffers’ exported twice. Previous export was in vmlinux
WARNING: drivers/media/v4l2-core/videobuf2-core: ‘vb2_core_qbuf’ exported twice. Previous export was in vmlinux
WARNING: drivers/media/v4l2-core/videobuf2-core: ‘vb2_core_prepare_buf’ exported twice. Previous export was in vmlinux
WARNING: drivers/media/v4l2-core/videobuf2-core: ‘vb2_discard_done’ exported twice. Previous export was in vmlinux
WARNING: drivers/media/v4l2-core/videobuf2-core: ‘vb2_buffer_done’ exported twice. Previous export was in vmlinux
WARNING: drivers/media/v4l2-core/videobuf2-core: ‘vb2_plane_cookie’ exported twice. Previous export was in vmlinux
WARNING: drivers/media/v4l2-core/videobuf2-core: ‘vb2_plane_vaddr’ exported twice. Previous export was in vmlinux
WARNING: drivers/media/v4l2-core/videobuf2-core: ‘vb2_core_create_bufs’ exported twice. Previous export was in vmlinux
WARNING: drivers/media/v4l2-core/videobuf2-core: ‘vb2_core_reqbufs’ exported twice. Previous export was in vmlinux
WARNING: drivers/media/v4l2-core/videobuf2-core: ‘vb2_verify_memory_type’ exported twice. Previous export was in vmlinux
WARNING: drivers/media/v4l2-core/videobuf2-core: ‘vb2_core_querybuf’ exported twice. Previous export was in vmlinux
WARNING: drivers/media/v4l2-core/videobuf2-core: ‘vb2_buffer_in_use’ exported twice. Previous export was in vmlinux
WARNING: drivers/media/v4l2-core/videobuf2-core: ‘vb2_debug’ exported twice. Previous export was in vmlinux
WARNING: drivers/media/v4l2-core/videobuf2-memops: ‘vb2_common_vm_ops’ exported twice. Previous export was in vmlinux
WARNING: drivers/media/v4l2-core/videobuf2-memops: ‘vb2_destroy_framevec’ exported twice. Previous export was in vmlinux
WARNING: drivers/media/v4l2-core/videobuf2-memops: ‘vb2_create_framevec’ exported twice. Previous export was in vmlinux
WARNING: drivers/media/v4l2-core/videobuf2-v4l2: ‘vb2_ops_wait_finish’ exported twice. Previous export was in vmlinux
WARNING: drivers/media/v4l2-core/videobuf2-v4l2: ‘vb2_ops_wait_prepare’ exported twice. Previous export was in vmlinux
WARNING: drivers/media/v4l2-core/videobuf2-v4l2: ‘vb2_fop_poll’ exported twice. Previous export was in vmlinux
WARNING: drivers/media/v4l2-core/videobuf2-v4l2: ‘vb2_fop_read’ exported twice. Previous export was in vmlinux
WARNING: drivers/media/v4l2-core/videobuf2-v4l2: ‘vb2_fop_write’ exported twice. Previous export was in vmlinux
WARNING: drivers/media/v4l2-core/videobuf2-v4l2: ‘vb2_fop_release’ exported twice. Previous export was in vmlinux
WARNING: drivers/media/v4l2-core/videobuf2-v4l2: ‘_vb2_fop_release’ exported twice. Previous export was in vmlinux
WARNING: drivers/media/v4l2-core/videobuf2-v4l2: ‘vb2_fop_mmap’ exported twice. Previous export was in vmlinux
WARNING: drivers/media/v4l2-core/videobuf2-v4l2: ‘vb2_ioctl_expbuf’ exported twice. Previous export was in vmlinux
WARNING: drivers/media/v4l2-core/videobuf2-v4l2: ‘vb2_ioctl_streamoff’ exported twice. Previous export was in vmlinux
WARNING: drivers/media/v4l2-core/videobuf2-v4l2: ‘vb2_ioctl_streamon’ exported twice. Previous export was in vmlinux
WARNING: drivers/media/v4l2-core/videobuf2-v4l2: ‘vb2_ioctl_dqbuf’ exported twice. Previous export was in vmlinux
WARNING: drivers/media/v4l2-core/videobuf2-v4l2: ‘vb2_ioctl_qbuf’ exported twice. Previous export was in vmlinux
WARNING: drivers/media/v4l2-core/videobuf2-v4l2: ‘vb2_ioctl_querybuf’ exported twice. Previous export was in vmlinux
WARNING: drivers/media/v4l2-core/videobuf2-v4l2: ‘vb2_ioctl_prepare_buf’ exported twice. Previous export was in vmlinux
WARNING: drivers/media/v4l2-core/videobuf2-v4l2: ‘vb2_ioctl_create_bufs’ exported twice. Previous export was in vmlinux
WARNING: drivers/media/v4l2-core/videobuf2-v4l2: ‘vb2_ioctl_reqbufs’ exported twice. Previous export was in vmlinux
WARNING: drivers/media/v4l2-core/videobuf2-v4l2: ‘vb2_thread_stop’ exported twice. Previous export was in vmlinux
WARNING: drivers/media/v4l2-core/videobuf2-v4l2: ‘vb2_thread_start’ exported twice. Previous export was in vmlinux
WARNING: drivers/media/v4l2-core/videobuf2-v4l2: ‘vb2_write’ exported twice. Previous export was in vmlinux
WARNING: drivers/media/v4l2-core/videobuf2-v4l2: ‘vb2_read’ exported twice. Previous export was in vmlinux
WARNING: drivers/media/v4l2-core/videobuf2-v4l2: ‘vb2_poll’ exported twice. Previous export was in vmlinux
WARNING: drivers/media/v4l2-core/videobuf2-v4l2: ‘vb2_queue_release’ exported twice. Previous export was in vmlinux
WARNING: drivers/media/v4l2-core/videobuf2-v4l2: ‘vb2_queue_init’ exported twice. Previous export was in vmlinux
WARNING: drivers/media/v4l2-core/videobuf2-v4l2: ‘vb2_expbuf’ exported twice. Previous export was in vmlinux
WARNING: drivers/media/v4l2-core/videobuf2-v4l2: ‘vb2_streamoff’ exported twice. Previous export was in vmlinux
WARNING: drivers/media/v4l2-core/videobuf2-v4l2: ‘vb2_streamon’ exported twice. Previous export was in vmlinux
WARNING: drivers/media/v4l2-core/videobuf2-v4l2: ‘vb2_dqbuf’ exported twice. Previous export was in vmlinux
WARNING: drivers/media/v4l2-core/videobuf2-v4l2: ‘vb2_qbuf’ exported twice. Previous export was in vmlinux
WARNING: drivers/media/v4l2-core/videobuf2-v4l2: ‘vb2_create_bufs’ exported twice. Previous export was in vmlinux
WARNING: drivers/media/v4l2-core/videobuf2-v4l2: ‘vb2_prepare_buf’ exported twice. Previous export was in vmlinux
WARNING: drivers/media/v4l2-core/videobuf2-v4l2: ‘vb2_reqbufs’ exported twice. Previous export was in vmlinux
WARNING: drivers/media/v4l2-core/videobuf2-v4l2: ‘vb2_querybuf’ exported twice. Previous export was in vmlinux
ERROR: “byte_rev_table” [lib/zlib_deflate/zlib_deflate.ko] undefined!
ERROR: “cpu_tss” [fs/nfsd/nfsd.ko] undefined!
ERROR: “current_task” [fs/nfsd/nfsd.ko] undefined!
ERROR: “warn_slowpath_null” [fs/nfsd/nfsd.ko] undefined!
ERROR: “warn_slowpath_fmt” [fs/nfsd/nfsd.ko] undefined!
ERROR: “warn_slowpath_null” [fs/configfs/configfs.ko] undefined!
ERROR: “_copy_from_user” [fs/configfs/configfs.ko] undefined!
ERROR: “_copy_from_user” [fs/binfmt_misc.ko] undefined!
ERROR: “_copy_to_user” [drivers/usb/serial/whiteheat.ko] undefined!
ERROR: “_copy_to_user” [drivers/usb/serial/usb_wwan.ko] undefined!
ERROR: “_copy_from_user” [drivers/usb/serial/usb_wwan.ko] undefined!
ERROR: “_copy_to_user” [drivers/usb/serial/ti_usb_3410_5052.ko] undefined!
ERROR: “_copy_from_user” [drivers/usb/serial/ti_usb_3410_5052.ko] undefined!
ERROR: “_copy_to_user” [drivers/usb/serial/ssu100.ko] undefined!
ERROR: “_copy_to_user” [drivers/usb/serial/quatech2.ko] undefined!
ERROR: “_copy_to_user” [drivers/usb/serial/pl2303.ko] undefined!
ERROR: “_copy_to_user” [drivers/usb/serial/opticon.ko] undefined!
ERROR: “_copy_to_user” [drivers/usb/serial/mos7840.ko] undefined!
ERROR: “_copy_from_user” [drivers/usb/serial/mos7720.ko] undefined!
ERROR: “_copy_to_user” [drivers/usb/serial/mos7720.ko] undefined!
ERROR: “__preempt_count” [drivers/usb/serial/keyspan_pda.ko] undefined!
ERROR: “_copy_to_user” [drivers/usb/serial/io_ti.ko] undefined!
ERROR: “_copy_to_user” [drivers/usb/serial/io_edgeport.ko] undefined!
ERROR: “current_task” [drivers/usb/serial/io_edgeport.ko] undefined!
ERROR: “_copy_from_user” [drivers/usb/serial/ftdi_sio.ko] undefined!
ERROR: “_copy_to_user” [drivers/usb/serial/ftdi_sio.ko] undefined!
ERROR: “_copy_to_user” [drivers/usb/serial/f81232.ko] undefined!
ERROR: “current_task” [drivers/usb/serial/digi_acceleport.ko] undefined!
ERROR: “__preempt_count” [drivers/usb/serial/digi_acceleport.ko] undefined!
ERROR: “_copy_to_user” [drivers/usb/serial/ark3116.ko] undefined!
ERROR: “_copy_from_user” [drivers/usb/serial/ark3116.ko] undefined!
ERROR: “phys_base” [drivers/usb/misc/usbtest.ko] undefined!
ERROR: “warn_slowpath_null” [drivers/usb/gadget/libcomposite.ko] undefined!
ERROR: “warn_slowpath_fmt” [drivers/usb/gadget/libcomposite.ko] undefined!
ERROR: “cpu_tss” [drivers/usb/gadget/function/usb_f_mass_storage.ko] undefined!
ERROR: “current_task” [drivers/usb/gadget/function/usb_f_mass_storage.ko] undefined!
ERROR: “warn_slowpath_null” [drivers/usb/gadget/function/usb_f_mass_storage.ko] undefined!
ERROR: “warn_slowpath_null” [drivers/usb/gadget/function/u_serial.ko] undefined!
ERROR: “warn_slowpath_null” [drivers/usb/gadget/function/u_ether.ko] undefined!
ERROR: “_copy_to_user” [drivers/spi/spidev.ko] undefined!
ERROR: “copy_user_enhanced_fast_string” [drivers/spi/spidev.ko] undefined!
ERROR: “copy_user_generic_string” [drivers/spi/spidev.ko] undefined!
ERROR: “copy_user_generic_unrolled” [drivers/spi/spidev.ko] undefined!
ERROR: “cpu_tss” [drivers/spi/spidev.ko] undefined!
ERROR: “_copy_from_user” [drivers/spi/spidev.ko] undefined!
ERROR: “warn_slowpath_null” [drivers/spi/spidev.ko] undefined!
ERROR: “find_first_zero_bit” [drivers/spi/spidev.ko] undefined!
ERROR: “byte_rev_table” [drivers/net/usb/sr9800.ko] undefined!
ERROR: “byte_rev_table” [drivers/net/usb/sr9700.ko] undefined!
ERROR: “byte_rev_table” [drivers/net/usb/smsc95xx.ko] undefined!
ERROR: “byte_rev_table” [drivers/net/usb/smsc75xx.ko] undefined!
ERROR: “warn_slowpath_null” [drivers/net/usb/r8152.ko] undefined!
ERROR: “cpu_number” [drivers/net/usb/r8152.ko] undefined!
ERROR: “byte_rev_table” [drivers/net/usb/r8152.ko] undefined!
ERROR: “byte_rev_table” [drivers/net/usb/mcs7830.ko] undefined!
ERROR: “__preempt_count” [drivers/net/usb/kaweth.ko] undefined!
ERROR: “__put_user_4” [drivers/net/ppp/pppox.ko] undefined!
ERROR: “_copy_from_user” [drivers/net/ppp/pppoe.ko] undefined!
ERROR: “__put_user_4” [drivers/net/ppp/pppoe.ko] undefined!
ERROR: “__get_user_4” [drivers/net/ppp/pppoe.ko] undefined!
ERROR: “_copy_from_user” [drivers/net/ppp/ppp_synctty.ko] undefined!
ERROR: “_copy_to_user” [drivers/net/ppp/ppp_synctty.ko] undefined!
ERROR: “__get_user_4” [drivers/net/ppp/ppp_synctty.ko] undefined!
ERROR: “__put_user_4” [drivers/net/ppp/ppp_synctty.ko] undefined!
ERROR: “phys_base” [drivers/net/ppp/ppp_mppe.ko] undefined!
ERROR: “__put_user_4” [drivers/net/ppp/ppp_generic.ko] undefined!
ERROR: “__get_user_4” [drivers/net/ppp/ppp_generic.ko] undefined!
ERROR: “current_task” [drivers/net/ppp/ppp_generic.ko] undefined!
ERROR: “_copy_to_user” [drivers/net/ppp/ppp_generic.ko] undefined!
ERROR: “_copy_from_user” [drivers/net/ppp/ppp_generic.ko] undefined!
ERROR: “_copy_from_user” [drivers/net/ppp/ppp_async.ko] undefined!
ERROR: “_copy_to_user” [drivers/net/ppp/ppp_async.ko] undefined!
ERROR: “__get_user_4” [drivers/net/ppp/ppp_async.ko] undefined!
ERROR: “__put_user_4” [drivers/net/ppp/ppp_async.ko] undefined!
ERROR: “dma_ops” [drivers/media/v4l2-core/videobuf2-vmalloc.ko] undefined!
ERROR: “warn_slowpath_null” [drivers/media/v4l2-core/videobuf2-vmalloc.ko] undefined!
ERROR: “ioremap_nocache” [drivers/media/v4l2-core/videobuf2-vmalloc.ko] undefined!
ERROR: “iounmap” [drivers/media/v4l2-core/videobuf2-vmalloc.ko] undefined!
ERROR: “_copy_from_user” [drivers/media/v4l2-core/videobuf2-v4l2.ko] undefined!
ERROR: “_copy_to_user” [drivers/media/v4l2-core/videobuf2-v4l2.ko] undefined!
ERROR: “current_task” [drivers/media/v4l2-core/videobuf2-v4l2.ko] undefined!
ERROR: “warn_slowpath_null” [drivers/media/v4l2-core/videobuf2-v4l2.ko] undefined!
ERROR: “warn_slowpath_fmt” [drivers/media/v4l2-core/videobuf2-core.ko] undefined!
ERROR: “warn_slowpath_null” [drivers/media/v4l2-core/videobuf2-core.ko] undefined!
ERROR: “current_task” [drivers/media/v4l2-core/videobuf-core.ko] undefined!
ERROR: “_copy_to_user” [drivers/media/v4l2-core/videobuf-core.ko] undefined!
ERROR: “__preempt_count” [drivers/media/usb/zr364xx/zr364xx.ko] undefined!
ERROR: “_copy_to_user” [drivers/media/usb/uvc/uvcvideo.ko] undefined!
ERROR: “_copy_from_user” [drivers/media/usb/uvc/uvcvideo.ko] undefined!
ERROR: “_copy_to_user” [drivers/media/usb/stkwebcam/stkwebcam.ko] undefined!
ERROR: “current_task” [drivers/media/usb/gspca/m5602/gspca_m5602.ko] undefined!
ERROR: “_copy_to_user” [drivers/media/usb/gspca/gspca_main.ko] undefined!
ERROR: “current_task” [drivers/media/usb/gspca/gspca_main.ko] undefined!
ERROR: “current_task” [drivers/media/usb/gspca/gspca_cpia1.ko] undefined!
ERROR: “find_first_bit” [drivers/input/joydev.ko] undefined!
ERROR: “__get_user_4” [drivers/input/joydev.ko] undefined!
ERROR: “__put_user_1” [drivers/input/joydev.ko] undefined!
ERROR: “__put_user_4” [drivers/input/joydev.ko] undefined!
ERROR: “__put_user_8” [drivers/input/joydev.ko] undefined!
ERROR: “_copy_to_user” [drivers/input/joydev.ko] undefined!
ERROR: “__get_user_8” [drivers/input/joydev.ko] undefined!
ERROR: “_copy_from_user” [drivers/input/joydev.ko] undefined!
make[1]: *** [__modpost] Error 1
make: *** [modules] Error 2
root@sobin-HP-Pavilion-dv4-Notebook-PC:/home/sobin/dragon_board/kernel#

Can you sugges what next. Any issue in the kernel source. Undefined errrs tells some bug in the kernel. Does it neeed to be fixed ?


#6

Hi ,

I was trying to build the kernel for my Dragon 410 C board and I followed the exact steps mentioned in the below link

After following all the steps I am able to create the boot image (Image.gz + dtb)
But when I try to boot my board with this image I am getting following error.
fastboot boot boot-db410c.img
downloading ‘boot.img’…
OKAY [ 0.495s]
booting…
FAILED (remote: dtb not found)
finished. total time: 0.936s

Can any one please guide me where I am doing wrong ?
It will be great help if you revert ASAP.

Thanks


#7

Can any one please guide me where I am doing wrong ?

Did you install the 18.01 release or are you running with an older
version?


#8

Thanks danielt for the reply

I hope you are talking about the ubuntu version , Please find the below details about my ubuntu machine
Description: Ubuntu 16.04 LTS
Release: 16.04
Codename: xenial
x86_64 bit machine

FYI : I am trying to replace the kernel on the DB_410C which is running with Android[5.1.1] on it.

Thanks


#9

I think you need to update the bootloader (LK), the one you have does not support the appended DTB. I would suggest to download the rescue files [1] and flash LK bootloader with fastboot:

fastboot flash aboot emmc_appsboot.mbn

[1] http://snapshots.linaro.org/96boards/dragonboard410c/linaro/rescue/latest/dragonboard-410c-bootloader-sd-linux-99.zip

EDIT: This comment is not relevant if you’re platform is running Android, cf Daniel’s comment below.


#10

Afraid not, I was asking what you were running on the Dragonboard …

… thankfully you told us that too.

I’m afraid the guide you are following is for people running Debian GNU/Linux on their Dragonboard. The instructions will not work for AOSP (it may boot but it will break Android features since they expect a different kernel).

As far as I know there are no kernel build instructions for AOSP+DB410C but the full build guide will result in the kernel being recompiled along with everything else:


#11

HI danielt ,

Thanks for the reply.
Is there any repository where dedicated Kernel source for AOSP is maintained?
Because it will consume more time to Download the AOSP code (As its pretty huge ~60GB)
Please let me know if you have any other alternative ?


#12

the kernel used for the Linaro AOSP project on Dragonboard is this one:

https://git.linaro.org/landing-teams/working/qualcomm/kernel.git/log/?h=release/android/qcomlt-4.14

e.g. branch name is release/android/qcomlt-4.14, and the defconfig files we use to build are: “qcom_defconfig android-base.config android-recommended.config”

We publish the kernel and boot image here:
http://snapshots.linaro.org/96boards/dragonboard410c/linaro/aosp/kernel/latest/

The binaries there are generated from this Jenkins job:
https://git.linaro.org/ci/job/configs.git/tree/lt-qcom-linux-aosp.yaml

If you unroll all scripts you will be able to find the instructions we use to build.


#13

Thanks ndec. its very helpful.


#14

@shan2911: From the version number you quoted it looks to me like you are running the Qualcomm port of AOSP, not the Linaro port. Thus I think you might encounter also problems with release/android/qcomlt-4.14 , the Qualcomm port of AOSP will not expect this kernel.

The Linaro port is still a work-in-progress and has little in the way of documentation, although there is a build guide:


#15

I appreciate the support :slight_smile:


#16

HI ,

I followed the steps mentioned in the below link

But there is no success , I am getting the same result.[FAILED (remote: dtb not found)]

I order to make sure I built the entire AOSP , then try to boot with only boot image (fastboot boot boot.img) , for this step also I am getting the same result [[FAILED (remote: dtb not found)]

I am not sure where I am doing wrong ?
is there any other methods we can get rid of this error ? meaning building the boot image with dtb.

Reverts are much appreciated.

Note :The version of Kernel currently DB_410C board is running “Linux version 3.10.49”


#17

The steps use appended DTB as well:

cat arch/arm64/boot/Image.gz arch/arm64/boot/dts/qcom/apq8016-sbc.dtb > db410c-qcomlt-4.14.gz-dtb

This requires an up-to-date bootloader. Like I said, I suggest you to update LK (aboot partition).

You can also use rescue procedure to update firmware/bootloader:


#18

Just to confirm did you follow the whole guide or just the kernel build?

(following the whole guide won’t update your boot firmware… you still need to do that but it will ensure you have a userspace that matches the kernel).


#19

Hi Loic ,

Thanks for the support ,

update of LK(aboot partition ) is applicable to system running with Android also ?

Note : I flashed the aboot partition as mentioned , after the reboot my adb connection is not establishing .Looks like it got brick.


#20

Hi Danielt ,

First I tried with only the kernel build , but failed to update the kernel
Then I tried to build the complete AOSP and tried to boot with the boot image part of this build , here also I failed.
I am totally blank , Can please some one guide me what is the reason for this fail (Eventhough we merge the dtb with the regular kernel build (Image.gz)?