This thread has been locked.

If you have a related question, please click the "Ask a related question" button in the top right corner. The newly created question will be automatically linked to this question.

TDA4VM-Q1: [Q] about the "Customizing own kernel source"

Part Number: TDA4VM-Q1
Other Parts Discussed in Thread: TDA4VM

Dear,

I am building the "Processor SDK Linux for J721e 09_01_00" in your site. ( https://software-dl.ti.com/jacinto7/esd/processor-sdk-linux-jacinto7/latest/exports/docs/linux/Overview_Building_the_SDK.html#quick-start )

I follow the order in your site and this building was completed.

Also, this image work in your EVK board.

Then, I want to change the customizing the linux kernel and pleaes let me know " What do I do for the customizing the linux kernel ? ".

As the "the customizing the linux kernel" is " work with our own kernel source ".

It's for example in " https://variwiki.com/index.php?title=Yocto_Customizing_the_Linux_kernel&release=mx8mp-yocto-mickledore-6.1.36_2.1.0-v1.1 "

As this site is " Use a local repository"

>>  Setup Yocto

$ cd ~/var-fsl-yocto
$ MACHINE=imx8mp-var-dart DISTRO=fsl-imx-xwayland . var-setup-release.sh build_xwayland

>> Get the source code

$  bitbake -c patch virtual/kernel
$ mkdir -p ../local_repos/linux-imx
$ cp -a tmp/work-shared/imx8mp-var-dart/kernel-source/. ../local_repos/linux-imx
$ cd ../local_repos/linux-imx
$ git reset --hard
$ git clean -fdx

>> Make your changes in the source code and commit them.

$ cd ~/var-fsl-yocto/local_repos/linux-imx
$ gedit arch/arm64/boot/dts/freescale/imx8mp-var-dart.dts
edit and save

$ git commit -a -m "my device tree changes"

best regards,

hosung shin.

  • Hello Hosung,

    As the "the customizing the linux kernel" is " work with our own kernel source ".

    Can you tell us what custom kernel you are referring to here? Is this a TDA4VM kernel or some other platform?

    Please note that we do not support our competition platform. Let us know.

    Thanks.

  • Hi Praveen,

    Of course, It's your kernel ( TDA4VM kernel >> after building,  this is the directory : yocto-build/build/arago-tmp-default-glibc/work-shared/j721e-evm/kernel-source )

    best regards,

    hosung shin.

  • Hi Hosung,

    Do you want to use a customized kernel within a Yocto build so bitbake picks up your custom kernel, or do you have an existing system and just want to rebuild the kernel and install it onto the system?

    For just rebuilding the kernel, instructions can be found here: J721E Kernel User Guide.

    Best,
    Jared

  • Hi Jared,

    I was going to inquire about this J721E kernel User guide.

    Please confirm if my understanding is correct.

    I used the NXP yorto project in first time, then, your yorto project(TDA4VM) is second time.

    As you know, the NXP yorto project ( varisicte project) 's building is like below

    (A) environment setup : MACHINE=imx8mp-var-dart DISTRO=fsl-imx-xwayland . var-setup-release.sh build_xwayland

    (B) kernel modified  : gedit arch/arm64/boot/dts/freescale/imx8mp-var-dart.dts /  git commit -a -m "my device tree changes"

    (C) compile : bitbake image_full 

    (D) image : make this image for SD card  (  imx-image-full-imx8qmmek-20240305234652.rootfs.wic.bz2 )

    Then, your project ( TDA4VM )'s buidling is like below

    (A-1) environment setup : . conf/setenv  / echo 'ARAGO_BRAND = "edgeai"' >> conf/local.conf

    (B-1) kernel modified : 

              kernel environment : export PATH=<sdk path>/linux-devkit/sysroots/x86_64-arago-linux/usr/bin/aarch64-oe-linux:$PATH

                                               make ARCH=arm64 CROSS_COMPILE=aarch64-oe-linux- <defconfig>

              source modified...( >> arch/arm64/boot/dts/freescale/imx8mp-var-dart.dts )

              make ARCH=arm64 CROSS_COMPILE=aarch64-oe-linux- Imag

             change “linux.bin” to “<path-to-tisdk>/board-support/prebuilt-images/Image”.

    (C-1) compile : MACHINE=j721e-evm  bitbake -k tisdk-edgeai-image

    (D-1) image : make the image for SD card  ( tisdk-edgeai-image-j721e-evm-20240306095053.rootfs.wic.xz)

    If that's a right, your (B-1) is a very difficult.

    Is there a way to reduce (B-1) to (B) ?

    best regards,

    hosung shin.

  • Hi Hosung,

    To create a new image in Yocto, you can make a new layer and create a bbappend to edit the kernel with any patches you make. More in-depth instructions can be found within the Yocto project's documentation.

    You could also use a bbappend to change where the recipe is grabbing the kernel from, and change it to a local file/directory instead for git.ti.com.

    Best,
    Jared

  • Hi Jared,

    As you said " You could also use a bbappend to change where the recipe is grabbing the kernel from, and change it to a local file/directory instead for git.ti.com "

    That's what I wanted.

    Could you supported the detailed information for that.

    I am already trying it, but, it doesn't work.

    My changed point in linux-ti-staging_6.1.bb 

    Please, advice for my changed point

    [before]

    KERNEL_GIT_URI ?= "git://git.ti.com/git/ti-linux-kernel/ti-linux-kernel.git"
    KERNEL_GIT_PROTOCOL = "https"
    SRC_URI += "${KERNEL_GIT_URI};protocol=${KERNEL_GIT_PROTOCOL};branch=${BRANCH} \
                          file://defconfig"

    [after]

    KERNEL_GIT_URI ?= "git://$(BSPDIR)/board-support/kernel-source"
    KERNEL_GIT_PROTOCOL = "file"
    SRC_URI += "${KERNEL_GIT_URI};protocol=${KERNEL_GIT_PROTOCOL};branch=${BRANCH} \
                          file://defconfig"

    best regards,

    hosung shin.

  • Hi Hosung,

    I assume BSPDIR is the location of the directory you want. Did you use parenthesis or braces to surround it? They should be braces. Can you also append a / to the end of your KERNEL_GIT_URI variable?

    Best,
    Jared

  • Hi Jared,

    Sure, I used it like below..

    also, the "/home/wise/ext_hdd2/shs/ti-tda4vm-bspbase1/board-support/kernel-source " is the kernel source code.

    ## [tenchi]
    BSPDIR = "/home/wise/ext_hdd2/shs/ti-tda4vm-bspbase1"
    KERNEL_GIT_URI ?= "git://$(BSPDIR)/board-support/kernel-source"
    KERNEL_GIT_PROTOCOL = "file"
    SRC_URI += "${KERNEL_GIT_URI};protocol=${KERNEL_GIT_PROTOCOL};branch=${BRANCH} \
                           file://defconfig"

    But, It was happend the building error like below..

    also I attached this error log file ( builderror1.log ) 

    NOTE: Started PRServer with DBfile: /home/wise/ext_hdd2/shs/ti-tda4vm-bspbase1/yocto-build/build/cache/prserv.sqlite3, Address: 127.0.0.1:33615, PID: 1791728
    Loading cache...done.
    Loaded 9394 entries from dependency cache.
    Parsing recipes...done.
    Parsing of 6324 .bb files complete (6320 cached, 4 parsed). 9398 targets, 613 skipped, 0 masked, 0 errors.
    NOTE: Resolving any missing task queue dependencies
    NOTE: Resolving any missing task queue dependencies
    NOTE: Resolving any missing task queue dependencies
    NOTE: Resolving any missing task queue dependencies
    NOTE: Resolving any missing task queue dependencies
    NOTE: Resolving any missing task queue dependencies
    
    Build Configuration (mc:default):
    BB_VERSION           = "2.0.0"
    BUILD_SYS            = "x86_64-linux"
    NATIVELSBSTRING      = "ubuntu-20.04"
    TARGET_SYS           = "aarch64-oe-linux"
    MACHINE              = "j721e-evm"
    DISTRO               = "arago"
    DISTRO_VERSION       = "2023.10"
    TUNE_FEATURES        = "aarch64"
    TARGET_FPU           = ""
    meta-arago-distro    
    meta-arago-extras    
    meta-arago-demos     
    meta-arago-test      = "HEAD:769c052cff7eccb08de6d0f1dbcbac5c56b6b77a"
    meta-qt5             = "HEAD:ae8a97f79364bed1abc297636f7933d0e35f22be"
    meta-virtualization  = "HEAD:67b0ef4256a484851f3556d281ca4caa88374388"
    meta-networking      
    meta-python          
    meta-oe              
    meta-gnome           
    meta-filesystems     = "HEAD:8a75c61cce2aa1d6e5a3597ab8fc5a7e6aeae1e4"
    meta-ti-extras       
    meta-ti-bsp          = "HEAD:8a468a00043e824ca85b1065f770b045b5f894d7"
    meta-arm             
    meta-arm-toolchain   = "HEAD:b187fb9232ca0a6b5f8f90b4715958546fc41d73"
    meta                 = "HEAD:11da43b58e19583a9bc16044309610cfb2e86469"
    meta-tisdk           = "HEAD:7a4f8861879ec1ac2675e51e96920989c2522960"
    meta-edgeai          = "HEAD:8e6594ed87582cd9b19e1cf2007d8514fcf03c85"
    
    
    Build Configuration:
    BB_VERSION           = "2.0.0"
    BUILD_SYS            = "x86_64-linux"
    NATIVELSBSTRING      = "ubuntu-20.04"
    TARGET_SYS           = "arm-oe-eabi"
    MACHINE              = "j721e-evm-k3r5"
    DISTRO               = "arago"
    DISTRO_VERSION       = "2023.10"
    TUNE_FEATURES        = "arm armv7a vfp thumb callconvention-hard"
    TARGET_FPU           = "hard"
    meta-arago-distro    
    meta-arago-extras    
    meta-arago-demos     
    meta-arago-test      = "HEAD:769c052cff7eccb08de6d0f1dbcbac5c56b6b77a"
    meta-qt5             = "HEAD:ae8a97f79364bed1abc297636f7933d0e35f22be"
    meta-virtualization  = "HEAD:67b0ef4256a484851f3556d281ca4caa88374388"
    meta-networking      
    meta-python          
    meta-oe              
    meta-gnome           
    meta-filesystems     = "HEAD:8a75c61cce2aa1d6e5a3597ab8fc5a7e6aeae1e4"
    meta-ti-extras       
    meta-ti-bsp          = "HEAD:8a468a00043e824ca85b1065f770b045b5f894d7"
    meta-arm             
    meta-arm-toolchain   = "HEAD:b187fb9232ca0a6b5f8f90b4715958546fc41d73"
    meta                 = "HEAD:11da43b58e19583a9bc16044309610cfb2e86469"
    meta-tisdk           = "HEAD:7a4f8861879ec1ac2675e51e96920989c2522960"
    meta-edgeai          = "HEAD:8e6594ed87582cd9b19e1cf2007d8514fcf03c85"
    
    Initialising tasks...done.
    Sstate summary: Wanted 125 Local 79 Mirrors 0 Missed 46 Current 4555 (63% match, 99% complete)
    NOTE: Executing Tasks
    NOTE: Running task 2140 of 11842 (/home/wise/ext_hdd2/shs/ti-tda4vm-bspbase1/yocto-build/sources/meta-ti/meta-ti-bsp/recipes-kernel/linux/linux-ti-staging_6.1.bb:do_fetch)
    NOTE: recipe linux-ti-staging-6.1.46+gitAUTOINC+5892b80d6b-r0b.arago5_tisdk_1_edgeai_0_edgeai_7: task do_fetch: Started
    WARNING: linux-ti-staging-6.1.46+gitAUTOINC+5892b80d6b-r0b.arago5_tisdk_1_edgeai_0_edgeai_7 do_fetch: Failed to fetch URL git://$(BSPDIR)/board-support/kernel-source;protocol=file;branch=ti-linux-6.1.y, attempting MIRRORS if available
    NOTE: recipe linux-ti-staging-6.1.46+gitAUTOINC+5892b80d6b-r0b.arago5_tisdk_1_edgeai_0_edgeai_7: task do_fetch: Failed
    NOTE: Tasks Summary: Attempted 11724 tasks of which 11723 didn't need to be rerun and 1 failed.
    NOTE: Writing buildhistory
    NOTE: Writing buildhistory took: 4 seconds
    NOTE: Writing buildhistory
    NOTE: Writing buildhistory took: 4 seconds
    
    Summary: 1 task failed:
      /home/wise/ext_hdd2/shs/ti-tda4vm-bspbase1/yocto-build/sources/meta-ti/meta-ti-bsp/recipes-kernel/linux/linux-ti-staging_6.1.bb:do_fetch
    Summary: There was 1 WARNING message.
    Summary: There were 2 ERROR messages, returning a non-zero exit code.
    

    please, advice for this error.

    #######################################

    #######################################

    best regards,

    hosung shin.

  • Hi Hosung,

    Can you change your code to the following?

    ## [tenchi]
    BSPDIR = "/home/wise/ext_hdd2/shs/ti-tda4vm-bspbase1"
    KERNEL_GIT_URI ?= "git://${BSPDIR}/board-support/kernel-source/"
    KERNEL_GIT_PROTOCOL = "file"
    SRC_URI += "${KERNEL_GIT_URI};protocol=${KERNEL_GIT_PROTOCOL};branch=${BRANCH} \
               file://defconfig"

    Best,
    Jared

  • Hi Jared,

    It works( building is OK), Big thanks you for your support.

    best regards,

    hosung shin.