Search by Tags

Customizing Kernel Arguments in Torizon

 

Article updated at 17 Mar 2021
Subscribe for this article updates

Select the version of your OS from the tabs below. If you don't know the version you are using, run the command cat /etc/os-release or cat /etc/issue on the board.



Remember that you can always refer to the Torizon Documentation, there you can find a lot of relevant articles that might help you in the application development.

Torizon 5.2.0

Introduction

The Linux Kernel of TorizonCore accepts certain boot-time arguments (parameters) that configure aspects of the kernel itself or its modules. This article briefly describes the method provided by the TorizonCore Builder tool (which is part of the Torizon platform) to perform such configuration.

To summarize, the procedure to set the custom kernel arguments follows the standard use of TorizonCore Builder, that is:

  1. Install Torizon Core Builder and unpack a base TorizonCore Easy Installer image.
  2. Execute any customizations by issuing commands provided by the tool.
  3. Set custom kernel arguments by issuing the command kernel set_custom_args.
  4. Use the command union to merge the changes onto the base image.
  5. Use the command deploy to deploy them onto the device or to create a new Easy Installer image.

To learn which Linux Kernel version corresponds to the latest TorizonCore versions, check the Embedded Linux Release Matrix.

Prerequisites

Installing TorizonCore Builder

To use TorizonCore Builder, you need to create an alias. Follow the installation instructions on the TorizonCore Builder article. Make sure to:

  • Unpack the TorizonCore image, as explained in the article.
  • Use an empty working directory and navigate to it. This directory is shared (bind-mounted) with the TorizonCore Builder container, and it stores temporary files and the final image.

Basic Procedure

For setting the custom kernel arguments, one would simply run:

$ torizoncore-builder kernel set_custom_args "param1=value1" "param2=value2" "param3=value3"
'custom-kargs_overlay.dts' compiles successfully.
Overlay custom-kargs_overlay.dtbo successfully applied.
Kernel custom arguments successfully configured with "param1=value1 param2=value2 param3=value3".

As shown in the above message, a device tree overlay will be applied to the image to set the custom arguments. This fact can be verified by using the dto status command, which will display the custom-kargs_overlay.dtbo amongst any other applied overlays, like so:

$ torizoncore-builder dto status
Enabled overlays over device tree imx6dl-colibri-eval-v3.dtb:
- colibri-imx6_parallel-rgb_overlay.dtbo
- colibri-imx6_stmpe-ts_overlay.dtbo
- display-edt7_overlay.dtbo
- custom-kargs_overlay.dtbo

Warning: Since the arguments are kept in a device-tree overlay, the user should be careful not to remove that overlay (especially by using dto remove --all) or the arguments will not be present on the deployed image.

Checking the current set of custom kernel arguments

To determine what the current custom kernel arguments are (that is, what configuration would take effect upon the execution of a union command) use:

$ torizoncore-builder kernel get_custom_args
Currently configured custom kernel arguments: "param1=value1 param2=value2 param3=value3".

Finally, it is also possible to clear any applied custom kernel arguments by doing:

$ torizoncore-builder kernel clear_custom_args
Custom kernel arguments successfully cleared.

This will remove the corresponding device-tree overlay (custom-kargs_overlay.dtbo) as done by dto remove.

Deploying the Changes

Now that the custom arguments have been applied, you can use the union and deploy commands to deploy the changes either to your device, or create a custom TorizonCore image for Toradex Easy Installer.

Deploying With Torizon OTA

Get Started With Torizon OTA

Alternatively or in addition to creating a custom image for Toradex Easy Installer, you can deploy your custom kernel arguments using Torizon OTA. Learn how to do it on Signing and Pushing TorizonCore Images to Torizon OTA.