[PATCH 00/20] Kernel build fixups, split object directory off (partial WIP)

Elliott Mitchell ehem+openwrt at m5p.com
Tue Nov 14 17:04:46 PST 2023


The first 3 are fixes for issues I uncovered during part of this work.
Two are simple cleanup.  The third is an outright bugfix, though I'm
uncertain of exactly how the commit should look.

The handling of kernel modules with OpenWRT means areas marked as modules
get built, but then lost.  In light of this, things marked as modules in
kernel configuration files should be removed.  Once they're removed, it
then seems reasonable to start copying unrecorded lost modules to the
image to make the feature useful in the future.

A long tradition with kernels is keeping source separate from object and
other compiled/interpretted files.  This is useful for doing multiple
distinct kernel builds from a single source tree.  This has gained value
as the size of the Linux kernel source has grown.  Most of the series is
attempting to head in the direction of separating these.


Patch #8 is the first step towards getting this operational.  Simply
introduce two variables which get propogated to the kernel build.

Patch #9 I found $(DTS_DIR) had a similar issue.  This gets a similar
solution, luckily this effects fewer spots.  Alas, this too may not be
fully covered.

Patches 10-19 cover the instances of where $(LINUX_DIR) used to be used.
The earlier ones are more likely to be right, the later ones I'm rather
unsure of.  These need a lot of checking.

Patch #20 is simply a test case for people to check things with.


Elliott Mitchell (20):
  ppp: make copy of compiler_types.h unconditional
  package/lantiq: use make -C instead of `cd;`
  bcm27xx: fix device-tree support patch for split source/build dirs
  patch: always backup files
  build: merge Kernel/Prepare steps together
  kernel: remove drivers marked as modules
  kernel: copy all built kernel modules to root filesystem image
  build: add make variables for kernel source and object directories
  [WIP] build: split $(DTB_DIR) off of $(DTS_DIR)
  [WIP] build: use dtc from $(LINUX_OBJ_DIR)
  [WIP] package/target: update to get modules from $(LINUX_OBJ_DIR)
  [WIP] build: adjust include paths to use LINUX_SRC_DIR/LINUX_OBJ_DIR
  [WIP] build: point user_headers at $(LINUX_OBJ_DIR)
  [WIP] build: update quilt references to use $(LINUX_SRC_DIR)
  [WIP] package: update packages with explicit make flags
  [WIP] build: point kernel build tasks at $(LINUX_OBJ_DIR)
  [WIP] build: split kernel object directory from kernel source
    directory
  [WIP] build: point remaining obvious cases at $(LINUX_SRC_DIR)
  [WIP] build: point remainder at $(LINUX_SRC_DIR)
  [TEST] TESTING: try separating build from sources

 include/autotools.mk                          |   2 +-
 include/image-commands.mk                     |   6 +-
 include/image.mk                              |   8 +-
 include/kernel-build.mk                       |  38 +--
 include/kernel-defaults.mk                    | 127 ++++----
 include/kernel.mk                             |  20 +-
 include/quilt.mk                              |  16 +-
 include/trusted-firmware-a.mk                 |   2 +-
 include/u-boot.mk                             |   2 +-
 package/devel/kselftests-bpf/Makefile         |   4 +-
 package/devel/perf/Makefile                   |   6 +-
 package/devel/strace/Makefile                 |   2 +-
 package/firmware/layerscape/ls-dpl/Makefile   |   2 +-
 package/kernel/bpf-headers/Makefile           |  10 +-
 package/kernel/broadcom-wl/Makefile           |   2 +-
 package/kernel/cryptodev-linux/Makefile       |   2 +-
 package/kernel/lantiq/ltq-adsl-mei/Makefile   |   5 +-
 package/kernel/lantiq/ltq-adsl/Makefile       |   4 +-
 package/kernel/lantiq/ltq-atm/Makefile        |   5 +-
 package/kernel/lantiq/ltq-deu/Makefile        |   5 +-
 package/kernel/lantiq/ltq-ifxos/Makefile      |   4 +-
 package/kernel/lantiq/ltq-ptm/Makefile        |   5 +-
 package/kernel/lantiq/ltq-tapi/Makefile       |   4 +-
 .../kernel/lantiq/ltq-vdsl-vr11-mei/Makefile  |   4 +-
 package/kernel/lantiq/ltq-vdsl-vr11/Makefile  |   4 +-
 .../kernel/lantiq/ltq-vdsl-vr9-mei/Makefile   |   4 +-
 package/kernel/lantiq/ltq-vdsl-vr9/Makefile   |   4 +-
 package/kernel/lantiq/ltq-vmmc/Makefile       |   4 +-
 package/kernel/linux/Makefile                 |   6 +-
 package/kernel/linux/modules/block.mk         | 106 +++----
 package/kernel/linux/modules/can.mk           |  36 +--
 package/kernel/linux/modules/crypto.mk        | 252 +++++++--------
 package/kernel/linux/modules/firewire.mk      |   8 +-
 package/kernel/linux/modules/fs.mk            | 100 +++---
 package/kernel/linux/modules/gpio-cascade.mk  |   2 +-
 package/kernel/linux/modules/hwmon.mk         |  98 +++---
 package/kernel/linux/modules/i2c.mk           |   2 +-
 package/kernel/linux/modules/iio.mk           |  80 ++---
 package/kernel/linux/modules/input.mk         |  26 +-
 package/kernel/linux/modules/leds.mk          |  20 +-
 package/kernel/linux/modules/lib.mk           |  76 ++---
 package/kernel/linux/modules/multiplexer.mk   |   4 +-
 package/kernel/linux/modules/netdevices.mk    | 214 ++++++-------
 package/kernel/linux/modules/netfilter.mk     | 168 +++++-----
 package/kernel/linux/modules/netsupport.mk    | 204 ++++++-------
 package/kernel/linux/modules/nls.mk           |  44 +--
 package/kernel/linux/modules/other.mk         | 202 ++++++------
 package/kernel/linux/modules/pcmcia.mk        |  14 +-
 package/kernel/linux/modules/sound.mk         |  98 +++---
 package/kernel/linux/modules/spi.mk           |  10 +-
 package/kernel/linux/modules/usb.mk           | 288 +++++++++---------
 package/kernel/linux/modules/video.mk         | 168 +++++-----
 package/kernel/linux/modules/virt.mk          |  24 +-
 package/kernel/linux/modules/w1.mk            |   6 +-
 package/kernel/linux/modules/wpan.mk          |  20 +-
 package/kernel/mac80211/Makefile              |  10 +-
 package/kernel/qca-nss-dp/Makefile            |   2 +-
 package/kernel/qca-ssdk/Makefile              |   2 +-
 package/network/config/ltq-adsl-app/Makefile  |   2 +-
 package/network/config/swconfig/Makefile      |   2 +-
 package/network/services/ppp/Makefile         |  10 +-
 package/network/utils/arptables/Makefile      |   2 +-
 package/network/utils/iproute2/Makefile       |   2 +-
 package/network/utils/ipset/Makefile          |   2 +-
 package/network/utils/iptables/Makefile       |  14 +-
 package/network/utils/linux-atm/Makefile      |   2 +-
 package/utils/spidev_test/Makefile            |   4 +-
 scripts/patch-kernel.sh                       |   2 +-
 target/imagebuilder/Makefile                  |  14 +-
 target/imagebuilder/files/Makefile            |   4 +-
 target/linux/apm821xx/modules.mk              |   4 +-
 target/linux/archs38/image/Makefile           |   6 +-
 target/linux/armsr/armv8/config-6.1           |   2 +-
 target/linux/armsr/modules.mk                 |  80 ++---
 target/linux/at91/modules.mk                  |  18 +-
 target/linux/ath79/modules.mk                 |   2 +-
 target/linux/bcm27xx/image/Makefile           |   6 +-
 target/linux/bcm27xx/modules/hwmon.mk         |   2 +-
 target/linux/bcm27xx/modules/other.mk         |   6 +-
 target/linux/bcm27xx/modules/sound.mk         | 206 ++++++-------
 target/linux/bcm27xx/modules/spi.mk           |   4 +-
 target/linux/bcm27xx/modules/video.mk         |  16 +-
 ...BCM2708-Add-core-Device-Tree-support.patch |   2 +-
 target/linux/bcm47xx/modules.mk               |   6 +-
 target/linux/bcm4908/image/Makefile           |   8 +-
 target/linux/bcm53xx/image/Makefile           |   6 +-
 target/linux/bcm53xx/modules.mk               |   6 +-
 target/linux/bcm63xx/modules.mk               |   4 +-
 target/linux/bmips/modules.mk                 |   6 +-
 target/linux/gemini/modules.mk                |   2 +-
 target/linux/imx/image/common.mk              |   2 +-
 target/linux/imx/image/cortexa9.mk            |   4 +-
 target/linux/ipq40xx/image/generic.mk         |   2 +-
 target/linux/ipq806x/modules.mk               |  14 +-
 target/linux/ixp4xx/config-6.1                |  12 +-
 target/linux/kirkwood/modules.mk              |   4 +-
 target/linux/layerscape/image/Makefile        |  10 +-
 target/linux/layerscape/image/armv7.mk        |   4 +-
 target/linux/layerscape/image/armv8_64b.mk    |  10 +-
 target/linux/layerscape/modules.mk            |   4 +-
 target/linux/mediatek/filogic/config-5.15     |   2 +-
 target/linux/mediatek/filogic/config-6.1      |   2 +-
 target/linux/mediatek/image/filogic.mk        |   2 +-
 target/linux/mediatek/image/mt7622.mk         |   4 +-
 target/linux/mediatek/image/mt7623.mk         |   4 +-
 target/linux/mediatek/modules.mk              |   8 +-
 target/linux/mediatek/mt7622/config-5.15      |   2 +-
 target/linux/mediatek/mt7622/config-6.1       |   2 +-
 target/linux/mvebu/modules.mk                 |   4 +-
 target/linux/mxs/image/Makefile               |   2 +-
 target/linux/omap/image/Makefile              |   2 +-
 target/linux/oxnas/modules.mk                 |   4 +-
 target/linux/pistachio/image/Makefile         |   2 +-
 target/linux/ramips/image/mt7621.mk           |   2 +-
 target/linux/ramips/modules.mk                |  20 +-
 target/linux/ramips/rt288x/config-5.15        |  14 +-
 target/linux/rockchip/image/Makefile          |   4 +-
 target/linux/sifiveu/config-6.1               |   4 +-
 target/linux/sifiveu/image/Makefile           |   2 +-
 target/linux/sunxi/image/Makefile             |   2 +-
 target/linux/sunxi/modules.mk                 |  16 +-
 target/linux/tegra/image/Makefile             |   4 +-
 target/linux/uml/config-5.15                  |   2 +-
 target/linux/uml/config-6.1                   |   2 +-
 target/linux/uml/image/Makefile               |   2 +-
 target/linux/x86/64/config-5.15               |   2 +-
 target/linux/x86/64/config-6.1                |   2 +-
 target/linux/x86/generic/config-5.15          |   2 +-
 target/linux/x86/generic/config-6.1           |   2 +-
 target/linux/x86/modules.mk                   |  22 +-
 target/linux/zynq/image/Makefile              |   2 +-
 target/sdk/Makefile                           |   6 +-
 toolchain/kernel-headers/Makefile             |   2 +-
 133 files changed, 1630 insertions(+), 1633 deletions(-)

-- 
(\___(\___(\______          --=> 8-) EHM <=--          ______/)___/)___/)
 \BS (    |       ehem+openwrt at m5p.com     PGP 87145445       |    )   /
  \_CS\   |  _____  -O #include <stddisclaimer.h> O-   _____  |   /  _/
8A19\___\_|_/58D2 7E3D DDF4 7BA6 <-PGP-> 41D1 B375 37D0 8714\_|_/___/5445






More information about the openwrt-devel mailing list