1. Article purpose
This article is intended for Distribution Package users (see Which Package better suits your needs for more information).
This page explains how to change the kernel configuration.
2. Prerequisites
The environment must be installed using the Distribution Package adapted to your selected microprocessor device, STM32MP1 Distribution Package for Android. You must get kernel sources as explained in How to build kernel for Android.
To be able to execute following instructions you need to work from your distribution root directory STM32MP1 Distribution Package for Android, initialise your environment and then run lunch
:
source build/envsetup.sh lunch aosp-eval-userdebug
3. Updating the kernel configuration
By using menuconfig
, you can update the configuration file for your needs. Some guidelines are given below.
3.1. Saving the current configuration
Before making any changes to the kernel configuration, it is advised to save your current configuration in a defconfig.default
file which is in the same format as used by the Linux kernel defconfig files:
build_kernel defaultconfig
A default config file named defconfig.default
is generated in out-bsp/stm32mp1/KERNEL_OBJ/
directory which can the be copied to a safe location.
3.2. Creating a new kernel configuration
Start menuconfig
:
build_kernel menuconfig
You can load a .config
file and modify any entry using this interface. Please read on the top of the windows the instructions to navigate.
Do not forget to hit save. This will generate a .config
file located in out-bsp/stm32mp1/KERNEL_OBJ/
.
3.3. Applying the newly generated kernel configuration
You need to compare the defconfig.default
file with the one create above. You can you a graphical tool like meld
.
meld out-bsp/stm32mp1/KERNEL_OBJ/myNewConfig.config out-bsp/stm32mp1/KERNEL_OBJ/defconfig.default
Then report the changes to the android-soc.config
file located in device/stm/stm32mp1-kernel/source/kconfig/<kernel version>/
.
3.4. Rebuilding the kernel
After having made the changes to android-soc.config
, you can rebuild the kernel by invoking the command below. For more details, refer to How to build kernel for Android.
build_kernel
4. Changing the default kernel command line
You can customize the kernel command line call at boot time.
Arguments are defined in the BoardConfig.mk
file located in device/stm/stm32mp1/<Board>/
.
Change the value of the BOARD_KERNEL_CMDLINE variable to your needs.
5. Changing the Device Tree
The kernel device tree (DTB0 or DTB1) used is set in the dt.mk
file available in the device/stm/stm32mp1/build/tasks/
directory.
This file is located inside the Linux kernel source code previously loaded and can be modified directly in device/stm/stm32mp1-kernel/linux-stm32mp1/arch/arm/boot/dts
.