porting guide errors

cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 

porting guide errors

5,145 Views
davidvescovi
Contributor V

I am following i.MX Porting Guide , Rev. LF5.10.35_2.0.0, 30 June 2021 (the latest to date)

I can build the whole demo image and the linux-imx kernel just fine for the standard iMX8mp evk

I am attempting to use section 2.1.2  How to build and load Kernel in Yocto Project

I followed the instructions exactly but can not get my custom kernel to build.

I have a modified MACHINE name and I have a slightly modified kernel defconfig that just adds some extra drivers, I renamed "custom_defconfig" and placed it in a modified recipe under my new layer.

i.e. recipes-kernel/linux_imx/files

I have linux-imx_5.10.bbappend with just the following:

FILESEXTRAPATHS_prepend := "${THISDIR}/${PN}:"
SRC_URI_append = "file://custom_defconfig"

COMPATIBLE_MACHINE = "(mx8)"

 

I set my custom layer to a high priority (10)

I have no patches ... just added another kernel driver only

I can tell my custom layer is being picked up by using  bitbake-layers show-layers that is ok

when I run bitbake linux-imx it seems to stall at the do_fetch stage.

There is something quite obviously wrong with the documentation as written.

I have tried this several times with several different permutations but nothing works.

I can only conclude it was never tested with the latest release. I can see several of the linux-imx bitbake tasks were changed from what I remember in previously releases, maybe that has something to do with it?

Afer a LOOOONG time in the do_fetch I get this warning:

NOTE: Executing Tasks
WARNING: linux-imx-5.10.35+gitAUTOINC+ef3f2cfc60-r0 do_fetch: Failed to fetch URL git://source.codeaurora.org/external/imx/linux-imx.git;protocol=https;branch=lf-5.10.yfile://custom_defconfig, attempting MIRRORS if available
C

It then tries mirror etc.

I do not know why it is trying fetch custom_defconfig remotely as it is local.

 

 

 

 

 

6 Replies

4,509 Views
kevinrowland
Contributor IV
Failed to fetch URL git://source.codeaurora.org/external/imx/linux-imx.git;protocol=https;branch=lf-5.10.yfile://custom_defconfig

If this is copy-pasted directly from your build machine without modification, then you've just missed adding whitespace between your SRC_URI entries.

In general you should use the "+=" operator with SRC_URI, which automatically appends with spaces (ref).

0 Kudos

5,134 Views
davidvescovi
Contributor V

seems I am not the only one having this issue

Re: howto add my kernel defconfig file to yocto - NXP Community

5,129 Views
davidvescovi
Contributor V

It seems the in-tree kernel recipe  now kind of follows the Qoriq builds and the documentation has not caught up.

I was able to insert a kernel configuration fragment by creating a linux-imx_5.10.bbappend file with the following:

FILESEXTRAPATHS_prepend := "${THISDIR}/files:"

# add custom fragment
SRC_URI += "file://build/custom.cfg"

DELTA_KERNEL_DEFCONFIG = "custom.cfg"

 

Note: "${THISDIR}/files:" and SRC_URI += "file://build/custom.cfg" to place fragment at proper directory

 

 

2,948 Views
portheng
Contributor I

Thanks for your solution. For some reasons all my configuration fragments are not being applied and `kernel_configcheck` told me it's being overridden by the defconfig without telling me why; I have been pulling my hair out over this, and I had been closely following Yocto kirkstone guide to create configuration fragments. 

Adding this `DELTA_KERNEL_DEFCONFIG = "custom.cfg"` seems to be the difference maker for linux-imx kernel recipes, and it has finally applied the appropriate fragments. 

Edit: Looking through `linux-imx_5.10.bb` in "meta-imx/meta-bsp/recipes-kernel/linux/linux-imx_5.10.bb" suggests that this is why config fragments don't work.

# Use a verbatim copy of the defconfig from the linux-imx repo.
# IMPORTANT: This task effectively disables kernel config fragments
# since the config fragments applied in do_kernel_configme are replaced.
addtask copy_defconfig after do_kernel_configme before do_kernel_localversion
do_copy_defconfig () {
install -d ${B}
if [ ${DO_CONFIG_V7_COPY} = "yes" ]; then
# copy latest IMX_KERNEL_CONFIG_AARCH32 to use for mx6, mx6ul and mx7
mkdir -p ${B}
cp ${S}/arch/arm/configs/${IMX_KERNEL_CONFIG_AARCH32} ${B}/.config
else
# copy latest IMX_KERNEL_CONFIG_AARCH64 to use for mx8
mkdir -p ${B}
cp ${S}/arch/arm64/configs/${IMX_KERNEL_CONFIG_AARCH64} ${B}/.config
fi
}

0 Kudos

2,870 Views
vik
Contributor II

One alternative is to modify copy_defconfig function in recipe to:
-# Use a verbatim copy of the defconfig from the linux-imx repo.
-# IMPORTANT: This task effectively disables kernel config fragments
-# since the config fragments applied in do_kernel_configme are replaced.
-addtask copy_defconfig after do_kernel_configme before do_kernel_localversion
+addtask copy_defconfig after do_patch before do_preconfigure
And then you just specify your kernel fragments in SRC_URI. 

What I missed here is how to modify function in .bbappend recipe, so I had to change it in .bb.

0 Kudos

3,040 Views
paolamg
Contributor II

@davidvescovi @kevinrowland 
I couldn't use my custom defconfig, but with fragments it worked, adding in my "linux-imx_5.10.bbappend":

FILESEXTRAPATHS_prepend := "${THISDIR}/files:"

SRC_URI_append = " \
  file://custom1.cfg \
  file://custom2.cfg \
"

DELTA_KERNEL_DEFCONFIG_append = "custom1.cfg custom2.cfg"

without the reference to a "build" directory and appending to DELTA_KERNEL_DEFCONFIG

Build Configuration:
BB_VERSION = "1.50.0"
BUILD_SYS = "x86_64-linux"
NATIVELSBSTRING = "ubuntu-20.04"
TARGET_SYS = "arm-poky-linux-gnueabi"
MACHINE = "imx6soloce"
DISTRO = "fsl-imx-x11"
DISTRO_VERSION = "5.10-hardknott"
TUNE_FEATURES = "arm vfp cortexa9 neon thumb callconvention-hard"
TARGET_FPU = "hard"

Thanks