Andrew Geissler | f034379 | 2020-11-18 10:42:21 -0600 | [diff] [blame] | 1 | .. SPDX-License-Identifier: CC-BY-SA-2.0-UK |
Andrew Geissler | c9f7865 | 2020-09-18 14:11:35 -0500 | [diff] [blame] | 2 | |
| 3 | ********************** |
| 4 | Kernel Development FAQ |
| 5 | ********************** |
| 6 | |
Andrew Geissler | c9f7865 | 2020-09-18 14:11:35 -0500 | [diff] [blame] | 7 | Common Questions and Solutions |
| 8 | ============================== |
| 9 | |
William A. Kennington III | ac69b48 | 2021-06-02 12:28:27 -0700 | [diff] [blame] | 10 | Here are some solutions for common questions. |
Andrew Geissler | c9f7865 | 2020-09-18 14:11:35 -0500 | [diff] [blame] | 11 | |
| 12 | How do I use my own Linux kernel ``.config`` file? |
| 13 | -------------------------------------------------- |
| 14 | |
| 15 | Refer to the |
Andrew Geissler | 09209ee | 2020-12-13 08:44:15 -0600 | [diff] [blame] | 16 | ":ref:`kernel-dev/common:changing the configuration`" |
Andrew Geissler | c9f7865 | 2020-09-18 14:11:35 -0500 | [diff] [blame] | 17 | section for information. |
| 18 | |
| 19 | How do I create configuration fragments? |
| 20 | ---------------------------------------- |
| 21 | |
| 22 | A: Refer to the |
Andrew Geissler | 09209ee | 2020-12-13 08:44:15 -0600 | [diff] [blame] | 23 | ":ref:`kernel-dev/common:creating configuration fragments`" |
Andrew Geissler | c9f7865 | 2020-09-18 14:11:35 -0500 | [diff] [blame] | 24 | section for information. |
| 25 | |
| 26 | How do I use my own Linux kernel sources? |
| 27 | ----------------------------------------- |
| 28 | |
| 29 | Refer to the |
Andrew Geissler | 09209ee | 2020-12-13 08:44:15 -0600 | [diff] [blame] | 30 | ":ref:`kernel-dev/common:working with your own sources`" |
Andrew Geissler | c9f7865 | 2020-09-18 14:11:35 -0500 | [diff] [blame] | 31 | section for information. |
| 32 | |
Andrew Geissler | 595f630 | 2022-01-24 19:11:47 +0000 | [diff] [blame] | 33 | How do I install/not-install the kernel image on the root filesystem? |
| 34 | --------------------------------------------------------------------- |
Andrew Geissler | c9f7865 | 2020-09-18 14:11:35 -0500 | [diff] [blame] | 35 | |
| 36 | The kernel image (e.g. ``vmlinuz``) is provided by the |
| 37 | ``kernel-image`` package. Image recipes depend on ``kernel-base``. To |
| 38 | specify whether or not the kernel image is installed in the generated |
Patrick Williams | 0ca19cc | 2021-08-16 14:03:13 -0500 | [diff] [blame] | 39 | root filesystem, override ``RDEPENDS:${KERNEL_PACKAGE_NAME}-base`` to include or not |
Andrew Geissler | c9f7865 | 2020-09-18 14:11:35 -0500 | [diff] [blame] | 40 | include "kernel-image". See the |
Patrick Williams | 0ca19cc | 2021-08-16 14:03:13 -0500 | [diff] [blame] | 41 | ":ref:`dev-manual/common-tasks:appending other layers metadata with your layer`" |
Andrew Geissler | c9f7865 | 2020-09-18 14:11:35 -0500 | [diff] [blame] | 42 | section in the |
| 43 | Yocto Project Development Tasks Manual for information on how to use an |
| 44 | append file to override metadata. |
| 45 | |
| 46 | How do I install a specific kernel module? |
| 47 | ------------------------------------------ |
| 48 | |
| 49 | Linux kernel modules are packaged individually. To ensure a |
| 50 | specific kernel module is included in an image, include it in the |
Andrew Geissler | 4c19ea1 | 2020-10-27 13:52:24 -0500 | [diff] [blame] | 51 | appropriate machine :term:`RRECOMMENDS` variable. |
Andrew Geissler | c9f7865 | 2020-09-18 14:11:35 -0500 | [diff] [blame] | 52 | These other variables are useful for installing specific modules: |
Andrew Geissler | 4c19ea1 | 2020-10-27 13:52:24 -0500 | [diff] [blame] | 53 | - :term:`MACHINE_ESSENTIAL_EXTRA_RDEPENDS` |
| 54 | - :term:`MACHINE_ESSENTIAL_EXTRA_RRECOMMENDS` |
| 55 | - :term:`MACHINE_EXTRA_RDEPENDS` |
| 56 | - :term:`MACHINE_EXTRA_RRECOMMENDS` |
| 57 | |
Andrew Geissler | c9f7865 | 2020-09-18 14:11:35 -0500 | [diff] [blame] | 58 | For example, set the following in the ``qemux86.conf`` file to include |
| 59 | the ``ab123`` kernel modules with images built for the ``qemux86`` |
Andrew Geissler | c926e17 | 2021-05-07 16:11:35 -0500 | [diff] [blame] | 60 | machine:: |
Andrew Geissler | c9f7865 | 2020-09-18 14:11:35 -0500 | [diff] [blame] | 61 | |
| 62 | MACHINE_EXTRA_RRECOMMENDS += "kernel-module-ab123" |
| 63 | |
Andrew Geissler | 4c19ea1 | 2020-10-27 13:52:24 -0500 | [diff] [blame] | 64 | For more information, see the |
Andrew Geissler | 09209ee | 2020-12-13 08:44:15 -0600 | [diff] [blame] | 65 | ":ref:`kernel-dev/common:incorporating out-of-tree modules`" section. |
Andrew Geissler | c9f7865 | 2020-09-18 14:11:35 -0500 | [diff] [blame] | 66 | |
| 67 | How do I change the Linux kernel command line? |
| 68 | ---------------------------------------------- |
| 69 | |
| 70 | The Linux kernel command line is |
Andrew Geissler | 0903674 | 2021-06-25 14:25:14 -0500 | [diff] [blame] | 71 | typically specified in the machine config using the :term:`APPEND` variable. |
Andrew Geissler | c9f7865 | 2020-09-18 14:11:35 -0500 | [diff] [blame] | 72 | For example, you can add some helpful debug information doing the |
Andrew Geissler | c926e17 | 2021-05-07 16:11:35 -0500 | [diff] [blame] | 73 | following:: |
Andrew Geissler | c9f7865 | 2020-09-18 14:11:35 -0500 | [diff] [blame] | 74 | |
| 75 | APPEND += "printk.time=y initcall_debug debug" |
| 76 | |