linux-kernel: Build only one kernel per platform

With this change we are building the same kernel config for all
hardwares belonging to the same platform. The configs only differ from
one or two drivers which are enabled or not and they are anyway not
loaded as long as the devicetree is not matching.

But having only one config for several hardwares is reducing maintenance
(like enabling or disabling kernel security features) and also reducing
build time when building for different machines.

BugzID: 75223
This commit is contained in:
Alexandre Bard 2021-10-14 09:53:32 +02:00
parent 7bc85ccf32
commit 17fae35e5e
9 changed files with 33 additions and 24 deletions

View File

@ -7,7 +7,7 @@ MACHINEOVERRIDES .= ":am335x-nmhw24"
UBOOT_MACHINE = "am335x_hw25_defconfig" UBOOT_MACHINE = "am335x_hw25_defconfig"
KERNEL_DEVICETREE = "am335x-hw25.dtb " KERNEL_DEVICETREE_TO_USE = "${HW25_DT}"
SERIAL_CONSOLES = "115200;ttyS0" SERIAL_CONSOLES = "115200;ttyS0"
DEFAULT_ETH = "lan0" DEFAULT_ETH = "lan0"

View File

@ -4,7 +4,7 @@
#require conf/machine/include/ti33x.inc #require conf/machine/include/ti33x.inc
require am335x-nmhw21.conf require am335x-nmhw21.conf
KERNEL_DEVICETREE = "am335x-hw26.dtb " KERNEL_DEVICETREE_TO_USE = "${HW26_DT}"
MACHINEOVERRIDES .= ":am335x-nmhw21" MACHINEOVERRIDES .= ":am335x-nmhw21"
MACHINE_FEATURES += "pps" MACHINE_FEATURES += "pps"
MACHINE_FEATURES_remove = "user-module" MACHINE_FEATURES_remove = "user-module"

View File

@ -6,11 +6,7 @@ require conf/machine/include/ti33x.inc
MACHINE_EXTRA_RRECOMMENDS = " kernel-modules kernel-devicetree" MACHINE_EXTRA_RRECOMMENDS = " kernel-modules kernel-devicetree"
KERNEL_DEFCONFIG ??= "am335x-nmhw21_defconfig" KERNEL_DEVICETREE_TO_USE = "${HW21_DT}"
KERNEL_DEVICETREE = "am335x-nmhw21-prod1.dtb \
"
KERNEL_IMAGETYPE = "zImage"
PREFERRED_PROVIDER_virtual/bootloader = "u-boot-ti33x" PREFERRED_PROVIDER_virtual/bootloader = "u-boot-ti33x"
UBOOT_MACHINE = "am335x_nmhw21_defconfig" UBOOT_MACHINE = "am335x_nmhw21_defconfig"

View File

@ -6,11 +6,7 @@ require conf/machine/include/ti33x.inc
MACHINE_EXTRA_RRECOMMENDS = " kernel-modules kernel-devicetree" MACHINE_EXTRA_RRECOMMENDS = " kernel-modules kernel-devicetree"
KERNEL_DEFCONFIG ??= "am335x-nmhw24_defconfig" KERNEL_DEVICETREE_TO_USE = "${HW24_DT}"
KERNEL_DEVICETREE = "am335x-nmhw24-prod1.dtb \
"
KERNEL_IMAGETYPE = "zImage"
PREFERRED_PROVIDER_virtual/bootloader = "u-boot-ti33x" PREFERRED_PROVIDER_virtual/bootloader = "u-boot-ti33x"
UBOOT_MACHINE = "am335x_nrhw24_defconfig" UBOOT_MACHINE = "am335x_nrhw24_defconfig"

View File

@ -6,14 +6,7 @@ require conf/machine/include/ti33x.inc
MACHINE_EXTRA_RRECOMMENDS = " kernel-modules kernel-devicetree" MACHINE_EXTRA_RRECOMMENDS = " kernel-modules kernel-devicetree"
KERNEL_DEFCONFIG ??= "am335x-nrhw16_defconfig" KERNEL_DEVICETREE_TO_USE = "${HW16_DT}"
KERNEL_DEVICETREE = "am335x-nrhw16.dtb \
am335x-nrhw16-prod2.dtb \
am335x-nrhw16-prod3.dtb \
am335x-nrhw16-prod4.dtb \
am335x-nrhw16-prod5.dtb \
"
KERNEL_IMAGETYPE = "zImage"
PREFERRED_PROVIDER_virtual/bootloader = "u-boot-ti33x" PREFERRED_PROVIDER_virtual/bootloader = "u-boot-ti33x"
UBOOT_MACHINE = "am335x_nbhw16_v2_defconfig" UBOOT_MACHINE = "am335x_nbhw16_v2_defconfig"

View File

@ -6,10 +6,7 @@ require conf/machine/include/ti33x.inc
MACHINE_EXTRA_RRECOMMENDS = " kernel-modules kernel-devicetree" MACHINE_EXTRA_RRECOMMENDS = " kernel-modules kernel-devicetree"
KERNEL_DEFCONFIG ??= "am335x-nrhw20_defconfig" KERNEL_DEVICETREE_TO_USE = "${HW20_DT}"
KERNEL_DEVICETREE = "am335x-nrhw20-prod1.dtb \
"
KERNEL_IMAGETYPE = "zImage"
PREFERRED_PROVIDER_virtual/bootloader = "u-boot-ti33x" PREFERRED_PROVIDER_virtual/bootloader = "u-boot-ti33x"
UBOOT_MACHINE = "am335x_nrhw20_defconfig" UBOOT_MACHINE = "am335x_nrhw20_defconfig"

View File

@ -45,3 +45,25 @@ MACHINE_FEATURES = "kernel26 apm usbgadget usbhost pci vfat ext2 screen alsa eth
NM_TARGET = "netbird" NM_TARGET = "netbird"
NM_ARCH = "arm" NM_ARCH = "arm"
MACHINEOVERRIDES =. "${NM_TARGET}:" MACHINEOVERRIDES =. "${NM_TARGET}:"
# We have one kernel for all TI machines
KERNEL_IMAGETYPE = "zImage"
KERNEL_DEFCONFIG = "am335x-netmodule_defconfig"
STAGING_KERNEL_DIR = "${TMPDIR}/work-shared/${TUNE_PKGARCH}/kernel-source"
STAGING_KERNEL_BUILDDIR = "${TMPDIR}/work-shared/${TUNE_PKGARCH}/kernel-build-artifacts"
# We need to specify all devicetrees here in order to build them with the kernel
HW16_DT = "am335x-nrhw16.dtb \
am335x-nrhw16-prod2.dtb \
am335x-nrhw16-prod3.dtb \
am335x-nrhw16-prod4.dtb \
am335x-nrhw16-prod5.dtb \
"
HW20_DT = "am335x-nrhw20-prod1.dtb"
HW21_DT = "am335x-nmhw21-prod1.dtb"
HW24_DT = "am335x-nmhw24-prod1.dtb"
HW25_DT = "am335x-hw25.dtb"
HW26_DT = "am335x-hw26.dtb"
KERNEL_DEVICETREE = "${HW16_DT} ${HW20_DT} ${HW21_DT} ${HW24_DT} ${HW25_DT} ${HW26_DT}"

View File

@ -18,6 +18,9 @@ SRC_URI_append_netbird = " file://wlan.cfg"
SRCREV ?= "${AUTOREV}" SRCREV ?= "${AUTOREV}"
# We are building one kernel for all machines with the same architecture
PACKAGE_ARCH = "${TUNE_PKGARCH}"
# HW23 is using a different source # HW23 is using a different source
SRC_URI_imx8-nmhw23 = "git://git.netmodule.intranet/yoctoproject/linux-netmodule.git;protocol=ssh;user=gitea;branch=4.14/nxp/nmhw23" SRC_URI_imx8-nmhw23 = "git://git.netmodule.intranet/yoctoproject/linux-netmodule.git;protocol=ssh;user=gitea;branch=4.14/nxp/nmhw23"
LIC_FILES_CHKSUM_imx8-nmhw23 = "file://COPYING;md5=d7810fab7487fb0aad327b76f1be7cd7" LIC_FILES_CHKSUM_imx8-nmhw23 = "file://COPYING;md5=d7810fab7487fb0aad327b76f1be7cd7"

View File

@ -26,6 +26,8 @@ INITRAMFS_IMAGE_NAME ?= "${INITRAMFS_IMAGE}-${MACHINE}"
UBOOT_LOADADDRESS ?= "${UBOOT_ENTRYPOINT}" UBOOT_LOADADDRESS ?= "${UBOOT_ENTRYPOINT}"
KERNEL_DEVICETREE = "${KERNEL_DEVICETREE_TO_USE}"
do_configure_prepend () { do_configure_prepend () {
install -d ${S}/arch/${ARCH}/boot/ install -d ${S}/arch/${ARCH}/boot/
for DTB in ${KERNEL_DEVICETREE}; do for DTB in ${KERNEL_DEVICETREE}; do