<?xml version="1.0" encoding="UTF-8"?>
<rss xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns:taxo="http://purl.org/rss/1.0/modules/taxonomy/" version="2.0">
  <channel>
    <title>i.MX ProcessorsのトピックRe: Install kernel-headers on target - flexbuild Linux Debian 6.12.49</title>
    <link>https://community.nxp.com/t5/i-MX-Processors/Install-kernel-headers-on-target-flexbuild-Linux-Debian-6-12-49/m-p/2410566#M246591</link>
    <description>&lt;P&gt;Hi,&lt;/P&gt;&lt;P&gt;Yes I quickly figured that trying&amp;nbsp;&lt;STRONG&gt;apt install linux-headers-$(uname -r)&amp;nbsp;&lt;/STRONG&gt;would not give me the right headers.&lt;/P&gt;&lt;P&gt;Thank you for your quick response, I should be able to adopt a workflow that works for me.&lt;/P&gt;</description>
    <pubDate>Wed, 02 Sep 2026 11:31:46 GMT</pubDate>
    <dc:creator>sombreminjaben</dc:creator>
    <dc:date>2026-09-02T11:31:46Z</dc:date>
    <item>
      <title>Install kernel-headers on target - flexbuild Linux Debian 6.12.49</title>
      <link>https://community.nxp.com/t5/i-MX-Processors/Install-kernel-headers-on-target-flexbuild-Linux-Debian-6-12-49/m-p/2410357#M246580</link>
      <description>&lt;P&gt;Hi,&lt;/P&gt;&lt;P&gt;I am developing a custom out-of-tree Linux module for my IMX8MP-EVK board running Debian Linux (built using the latest version of flexbuild). Currently, to build my module, I added it to the Linux sources, modifying the corresponding Kconfig and Makefile. However, I would like to be able to build my module on-target to make the process faster but there are no kernel-headers installed and I can't seem to find how to get them on target.&amp;nbsp;&lt;/P&gt;&lt;P&gt;Could anyone guide me on how to build my Debian Linux with kernel-headers installed ?&lt;/P&gt;&lt;P&gt;Thanks.&lt;/P&gt;&lt;P&gt;Benjamin.&lt;/P&gt;</description>
      <pubDate>Wed, 02 Sep 2026 08:02:09 GMT</pubDate>
      <guid>https://community.nxp.com/t5/i-MX-Processors/Install-kernel-headers-on-target-flexbuild-Linux-Debian-6-12-49/m-p/2410357#M246580</guid>
      <dc:creator>sombreminjaben</dc:creator>
      <dc:date>2026-09-02T08:02:09Z</dc:date>
    </item>
    <item>
      <title>Re: Install kernel-headers on target - flexbuild Linux Debian 6.12.49</title>
      <link>https://community.nxp.com/t5/i-MX-Processors/Install-kernel-headers-on-target-flexbuild-Linux-Debian-6-12-49/m-p/2410476#M246586</link>
      <description>&lt;P&gt;For the i.MX8MP-EVK Debian image built with Flexbuild, the practical answer is:&amp;nbsp;&lt;STRONG&gt;do not rely on&amp;nbsp;apt install linux-headers-$(uname -r)&amp;nbsp;on the target&lt;/STRONG&gt;&amp;nbsp;. The retrieved NXP material shows Flexbuild builds the kernel, DTBs, modules, boot image, and rootfs, but I did not find an i.MX8MP-specific Flexbuild option that generates and preinstalls a matching&amp;nbsp;linux-headers-*&amp;nbsp;package into the Debian rootfs. The supported/clean workflow is to build your out-of-tree module against the&amp;nbsp;&lt;STRONG&gt;same compiled kernel tree&lt;/STRONG&gt;&amp;nbsp;used by Flexbuild, then copy the&amp;nbsp;.ko&amp;nbsp;to the board.&lt;/P&gt;
&lt;P&gt;Recommended workflow:&lt;/P&gt;
&lt;P&gt;cd flexbuild&lt;/P&gt;
&lt;P&gt;. setup.env&lt;/P&gt;
&lt;P&gt;bld docker&lt;/P&gt;
&lt;P&gt;. setup.env&lt;/P&gt;
&lt;P&gt;bld host-dep&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;# Full image, or at least the kernel&lt;/P&gt;
&lt;P&gt;LOG_LEVEL=0 bld -m imx8mpevk&lt;/P&gt;
&lt;P&gt;# or:&lt;/P&gt;
&lt;P&gt;LOG_LEVEL=0 bld linux -m imx8mpevk&lt;/P&gt;
&lt;P&gt;The Debian SDK guide lists&amp;nbsp;bld -m imx8mpevk&amp;nbsp;as the full build command and&amp;nbsp;bld linux -m imx8mpevk&amp;nbsp;as the separate kernel build command; it also says the kernel-related source is under&amp;nbsp;components_lsdk2512/linux/&amp;nbsp;, and the compiled output is under&amp;nbsp;build_lsdk2512/linux/linux/arm64/IMX&amp;nbsp;for the i.MX platform example.&lt;/P&gt;
&lt;P&gt;Then build your external module on the host against that compiled/prepared kernel tree, for example:&lt;/P&gt;
&lt;P&gt;obj-m += my_driver.o&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;KERNEL_SRC ?= /path/to/flexbuild/components_lsdk2512/linux&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;all:&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; $(MAKE) -C $(KERNEL_SRC) M=$(PWD) modules&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;clean:&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; $(MAKE) -C $(KERNEL_SRC) M=$(PWD) clean&lt;/P&gt;
&lt;P&gt;For external modules, NXP’s current i.MX Linux 6.12 guide says the requirements are a compiled kernel, a board running the same kernel version, and a toolchain; it also notes that a full kernel compilation is required to generate the headers and symbol files needed for external module compilation.&amp;nbsp;The same guide uses the standard external-module form:&lt;/P&gt;
&lt;P&gt;make -C $(KERNEL_SRC) M=$(PWD) modules&lt;/P&gt;
&lt;P&gt;and then copies the resulting&amp;nbsp;.ko&amp;nbsp;to the board for&amp;nbsp;insmod&amp;nbsp;.&lt;/P&gt;
&lt;P&gt;If you specifically want&amp;nbsp;&lt;STRONG&gt;on-target&lt;/STRONG&gt;&amp;nbsp;builds, you can manually install a matching prepared kernel tree on the target, but treat it as a manual workaround rather than a documented i.MX8MP Flexbuild “install headers” feature:&lt;/P&gt;
&lt;P&gt;# on target&lt;/P&gt;
&lt;P&gt;sudo mkdir -p /usr/src/linux-headers-$(uname -r)&lt;/P&gt;
&lt;P&gt;sudo ln -sfn /usr/src/linux-headers-$(uname -r) /lib/modules/$(uname -r)/build&lt;/P&gt;
&lt;P&gt;Copy the matching Flexbuild kernel source/build artifacts from the host into that directory, including the generated files and&amp;nbsp;Module.symvers&amp;nbsp;. Then on the target:&lt;/P&gt;
&lt;P&gt;cd /usr/src/linux-headers-$(uname -r)&lt;/P&gt;
&lt;P&gt;make oldconfig&lt;/P&gt;
&lt;P&gt;make prepare&lt;/P&gt;
&lt;P&gt;# or, for module builds:&lt;/P&gt;
&lt;P&gt;make modules_prepare&lt;/P&gt;
&lt;P&gt;The important points are:&lt;/P&gt;
&lt;UL&gt;
&lt;LI&gt;The kernel source/build tree must match the exact kernel running on the board: check&amp;nbsp;uname -r&amp;nbsp;.&lt;/LI&gt;
&lt;LI&gt;Module.symvers&amp;nbsp;should be present; otherwise module versioning/dependency information may be missing.&lt;/LI&gt;
&lt;LI&gt;make oldconfig &amp;amp;&amp;amp; make prepare&amp;nbsp;/&amp;nbsp;make modules_prepare&amp;nbsp;is the usual step to prepare the tree for external module builds.&lt;/LI&gt;
&lt;LI&gt;Native builds on the board are usually slower; NXP guidance generally recommends host-side cross-compilation for i.MX external modules.&lt;/LI&gt;
&lt;/UL&gt;
&lt;P&gt;So the short answer is:&amp;nbsp;&lt;STRONG&gt;Flexbuild can build the matching kernel, but for i.MX8MP Debian I would build the module on the host against the Flexbuild kernel tree, not try to install distro-style&amp;nbsp;linux-headers&amp;nbsp;on the board.&lt;/STRONG&gt;&amp;nbsp;If you need on-target iteration, copy the matching prepared kernel tree to&amp;nbsp;/usr/src/linux-headers-$(uname -r)&amp;nbsp;and point&amp;nbsp;/lib/modules/$(uname -r)/build&amp;nbsp;at it.&lt;/P&gt;
&lt;P&gt;Use the Flexbuild-compiled kernel tree as your “headers” source; a packaged, apt-installable&amp;nbsp;linux-headers-$(uname -r)&amp;nbsp;flow is not documented for i.MX8MP Flexbuild Debian in the material retrieved.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Wed, 02 Sep 2026 09:46:56 GMT</pubDate>
      <guid>https://community.nxp.com/t5/i-MX-Processors/Install-kernel-headers-on-target-flexbuild-Linux-Debian-6-12-49/m-p/2410476#M246586</guid>
      <dc:creator>yipingwang</dc:creator>
      <dc:date>2026-09-02T09:46:56Z</dc:date>
    </item>
    <item>
      <title>Re: Install kernel-headers on target - flexbuild Linux Debian 6.12.49</title>
      <link>https://community.nxp.com/t5/i-MX-Processors/Install-kernel-headers-on-target-flexbuild-Linux-Debian-6-12-49/m-p/2410566#M246591</link>
      <description>&lt;P&gt;Hi,&lt;/P&gt;&lt;P&gt;Yes I quickly figured that trying&amp;nbsp;&lt;STRONG&gt;apt install linux-headers-$(uname -r)&amp;nbsp;&lt;/STRONG&gt;would not give me the right headers.&lt;/P&gt;&lt;P&gt;Thank you for your quick response, I should be able to adopt a workflow that works for me.&lt;/P&gt;</description>
      <pubDate>Wed, 02 Sep 2026 11:31:46 GMT</pubDate>
      <guid>https://community.nxp.com/t5/i-MX-Processors/Install-kernel-headers-on-target-flexbuild-Linux-Debian-6-12-49/m-p/2410566#M246591</guid>
      <dc:creator>sombreminjaben</dc:creator>
      <dc:date>2026-09-02T11:31:46Z</dc:date>
    </item>
  </channel>
</rss>

