Project

General

Profile

Customizing the Kernel with Yocto

Customizing mitysom5csx_devkit_defconfig

The base defconfig that is built with meta-cl-socfpga is mitysom5csx_devkit_defconfig. It can be altered in a custom layer using what Yocto calls configuration fragments. These fragments are created based off of the delta of the custom defconfig and mitysom5csx_devkit_defconfig.

Here are the steps to create a configuration fragment:
  1. Enter the yocto environment
    . oe-init-build-env
    
  2. Run the following to setup the .config
    bitbake virtual/kernel -c kernel_configme -f
    
  3. Run the following to enter menuconfig
    bitbake virtual/kernel -c menuconfig
    
  4. Make the changes to the configuration through menuconfig
  5. After you're done hit save and use all the default settings
  6. Hit exit
  7. Run the following to create the fragment:
    bitbake virtual/kernel -c diffconfig
    
  8. The fragment is located in the following path(NOTE: yours might be slight different due HEAD SHA is in the path name):
    tmp/work/mitysom_c5-poky-linux-gnueabi/linux-cl-socfpga-ltsi/4.9.78-ltsi+gitAUTOINC+09db60d83c-r0/fragment.cfg
    

Once you have your fragment you can add it to your custom layer. An example layer can be downloaded here: meta-example.tar.gz

This layer has a configuration fragment that adds the Altera UART driver as a module and adds in a device that will use this driver.

The Structure looks like the following:

├── conf
│   └── layer.conf
└── recipes-kernel
    └── linux
        ├── linux-cl-socfpga-ltsi
        │   ├── fragment.cfg [configuration fragment with the added UART driver]
        │   └── socfpga_mitysom5csx_devkit_with_uart.dts [device tree which adds a soft UART core to the lightweight bus]
        └── linux-cl-socfpga-ltsi_4.9.78.bbappend [bitbake append file which appends to the normal kernel build and adds in the fragment and device tree]

Instead of using fragments you can add your entire defconfig to your custom layer. To do this you need to create the structure like above but add your defconfig (must be named defconfig) to the linux-cl-socfpga-ltsi instead of the fragment.cfg and update the bbappend's SRC_URI to point to it instead of the fragment.

For further information please visit the yocto kernel manual: https://www.yoctoproject.org/docs/2.4/kernel-dev/kernel-dev.html

Go to top
Add picture from clipboard (Maximum size: 1 GB)