This is a cache of https://discuss.96boards.org/t/dragonboard-410c-compile-my-own-kernel/4217. It is a snapshot of the page at 2024-10-31T07:49:54.099+0000.
Dragonboard 410c, compile my own kernel - DragonBoard410c - 96Boards Forum

Dragonboard 410c, compile my own kernel

Hello,
I’m trying to use the Coresight feature. I purchased the Dragonboard 410c, and got it with Debian Linux, and kernel 4.9.0(4.9.30-linaro-lt-qcom). This kernel version is too old for me, as it doesn’t contain some new coresight features. Furthermore, some of the features i need are not mainstreamed, so ineed to compile my own kernel from this repository:
https://github.com/Linaro/perf-opencsd

I’m not sure how to do so, as compling your own kernel(not from the qcom repo, and not a release branch based on debian) for this board is not documented anywhere, and i’m not sure how do i get to a final product containing an img file that i can load to an SD card and boot.
Thanks!

1 Like

The latest Debian images use the v4.14 kernel… I would strongly advise
upgrading to these before doing much else.

Anyhow, if you still need to compile the kernel you will find
instructions in the release notes:
http://releases.linaro.org/96boards/dragonboard410c/linaro/debian/latest/

hi,

I will just add a few more details here. We maintain a kernel release branch (4.9, 4.14, …) for the DB410c, which is being used for the Linaro releases. That’s the ‘official’ release branch for all our builds. It is based on mainline, and contains additional patches:

  • some backports, e.g. patches that have been merged after the branch point we used (4.14) and that we want in our builds
  • LTS fixes (we merge 4.14.x regularly)
  • other ‘stuff’ which are patches not in mainline , because they are not ready yet

We try to guarantee that if you use the branch that we maintain, most things should work ‘out of the box’. we provide compilation instructions, binary images, …

However over the years, a lot of what we’ve done has been merged in mainline already. And mainline has pretty decent support for DB410c already. And you should be able to use any recent kernel commit and get it to boot on the board. Some features might not be enabled in Kconfig, but most things should be enabled now. And if you find missing options in arch/arm64/configs/defconfig that would be beneficial for DB410c, let us know and we can fix that (or even better, you can send a patch for it!).

cheers

Hey,
I have sucessfully compiled my own kernel. I compiled a kernel that is based on v4.14, then i followed the instructions here:
http://releases.linaro.org/96boards/dragonboard410c/linaro/debian/latest/

And created a final boot-410c.img file just as it says there, now, i’m not sure how do i boot this kernel on the board without using the fastboot method. I need to use an SD Card.. i haven’t found any documentation whatsoever regarding this issue.

I have also compiled the modules(make modules with the distro.config as the configuration). I’m not sure replacing them in /lib/modules is a good idea, just in case i mess up the compiled kernel i do want to be able to boot with the older one…

any ideas?

thanks.

If you already have your sdcard partitioned (e.g. with debian), you can just replace the boot partition with the one you created. e.g:

$ cat boot-410c.img > /dev/disk/by-partlabel/boot

Just in case check that this effectively points to the sdcard:

$ ls -l /dev/disk/by-partlabel/boot 
lrwxrwxrwx 1 root root /dev/disk/by-partlabel/boot -> ../../mmcblk0p7

If you install your module with INSTALL_MOD_PATH, it creates a versioned module directory (e.g. 4.14.15-00002-g088455d-dirty) you can safely copy into lib/modules. Several versions can coexist, at runtime the one matching the kernel version will be used.

And created a final boot-410c.img file just as it says there, now, i’m not sure how do i boot this kernel on the board without using the fastboot method. I need to use an SD Card.. i haven’t found any documentation whatsoever regarding this issue.

You mean you are booting your DB410C from the SD card?

That’s fairly easy…

If you put the SD card in your host PC then you can use fdisk to show
the partition table on the SD card.

Look for a boot partition (make sure you are looking at the SD card, not
the PC’s hard disc) and note its number.

Then is should be a matter of:

dd if=boot-410c.img of=/dev/sd

I have also compiled the modules(make modules with the distro.config as the configuration). I’m not sure replacing them in /lib/modules is a good idea, just in case i mess up the compiled kernel i do want to be able to boot with the older one…

You can always rename /lib/modules if you want to… but note that the
instructions about will have overwritten the kernel anyway (although you
can recover it by using dd to copy in the original kernel image).

Also I think that most features will still work even with the kernel
modules missing (IIRC the kernel for DB410C is configured so that
modules are mostly used for hotplugable drivers such as USB rather than
for core features).

fdisk -l shows “Unknown” for every partition type except the rootfs.
So i’m not really sure where is the boot partition… i tried to boot with the SD card and a debian release(from here https://www.96boards.org/documentation/consumer/dragonboard410c/downloads/debian.md.html,
SD CARD image)

And gather maybe information about the boot partition that was used to boot the device from the SD card, but the symbol link “/dev/disk/by-partlabel/boot” points to the eMMc, not the SDcard, which is weird…

So no idea about how i get the boot partition on the SD card…(with the img installed on it)

Also, regardless to this question, i noticed the image i downloaded from the SD card mirror download contains some kind of a “developer” kernel, with no GUI at all. Only a terminal. This is not exactly the version i got with the Dragonboard 410c on the eMMc, this is slightly a different one… how do i get the updated version of the release that isn’t aimed to developers?

And what is the different? “linaro-developer” vs “linaro” users (SD card vs eMMc)

sudo gdisk -l /dev/mmcblk1

and it will list all partitions from GPT. the boot partition is the one with the ‘boot’ label.

When you have both the SD card and the eMMC ‘formated’ for a linux boot, you end up with 2 partition with the label ‘boot’, one on the SD, one on the eMMC. /dev/disk/by-partlabel/boot will then point to ‘one of them’, not sure how this is done, i suspect it’s the first one the kernel will ‘see’. in this specific case, by-partlabel is indeed not useful.