Arm Community
Arm Community
  • Site
  • User
  • Site
  • Search
  • User
  • Groups
    • Research Collaboration and Enablement
    • DesignStart
    • Education Hub
    • Innovation
    • Open Source Software and Platforms
  • Forums
    • AI and ML forum
    • Architectures and Processors forum
    • Arm Development Platforms forum
    • Arm Development Studio forum
    • Arm Virtual Hardware forum
    • Automotive forum
    • Compilers and Libraries forum
    • Graphics, Gaming, and VR forum
    • High Performance Computing (HPC) forum
    • Infrastructure Solutions forum
    • Internet of Things (IoT) forum
    • Keil forum
    • Morello Forum
    • Operating Systems forum
    • SoC Design and Simulation forum
    • 中文社区论区
  • Blogs
    • AI and ML blog
    • Announcements
    • Architectures and Processors blog
    • Automotive blog
    • Graphics, Gaming, and VR blog
    • High Performance Computing (HPC) blog
    • Infrastructure Solutions blog
    • Innovation blog
    • Internet of Things (IoT) blog
    • Operating Systems blog
    • Research Articles
    • SoC Design and Simulation blog
    • Tools, Software and IDEs blog
    • 中文社区博客
  • Support
    • Arm Support Services
    • Documentation
    • Downloads
    • Training
    • Arm Approved program
    • Arm Design Reviews
  • Community Help
  • More
  • Cancel
Open Source Software and Platforms
Open Source Software and Platforms
Wiki Modify Linux kernel config flags in the Arm Platforms deliverables
  • Help
  • Jump...
  • Cancel
  • About this wiki
  • Supported platforms
  • Obtaining support
  • +Arm Reference Platforms deliverables
  • +A-class platforms
  • +M-class platforms
  • +R-class platforms
  • +FPGA prototyping boards
  • -Open source software
    • -Linux/Android
      • ------- Power management -------
      • cpufreq (DVFS)
      • cpuidle (hotplug)
      • +Energy Aware Scheduling (EAS)
      • System Suspend to RAM
      • ------- Configuration -------
      • +Device Tree
      • Modify Linux kernel config flags in the Arm Platforms deliverables
      • ----- Virtualization -----
      • Spawn a Linux virtual machine on Arm using QEMU (KVM)
      • ------- User-space -------
      • Android
      • Debian
      • Fedora Server
      • OpenEmbedded
      • Build a Buildroot user-space
      • Build an ILP32 user-space
      • BusyBox
    • +Trusted Firmware-A
    • Trusted Firmware-M
    • +EDK II UEFI
    • OP-TEE
    • +U-Boot
    • Robotics
    • Mbed OS
    • +SCP

Modify Linux kernel config flags in the Arm Platforms deliverables

Preface

This article:

  • Compares how an upstream kernel.org kernel is built and how an Arm Platforms deliverables kernel is built.
  • Describes how to enable/disable arbitrary kernel config flags for an Arm Platforms deliverables kernel.

These instructions were written using the Armv8 Base Platform FVP but can be easily adapted for other platforms.

 

Prerequisites

Follow the Arm Platforms instructions for Armv8-A FVPs to initialize an Arm Platforms workspace for a configuration of your choice. In this article we will use a build from source Busybox configuration for the Armv8-A Base Platform FVP:

+-------------+--------------------------------------------------+
| Workspace   | <workspace>                                      |
| Platform    | Armv8-A Base Platform with 64-bit software stack |
| Type        | Built from source                                |
| Environment | Linux kernel + filesystem                        |
| Kernel      | latest-armlt (4.17 commit 9b2769768c)            |
| Filesystem  | Busybox commit 111cdcf295                        |
+-------------+--------------------------------------------------+

Install the Armv8 Base Platform model from Arm Developer.

Install the libncurses5 package.

 

Modifying the Linux kernel

Upstream kernel.org kernels are typically configured using `make menuconfig' to generate a `.config' file listing which flags to set and with what values; the kernel is then built against this config. Users wishing to modify the Linux kernel shipped with the Arm Platforms deliverables will notice that this method of configuring the kernel does not work; the `.config' will be ignored.

This is because the build scripts copy the kernel sources into a platform-specific directory and then generate a new `.config' in that directory by combining a number of configuration "fragments":

The solution is to:

  1. Build the Arm Platforms deliverables without any modifications in order to generate the platform-specific sources and `.config'
  2. Run `make menuconfig' inside the platform-specific directory to modify the generated `.config'
  3. Re-build the Linux kernel outside of the Arm Platforms build system i.e. by running `make'
  4. Re-package the Arm Platforms deliverables to include the modified kernel
### Generate platform-specific sources and .config
cd <workspace>
./build-scripts/build-all.sh all

### Enter platform-specific source directory
### For Armv8-A FVP using Busybox:
cd ./linux/out/fvp/mobile_bb/

### Modify platform-specific .config
make ARCH=arm64 menuconfig

### Re-build kernel using modified .config
### Note: replace `[...]' with the correct version info for your workspace release
make -j8 ARCH=arm64 CROSS_COMPILE=<workspace>/tools/gcc/gcc-linaro-[...]_aarch64-linux-gnu/bin/aarch64-linux-gnu-

### Re-package Arm Platforms deliverables to include the modified kernel
cd <workspace>
./build-scripts/build-all.sh package

WARNING: Do not run `./build-scripts/build-linux.sh package' as this will not package the re-built kernel; also avoid running `./build-scripts/build-all.sh all' as this will trample over your modified `.config'.

To check your changes have been applied, run the kernel on your target platform and then zcat its configuration at runtime:

    zcat /proc/config.gz | grep "CONFIG_VIRTUALIZATION"

In this example we have enabled the CONFIG_VIRTUALIZATION flag:

Before:


After:

  • AEMv8 FVP
  • U-Boot
  • Armv8
  • Linux
  • Share
  • History
  • More
  • Cancel
Related
Recommended