Skip to content

Instantly share code, notes, and snippets.

@splatch
Last active July 13, 2020 12:48
Show Gist options
  • Save splatch/b5819cb575ac2df2f715d1a222b70e76 to your computer and use it in GitHub Desktop.
Save splatch/b5819cb575ac2df2f715d1a222b70e76 to your computer and use it in GitHub Desktop.
A (non) working sample how to append additional modules to custom distro created via yocto build.
FILESEXTRAPATHS_prepend := "${THISDIR}/${PN}:"
SRC_URI += " \
file://enable_can.cfg \
"
KERNEL_MODULE_AUTOLOAD_append_can = "can"
KERNEL_MODULE_AUTOLOAD_append_canraw = "can-raw"
KERNEL_MODULE_AUTOLOAD_append_gsusb = "gs_usb"
KERNEL_MODULE_AUTOLOAD_append_slcan = "slcan"
KERNEL_MODULE_PROBECONF_append_can = "can"
KERNEL_MODULE_PROBECONF_append_canraw = "can-raw"
KERNEL_MODULE_PROBECONF_append_gsusb = "gs_usb"
KERNEL_MODULE_PROBECONF_append_slcan = "slcan"
CONFIG_CAN=m
CONFIG_CAN_DEV=m
CONFIG_CAN_RAW=m
CONFIG_CAN_GS_USB=m
CONFIG_CAN_SLCAN=m
FILESEXTRAPATHS_prepend := "${THISDIR}/${PN}:"
SRC_URI += "file://enable_qmi_driver.cfg"
require enable-can.inc
@splatch
Copy link
Author

splatch commented Jul 13, 2020

Output of the appends

# $KERNEL_MODULES_META_PACKAGE
#   set? /work/poky/meta/classes/kernel-module-split.bbclass:33
#     "${@ d.getVar("KERNEL_PACKAGE_NAME") or "kernel" }-modules"
KERNEL_MODULES_META_PACKAGE="kernel-modules"
#
# $KERNEL_MODULE_AUTOLOAD [5 operations]
#   set /work/poky/meta/conf/documentation.conf:246
#     [doc] "Lists kernel modules that need to be auto-loaded during boot"
#   _append[core2-32-intel-common] /work/meta-intel/recipes-kernel/linux/linux-intel_4.19.bb:17
#     " uio"
#   _append[corei7-64-intel-common] /work/meta-intel/recipes-kernel/linux/linux-intel_4.19.bb:18
#     " uio"
#   _append[can] /repo/recipes-kernel/linux/enable-can.inc:7
#     "can can-dev can-raw gs_usb slcan"
#   override[intel-x86-common]:set /work/meta-intel/recipes-kernel/linux/meta-intel-compat-kernel.inc:13
#     " ${INTEL_COMMON_AUTOLOAD}"
# pre-expansion value:
#   " ${INTEL_COMMON_AUTOLOAD} uio"
KERNEL_MODULE_AUTOLOAD="  uio iwlwifi i915 uio"
#
# $KERNEL_MODULE_AUTOLOAD_intel-x86-common
#   set /work/meta-intel/recipes-kernel/linux/meta-intel-compat-kernel.inc:13
#     " ${INTEL_COMMON_AUTOLOAD}"
KERNEL_MODULE_AUTOLOAD_intel-x86-common="  uio iwlwifi i915"
#
# $KERNEL_MODULE_PACKAGE_PREFIX
#   set? /work/poky/meta/classes/kernel-module-split.bbclass:35
#     ""
KERNEL_MODULE_PACKAGE_PREFIX=""
#
# $KERNEL_MODULE_PACKAGE_SUFFIX
#   set? /work/poky/meta/classes/kernel-module-split.bbclass:36
#     "-${KERNEL_VERSION}"
KERNEL_MODULE_PACKAGE_SUFFIX="-None"
#
# $KERNEL_MODULE_PROBECONF
#   set /work/poky/meta/conf/documentation.conf:247
#     [doc] "Lists kernel modules for which the build system expects to find module_conf_* values that specify configuration for each of the modules"
#

@splatch
Copy link
Author

splatch commented Jul 13, 2020

Output of bitbake -e with KERNEL_MODULE_AUTOLOAD_append = " "

# $KERNEL_MODULE_AUTOLOAD [5 operations]
#   set /work/poky/meta/conf/documentation.conf:246
#     [doc] "Lists kernel modules that need to be auto-loaded during boot"
#   _append[core2-32-intel-common] /work/meta-intel/recipes-kernel/linux/linux-intel_4.19.bb:17
#     " uio"
#   _append[corei7-64-intel-common] /work/meta-intel/recipes-kernel/linux/linux-intel_4.19.bb:18
#     " uio"
#   _append /repo/recipes-kernel/linux/enable-can.inc:7
#     " can can-dev can-raw gs_usb slcan "
#   override[intel-x86-common]:set /work/meta-intel/recipes-kernel/linux/meta-intel-compat-kernel.inc:13
#     " ${INTEL_COMMON_AUTOLOAD}"
# pre-expansion value:
#   " ${INTEL_COMMON_AUTOLOAD} uio can can-dev can-raw gs_usb slcan "
KERNEL_MODULE_AUTOLOAD="  uio iwlwifi i915 uio can can-dev can-raw gs_usb slcan "

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment