Search code examples
embedded-linuxyoctoopenembeddedlinaro

How can I configure yocto to compile linaro eglibc for kernel 3.10.0


I'm working on a bsp layer for SBC Pine64 and my image is successfully generated but I'm getting "FATAL: kernel too old" when booting init from busybox. I've checked my busybox binary and it's being compiled for kernel 3.14.0.

My kernel is version 3.10 and I've used Linaro 5.3 toolchain. I've tried adding: OLDEST_KERNEL = "3.10.0" and I've also tried using Linaro 4.9 but I still get the same error. I'm using yocto Krogoth and generating core-image-minial. Please, see below a snip of the error from boot log:

[13.068932] EXT4-fs (mmcblk0p2): couldn't mount as ext3 due to feature incompatibilities
[13.086717] EXT4-fs (mmcblk0p2): couldn't mount as ext2 due to feature incompatibilities
[13.112988] EXT4-fs (mmcblk0p2): mounted filesystem with ordered data mode. Opts: (null)
[13.127040] VFS: Mounted root (ext4 filesystem) readonly on device 179:2.
[13.143393] devtmpfs: mounted
[13.151972] Freeing unused kernel memory: 520K (ffffffc0009e4000 - ffffffc000a66000)
FATAL: kernel too old
[13.198566] Kernel panic - not syncing: Attempted to kill init! exitcode=0x00007f00
[13.198566]
[13.218884] CPU: 2 PID: 1 Comm: init Not tainted 3.10.102-pine64 #1
[13.230876] Call trace:

How can I configure yocto to compile linaro eglibc for kernel 3.10.0?

Thx, Montez


Solution

  • When you want to override an existing variable that is not "soft-assigned", which is to say does not use the ?= syntax but instead = syntax, you need to use one of the variables in OVERRIDES as part of changing the value. You can see how overrides work already as in conf/bitbake.conf we have:

    ##################################################################
    # Kernel info.
    ##################################################################
    
    OLDEST_KERNEL = "3.2.0"
    OLDEST_KERNEL_aarch64 = "3.14"
    OLDEST_KERNEL_nios2 = "3.19"
    

    And aarch64 is already found in your overrides list. Fortunately there are other values in that list, and when evaluating variables the ones later in the list in OVERRIDES take precedence. So in your local.conf you can do:

    OLDEST_KERNEL_forcevariable = "3.10"
    

    And then confirm that it has taken effect:

    $ bitbake -e busybox | grep -E ^OLDEST_KERNEL=
    OLDEST_KERNEL="3.10"