[yocto] Building Out-of-Tree Modules on the BBB Target

Bruce Ashfield bruce.ashfield at gmail.com
Sun May 12 05:56:45 PDT 2019


On Sun, May 12, 2019 at 6:54 AM Zoran Stojsavljevic <
zoran.stojsavljevic at gmail.com> wrote:

> Hello to the YOCTO community,
>
> I am using (to build the target for Beagle Bone Black) the following
> script:
> https://github.com/ZoranStojsavljevic/bbb-yocto
> https://github.com/ZoranStojsavljevic/bbb-yocto/blob/master/bbb-yocto.sh
>
> The latest kernel I am using from the following repo:
> https://github.com/jumpnow/meta-bbb
>
> Is kernel 5.0.14 .
>
> Here is the snippet of the boot traces:
> Starting kernel ...
>
> [    0.000000] Booting Linux on physical CPU 0x0
> [    0.000000] Linux version 5.0.14-jumpnow (oe-user at oe-host) (gcc
> version 8.3.0 (GCC)) #1 Fri May 10 13:12:33 UTC 2019
> [    0.000000] CPU: ARMv7 Processor [413fc082] revision 2 (ARMv7),
> cr=10c5387d
> [    0.000000] CPU: PIPT / VIPT nonaliasing data cache, VIPT aliasing
> instruction cache
> [    0.000000] OF: fdt: Machine model: TI AM335x BeagleBone Black
> [    0.000000] Memory policy: Data cache writeback
> [    0.000000] cma: Reserved 16 MiB at 0x9f000000
> [    0.000000] CPU: All CPU(s) started in SVC mode.
> [    0.000000] AM335X ES2.1 (sgx neon)
> [    0.000000] random: get_random_bytes called from
> start_kernel+0xa4/0x460 with crng_init=0
> [    0.000000] Built 1 zonelists, mobility grouping on.  Total pages:
> 130048
> [    0.000000] Kernel command line: console=ttyO0,115200n8
> root=/dev/ram0 ip=dhcp
>
> According to the documentation, the following:
> 2.10.1. Building Out-of-Tree Modules on the Target
> https://www.yoctoproject.org/docs/latest/kernel-dev/kernel-dev.html
>
> I tried to find /usr/src/kernels/5.0.14... Directory, since I see
> from the build that kernel-dev and kernel-devsrc are included:
> [user at fedora29-ssd bbb-yocto]$ bitbake -s | grep kernel
> core-image-kernel-dev                                 :1.0-r0
> kernel-devsrc                                         :1.0-r0
> kernel-selftest                                       :1.0-r0
>
> THE PROBLEM: But I could not find ob BBB target /usr/src/kernels
> directory at all!?
>

devsrc puts the source in /usr/src/kernel/ and also makes a symlink to
/lib/modules/<version>/source

Was /usr/src/kernels/ a typo ? If you aren't seeing the source in either of
the two locations I mention above, then we do have a bug.
You also have to recreate the scripts/tools in that source directory before
building, via a 'make scripts prepare' in the /usr/src/kernel directory.


>
> Two questions here?
> [1] Do you have any advice on this problem (what I am missing here)?
> [2] Alternative to [1]: how I can use cross compiler from
> .../build/tmp to build Out-of-Tree Module for the BBB target on the
> host?
>

Are you talking about doing this by hand ? in the SDK or with a recipe ? If
it is via SDK or recipe, then everything is setup to work if you follow the
hello-world module example in meta-skeleton. If you are trying to invoke
things using another build system, there are more hoops to jump through.

The yocto QA steps do perform out of tree kernel module builds, so it
should be working.

I checked and the yocto mega manual should be up to date in this area, if
it isn't, raising a bug in the tracker would point us to where it has gone
stale (since it does look like you've been using it, so there very well
could be an issue).

Bruce



>
> Thank you,
> Zoran
> _______
> --
> _______________________________________________
> yocto mailing list
> yocto at yoctoproject.org
> https://lists.yoctoproject.org/listinfo/yocto
>


-- 
- Thou shalt not follow the NULL pointer, for chaos and madness await thee
at its end
- "Use the force Harry" - Gandalf, Star Trek II
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.yoctoproject.org/pipermail/yocto/attachments/20190512/d4d230ee/attachment.html>


More information about the yocto mailing list