Custom machine for Linux v2.7b3

Hi, I tried to write custom machine for our carrier board which runs OE v2.7b3. I followed the Brandon Shibley’s webinar but there are a lot of changes in structure since then but I made the changes to new structure as best I know. Problem is that when I run bitbake console-tdx-image compilation of kernel fails with this output

ERROR: linux-toradex-4.1-2.0.x-2.7.3 do_compile: oe_runmake failed
ERROR: linux-toradex-4.1-2.0.x-2.7.3 do_compile: Function failed: do_compile (log file is located at /media/data/jurena/oe-core/build/tmp-glibc/work/colibri_imx6_rayservice-angstrom-linux-gnueabi/linux-toradex/4.1-2.0.x-2.7.3/temp/log.do_compile.17155)
ERROR: Logfile of failure stored in: /media/data/jurena/oe-core/build/tmp-glibc/work/colibri_imx6_rayservice-angstrom-linux-gnueabi/linux-toradex/4.1-2.0.x-2.7.3/temp/log.do_compile.17155
Log data follows:
| DEBUG: Executing shell function do_compile
| NOTE: make -j 8 HOSTCC=gcc  HOSTCPP=gcc  -E uImage CC=arm-angstrom-linux-gnueabi-gcc  -mno-thumb-interwork -marm -fuse-ld=bfd LD=arm-angstrom-linux-gnueabi-ld.bfd   LOADADDR=0x10008000
| ERROR: oe_runmake failed
|   CHK     include/config/kernel.release
|   GEN     ./Makefile
|   CHK     include/generated/uapi/linux/version.h
|   CHK     include/generated/utsrelease.h
|   Using /media/data/jurena/oe-core/build/tmp-glibc/work-shared/colibri-imx6-rayservice/kernel-source as source for kernel
| make[3]: 'include/generated/mach-types.h' is up to date.
|   CHK     include/generated/bounds.h
|   CHK     include/generated/asm-offsets.h
|   CALL    /media/data/jurena/oe-core/build/tmp-glibc/work-shared/colibri-imx6-rayservice/kernel-source/scripts/checksyscalls.sh
|   CHK     include/generated/compile.h
|   LD      drivers/cpufreq/built-in.o
| drivers/cpufreq/imx7-cpufreq.o: In function `.LANCHOR1':
| imx7-cpufreq.c:(.bss+0x3c): multiple definition of `soc_reg'
| drivers/cpufreq/imx6q-cpufreq.o:imx6q-cpufreq.c:(.bss+0x30): first defined here
| drivers/cpufreq/imx7-cpufreq.o: In function `.LANCHOR1':
| imx7-cpufreq.c:(.bss+0x24): multiple definition of `arm_reg'
| drivers/cpufreq/imx6q-cpufreq.o:imx6q-cpufreq.c:(.bss+0x20): first defined here
| /media/data/jurena/oe-core/build/tmp-glibc/work-shared/colibri-imx6-rayservice/kernel-source/scripts/Makefile.build:337: recipe for target 'drivers/cpufreq/built-in.o' failed
| make[4]: *** [drivers/cpufreq/built-in.o] Error 1
| /media/data/jurena/oe-core/build/tmp-glibc/work-shared/colibri-imx6-rayservice/kernel-source/scripts/Makefile.build:403: recipe for target 'drivers/cpufreq' failed
| make[3]: *** [drivers/cpufreq] Error 2
| make[3]: *** Waiting for unfinished jobs....
|   CHK     kernel/config_data.h
| /media/data/jurena/oe-core/build/tmp-glibc/work-shared/colibri-imx6-rayservice/kernel-source/Makefile:950: recipe for target 'drivers' failed
| make[2]: *** [drivers] Error 2
| make[2]: *** Waiting for unfinished jobs....
| Makefile:146: recipe for target 'sub-make' failed
| make[1]: *** [sub-make] Error 2
| Makefile:24: recipe for target '__sub-make' failed
| make: *** [__sub-make] Error 2
| ERROR: Function failed: do_compile (log file is located at /media/data/jurena/oe-core/build/tmp-glibc/work/colibri_imx6_rayservice-angstrom-linux-gnueabi/linux-toradex/4.1-2.0.x-2.7.3/temp/log.do_compile.17155)
ERROR: Task (/media/data/jurena/oe-core/build/../layers/meta-toradex-nxp/recipes-kernel/linux/linux-toradex_4.1-2.0.x.bb:do_compile) failed with exit code '1'
NOTE: Tasks Summary: Attempted 3655 tasks of which 3654 didn't need to be rerun and 1 failed.
NOTE: Writing buildhistory

I think that the machine name is somehow badly configure because Makefile obviously tries to compile sources for imx6 and imx7. So my question is that is possible to create custom machine in same way as is descripted in referenced video also for OE 2.7b3?

The layer structure is really simple and I just define necessary files which are needed to create machine.

../layers/meta-rayservice/
├── conf
│   ├── layer.conf
│   └── machine
│       └── colibri-imx6-rayservice.conf
├── recipes-bsp
│   └── u-boot
│       └── u-boot-toradex_2016.11.bbappend
├── recipes-images
│   └── images
│       ├── console-trdx-image.bb
│       └── files
│           └── colibri-imx6-rayservice
│               ├── colibri-imx6-rayservice_bin -> ../../../../../meta-toradex-demos/recipes-images/images/files/colibri-imx6/colibri-imx6_bin/
│               ├── imx_flash -> ../../../../../meta-toradex-demos/recipes-images/images/files/colibri-imx6/imx_flash/
│               └── update.sh
└── recipes-kernel
    └── linux
        └── linux-toradex_4.1-2.0.x.bbappend

Hi

The issue is, that the current linux-toradex_4.1-2.0.x codebase does not allow for both imx6q-cpufreq.c and imx7-cpufreq.c to be linked into the kernel.

(before this commit is was the other way around, the kernel did not link if one did not have both compiled …)

The fix for you would be to provide a specific defconfig for your machine, starting from this one and making sure that you not enable the i.MX 7 specific kernel options.

Max

Cherry-picking the following two commits allows to build a kernel with any combination
of imx6-cpufreq.c and imx7-cpufreq.c.

http://git.toradex.com/cgit/linux-toradex.git/commit/?h=toradex_4.1-2.0.x-imx-next&id=22eb8a911a802e32b5217c48b5b48a38353cf2b4
http://git.toradex.com/cgit/linux-toradex.git/commit/?h=toradex_4.1-2.0.x-imx-next&id=3f68dc7c600c0354f5df7f06b931661319addafb

Edit: fixed the links

Hi, thank you a lot for answer. About the defconfig. I thought it is copied by appending to do_unpack function and because I am just modifing the current colibri-imx6 module I don’t have to make any changes. So I copied suggested defconfig to my recipies folder and added definition to append file so it looks like this

FILESEXTRAPATHS_prepend := "${THISDIR}/:"

SRC_URI += "file://linux-toradex-4.1-2.0.x/colibri-imx6-rayservice/defconfig"

SRCREV = "3f68dc7c600c0354f5df7f06b931661319addafb"

COMPATIBLE_MACHINE = "(colibri-imx6|colibri-imx6-rayservice|apalis-imx6)"

(I removed the do_pack_append function).
I also changed src_rev to latest rev which fixed initial problem, but now I am getting this output

Log data follows:
| DEBUG: Executing shell function do_compile
| NOTE: make -j 8 HOSTCC=gcc  HOSTCPP=gcc  -E uImage CC=arm-angstrom-linux-gnueabi-gcc  -mno-thumb-interwork -marm -fuse-ld=bfd LD=arm-angstrom-linux-gnueabi-ld.bfd   LOADADDR=0x10008000
| ERROR: oe_runmake failed
|   CHK     include/config/kernel.release
|   GEN     ./Makefile
|   CHK     include/generated/uapi/linux/version.h
|   Using /media/data/jurena/oe-core/build/tmp-glibc/work-shared/colibri-imx6-rayservice/kernel-source as source for kernel
|   CHK     include/generated/utsrelease.h
| make[3]: 'include/generated/mach-types.h' is up to date.
|   CHK     include/generated/bounds.h
|   CHK     include/generated/asm-offsets.h
|   CALL    /media/data/jurena/oe-core/build/tmp-glibc/work-shared/colibri-imx6-rayservice/kernel-source/scripts/checksyscalls.sh
|   CHK     include/generated/compile.h
|   CHK     kernel/config_data.h
|   LINK    vmlinux
|   LD      vmlinux.o
|   MODPOST vmlinux.o
|   GEN     .version
|   CHK     include/generated/compile.h
|   UPD     include/generated/compile.h
|   CC      init/version.o
|   LD      init/built-in.o
| drivers/built-in.o: In function `mxc_hdmi_edid_rebuild_modelist':
| coresight-etm-cp14.c:(.text+0x45ac4): undefined reference to `mxc_edid_mode_to_vic'
| drivers/built-in.o: In function `mxc_hdmi_disp_init':
| coresight-etm-cp14.c:(.text+0x45de4): undefined reference to `mxc_cea_mode'
| coresight-etm-cp14.c:(.text+0x45dec): undefined reference to `mxc_cea_mode'
| drivers/built-in.o: In function `mxc_hdmi_read_edid':
| coresight-etm-cp14.c:(.text+0x46b58): undefined reference to `mxc_edid_parse_ext_blk'
| coresight-etm-cp14.c:(.text+0x46bb4): undefined reference to `mxc_edid_parse_ext_blk'
| coresight-etm-cp14.c:(.text+0x46c6c): undefined reference to `mxc_edid_read'
| drivers/built-in.o: In function `mxc_hdmi_setup.constprop.3':
| coresight-etm-cp14.c:(.text+0x4781c): undefined reference to `mxc_edid_mode_to_vic'
| drivers/built-in.o: In function `hotplug_worker':
| coresight-etm-cp14.c:(.text+0x48220): undefined reference to `mxc_cea_mode'
| coresight-etm-cp14.c:(.text+0x48228): undefined reference to `mxc_cea_mode'
| drivers/built-in.o: In function `sii902x_read_edid':
| coresight-etm-cp14.c:(.text+0x559d4): undefined reference to `mxc_edid_read'
| /media/data/jurena/oe-core/build/tmp-glibc/work-shared/colibri-imx6-rayservice/kernel-source/Makefile:936: recipe for target 'vmlinux' failed
| make[2]: *** [vmlinux] Error 1
| Makefile:146: recipe for target 'sub-make' failed
| make[1]: *** [sub-make] Error 2
| Makefile:24: recipe for target '__sub-make' failed
| make: *** [__sub-make] Error 2
| ERROR: Function failed: do_compile (log file is located at /media/data/jurena/oe-core/build/tmp-glibc/work/colibri_imx6_rayservice-angstrom-linux-gnueabi/linux-toradex/4.1-2.0.x-2.7.3/temp/log.do_compile.16507)
ERROR: Task (/media/data/jurena/oe-core/build/../layers/meta-toradex-nxp/recipes-kernel/linux/linux-toradex_4.1-2.0.x.bb:do_compile) failed with exit code '1'
NOTE: Tasks Summary: Attempted 3655 tasks of which 3654 didn't need to be rerun and 1 failed.
NOTE: Writing buildhistory

I must do something really wrong because I just add few files like in video and it breaks compilation completly.

Hi

Note that adding defconfig a second time to SRC_URI is wrong.
That way bitbake searches all paths it searches for local files for two files, once for defconfig and once for linux-toradex-4.1-2.0.x/colibri-imx6-rayservice/defconfig. The fetched later will overwrite the one fetched first.

Then set the FILESEXTRAPATHS_prepend as follows, bitbake will by itself append as subfolder …

FILESEXTRAPATHS_prepend := "${THISDIR}/linux-toradex-4.1-2.0.x:"

The defconfig which you use (which is (or is a copy of) this one I guess) seems to no longer compile. You would have to remove the following line:

# CONFIG_FB_MXC_EDID is not set

Max

Hi,
thanks very much, compilation is now successfull.
If I may just a question. Is there a way how to get rid off the link to machine flash and dist tools which is created in meta-toradex-demos? It not a big deal but I would like to be able just clone my repository with sublayer without aditional changes to other layers.

Once again thank you.
Best regards,
Tomas

I don’t understand the question.
What link?

Brandon is in video creating a symbolic link to new layer from meta-toradex layer. I tried to copy tdx-image-fstype.inc to my layer and override it a little, but my image recipe keeps including tdx-image-fstype.inc from meta-toradex-demos. So without the link to my layer, compilation fails because directory colibri-imx6-rayservice do not exists.

It’s nothing crucial I am just wondering if and how this can be done.

Best, Tomas

I don’t really know.

However instead of digging into this, why not renaming your recipes-images/images/tdx-image-fstype.inc to recipes-images/images/my-image-fstype.inc and changing in your image recipe

require recipes-images/images/my-image-fstype.inc

Max

Yeah that actually did it. Thanks for suggestion.

Best regards,
Tomas