Reputation: 3205
I am currently trying to compile a kernel with yocto (jethro). Kernel one can fetch from here (commit 4561d2504e8ea562674070350d27c19357f0d7f0)
git clone --depth 1 --branch pine64-hacks-1.2 --single-branch https://github.com/longsleep/linux-pine64.git linux-pine64
I tried to compile it, and it is a success but integrating it in yocto system gives compilation errors. Looking at the logs, one can think some modules don't work but they can be compiled if not integrated in Yocto. A parameter has not been set, for sure, I just don't know how to proceed to have a similar behaviour in yocto. Some parts of the log that can help to understand.
+ oe_runmake Image CC=aarch64-poky-linux-gcc -fuse-ld=bfd --sysroot=/home/dbensoussan/new_poky/poky/build/tmp/sysroots/pine64 LD=aarch64-poky-linux-ld.bfd --sysroot=/home/dbensoussan/new_poky/poky/build/tmp/sysroots/pine64
+ bbnote make -j 8 Image CC=aarch64-poky-linux-gcc -fuse-ld=bfd --sysroot=/home/dbensoussan/new_poky/poky/build/tmp/sysroots/pine64 LD=aarch64-poky-linux-ld.bfd --sysroot=/home/dbensoussan/new_poky/poky/build/tmp/sysroots/pine64
+ printf %b\0 bbnote make -j 8 Image CC=aarch64-poky-linux-gcc -fuse-ld=bfd --sysroot=/home/dbensoussan/new_poky/poky/build/tmp/sysroots/pine64 LD=aarch64-poky-linux-ld.bfd --sysroot=/home/dbensoussan/new_poky/poky/build/tmp/sysroots/pine64
+ make -j 8 Image CC=aarch64-poky-linux-gcc -fuse-ld=bfd --sysroot=/home/dbensoussan/new_poky/poky/build/tmp/sysroots/pine64 LD=aarch64-poky-linux-ld.bfd --sysroot=/home/dbensoussan/new_poky/poky/build/tmp/sysroots/pine64
GEN /home/dbensoussan/new_poky/poky/build/tmp/work/pine64-poky-linux/linux-pine64/3.10-r0/linux-pine64-standard-build/Makefile
scripts/kconfig/conf --silentoldconfig Kconfig
Here are warnings :
drivers/net/wireless/bcmdhd/Kconfig:50:warning: defaults for choice values not supported
warning: (COMPAT) selects COMPAT_BINFMT_ELF which has unmet direct dependencies (COMPAT && BINFMT_ELF)
GEN /home/dbensoussan/new_poky/poky/build/tmp/work/pine64-poky-linux/linux-pine64/3.10-r0/linux-pine64-standard-build/Makefile
/home/dbensoussan/new_poky/poky/build/tmp/work-shared/pine64/kernel-source/scripts/dtc/updatetree.c: In function 'sunxi_dt_init_pinconf_prop':
/home/dbensoussan/new_poky/poky/build/tmp/work-shared/pine64/kernel-source/scripts/dtc/updatetree.c: In function 'sunxi_dt_init_pinconf_prop':
/home/dbensoussan/new_poky/poky/build/tmp/work-shared/pine64/kernel-source/scripts/dtc/updatetree.c:149:8: warning: variable 'propend' set but not used [-Wunused-but-set-variable]
void *propend;
/home/dbensoussan/new_poky/poky/build/tmp/work-shared/pine64/kernel-source/scripts/dtc/updatetree.c:306:9: warning: variable 'ret' set but not used [-Wunused-but-set-variable]
int i, ret, len, gpio_value[4], phandle, phandle_count;
GEN usr/initramfs_data.cpio
In file included from /home/dbensoussan/new_poky/poky/build/tmp/work-shared/pine64/kernel-source/include/linux/memcontrol.h:22:0,
from /home/dbensoussan/new_poky/poky/build/tmp/work-shared/pine64/kernel-source/include/linux/swap.h:8,
from /home/dbensoussan/new_poky/poky/build/tmp/work-shared/pine64/kernel-source/include/linux/suspend.h:4,
from /home/dbensoussan/new_poky/poky/build/tmp/work-shared/pine64/kernel-source/init/do_mounts.c:16:
/home/dbensoussan/new_poky/poky/build/tmp/work-shared/pine64/kernel-source/include/linux/cgroup.h:907:18: warning: 'struct cgroup_taskset' declared inside parameter list
struct cgroup_taskset *tset)
A lot of cgroup warnings follow and ends with an error and ends the compilation:
/home/dbensoussan/new_poky/poky/build/tmp/work-shared/pine64/kernel-source/security/apparmor/lsm.c:1293:29: error: 'CONFIG_SECURITY_APPARMOR_UNCONFINED_INIT' undeclared here (not in a function)
bool aa_g_unconfined_init = CONFIG_SECURITY_APPARMOR_UNCONFINED_INIT;
My kernel recipe is:
require recipes-kernel/linux/linux-yocto.inc
DESCRIPTION = "Linux kernel for Allwinner a64 processors"
COMPATIBLE_MACHINE = "pine64"
LINUX_VERSION ?= "3.10"
PV = "${LINUX_VERSION}"
SRCREV_pn-${PN} = "6c0b852b9ab4688534c8e978d2d55cf8a26cbd05"
KERNEL_DEVICETREE ?= " \
allwinner/sun50i-a64-pine64.dtb \
allwinner/sun50i-a64-pine64-plus.dtb \
"
KERNEL_IMAGETYPE="Image"
KERNEL_DEFCONFIG_pine64 ?= "defconfig"
DEPENDS_aarch64 += "libgcc"
SRC_URI += "git://github.com/apritzel/linux.git;protocol=git;branch=a64-v4 \
file://defconfig \
"
S = "${WORKDIR}/git"
do_kernel_configme_prepend() {
echo "new custom config install"
install -m 0644 ${S}/arch/${ARCH}/configs/${KERNEL_DEFCONFIG} ${WORKDIR}/defconfig || die "No default configuration for ${MACHINE} / ${KERNEL_DEFCONFIG} available."
}
Upvotes: 1
Views: 1220
Reputation: 471
I'm not sure about the failure, but judging by the error it is unlikely to be related to the build system. There are quite a few things that jump out as being odd in the recipe though:
SRC_URI =
instead of SRC_URI +=
- you appear to have all the items listed that you'd want to fetch, so you should be setting the value not appending to itSRCREV_pn-${PN} =
is ugly - we're already in the context of the recipe so a pn- override should not be necessary. Use SRCREV =
instead.=
instead of ?=
unless you genuinely expect the value to be overridden via the configuration, otherwise your recipe's desired values may never be used if there is a default.DEPENDS_aarch64 +=
line isn't going to do what you probably think it does. It won't add libgcc
to the DEPENDS
, it'll set that value outright as DEPENDS
because the +=
happens immediately and not at the same time as the override, leaving you with DEPENDS_aarch64 = " libgcc"
. Assuming this line is even necessary at all, you should just use DEPENDS +=
since this is a machine-specific recipe - you should always be building for aarch64
, right?SRC_URI
and also copying the defconfig
from the kernel is horrific. Drop all of that and instead set KBUILD_DEFCONFIG = "defconfig"
instead (if that is genuinely the name of the defconfig
file within the source tree under arch/${ARCH}/configs
).Upvotes: 0