DistroKit Mailinglist
 help / color / mirror / Atom feed
* [DistroKit] [PATCH 1/8] mips, mipsel: kernel-*: bring back KERNEL_*_PATH
@ 2021-10-24 19:45 Roland Hieber
  2021-10-24 19:45 ` [DistroKit] [PATCH 2/8] mips, mipsel: kernel-*: bring up-to-date with PTXdist 2021.07.0 template Roland Hieber
                   ` (6 more replies)
  0 siblings, 7 replies; 12+ messages in thread
From: Roland Hieber @ 2021-10-24 19:45 UTC (permalink / raw)
  To: distrokit; +Cc: Roland Hieber

Even if this is currently unused, having this variable like in the
PTXdist template prevents confusion when backporting patches from the
template to the BSP recipes.

Signed-off-by: Roland Hieber <rhi@pengutronix.de>
---
 configs/platform-mips/rules/kernel-ar9331.make  | 1 +
 configs/platform-mips/rules/kernel-malta.make   | 1 +
 configs/platform-mipsel/rules/kernel-malta.make | 1 +
 3 files changed, 3 insertions(+)

diff --git a/configs/platform-mips/rules/kernel-ar9331.make b/configs/platform-mips/rules/kernel-ar9331.make
index 98452a90a0a4..7893431abeaf 100644
--- a/configs/platform-mips/rules/kernel-ar9331.make
+++ b/configs/platform-mips/rules/kernel-ar9331.make
@@ -36,6 +36,7 @@ KERNEL_AR9331_BUILD_OOT	:= KEEP
 KERNEL_AR9331_WRAPPER_BLACKLIST := \
 	$(PTXDIST_LOWLEVEL_WRAPPER_BLACKLIST)
 
+KERNEL_AR9331_PATH	:= PATH=$(CROSS_PATH)
 KERNEL_AR9331_CONF_OPT	:= \
 	-C $(KERNEL_AR9331_DIR) \
 	O=$(KERNEL_AR9331_BUILD_DIR) \
diff --git a/configs/platform-mips/rules/kernel-malta.make b/configs/platform-mips/rules/kernel-malta.make
index cfb387442d41..f93262cbccd1 100644
--- a/configs/platform-mips/rules/kernel-malta.make
+++ b/configs/platform-mips/rules/kernel-malta.make
@@ -36,6 +36,7 @@ KERNEL_MALTA_BUILD_OOT	:= KEEP
 KERNEL_MALTA_WRAPPER_BLACKLIST := \
 	$(PTXDIST_LOWLEVEL_WRAPPER_BLACKLIST)
 
+KERNEL_MALTA_PATH		:= PATH=$(CROSS_PATH)
 KERNEL_MALTA_CONF_OPT	:= \
 	-C $(KERNEL_MALTA_DIR) \
 	O=$(KERNEL_MALTA_BUILD_DIR) \
diff --git a/configs/platform-mipsel/rules/kernel-malta.make b/configs/platform-mipsel/rules/kernel-malta.make
index cfb387442d41..f93262cbccd1 100644
--- a/configs/platform-mipsel/rules/kernel-malta.make
+++ b/configs/platform-mipsel/rules/kernel-malta.make
@@ -36,6 +36,7 @@ KERNEL_MALTA_BUILD_OOT	:= KEEP
 KERNEL_MALTA_WRAPPER_BLACKLIST := \
 	$(PTXDIST_LOWLEVEL_WRAPPER_BLACKLIST)
 
+KERNEL_MALTA_PATH		:= PATH=$(CROSS_PATH)
 KERNEL_MALTA_CONF_OPT	:= \
 	-C $(KERNEL_MALTA_DIR) \
 	O=$(KERNEL_MALTA_BUILD_DIR) \
-- 
2.30.2


_______________________________________________
DistroKit mailing list
DistroKit@pengutronix.de


^ permalink raw reply	[flat|nested] 12+ messages in thread

* [DistroKit] [PATCH 2/8] mips, mipsel: kernel-*: bring up-to-date with PTXdist 2021.07.0 template
  2021-10-24 19:45 [DistroKit] [PATCH 1/8] mips, mipsel: kernel-*: bring back KERNEL_*_PATH Roland Hieber
@ 2021-10-24 19:45 ` Roland Hieber
  2021-10-24 19:45 ` [DistroKit] [PATCH 3/8] mips, mipsel: kernel-*: rework device-tree handling Roland Hieber
                   ` (5 subsequent siblings)
  6 siblings, 0 replies; 12+ messages in thread
From: Roland Hieber @ 2021-10-24 19:45 UTC (permalink / raw)
  To: distrokit; +Cc: Roland Hieber

This ports the following PTXdist commits:

    | commit 5b006ca1670901a4b74a863535e68ec5324b2366
    | Author: Michael Olbrich <m.olbrich@pengutronix.de>
    | Date:   2019-10-28 22:47:54
    |
    |     template-kernel: use ptx/nl
    |
    |     Otherwise, errors might be ignored.
    |
    |     Signed-off-by: Michael Olbrich <m.olbrich@pengutronix.de>
    |
    | commit a81a9f0fa98d78c62749011666e360603ae35b08
    | Author: Roland Hieber <rhi@pengutronix.de>
    | Date:   2020-06-23 12:17:30
    |
    |     template: kernel: fix make syntax
    |
    |     The closing brace for the foreach macro was removed when the line was
    |     converted from ';' to '$(ptx/nl)'.
    |
    |     Fixes: 5b006ca1670901a4b74a ("template-kernel: use ptx/nl")
    |     Signed-off-by: Roland Hieber <rhi@pengutronix.de>
    |     Message-Id: <20200623101730.32495-1-rhi@pengutronix.de>
    |     Signed-off-by: Michael Olbrich <m.olbrich@pengutronix.de>
    |
    | commit 0284f2d88e5c50ebc65684282ef0be8a6259f76b
    | Author: Michael Olbrich <m.olbrich@pengutronix.de>
    | Date:   2020-06-26 11:15:34
    |
    |     template-kernel: handle plugin detection for kernel version >= v5.7
    |
    |     The old hack to disable plugin support no longer works with v5.7.
    |     Instead, add -DGENERATOR_FILE to the HOSTCC/HOSTCXX command.
    |     The plugin headers produce an error if this is defined.
    |
    |     Tested with v4.19, v5.6 and v5.7.
    |
    |     Signed-off-by: Michael Olbrich <m.olbrich@pengutronix.de>
    |
    | commit 7fb691e014c06b17c17dffe0d6c5d5f6c2a54403
    | Author: Michael Olbrich <m.olbrich@pengutronix.de>
    | Date:   2020-07-02 11:58:18
    |
    |     template-kernel: improve
    |
    |     The imagedir is deleted in 'ptxdist clean root'. So installing files there
    |     should only happen in targetinstall.
    |
    |     Keep the variable handling similar to the kernel package and make it
    |     possible to overwrite the kernel version in the kernel config.
    |
    |     Signed-off-by: Michael Olbrich <m.olbrich@pengutronix.de>
    |
    | commit 80ce928da2c8e0822e91964f0d65afcea5966c1c
    | Author: Roland Hieber <rhi@pengutronix.de>
    | Date:   2020-08-06 18:49:47
    |
    |     kernel: fix typo in HOSTCXX variable
    |
    |     The typo makes the variable expand to nothing. This was probably never
    |     caught because g++ is usually not used when building the kernel.
    |
    |     Fixes: a668fd6120742fe5ef6e (2020-06-11, "kernel: handle plugin detection for kernel version >= v5.7")
    |     Signed-off-by: Roland Hieber <rhi@pengutronix.de>
    |     Message-Id: <20200806164947.4187-1-rhi@pengutronix.de>
    |     Signed-off-by: Michael Olbrich <m.olbrich@pengutronix.de>
    |
    | commit b0f9f2fe33ca9027a554395c7ff467cabdc255e3
    | Author: Roland Hieber <rhi@pengutronix.de>
    | Date:   2020-08-07 12:44:24
    |
    |     barebox, kernel: enable use of {allyes, allno, allmod, alldef, rand}config
    |
    |     These config targets are documented in the man page, but until now, they
    |     only resulted in an error:
    |
    |         $ ptxdist alldefconfig kernel
    |         ptxdist: Checking dependencies. This may take some seconds.
    |
    |         make: *** No rule to make target 'kernel_alldefconfig'.  Stop.
    |
    |     Both kernel and barebox support all config targets which can be given on
    |     the ptxdist command line, so keep the match in the make recipe broad, as
    |     the ptxdist option parser will catch unknown config targets.
    |
    |     Signed-off-by: Roland Hieber <rhi@pengutronix.de>
    |     Message-Id: <20200807104425.30276-2-rhi@pengutronix.de>
    |     Signed-off-by: Michael Olbrich <m.olbrich@pengutronix.de>
    |
    | commit 682d95986b7acfcabb31a25c58f0074e69c9005d
    | Author: Roland Hieber <rhi@pengutronix.de>
    | Date:   2020-08-19 13:27:00
    |
    |     barebox, kernel: set <PKG>_CONF_TOOL := kconfig explicitely
    |
    |     Until now this worked without setting the variable because
    |     ptxd_make_world_init tries to autodetect the config tool, but we should
    |     make this explicit.
    |
    |     Signed-off-by: Roland Hieber <rhi@pengutronix.de>
    |
    |     Message-Id: <20200819112703.11988-1-rhi@pengutronix.de>
    |     Signed-off-by: Michael Olbrich <m.olbrich@pengutronix.de>
    |
    | commit 5af76a1c7d631cd69e673e4ac77783ba059b109d
    | Author: Roland Hieber <rhi@pengutronix.de>
    | Date:   2020-08-19 13:27:01
    |
    |     barebox, kernel: tab-align variables
    |
    |     Signed-off-by: Roland Hieber <rhi@pengutronix.de>
    |     Message-Id: <20200819112703.11988-2-rhi@pengutronix.de>
    |     Signed-off-by: Michael Olbrich <m.olbrich@pengutronix.de>
    |
    | commit 7fa9235fb915e537d21054dc6a60af6981969ba5
    | Author: Michael Olbrich <m.olbrich@pengutronix.de>
    | Date:   2020-10-07 11:32:05
    |
    |     kernel, barebox: use explicit list of config targets
    |
    |     The problem with the pattern rule is that it also matches some files, such
    |     as $(PTXDIST_TOPDIR)/config/images/barebox_partitions.config. This results
    |     in strange error messages.
    |
    |     Use a global list of possible config targets and use it to generate
    |     explicit lists of make targets.
    |
    |     Signed-off-by: Michael Olbrich <m.olbrich@pengutronix.de>
    |
    | commit 6db79433b230a4d86a2f8b74442ed2d8239ab6cd
    | Author: Roland Hieber <rhi@pengutronix.de>
    | Date:   2020-09-28 16:23:50
    |
    |     templates: add <PKG>_LICENSE_FILES variable where appropriate
    |
    |     Signed-off-by: Roland Hieber <rhi@pengutronix.de>
    |     Message-Id: <20200928142350.31523-1-rhi@pengutronix.de>
    |     Signed-off-by: Michael Olbrich <m.olbrich@pengutronix.de>
    |
    | commit 7a90f622f3e46e1cbae6ddc4c4debe4ae62a3e52
    | Author: Michael Olbrich <m.olbrich@pengutronix.de>
    | Date:   2021-04-01 16:09:33
    |
    |     template: kernel: fix disabling gcc plugins for >= v5.11
    |
    |     Just a copy of the same change from the kernel package.
    |
    |     Signed-off-by: Michael Olbrich <m.olbrich@pengutronix.de>
    |
    | commit 533f7709f61c54a1c133c5415be8de9b671a8095
    | Author: Michael Olbrich <m.olbrich@pengutronix.de>
    | Date:   2021-04-15 11:19:06
    |
    |     kernel/kernel-template: set PTXDIST_NO_GCC_PLUGINS=1 in _MAKE_ENV as well
    |
    |     Otherwise an implicit 'oldconfig' in the compile stage will try to enable
    |     plugins again.
    |
    |     Signed-off-by: Michael Olbrich <m.olbrich@pengutronix.de>

Link: https://git.pengutronix.de/cgit/ptxdist/commit/?id=a81a9f0fa98d78c62749
Link: https://git.pengutronix.de/cgit/ptxdist/commit/?id=0284f2d88e5c50ebc656
Link: https://git.pengutronix.de/cgit/ptxdist/commit/?id=7fb691e014c06b17c17d
Link: https://git.pengutronix.de/cgit/ptxdist/commit/?id=80ce928da2c8e0822e91
Link: https://git.pengutronix.de/cgit/ptxdist/commit/?id=b0f9f2fe33ca9027a554
Link: https://git.pengutronix.de/cgit/ptxdist/commit/?id=682d95986b7acfcabb31
Link: https://git.pengutronix.de/cgit/ptxdist/commit/?id=5af76a1c7d631cd69e67
Link: https://git.pengutronix.de/cgit/ptxdist/commit/?id=7fa9235fb915e537d210
Link: https://git.pengutronix.de/cgit/ptxdist/commit/?id=6db79433b230a4d86a2f
Link: https://git.pengutronix.de/cgit/ptxdist/commit/?id=7a90f622f3e46e1cbae6
Link: https://git.pengutronix.de/cgit/ptxdist/commit/?id=533f7709f61c54a1c133

Signed-off-by: Roland Hieber <rhi@pengutronix.de>
---
 .../platform-mips/rules/kernel-ar9331.make    | 41 ++++++++++-------
 configs/platform-mips/rules/kernel-malta.make | 45 ++++++++++++-------
 configs/platform-mips/rules/kernel.make       |  2 +-
 .../platform-mipsel/rules/kernel-malta.make   | 39 ++++++++++------
 configs/platform-mipsel/rules/kernel.make     |  2 +-
 5 files changed, 81 insertions(+), 48 deletions(-)

diff --git a/configs/platform-mips/rules/kernel-ar9331.make b/configs/platform-mips/rules/kernel-ar9331.make
index 7893431abeaf..b4a33fb09e38 100644
--- a/configs/platform-mips/rules/kernel-ar9331.make
+++ b/configs/platform-mips/rules/kernel-ar9331.make
@@ -26,6 +26,7 @@ KERNEL_AR9331_BUILD_DIR	:= $(KERNEL_AR9331_DIR)-build
 KERNEL_AR9331_CONFIG	:= $(call ptx/in-platformconfigdir, kernelconfig-ar9331)
 KERNEL_AR9331_REF_CONFIG	:= $(call ptx/in-platformconfigdir, kernelconfig)
 KERNEL_AR9331_LICENSE	:= GPL-2.0-only
+KERNEL_AR9331_LICENSE_FILES	:=
 KERNEL_AR9331_BUILD_OOT	:= KEEP
 
 # ----------------------------------------------------------------------------
@@ -36,15 +37,28 @@ KERNEL_AR9331_BUILD_OOT	:= KEEP
 KERNEL_AR9331_WRAPPER_BLACKLIST := \
 	$(PTXDIST_LOWLEVEL_WRAPPER_BLACKLIST)
 
-KERNEL_AR9331_PATH	:= PATH=$(CROSS_PATH)
-KERNEL_AR9331_CONF_OPT	:= \
+KERNEL_AR9331_PATH		:= PATH=$(CROSS_PATH)
+KERNEL_AR9331_SHARED_OPT	:= \
 	-C $(KERNEL_AR9331_DIR) \
 	O=$(KERNEL_AR9331_BUILD_DIR) \
 	$(call kernel-opts, KERNEL_AR9331)
 
 # no gcc plugins; avoid config changes depending on the host compiler
-KERNEL_AR9331_CONF_OPT += \
-	HOSTCXX=false
+KERNEL_AR9331_SHARED_OPT	+= \
+	HOSTCXX="$(HOSTCXX) -DGENERATOR_FILE" \
+	HOSTCC="$(HOSTCC) -DGENERATOR_FILE"
+KERNEL_AR9331_CONF_ENV	:= \
+	PTXDIST_NO_GCC_PLUGINS=1
+KERNEL_AR9331_MAKE_ENV	:= \
+	PTXDIST_NO_GCC_PLUGINS=1
+
+KERNEL_AR9331_CONF_TOOL	:= kconfig
+KERNEL_AR9331_CONF_OPT	:= \
+	$(KERNEL_AR9331_SHARED_OPT)
+
+# force using KERNEL_AR9331_VERSION in the kernelconfig
+#KERNEL_AR9331_CONF_OPT	+= \
+#	KERNELVERSION=$(KERNEL_AR9331_VERSION)
 
 KERNEL_AR9331_IMAGES := vmlinuz
 KERNEL_AR9331_IMAGES := $(addprefix $(KERNEL_AR9331_BUILD_DIR)/,$(KERNEL_AR9331_IMAGES))
@@ -64,25 +78,18 @@ endif
 # Compile
 # ----------------------------------------------------------------------------
 
-KERNEL_AR9331_MAKE_OPT := \
-	$(KERNEL_AR9331_CONF_OPT) \
+KERNEL_AR9331_MAKE_OPT	:= \
+	$(KERNEL_AR9331_SHARED_OPT) \
 	vmlinuz modules
 
 # ----------------------------------------------------------------------------
 # Install
 # ----------------------------------------------------------------------------
 
-KERNEL_AR9331_INSTALL_OPT := \
+KERNEL_AR9331_INSTALL_OPT	:= \
 	$(call kernel-opts, KERNEL_AR9331) \
 	modules_install
 
-$(STATEDIR)/kernel-ar9331.install:
-	@$(call targetinfo)
-	@$(call world/install, KERNEL_AR9331)
-	@$(foreach image, $(KERNEL_AR9331_IMAGES), \
-		install -m 644 $(image) $(IMAGEDIR)/$(notdir $(image))-ar9331$(ptx/nl))
-	@$(call touch)
-
 # ----------------------------------------------------------------------------
 # Target-Install
 # ----------------------------------------------------------------------------
@@ -90,6 +97,10 @@ $(STATEDIR)/kernel-ar9331.install:
 $(STATEDIR)/kernel-ar9331.targetinstall:
 	@$(call targetinfo)
 
+	@$(foreach image, $(KERNEL_AR9331_IMAGES), \
+		install -v -m 644 $(image) \
+			$(IMAGEDIR)/$(notdir $(image))-ar9331$(ptx/nl))
+
 	@$(call install_init,  kernel-ar9331)
 	@$(call install_fixup, kernel-ar9331, PRIORITY,optional)
 	@$(call install_fixup, kernel-ar9331, SECTION,base)
@@ -110,7 +121,7 @@ $(STATEDIR)/kernel-ar9331.targetinstall:
 # oldconfig / menuconfig
 # ----------------------------------------------------------------------------
 
-kernel-ar9331_oldconfig kernel-ar9331_menuconfig kernel-ar9331_nconfig: $(STATEDIR)/kernel-ar9331.extract
+$(call ptx/kconfig-targets, kernel-ar9331): $(STATEDIR)/kernel-ar9331.extract
 	@$(call world/kconfig, KERNEL_AR9331, $(subst kernel-ar9331_,,$@))
 
 # vim: syntax=make
diff --git a/configs/platform-mips/rules/kernel-malta.make b/configs/platform-mips/rules/kernel-malta.make
index f93262cbccd1..1d8b72c8efc2 100644
--- a/configs/platform-mips/rules/kernel-malta.make
+++ b/configs/platform-mips/rules/kernel-malta.make
@@ -26,6 +26,7 @@ KERNEL_MALTA_BUILD_DIR	:= $(KERNEL_MALTA_DIR)-build
 KERNEL_MALTA_CONFIG	:= $(call ptx/in-platformconfigdir, kernelconfig-malta)
 KERNEL_MALTA_REF_CONFIG	:= $(call ptx/in-platformconfigdir, kernelconfig)
 KERNEL_MALTA_LICENSE	:= GPL-2.0-only
+KERNEL_MALTA_LICENSE_FILES	:=
 KERNEL_MALTA_BUILD_OOT	:= KEEP
 
 # ----------------------------------------------------------------------------
@@ -36,18 +37,31 @@ KERNEL_MALTA_BUILD_OOT	:= KEEP
 KERNEL_MALTA_WRAPPER_BLACKLIST := \
 	$(PTXDIST_LOWLEVEL_WRAPPER_BLACKLIST)
 
-KERNEL_MALTA_PATH		:= PATH=$(CROSS_PATH)
-KERNEL_MALTA_CONF_OPT	:= \
+KERNEL_MALTA_PATH	:= PATH=$(CROSS_PATH)
+KERNEL_MALTA_SHARED_OPT	:= \
 	-C $(KERNEL_MALTA_DIR) \
 	O=$(KERNEL_MALTA_BUILD_DIR) \
 	$(call kernel-opts, KERNEL_MALTA)
 
 # no gcc plugins; avoid config changes depending on the host compiler
-KERNEL_MALTA_CONF_OPT += \
-	HOSTCXX=false
+KERNEL_MALTA_SHARED_OPT	+= \
+	HOSTCXX="$(HOSTCXX) -DGENERATOR_FILE" \
+	HOSTCC="$(HOSTCC) -DGENERATOR_FILE"
+KERNEL_MALTA_CONF_ENV	:= \
+	PTXDIST_NO_GCC_PLUGINS=1
+KERNEL_MALTA_MAKE_ENV	:= \
+	PTXDIST_NO_GCC_PLUGINS=1
+
+KERNEL_MALTA_CONF_TOOL	:= kconfig
+KERNEL_MALTA_CONF_OPT	:= \
+	$(KERNEL_MALTA_SHARED_OPT)
+
+# force using KERNEL_MALTA_VERSION in the kernelconfig
+#KERNEL_MALTA_CONF_OPT	+= \
+#	KERNELVERSION=$(KERNEL_MALTA_VERSION)
 
-KERNEL_MALTA_IMAGES := vmlinuz
-KERNEL_MALTA_IMAGES := $(addprefix $(KERNEL_MALTA_BUILD_DIR)/,$(KERNEL_MALTA_IMAGES))
+KERNEL_MALTA_IMAGES	:= vmlinuz
+KERNEL_MALTA_IMAGES	:= $(addprefix $(KERNEL_MALTA_BUILD_DIR)/,$(KERNEL_MALTA_IMAGES))
 
 ifdef PTXCONF_KERNEL_MALTA
 $(KERNEL_MALTA_CONFIG):
@@ -64,25 +78,18 @@ endif
 # Compile
 # ----------------------------------------------------------------------------
 
-KERNEL_MALTA_MAKE_OPT := \
-	$(KERNEL_MALTA_CONF_OPT) \
+KERNEL_MALTA_MAKE_OPT	:= \
+	$(KERNEL_MALTA_SHARED_OPT) \
 	vmlinuz modules
 
 # ----------------------------------------------------------------------------
 # Install
 # ----------------------------------------------------------------------------
 
-KERNEL_MALTA_INSTALL_OPT := \
+KERNEL_MALTA_INSTALL_OPT	:= \
 	$(call kernel-opts, KERNEL_MALTA) \
 	modules_install
 
-$(STATEDIR)/kernel-malta.install:
-	@$(call targetinfo)
-	@$(call world/install, KERNEL_MALTA)
-	@$(foreach image, $(KERNEL_MALTA_IMAGES), \
-		install -m 644 $(image) $(IMAGEDIR)/$(notdir $(image))-malta$(ptx/nl))
-	@$(call touch)
-
 # ----------------------------------------------------------------------------
 # Target-Install
 # ----------------------------------------------------------------------------
@@ -90,6 +97,10 @@ $(STATEDIR)/kernel-malta.install:
 $(STATEDIR)/kernel-malta.targetinstall:
 	@$(call targetinfo)
 
+	@$(foreach image, $(KERNEL_MALTA_IMAGES), \
+		install -v -m 644 $(image) \
+			$(IMAGEDIR)/$(notdir $(image))-malta$(ptx/nl))
+
 	@$(call install_init,  kernel-malta)
 	@$(call install_fixup, kernel-malta, PRIORITY,optional)
 	@$(call install_fixup, kernel-malta, SECTION,base)
@@ -110,7 +121,7 @@ $(STATEDIR)/kernel-malta.targetinstall:
 # oldconfig / menuconfig
 # ----------------------------------------------------------------------------
 
-kernel-malta_oldconfig kernel-malta_menuconfig kernel-malta_nconfig: $(STATEDIR)/kernel-malta.extract
+$(call ptx/kconfig-targets, kernel-malta): $(STATEDIR)/kernel-malta.extract
 	@$(call world/kconfig, KERNEL_MALTA, $(subst kernel-malta_,,$@))
 
 # vim: syntax=make
diff --git a/configs/platform-mips/rules/kernel.make b/configs/platform-mips/rules/kernel.make
index a9eb0f207a80..6d5ca4d4ea0e 100644
--- a/configs/platform-mips/rules/kernel.make
+++ b/configs/platform-mips/rules/kernel.make
@@ -76,7 +76,7 @@ $(STATEDIR)/kernel.install:
 # oldconfig / menuconfig
 # ----------------------------------------------------------------------------
 
-kernel_oldconfig kernel_menuconfig kernel_nconfig: $(STATEDIR)/kernel.extract
+$(call ptx/kconfig-targets, kernel): $(STATEDIR)/kernel.extract
 	@$(call world/kconfig, KERNEL, $(subst kernel_,,$@))
 
 # vim: syntax=make
diff --git a/configs/platform-mipsel/rules/kernel-malta.make b/configs/platform-mipsel/rules/kernel-malta.make
index f93262cbccd1..94f49b89b774 100644
--- a/configs/platform-mipsel/rules/kernel-malta.make
+++ b/configs/platform-mipsel/rules/kernel-malta.make
@@ -26,6 +26,7 @@ KERNEL_MALTA_BUILD_DIR	:= $(KERNEL_MALTA_DIR)-build
 KERNEL_MALTA_CONFIG	:= $(call ptx/in-platformconfigdir, kernelconfig-malta)
 KERNEL_MALTA_REF_CONFIG	:= $(call ptx/in-platformconfigdir, kernelconfig)
 KERNEL_MALTA_LICENSE	:= GPL-2.0-only
+KERNEL_MALTA_LICENSE_FILES	:=
 KERNEL_MALTA_BUILD_OOT	:= KEEP
 
 # ----------------------------------------------------------------------------
@@ -37,14 +38,27 @@ KERNEL_MALTA_WRAPPER_BLACKLIST := \
 	$(PTXDIST_LOWLEVEL_WRAPPER_BLACKLIST)
 
 KERNEL_MALTA_PATH		:= PATH=$(CROSS_PATH)
-KERNEL_MALTA_CONF_OPT	:= \
+KERNEL_MALTA_SHARED_OPT	:= \
 	-C $(KERNEL_MALTA_DIR) \
 	O=$(KERNEL_MALTA_BUILD_DIR) \
 	$(call kernel-opts, KERNEL_MALTA)
 
 # no gcc plugins; avoid config changes depending on the host compiler
-KERNEL_MALTA_CONF_OPT += \
-	HOSTCXX=false
+KERNEL_MALTA_SHARED_OPT	+= \
+	HOSTCXX="$(HOSTCXX) -DGENERATOR_FILE" \
+	HOSTCC="$(HOSTCC) -DGENERATOR_FILE"
+KERNEL_MALTA_CONF_ENV	:= \
+	PTXDIST_NO_GCC_PLUGINS=1
+KERNEL_MALTA_MAKE_ENV	:= \
+	PTXDIST_NO_GCC_PLUGINS=1
+
+KERNEL_MALTA_CONF_TOOL	:= kconfig
+KERNEL_MALTA_CONF_OPT	:= \
+	$(KERNEL_MALTA_SHARED_OPT)
+
+# force using KERNEL_MALTA_VERSION in the kernelconfig
+#KERNEL_MALTA_CONF_OPT	+= \
+#	KERNELVERSION=$(KERNEL_MALTA_VERSION)
 
 KERNEL_MALTA_IMAGES := vmlinuz
 KERNEL_MALTA_IMAGES := $(addprefix $(KERNEL_MALTA_BUILD_DIR)/,$(KERNEL_MALTA_IMAGES))
@@ -64,25 +78,18 @@ endif
 # Compile
 # ----------------------------------------------------------------------------
 
-KERNEL_MALTA_MAKE_OPT := \
-	$(KERNEL_MALTA_CONF_OPT) \
+KERNEL_MALTA_MAKE_OPT	:= \
+	$(KERNEL_MALTA_SHARED_OPT) \
 	vmlinuz modules
 
 # ----------------------------------------------------------------------------
 # Install
 # ----------------------------------------------------------------------------
 
-KERNEL_MALTA_INSTALL_OPT := \
+KERNEL_MALTA_INSTALL_OPT	:= \
 	$(call kernel-opts, KERNEL_MALTA) \
 	modules_install
 
-$(STATEDIR)/kernel-malta.install:
-	@$(call targetinfo)
-	@$(call world/install, KERNEL_MALTA)
-	@$(foreach image, $(KERNEL_MALTA_IMAGES), \
-		install -m 644 $(image) $(IMAGEDIR)/$(notdir $(image))-malta$(ptx/nl))
-	@$(call touch)
-
 # ----------------------------------------------------------------------------
 # Target-Install
 # ----------------------------------------------------------------------------
@@ -90,6 +97,10 @@ $(STATEDIR)/kernel-malta.install:
 $(STATEDIR)/kernel-malta.targetinstall:
 	@$(call targetinfo)
 
+	@$(foreach image, $(KERNEL_MALTA_IMAGES), \
+		install -v -m 644 $(image) \
+			$(IMAGEDIR)/$(notdir $(image))-malta$(ptx/nl))
+
 	@$(call install_init,  kernel-malta)
 	@$(call install_fixup, kernel-malta, PRIORITY,optional)
 	@$(call install_fixup, kernel-malta, SECTION,base)
@@ -110,7 +121,7 @@ $(STATEDIR)/kernel-malta.targetinstall:
 # oldconfig / menuconfig
 # ----------------------------------------------------------------------------
 
-kernel-malta_oldconfig kernel-malta_menuconfig kernel-malta_nconfig: $(STATEDIR)/kernel-malta.extract
+$(call ptx/kconfig-targets, kernel-malta): $(STATEDIR)/kernel-malta.extract
 	@$(call world/kconfig, KERNEL_MALTA, $(subst kernel-malta_,,$@))
 
 # vim: syntax=make
diff --git a/configs/platform-mipsel/rules/kernel.make b/configs/platform-mipsel/rules/kernel.make
index a9eb0f207a80..6d5ca4d4ea0e 100644
--- a/configs/platform-mipsel/rules/kernel.make
+++ b/configs/platform-mipsel/rules/kernel.make
@@ -76,7 +76,7 @@ $(STATEDIR)/kernel.install:
 # oldconfig / menuconfig
 # ----------------------------------------------------------------------------
 
-kernel_oldconfig kernel_menuconfig kernel_nconfig: $(STATEDIR)/kernel.extract
+$(call ptx/kconfig-targets, kernel): $(STATEDIR)/kernel.extract
 	@$(call world/kconfig, KERNEL, $(subst kernel_,,$@))
 
 # vim: syntax=make
-- 
2.30.2


_______________________________________________
DistroKit mailing list
DistroKit@pengutronix.de


^ permalink raw reply	[flat|nested] 12+ messages in thread

* [DistroKit] [PATCH 3/8] mips, mipsel: kernel-*: rework device-tree handling
  2021-10-24 19:45 [DistroKit] [PATCH 1/8] mips, mipsel: kernel-*: bring back KERNEL_*_PATH Roland Hieber
  2021-10-24 19:45 ` [DistroKit] [PATCH 2/8] mips, mipsel: kernel-*: bring up-to-date with PTXdist 2021.07.0 template Roland Hieber
@ 2021-10-24 19:45 ` Roland Hieber
  2021-10-24 19:45 ` [DistroKit] [PATCH 4/8] mips, mipsel: kernel-*: use ptx/config-version and ptx/config-md5 Roland Hieber
                   ` (4 subsequent siblings)
  6 siblings, 0 replies; 12+ messages in thread
From: Roland Hieber @ 2021-10-24 19:45 UTC (permalink / raw)
  To: distrokit; +Cc: Roland Hieber

This ports the kernel template part of PTXdist commit f50cd1449e934730:

    | commit f50cd1449e9347309b1050b0b738882dac1954e9
    | Author: Michael Olbrich <m.olbrich@pengutronix.de>
    | Date:   2021-07-09 17:25:41
    |
    |     rework device-tree handling
    |
    |     It's not really possible to build a dtb by itself. A lot of included dtsi
    |     and header files are needed. So build the device-trees with the package
    |     that provides these files. Currently that's the kernel package.
    |
    |     This also means, that other kernel packages can have their own device-trees
    |     as well.
    |
    |     Signed-off-by: Michael Olbrich <m.olbrich@pengutronix.de>

Set KERNEL_*_DTS to the current values of PTXCONF_DTC_OFTREE_DTS from
the platformconfig, as this symbol will vanish when migrating to the
next PTXdist version.

Link: https://git.pengutronix.de/cgit/ptxdist/commit/?id=f50cd1449e9347309b10

Signed-off-by: Roland Hieber <rhi@pengutronix.de>
---
 .../platform-mips/rules/kernel-ar9331.make    | 31 +++++++++++++++++++
 configs/platform-mips/rules/kernel-malta.make | 31 +++++++++++++++++++
 .../platform-mipsel/rules/kernel-malta.make   | 31 +++++++++++++++++++
 3 files changed, 93 insertions(+)

diff --git a/configs/platform-mips/rules/kernel-ar9331.make b/configs/platform-mips/rules/kernel-ar9331.make
index b4a33fb09e38..7b9782d2b696 100644
--- a/configs/platform-mips/rules/kernel-ar9331.make
+++ b/configs/platform-mips/rules/kernel-ar9331.make
@@ -25,10 +25,16 @@ KERNEL_AR9331_DIR	:= $(BUILDDIR)/$(KERNEL_AR9331)
 KERNEL_AR9331_BUILD_DIR	:= $(KERNEL_AR9331_DIR)-build
 KERNEL_AR9331_CONFIG	:= $(call ptx/in-platformconfigdir, kernelconfig-ar9331)
 KERNEL_AR9331_REF_CONFIG	:= $(call ptx/in-platformconfigdir, kernelconfig)
+KERNEL_AR9331_DTS_PATH	:= ${PTXDIST_PLATFORMCONFIG_SUBDIR}/dts:${KERNEL_AR9331_DIR}/arch/${GENERIC_KERNEL_ARCH}/boot/dts/qca
+KERNEL_AR9331_DTS	:= ar9331_dpt_module.dts
+KERNEL_AR9331_DTB_FILES	:= $(addsuffix .dtb,$(basename $(KERNEL_AR9331_DTS)))
 KERNEL_AR9331_LICENSE	:= GPL-2.0-only
 KERNEL_AR9331_LICENSE_FILES	:=
 KERNEL_AR9331_BUILD_OOT	:= KEEP
 
+# track changes to devices-trees in the BSP
+$(call world/dts-cfghash-file, KERNEL_AR9331)
+
 # ----------------------------------------------------------------------------
 # Prepare
 # ----------------------------------------------------------------------------
@@ -90,6 +96,12 @@ KERNEL_AR9331_INSTALL_OPT	:= \
 	$(call kernel-opts, KERNEL_AR9331) \
 	modules_install
 
+$(STATEDIR)/kernel-ar9331.install:
+	@$(call targetinfo)
+	@$(call world/install, KERNEL_AR9331)
+	@$(call world/dtb, KERNEL_AR9331)
+	@$(call touch)
+
 # ----------------------------------------------------------------------------
 # Target-Install
 # ----------------------------------------------------------------------------
@@ -101,6 +113,11 @@ $(STATEDIR)/kernel-ar9331.targetinstall:
 		install -v -m 644 $(image) \
 			$(IMAGEDIR)/$(notdir $(image))-ar9331$(ptx/nl))
 
+	@$(foreach dtb ,$(KERNEL_AR9331_DTB_FILES), \
+		echo -e "Installing $(dtb) ...\n"$(ptx/nl) \
+		install -D -m0644 $(KERNEL_AR9331_PKGDIR)/boot/$(dtb) \
+			$(IMAGEDIR)/$(dtb)$(ptx/nl))
+
 	@$(call install_init,  kernel-ar9331)
 	@$(call install_fixup, kernel-ar9331, PRIORITY,optional)
 	@$(call install_fixup, kernel-ar9331, SECTION,base)
@@ -110,6 +127,10 @@ $(STATEDIR)/kernel-ar9331.targetinstall:
 	@$(call install_copy, kernel-ar9331, 0, 0, 0644, \
 		$(IMAGEDIR)/vmlinuz-ar9331, /boot/vmlinuz-ar9331, n)
 
+	@$(foreach dtb, $(KERNEL_AR9331_DTB_FILES), \
+		$(call install_copy, kernel-ar9331, 0, 0, 0644, -, \
+			/boot/$(dtb), n)$(ptx/nl))
+
 	@$(call install_glob, kernel-ar9331, 0, 0, -, /lib/modules, *.ko,, n)
 	@$(call install_glob, kernel-ar9331, 0, 0, -, /lib/modules,, *.ko */build */source, n)
 
@@ -117,6 +138,16 @@ $(STATEDIR)/kernel-ar9331.targetinstall:
 
 	@$(call touch)
 
+# ----------------------------------------------------------------------------
+# Clean
+# ----------------------------------------------------------------------------
+
+$(STATEDIR)/kernel-ar9331.clean:
+	@$(call targetinfo)
+	@$(call clean_pkg, KERNEL_AR9331)
+	@$(foreach dtb,$(KERNEL_AR9331_DTB_FILES), \
+		rm -vf $(IMAGEDIR)/$(dtb)$(ptx/nl))
+
 # ----------------------------------------------------------------------------
 # oldconfig / menuconfig
 # ----------------------------------------------------------------------------
diff --git a/configs/platform-mips/rules/kernel-malta.make b/configs/platform-mips/rules/kernel-malta.make
index 1d8b72c8efc2..c5028b996264 100644
--- a/configs/platform-mips/rules/kernel-malta.make
+++ b/configs/platform-mips/rules/kernel-malta.make
@@ -25,10 +25,16 @@ KERNEL_MALTA_DIR	:= $(BUILDDIR)/$(KERNEL_MALTA)
 KERNEL_MALTA_BUILD_DIR	:= $(KERNEL_MALTA_DIR)-build
 KERNEL_MALTA_CONFIG	:= $(call ptx/in-platformconfigdir, kernelconfig-malta)
 KERNEL_MALTA_REF_CONFIG	:= $(call ptx/in-platformconfigdir, kernelconfig)
+KERNEL_MALTA_DTS_PATH	:= ${PTXDIST_PLATFORMCONFIG_SUBDIR}/dts:${KERNEL_MALTA_DIR}/arch/${GENERIC_KERNEL_ARCH}/boot/dts/mti
+KERNEL_MALTA_DTS	:= malta.dts
+KERNEL_MALTA_DTB_FILES	:= $(addsuffix .dtb,$(basename $(KERNEL_MALTA_DTS)))
 KERNEL_MALTA_LICENSE	:= GPL-2.0-only
 KERNEL_MALTA_LICENSE_FILES	:=
 KERNEL_MALTA_BUILD_OOT	:= KEEP
 
+# track changes to devices-trees in the BSP
+$(call world/dts-cfghash-file, KERNEL_MALTA)
+
 # ----------------------------------------------------------------------------
 # Prepare
 # ----------------------------------------------------------------------------
@@ -90,6 +96,12 @@ KERNEL_MALTA_INSTALL_OPT	:= \
 	$(call kernel-opts, KERNEL_MALTA) \
 	modules_install
 
+$(STATEDIR)/kernel-malta.install:
+	@$(call targetinfo)
+	@$(call world/install, KERNEL_MALTA)
+	@$(call world/dtb, KERNEL_MALTA)
+	@$(call touch)
+
 # ----------------------------------------------------------------------------
 # Target-Install
 # ----------------------------------------------------------------------------
@@ -101,6 +113,11 @@ $(STATEDIR)/kernel-malta.targetinstall:
 		install -v -m 644 $(image) \
 			$(IMAGEDIR)/$(notdir $(image))-malta$(ptx/nl))
 
+	@$(foreach dtb ,$(KERNEL_MALTA_DTB_FILES), \
+		echo -e "Installing $(dtb) ...\n"$(ptx/nl) \
+		install -D -m0644 $(KERNEL_MALTA_PKGDIR)/boot/$(dtb) \
+			$(IMAGEDIR)/$(dtb)$(ptx/nl))
+
 	@$(call install_init,  kernel-malta)
 	@$(call install_fixup, kernel-malta, PRIORITY,optional)
 	@$(call install_fixup, kernel-malta, SECTION,base)
@@ -110,6 +127,10 @@ $(STATEDIR)/kernel-malta.targetinstall:
 	@$(call install_copy, kernel-malta, 0, 0, 0644, \
 		$(IMAGEDIR)/vmlinuz-malta, /boot/vmlinuz-malta, n)
 
+	@$(foreach dtb, $(KERNEL_MALTA_DTB_FILES), \
+		$(call install_copy, kernel-malta, 0, 0, 0644, -, \
+			/boot/$(dtb), n)$(ptx/nl))
+
 	@$(call install_glob, kernel-malta, 0, 0, -, /lib/modules, *.ko,, n)
 	@$(call install_glob, kernel-malta, 0, 0, -, /lib/modules,, *.ko */build */source, n)
 
@@ -117,6 +138,16 @@ $(STATEDIR)/kernel-malta.targetinstall:
 
 	@$(call touch)
 
+# ----------------------------------------------------------------------------
+# Clean
+# ----------------------------------------------------------------------------
+
+$(STATEDIR)/kernel-malta.clean:
+	@$(call targetinfo)
+	@$(call clean_pkg, KERNEL_MALTA)
+	@$(foreach dtb,$(KERNEL_MALTA_DTB_FILES), \
+		rm -vf $(IMAGEDIR)/$(dtb)$(ptx/nl))
+
 # ----------------------------------------------------------------------------
 # oldconfig / menuconfig
 # ----------------------------------------------------------------------------
diff --git a/configs/platform-mipsel/rules/kernel-malta.make b/configs/platform-mipsel/rules/kernel-malta.make
index 94f49b89b774..c2bea47e9d0c 100644
--- a/configs/platform-mipsel/rules/kernel-malta.make
+++ b/configs/platform-mipsel/rules/kernel-malta.make
@@ -25,10 +25,16 @@ KERNEL_MALTA_DIR	:= $(BUILDDIR)/$(KERNEL_MALTA)
 KERNEL_MALTA_BUILD_DIR	:= $(KERNEL_MALTA_DIR)-build
 KERNEL_MALTA_CONFIG	:= $(call ptx/in-platformconfigdir, kernelconfig-malta)
 KERNEL_MALTA_REF_CONFIG	:= $(call ptx/in-platformconfigdir, kernelconfig)
+KERNEL_MALTA_DTS_PATH	:= ${PTXDIST_PLATFORMCONFIG_SUBDIR}/dts:${KERNEL_MALTA_DIR}/arch/${GENERIC_KERNEL_ARCH}/boot/dts/mti
+KERNEL_MALTA_DTS	:= malta.dts
+KERNEL_MALTA_DTB_FILES	:= $(addsuffix .dtb,$(basename $(KERNEL_MALTA_DTS)))
 KERNEL_MALTA_LICENSE	:= GPL-2.0-only
 KERNEL_MALTA_LICENSE_FILES	:=
 KERNEL_MALTA_BUILD_OOT	:= KEEP
 
+# track changes to devices-trees in the BSP
+$(call world/dts-cfghash-file, KERNEL_MALTA)
+
 # ----------------------------------------------------------------------------
 # Prepare
 # ----------------------------------------------------------------------------
@@ -90,6 +96,12 @@ KERNEL_MALTA_INSTALL_OPT	:= \
 	$(call kernel-opts, KERNEL_MALTA) \
 	modules_install
 
+$(STATEDIR)/kernel-malta.install:
+	@$(call targetinfo)
+	@$(call world/install, KERNEL_MALTA)
+	@$(call world/dtb, KERNEL_MALTA)
+	@$(call touch)
+
 # ----------------------------------------------------------------------------
 # Target-Install
 # ----------------------------------------------------------------------------
@@ -101,6 +113,11 @@ $(STATEDIR)/kernel-malta.targetinstall:
 		install -v -m 644 $(image) \
 			$(IMAGEDIR)/$(notdir $(image))-malta$(ptx/nl))
 
+	@$(foreach dtb ,$(KERNEL_MALTA_DTB_FILES), \
+		echo -e "Installing $(dtb) ...\n"$(ptx/nl) \
+		install -D -m0644 $(KERNEL_MALTA_PKGDIR)/boot/$(dtb) \
+			$(IMAGEDIR)/$(dtb)$(ptx/nl))
+
 	@$(call install_init,  kernel-malta)
 	@$(call install_fixup, kernel-malta, PRIORITY,optional)
 	@$(call install_fixup, kernel-malta, SECTION,base)
@@ -110,6 +127,10 @@ $(STATEDIR)/kernel-malta.targetinstall:
 	@$(call install_copy, kernel-malta, 0, 0, 0644, \
 		$(IMAGEDIR)/vmlinuz-malta, /boot/vmlinuz-malta, n)
 
+	@$(foreach dtb, $(KERNEL_MALTA_DTB_FILES), \
+		$(call install_copy, kernel-malta, 0, 0, 0644, -, \
+			/boot/$(dtb), n)$(ptx/nl))
+
 	@$(call install_glob, kernel-malta, 0, 0, -, /lib/modules, *.ko,, n)
 	@$(call install_glob, kernel-malta, 0, 0, -, /lib/modules,, *.ko */build */source, n)
 
@@ -117,6 +138,16 @@ $(STATEDIR)/kernel-malta.targetinstall:
 
 	@$(call touch)
 
+# ----------------------------------------------------------------------------
+# Clean
+# ----------------------------------------------------------------------------
+
+$(STATEDIR)/kernel-malta.clean:
+	@$(call targetinfo)
+	@$(call clean_pkg, KERNEL_MALTA)
+	@$(foreach dtb,$(KERNEL_MALTA_DTB_FILES), \
+		rm -vf $(IMAGEDIR)/$(dtb)$(ptx/nl))
+
 # ----------------------------------------------------------------------------
 # oldconfig / menuconfig
 # ----------------------------------------------------------------------------
-- 
2.30.2


_______________________________________________
DistroKit mailing list
DistroKit@pengutronix.de


^ permalink raw reply	[flat|nested] 12+ messages in thread

* [DistroKit] [PATCH 4/8] mips, mipsel: kernel-*: use ptx/config-version and ptx/config-md5
  2021-10-24 19:45 [DistroKit] [PATCH 1/8] mips, mipsel: kernel-*: bring back KERNEL_*_PATH Roland Hieber
  2021-10-24 19:45 ` [DistroKit] [PATCH 2/8] mips, mipsel: kernel-*: bring up-to-date with PTXdist 2021.07.0 template Roland Hieber
  2021-10-24 19:45 ` [DistroKit] [PATCH 3/8] mips, mipsel: kernel-*: rework device-tree handling Roland Hieber
@ 2021-10-24 19:45 ` Roland Hieber
  2021-10-24 19:45 ` [DistroKit] [PATCH 5/8] ptxdist: migrate 2021.06.0 -> 2021.10.0 Roland Hieber
                   ` (3 subsequent siblings)
  6 siblings, 0 replies; 12+ messages in thread
From: Roland Hieber @ 2021-10-24 19:45 UTC (permalink / raw)
  To: distrokit; +Cc: Roland Hieber

These macros make sure that the version and MD5 result in the string
"undefined" when the respective package is not enabled in the menu.
See the following PTXdist commits:

 * commit 80d19e055622e87116df ("rules: new macros ptx/config-version and ptx/config-md5")
 * commit bc40d075ebcdf81cc14b ("kernel: use ptx/config-version and ptx/config-md5")

Link: https://git.pengutronix.de/cgit/ptxdist/commit/?id=80d19e055622e87116df
Link: https://git.pengutronix.de/cgit/ptxdist/commit/?id=bc40d075ebcdf81cc14b

Signed-off-by: Roland Hieber <rhi@pengutronix.de>
---
 configs/platform-mips/rules/kernel-ar9331.make  | 4 ++--
 configs/platform-mips/rules/kernel-malta.make   | 4 ++--
 configs/platform-mipsel/rules/kernel-malta.make | 4 ++--
 3 files changed, 6 insertions(+), 6 deletions(-)

diff --git a/configs/platform-mips/rules/kernel-ar9331.make b/configs/platform-mips/rules/kernel-ar9331.make
index 7b9782d2b696..74c10ce22dfb 100644
--- a/configs/platform-mips/rules/kernel-ar9331.make
+++ b/configs/platform-mips/rules/kernel-ar9331.make
@@ -14,8 +14,8 @@ PACKAGES-$(PTXCONF_KERNEL_AR9331) += kernel-ar9331
 #
 # Paths and names
 #
-KERNEL_AR9331_VERSION	:= $(KERNEL_VERSION)
-KERNEL_AR9331_MD5	:= $(call remove_quotes,$(PTXCONF_KERNEL_MD5))
+KERNEL_AR9331_VERSION	:= $(call ptx/config-version, PTXCONF_KERNEL)
+KERNEL_AR9331_MD5	:= $(call ptx/config-md5, PTXCONF_KERNEL)
 KERNEL_AR9331		:= linux-ar9331-$(KERNEL_AR9331_VERSION)
 KERNEL_AR9331_SUFFIX	:= tar.xz
 KERNEL_AR9331_URL	:= $(call kernel-url, KERNEL_AR9331)
diff --git a/configs/platform-mips/rules/kernel-malta.make b/configs/platform-mips/rules/kernel-malta.make
index c5028b996264..41e2760cd14a 100644
--- a/configs/platform-mips/rules/kernel-malta.make
+++ b/configs/platform-mips/rules/kernel-malta.make
@@ -14,8 +14,8 @@ PACKAGES-$(PTXCONF_KERNEL_MALTA) += kernel-malta
 #
 # Paths and names
 #
-KERNEL_MALTA_VERSION	:= $(KERNEL_VERSION)
-KERNEL_MALTA_MD5	:= $(call remove_quotes,$(PTXCONF_KERNEL_MD5))
+KERNEL_MALTA_VERSION	:= $(call ptx/config-version, PTXCONF_KERNEL)
+KERNEL_MALTA_MD5	:= $(call ptx/config-md5, PTXCONF_KERNEL)
 KERNEL_MALTA		:= linux-malta-$(KERNEL_MALTA_VERSION)
 KERNEL_MALTA_SUFFIX	:= tar.xz
 KERNEL_MALTA_URL	:= $(call kernel-url, KERNEL_MALTA)
diff --git a/configs/platform-mipsel/rules/kernel-malta.make b/configs/platform-mipsel/rules/kernel-malta.make
index c2bea47e9d0c..89f1e06c529a 100644
--- a/configs/platform-mipsel/rules/kernel-malta.make
+++ b/configs/platform-mipsel/rules/kernel-malta.make
@@ -14,8 +14,8 @@ PACKAGES-$(PTXCONF_KERNEL_MALTA) += kernel-malta
 #
 # Paths and names
 #
-KERNEL_MALTA_VERSION	:= $(KERNEL_VERSION)
-KERNEL_MALTA_MD5	:= $(call remove_quotes,$(PTXCONF_KERNEL_MD5))
+KERNEL_MALTA_VERSION	:= $(call ptx/config-version, PTXCONF_KERNEL)
+KERNEL_MALTA_MD5	:= $(call ptx/config-md5, PTXCONF_KERNEL)
 KERNEL_MALTA		:= linux-malta-$(KERNEL_MALTA_VERSION)
 KERNEL_MALTA_SUFFIX	:= tar.xz
 KERNEL_MALTA_URL	:= $(call kernel-url, KERNEL_MALTA)
-- 
2.30.2


_______________________________________________
DistroKit mailing list
DistroKit@pengutronix.de


^ permalink raw reply	[flat|nested] 12+ messages in thread

* [DistroKit] [PATCH 5/8] ptxdist: migrate 2021.06.0 -> 2021.10.0
  2021-10-24 19:45 [DistroKit] [PATCH 1/8] mips, mipsel: kernel-*: bring back KERNEL_*_PATH Roland Hieber
                   ` (2 preceding siblings ...)
  2021-10-24 19:45 ` [DistroKit] [PATCH 4/8] mips, mipsel: kernel-*: use ptx/config-version and ptx/config-md5 Roland Hieber
@ 2021-10-24 19:45 ` Roland Hieber
  2021-10-24 19:45 ` [DistroKit] [PATCH 6/8] mips, mipsel: kernel: re-fork from PTXdist 2021.10.0 Roland Hieber
                   ` (2 subsequent siblings)
  6 siblings, 0 replies; 12+ messages in thread
From: Roland Hieber @ 2021-10-24 19:45 UTC (permalink / raw)
  To: distrokit; +Cc: Roland Hieber

Migrate to the new version with default values.

Device tree handling has changed in upstream commit commit f50cd1449e93
(2021-07-09, Michael Olbrich: "rework device-tree handling"), which we
backported to the mips and mipsel kernel recipes in the previous commit.
For the rest, the PTXCONF_DTC_OFTREE_DT* variables were renamed to
PTXCONF_KERNEL_DTS*. iFor v8a, the DTS path also needs to include the
freescale/ subdir to prevent an error message in the kernel recipe.

Link: https://git.pengutronix.de/cgit/ptxdist/commit/?id=f50cd1449e9347309b10

Signed-off-by: Roland Hieber <rhi@pengutronix.de>
---
 configs/platform-mips/platformconfig   |  9 ++------
 configs/platform-mipsel/platformconfig |  9 ++------
 configs/platform-rpi/platformconfig    | 14 ++++++------
 configs/platform-v7a/platformconfig    | 14 ++++++------
 configs/platform-v8a/platformconfig    | 14 ++++++------
 configs/platform-x86_64/platformconfig |  8 ++++---
 configs/ptxconfig                      | 30 +++++++++++++++++++++++---
 7 files changed, 57 insertions(+), 41 deletions(-)

diff --git a/configs/platform-mips/platformconfig b/configs/platform-mips/platformconfig
index 0a9b6686e95c..bae6671624c6 100644
--- a/configs/platform-mips/platformconfig
+++ b/configs/platform-mips/platformconfig
@@ -1,6 +1,6 @@
 #
 # Automatically generated file; DO NOT EDIT.
-# PTXdist 2021.06.0
+# PTXdist 2021.10.0
 #
 PTXCONF__platformconfig_MAGIC__=y
 
@@ -19,7 +19,7 @@ PTXCONF_PLATFORM="mips"
 PTXCONF_PLATFORM_VERSION="-${PTXDIST_BSP_AUTOVERSION}"
 PTXCONF_RUNTIME=y
 PTXCONF_BUILDTIME=y
-PTXCONF_PLATFORMCONFIG_VERSION="2021.06.0"
+PTXCONF_PLATFORMCONFIG_VERSION="2021.10.0"
 
 #
 # architecture                  
@@ -112,11 +112,6 @@ PTXCONF_KERNEL=y
 PTXCONF_KERNEL_VERSION="5.14"
 PTXCONF_KERNEL_MD5="a082ef5748b813abca0649dab8be5f52"
 PTXCONF_KERNEL_LZOP=y
-PTXCONF_DTC=y
-PTXCONF_DTC_INSTALL_OFTREE=y
-PTXCONF_DTC_OFTREE_DTS_PATH="${PTXDIST_PLATFORMCONFIG_SUBDIR}/dts:${KERNEL_DIR}/arch/${GENERIC_KERNEL_ARCH}/boot/dts"
-PTXCONF_DTC_OFTREE_DTS="qca/ar9331_dpt_module.dts mti/malta.dts"
-PTXCONF_DTC_EXTRA_ARGS=""
 PTXCONF_HOST_DTC=y
 PTXCONF_HOST_DTC_VERSION="1.6.0"
 PTXCONF_HOST_DTC_MD5="cd36ac756290597f3cf1c5b6cfe12e77"
diff --git a/configs/platform-mipsel/platformconfig b/configs/platform-mipsel/platformconfig
index 54e58de7229d..dd697379137e 100644
--- a/configs/platform-mipsel/platformconfig
+++ b/configs/platform-mipsel/platformconfig
@@ -1,6 +1,6 @@
 #
 # Automatically generated file; DO NOT EDIT.
-# PTXdist 2021.06.0
+# PTXdist 2021.10.0
 #
 PTXCONF__platformconfig_MAGIC__=y
 
@@ -19,7 +19,7 @@ PTXCONF_PLATFORM="mipsel"
 PTXCONF_PLATFORM_VERSION="-${PTXDIST_BSP_AUTOVERSION}"
 PTXCONF_RUNTIME=y
 PTXCONF_BUILDTIME=y
-PTXCONF_PLATFORMCONFIG_VERSION="2021.06.0"
+PTXCONF_PLATFORMCONFIG_VERSION="2021.10.0"
 
 #
 # architecture                  
@@ -112,11 +112,6 @@ PTXCONF_KERNEL=y
 PTXCONF_KERNEL_VERSION="5.14"
 PTXCONF_KERNEL_MD5="a082ef5748b813abca0649dab8be5f52"
 PTXCONF_KERNEL_LZOP=y
-PTXCONF_DTC=y
-PTXCONF_DTC_INSTALL_OFTREE=y
-PTXCONF_DTC_OFTREE_DTS_PATH="${PTXDIST_PLATFORMCONFIG_SUBDIR}/dts:${KERNEL_DIR}/arch/${GENERIC_KERNEL_ARCH}/boot/dts"
-PTXCONF_DTC_OFTREE_DTS="mti/malta.dts"
-PTXCONF_DTC_EXTRA_ARGS=""
 PTXCONF_HOST_DTC=y
 PTXCONF_HOST_DTC_VERSION="1.6.0"
 PTXCONF_HOST_DTC_MD5="cd36ac756290597f3cf1c5b6cfe12e77"
diff --git a/configs/platform-rpi/platformconfig b/configs/platform-rpi/platformconfig
index 93f601bcf560..8923ddd17a1f 100644
--- a/configs/platform-rpi/platformconfig
+++ b/configs/platform-rpi/platformconfig
@@ -1,6 +1,6 @@
 #
 # Automatically generated file; DO NOT EDIT.
-# PTXdist 2021.06.0
+# PTXdist 2021.10.0
 #
 PTXCONF__platformconfig_MAGIC__=y
 
@@ -19,7 +19,7 @@ PTXCONF_PLATFORM="rpi"
 PTXCONF_PLATFORM_VERSION="-${PTXDIST_BSP_AUTOVERSION}"
 PTXCONF_RUNTIME=y
 PTXCONF_BUILDTIME=y
-PTXCONF_PLATFORMCONFIG_VERSION="2021.06.0"
+PTXCONF_PLATFORMCONFIG_VERSION="2021.10.0"
 
 #
 # architecture                  
@@ -116,6 +116,7 @@ PTXCONF_KERNEL_XPKG=y
 PTXCONF_KERNEL_INSTALL=y
 PTXCONF_KERNEL_MODULES=y
 PTXCONF_KERNEL_MODULES_INSTALL=y
+# PTXCONF_KERNEL_MODULES_SIGN is not set
 PTXCONF_KERNEL_VERSION="5.14"
 PTXCONF_KERNEL_MD5="a082ef5748b813abca0649dab8be5f52"
 # PTXCONF_KERNEL_IMAGE_BZ is not set
@@ -128,6 +129,10 @@ PTXCONF_KERNEL_IMAGE_Z=y
 # PTXCONF_KERNEL_IMAGE_RAW is not set
 # PTXCONF_KERNEL_IMAGE_SIMPLE is not set
 PTXCONF_KERNEL_IMAGE="zImage"
+PTXCONF_KERNEL_DTB=y
+PTXCONF_KERNEL_DTS_PATH="${KERNEL_DIR}/arch/${GENERIC_KERNEL_ARCH}/boot/dts"
+PTXCONF_KERNEL_DTS="bcm2835-rpi-b.dts"
+# PTXCONF_KERNEL_CODE_SIGNING is not set
 # PTXCONF_KERNEL_ZSTD is not set
 # PTXCONF_KERNEL_XZ is not set
 # PTXCONF_KERNEL_LZOP is not set
@@ -148,11 +153,6 @@ PTXCONF_KERNEL_CONFIG="kernelconfig"
 # Development features
 #
 PTXCONF_KERNEL_EXTRA_MAKEVARS=""
-PTXCONF_DTC=y
-# PTXCONF_DTC_INSTALL_OFTREE is not set
-PTXCONF_DTC_OFTREE_DTS_PATH="${KERNEL_DIR}/arch/${GENERIC_KERNEL_ARCH}/boot/dts"
-PTXCONF_DTC_OFTREE_DTS="bcm2835-rpi-b.dts"
-PTXCONF_DTC_EXTRA_ARGS=""
 PTXCONF_HOST_DTC=y
 PTXCONF_HOST_DTC_VERSION="1.6.0"
 PTXCONF_HOST_DTC_MD5="cd36ac756290597f3cf1c5b6cfe12e77"
diff --git a/configs/platform-v7a/platformconfig b/configs/platform-v7a/platformconfig
index 13f68fba8990..408910f4a1e2 100644
--- a/configs/platform-v7a/platformconfig
+++ b/configs/platform-v7a/platformconfig
@@ -1,6 +1,6 @@
 #
 # Automatically generated file; DO NOT EDIT.
-# PTXdist 2021.06.0
+# PTXdist 2021.10.0
 #
 PTXCONF__platformconfig_MAGIC__=y
 
@@ -19,7 +19,7 @@ PTXCONF_PLATFORM="v7a"
 PTXCONF_PLATFORM_VERSION="-${PTXDIST_BSP_AUTOVERSION}"
 PTXCONF_RUNTIME=y
 PTXCONF_BUILDTIME=y
-PTXCONF_PLATFORMCONFIG_VERSION="2021.06.0"
+PTXCONF_PLATFORMCONFIG_VERSION="2021.10.0"
 
 #
 # architecture                  
@@ -117,6 +117,7 @@ PTXCONF_KERNEL_XPKG=y
 PTXCONF_KERNEL_INSTALL=y
 PTXCONF_KERNEL_MODULES=y
 PTXCONF_KERNEL_MODULES_INSTALL=y
+# PTXCONF_KERNEL_MODULES_SIGN is not set
 PTXCONF_KERNEL_VERSION="5.14"
 PTXCONF_KERNEL_MD5="a082ef5748b813abca0649dab8be5f52"
 # PTXCONF_KERNEL_IMAGE_BZ is not set
@@ -129,6 +130,10 @@ PTXCONF_KERNEL_IMAGE_Z=y
 # PTXCONF_KERNEL_IMAGE_RAW is not set
 # PTXCONF_KERNEL_IMAGE_SIMPLE is not set
 PTXCONF_KERNEL_IMAGE="zImage"
+PTXCONF_KERNEL_DTB=y
+PTXCONF_KERNEL_DTS_PATH="${PTXDIST_PLATFORMCONFIG_SUBDIR}/dts:${KERNEL_DIR}/arch/${GENERIC_KERNEL_ARCH}/boot/dts"
+PTXCONF_KERNEL_DTS="am335x-bone.dts am335x-boneblack.dts vexpress-v2p-ca9.dts bcm2836-rpi-2-b.dts imx6q-sabrelite.dts imx6sx-udoo-neo-full.dts imx6dl-riotboard.dts imx6q-nitrogen6x.dts imx6qp-nitrogen6_max.dts bcm2837-rpi-3-b.dts bcm2837-rpi-cm3-io3.dts stm32mp157c-dk2.dts stm32mp157c-ev1.dts stm32mp157c-lxa-mc1.dts at91-sama5d27_som1_ek.dts at91-sama5d27_giantboard.dts"
+# PTXCONF_KERNEL_CODE_SIGNING is not set
 # PTXCONF_KERNEL_ZSTD is not set
 # PTXCONF_KERNEL_XZ is not set
 PTXCONF_KERNEL_LZOP=y
@@ -149,11 +154,6 @@ PTXCONF_KERNEL_CONFIG="kernelconfig"
 # Development features
 #
 PTXCONF_KERNEL_EXTRA_MAKEVARS=""
-PTXCONF_DTC=y
-PTXCONF_DTC_INSTALL_OFTREE=y
-PTXCONF_DTC_OFTREE_DTS_PATH="${PTXDIST_PLATFORMCONFIG_SUBDIR}/dts:${KERNEL_DIR}/arch/${GENERIC_KERNEL_ARCH}/boot/dts"
-PTXCONF_DTC_OFTREE_DTS="am335x-bone.dts am335x-boneblack.dts vexpress-v2p-ca9.dts bcm2836-rpi-2-b.dts imx6q-sabrelite.dts imx6sx-udoo-neo-full.dts imx6dl-riotboard.dts imx6q-nitrogen6x.dts imx6qp-nitrogen6_max.dts bcm2837-rpi-3-b.dts bcm2837-rpi-cm3-io3.dts stm32mp157c-dk2.dts stm32mp157c-ev1.dts stm32mp157c-lxa-mc1.dts at91-sama5d27_som1_ek.dts at91-sama5d27_giantboard.dts"
-PTXCONF_DTC_EXTRA_ARGS=""
 PTXCONF_HOST_DTC=y
 PTXCONF_HOST_DTC_VERSION="1.6.0"
 PTXCONF_HOST_DTC_MD5="cd36ac756290597f3cf1c5b6cfe12e77"
diff --git a/configs/platform-v8a/platformconfig b/configs/platform-v8a/platformconfig
index a5d93c16749c..838a7ad46188 100644
--- a/configs/platform-v8a/platformconfig
+++ b/configs/platform-v8a/platformconfig
@@ -1,6 +1,6 @@
 #
 # Automatically generated file; DO NOT EDIT.
-# PTXdist 2021.06.0
+# PTXdist 2021.10.0
 #
 PTXCONF__platformconfig_MAGIC__=y
 
@@ -19,7 +19,7 @@ PTXCONF_PLATFORM="v8a"
 PTXCONF_PLATFORM_VERSION="-${PTXDIST_BSP_AUTOVERSION}"
 PTXCONF_RUNTIME=y
 PTXCONF_BUILDTIME=y
-PTXCONF_PLATFORMCONFIG_VERSION="2021.06.0"
+PTXCONF_PLATFORMCONFIG_VERSION="2021.10.0"
 
 #
 # architecture                  
@@ -115,6 +115,7 @@ PTXCONF_KERNEL_XPKG=y
 PTXCONF_KERNEL_INSTALL=y
 PTXCONF_KERNEL_MODULES=y
 PTXCONF_KERNEL_MODULES_INSTALL=y
+# PTXCONF_KERNEL_MODULES_SIGN is not set
 PTXCONF_KERNEL_VERSION="5.14"
 PTXCONF_KERNEL_MD5="a082ef5748b813abca0649dab8be5f52"
 # PTXCONF_KERNEL_IMAGE_BZ is not set
@@ -127,6 +128,10 @@ PTXCONF_KERNEL_MD5="a082ef5748b813abca0649dab8be5f52"
 PTXCONF_KERNEL_IMAGE_RAW=y
 # PTXCONF_KERNEL_IMAGE_SIMPLE is not set
 PTXCONF_KERNEL_IMAGE="Image"
+PTXCONF_KERNEL_DTB=y
+PTXCONF_KERNEL_DTS_PATH="${PTXDIST_PLATFORMCONFIG_SUBDIR}/dts:${KERNEL_DIR}/arch/${GENERIC_KERNEL_ARCH}/boot/dts:${KERNEL_DIR}/arch/${GENERIC_KERNEL_ARCH}/boot/dts/freescale"
+PTXCONF_KERNEL_DTS="armada-3720-community.dts imx8mm-evk.dts imx8mp-evk.dts imx8mq-evk.dts"
+# PTXCONF_KERNEL_CODE_SIGNING is not set
 # PTXCONF_KERNEL_ZSTD is not set
 # PTXCONF_KERNEL_XZ is not set
 # PTXCONF_KERNEL_LZOP is not set
@@ -147,11 +152,6 @@ PTXCONF_KERNEL_CONFIG="kernelconfig"
 # Development features
 #
 PTXCONF_KERNEL_EXTRA_MAKEVARS=""
-PTXCONF_DTC=y
-PTXCONF_DTC_INSTALL_OFTREE=y
-PTXCONF_DTC_OFTREE_DTS_PATH="${PTXDIST_PLATFORMCONFIG_SUBDIR}/dts:${KERNEL_DIR}/arch/${GENERIC_KERNEL_ARCH}/boot/dts"
-PTXCONF_DTC_OFTREE_DTS="armada-3720-community.dts freescale/imx8mm-evk.dts freescale/imx8mp-evk.dts freescale/imx8mq-evk.dts"
-PTXCONF_DTC_EXTRA_ARGS=""
 PTXCONF_HOST_DTC=y
 PTXCONF_HOST_DTC_VERSION="1.6.0"
 PTXCONF_HOST_DTC_MD5="cd36ac756290597f3cf1c5b6cfe12e77"
diff --git a/configs/platform-x86_64/platformconfig b/configs/platform-x86_64/platformconfig
index 953d66bf381e..c910872eecdb 100644
--- a/configs/platform-x86_64/platformconfig
+++ b/configs/platform-x86_64/platformconfig
@@ -1,6 +1,6 @@
 #
 # Automatically generated file; DO NOT EDIT.
-# PTXdist 2021.06.0
+# PTXdist 2021.10.0
 #
 PTXCONF__platformconfig_MAGIC__=y
 
@@ -19,7 +19,7 @@ PTXCONF_PLATFORM="x86_64"
 PTXCONF_PLATFORM_VERSION="-${PTXDIST_BSP_AUTOVERSION}"
 PTXCONF_RUNTIME=y
 PTXCONF_BUILDTIME=y
-PTXCONF_PLATFORMCONFIG_VERSION="2021.06.0"
+PTXCONF_PLATFORMCONFIG_VERSION="2021.10.0"
 
 #
 # architecture                  
@@ -119,6 +119,7 @@ PTXCONF_KERNEL_XPKG=y
 PTXCONF_KERNEL_INSTALL=y
 PTXCONF_KERNEL_MODULES=y
 PTXCONF_KERNEL_MODULES_INSTALL=y
+# PTXCONF_KERNEL_MODULES_SIGN is not set
 PTXCONF_KERNEL_VERSION="5.14"
 PTXCONF_KERNEL_MD5="a082ef5748b813abca0649dab8be5f52"
 PTXCONF_KERNEL_IMAGE_BZ=y
@@ -131,6 +132,8 @@ PTXCONF_KERNEL_IMAGE_BZ=y
 # PTXCONF_KERNEL_IMAGE_RAW is not set
 # PTXCONF_KERNEL_IMAGE_SIMPLE is not set
 PTXCONF_KERNEL_IMAGE="bzImage"
+# PTXCONF_KERNEL_DTB is not set
+# PTXCONF_KERNEL_CODE_SIGNING is not set
 # PTXCONF_KERNEL_ZSTD is not set
 # PTXCONF_KERNEL_XZ is not set
 PTXCONF_KERNEL_LZOP=y
@@ -151,7 +154,6 @@ PTXCONF_KERNEL_CONFIG="kernelconfig"
 # Development features
 #
 PTXCONF_KERNEL_EXTRA_MAKEVARS=""
-# PTXCONF_DTC is not set
 # PTXCONF_HOST_DTC is not set
 
 #
diff --git a/configs/ptxconfig b/configs/ptxconfig
index c97e321e862a..1d8007a63cd2 100644
--- a/configs/ptxconfig
+++ b/configs/ptxconfig
@@ -1,6 +1,6 @@
 #
 # Automatically generated file; DO NOT EDIT.
-# PTXdist 2021.06.0
+# PTXdist 2021.10.0
 #
 PTXCONF_DATAPARTITION=y
 
@@ -67,7 +67,7 @@ PTXCONF_BSP=y
 PTXCONF_RUNTIME=y
 PTXCONF_BUILDTIME=y
 PTXCONF_VIRTUAL=y
-PTXCONF_CONFIGFILE_VERSION="2021.06.0"
+PTXCONF_CONFIGFILE_VERSION="2021.10.0"
 PTXCONF__ptxconfig_MAGIC__=y
 
 #
@@ -119,6 +119,7 @@ PTXCONF_HOST_PKG_CONFIG=y
 PTXCONF_HOST_SYSTEM_PERL=y
 PTXCONF_HOST_SYSTEM_PERL_XMLPARSER=y
 PTXCONF_HOST_SYSTEM_PYTHON3=y
+PTXCONF_HOST_SYSTEM_PYTHON3_JINJA2=y
 PTXCONF_HOST_SYSTEM_PYTHON3_SETUPTOOLS=y
 PTXCONF_HOST_XORGPROTO=y
 PTXCONF_HOST_ZLIB=y
@@ -1342,6 +1343,7 @@ PTXCONF_PCIUTILS_COMPRESS=y
 # PTXCONF_PCMCIAUTILS is not set
 # PTXCONF_PICOCOM is not set
 # PTXCONF_PNPUTILS is not set
+# PTXCONF_PPS_TOOLS is not set
 PTXCONF_PROCPS=y
 PTXCONF_PROCPS_USES_NCURSES=y
 PTXCONF_PROCPS_WITH_SYSTEMD=y
@@ -1410,14 +1412,17 @@ PTXCONF_PROCPS_TOP=y
 # PTXCONF_SYSTEMD_BOOTCHART is not set
 PTXCONF_SYSTEMD=y
 PTXCONF_SYSTEMD_DBUS=y
+PTXCONF_SYSTEMD_DBUS_SERVICES=y
 # PTXCONF_SYSTEMD_VCONSOLE is not set
 PTXCONF_SYSTEMD_DISABLE_RANDOM_SEED=y
+PTXCONF_SYSTEMD_HOSTNAMED=y
 # PTXCONF_SYSTEMD_LOGIND is not set
 # PTXCONF_SYSTEMD_UNITS_USER is not set
 # PTXCONF_SYSTEMD_NETWORK is not set
 PTXCONF_SYSTEMD_TIMEDATE=y
 PTXCONF_SYSTEMD_COREDUMP=y
 PTXCONF_SYSTEMD_SECCOMP=y
+PTXCONF_SYSTEMD_QUOTACHECK=y
 
 #
 # journald                    
@@ -1466,6 +1471,7 @@ PTXCONF_SYSTEMD_UDEV_DRIVERS_RULES=y
 # PTXCONF_U_BOOT_TOOLS is not set
 PTXCONF_UDEV=y
 PTXCONF_UDEV_LIBUDEV=y
+# PTXCONF_UHUBCTL is not set
 # PTXCONF_USB_MODESWITCH is not set
 PTXCONF_USBUTILS=y
 PTXCONF_USBUTILS_LSUSB=y
@@ -1543,6 +1549,8 @@ PTXCONF_UTIL_LINUX_NG_WDCTL=y
 #
 # BusyBox' sulogin is selected!
 #
+# PTXCONF_UTIL_LINUX_NG_SWITCH_ROOT is not set
+# PTXCONF_UTIL_LINUX_NG_PIVOT_ROOT is not set
 
 #
 # BusyBox' which is selected!
@@ -1624,16 +1632,23 @@ PTXCONF_ZSTD=y
 # PTXCONF_PYTHON3_PTYPROCESS is not set
 # PTXCONF_PYTHON3_PY is not set
 # PTXCONF_PYTHON3_PYALSAAUDIO is not set
+# PTXCONF_PYTHON3_PYASN1 is not set
 # PTXCONF_PYTHON3_PYCPARSER is not set
+# PTXCONF_PYTHON3_PYCRYPTODOMEX is not set
 # PTXCONF_PYTHON3_PYPARSING is not set
+# PTXCONF_PYTHON3_PYRO is not set
+# PTXCONF_PYTHON3_PYSMI is not set
+# PTXCONF_PYTHON3_PYSNMP is not set
 # PTXCONF_PYTHON3_PYTEST is not set
 # PTXCONF_PYTHON3_PYTZ is not set
 # PTXCONF_PYTHON3_PYYAML is not set
 # PTXCONF_PYTHON3_SETUPTOOLS is not set
 # PTXCONF_PYTHON3_SIMPLEGENERIC is not set
 # PTXCONF_PYTHON3_SIX is not set
+# PTXCONF_PYTHON3_SNMPCLITOOLS is not set
 # PTXCONF_PYTHON3_SQLPARSE is not set
 # PTXCONF_PYTHON3_SYSTEMD is not set
+# PTXCONF_PYTHON3_TABULATE is not set
 # PTXCONF_PYTHON3_TEXT_UNIDECODE is not set
 # PTXCONF_PYTHON3_TORNADO is not set
 # PTXCONF_PYTHON3_TRAITLETS is not set
@@ -1642,6 +1657,7 @@ PTXCONF_ZSTD=y
 # PTXCONF_PYTHON3_WCWIDTH is not set
 # PTXCONF_PYTHON3_WEBSOCKETS is not set
 # PTXCONF_PYTHON3_YARL is not set
+# PTXCONF_PYTHON3_YOYO_MIGRATIONS is not set
 # PTXCONF_PYTHON3_ZIPP is not set
 # end of python3 Extra Modules         
 # end of Scripting Languages           
@@ -1779,6 +1795,7 @@ PTXCONF_NETWORKMANAGER_NMCLI=y
 # PTXCONF_NETWORKMANAGER_CONCHECK is not set
 # PTXCONF_NETWORKMANAGER_EXAMPLES is not set
 # PTXCONF_NETWORKMANAGER_POLKIT is not set
+# PTXCONF_NETWORKMANAGER_MORE_LOGGING is not set
 
 #
 # networkmanager plugins        
@@ -1796,6 +1813,7 @@ PTXCONF_NETWORKMANAGER_NMCLI=y
 # PTXCONF_NSS is not set
 # PTXCONF_NTP is not set
 # PTXCONF_NTPCLIENT is not set
+# PTXCONF_OFONO is not set
 # PTXCONF_OPENFORTIVPN is not set
 # PTXCONF_OPENLDAP is not set
 # PTXCONF_OPENNHRP is not set
@@ -1852,7 +1870,6 @@ PTXCONF_OPENSSL=y
 # PTXCONF_CRYPTSETUP is not set
 # PTXCONF_DDRESCUE is not set
 PTXCONF_DOSFSTOOLS=y
-# PTXCONF_DOSFSTOOLS_UDEV is not set
 # PTXCONF_DOSFSTOOLS_MKFS_FAT is not set
 # PTXCONF_DOSFSTOOLS_MKFS_FAT_MSDOS is not set
 # PTXCONF_DOSFSTOOLS_MKFS_FAT_VFAT is not set
@@ -1914,6 +1931,7 @@ PTXCONF_E2FSPROGS_INSTALL_MKFS_EXT4=y
 # PTXCONF_LVM2 is not set
 # PTXCONF_MMC_UTILS is not set
 # PTXCONF_NCDU is not set
+# PTXCONF_NTFS_3G is not set
 # PTXCONF_OPKG is not set
 # PTXCONF_QUOTA_TOOLS is not set
 # PTXCONF_SAMBA is not set
@@ -2047,6 +2065,7 @@ PTXCONF_LIBKMOD_MODPROBE=y
 # PTXCONF_LIBLIST is not set
 # PTXCONF_LIBLTDL is not set
 # PTXCONF_LIBLZO is not set
+# PTXCONF_LIBMD is not set
 # PTXCONF_LIBMEMCACHE is not set
 # PTXCONF_LIBMEMCACHED is not set
 # PTXCONF_LIBMXML is not set
@@ -2126,6 +2145,7 @@ PTXCONF_READLINE=y
 PTXCONF_READLINE_NCURSES=y
 # PTXCONF_READLINE_ETC_INPUTRC is not set
 # PTXCONF_SDBUS_CPP is not set
+# PTXCONF_SEATD is not set
 # PTXCONF_SERDISPLIB is not set
 PTXCONF_SLANG=y
 # PTXCONF_SPARSEHASH is not set
@@ -2148,6 +2168,7 @@ PTXCONF_ZLIB=y
 #
 # SELinux                       
 #
+# PTXCONF_FSCRYPTCTL is not set
 # PTXCONF_IMA_EVM_UTILS is not set
 # PTXCONF_KEYUTILS is not set
 # PTXCONF_LIBSEPOL is not set
@@ -2214,6 +2235,7 @@ PTXCONF_DBUS_SYSTEMD_UNIT=y
 # PTXCONF_EVTEST is not set
 # PTXCONF_FIO is not set
 # PTXCONF_FLASHBENCH is not set
+# PTXCONF_GOOGLETEST is not set
 # PTXCONF_HOST_PELTS is not set
 # PTXCONF_IOZONE is not set
 # PTXCONF_IPERF is not set
@@ -2293,6 +2315,7 @@ PTXCONF_DBUS_SYSTEMD_UNIT=y
 # PTXCONF_OPENCV is not set
 # PTXCONF_OPUS is not set
 # PTXCONF_ORC is not set
+# PTXCONF_PIPEWIRE is not set
 # PTXCONF_PIXMAN is not set
 # PTXCONF_PSLIB is not set
 # PTXCONF_QPDF is not set
@@ -2313,6 +2336,7 @@ PTXCONF_DBUS_SYSTEMD_UNIT=y
 # PTXCONF_WPEBACKEND_FDO is not set
 # PTXCONF_WPEWEBKIT is not set
 # PTXCONF_XKEYBOARD_CONFIG is not set
+# PTXCONF_ZBAR is not set
 # end of libs                          
 
 #
-- 
2.30.2


_______________________________________________
DistroKit mailing list
DistroKit@pengutronix.de


^ permalink raw reply	[flat|nested] 12+ messages in thread

* [DistroKit] [PATCH 6/8] mips, mipsel: kernel: re-fork from PTXdist 2021.10.0
  2021-10-24 19:45 [DistroKit] [PATCH 1/8] mips, mipsel: kernel-*: bring back KERNEL_*_PATH Roland Hieber
                   ` (3 preceding siblings ...)
  2021-10-24 19:45 ` [DistroKit] [PATCH 5/8] ptxdist: migrate 2021.06.0 -> 2021.10.0 Roland Hieber
@ 2021-10-24 19:45 ` Roland Hieber
  2021-10-24 19:54   ` [DistroKit] [PATCH v2 " Roland Hieber
  2021-10-24 19:45 ` [DistroKit] [PATCH 7/8] mips, mipsel: don't actually compile the kernel Roland Hieber
  2021-10-24 19:45 ` [DistroKit] [PATCH 8/8] mips, mipsel: update kernel configs Roland Hieber
  6 siblings, 1 reply; 12+ messages in thread
From: Roland Hieber @ 2021-10-24 19:45 UTC (permalink / raw)
  To: distrokit; +Cc: Roland Hieber

The kernel recipe is currently only used for its config file, which
serves as a REF_CONFIG for the extra kernel packages. However the kernel
recipe has changed quite a bit upstream since it was last forked, and
especially the KERNEL_*_OPT variables form a public interface for other
recipes too (even though we currently don't have any in DistroKit). More
importantly, upstream has introduced options to keep the config diffs
clean when using newer GCC versions in combination with newer kernel
versions:

  * commit d57abb42 ("kernel: fix disabling gcc plugins for >= v5.11")
  * commit 114fecbd ("kernel: really fix disabling gcc plugins for >= v5.11")
  * commit 533f7709 ("kernel/kernel-template: set PTXDIST_NO_GCC_PLUGINS=1 in _MAKE_ENV as well")

Furthermore, the upstream recipe also installs the perf and iio
userspace tools, which could be helpful for debugging.

To make porting upstream patches to the kernel recipe easier in the
future, re-fork it from the current PTXdist version, and then re-do our
changes cleanly in the next commit. Update the platformconfig with all
new selectable features disabled. Since both platforms have the same
files, symlink one of them to the other.

Link: https://git.pengutronix.de/cgit/ptxdist/commit/?id=d57abb428d360e0
Link: https://git.pengutronix.de/cgit/ptxdist/commit/?id=114fecbd4e97e97
Link: https://git.pengutronix.de/cgit/ptxdist/commit/?id=533f7709f61c54a

Signed-off-by: Roland Hieber <rhi@pengutronix.de>
---
 configs/platform-mips/platformconfig        |  34 ++
 configs/platform-mips/platforms/kernel.in   | 330 +++++++++++++++++++-
 configs/platform-mips/rules/kernel.make     | 299 +++++++++++++++++-
 configs/platform-mipsel/platformconfig      |  39 +++
 configs/platform-mipsel/platforms/kernel.in | 330 +++++++++++++++++++-
 configs/platform-mipsel/rules/kernel.make   | 299 +++++++++++++++++-
 6 files changed, 1317 insertions(+), 14 deletions(-)

diff --git a/configs/platform-mips/platformconfig b/configs/platform-mips/platformconfig
index bae6671624c6..5ca070a4a0ab 100644
--- a/configs/platform-mips/platformconfig
+++ b/configs/platform-mips/platformconfig
@@ -109,9 +109,42 @@ PTXCONF_TARGET_EXTRA_LDFLAGS=""
 # end of architecture                  
 
 PTXCONF_KERNEL=y
+# PTXCONF_KERNEL_INSTALL is not set
+# PTXCONF_KERNEL_MODULES is not set
 PTXCONF_KERNEL_VERSION="5.14"
 PTXCONF_KERNEL_MD5="a082ef5748b813abca0649dab8be5f52"
+# PTXCONF_KERNEL_IMAGE_BZ is not set
+# PTXCONF_KERNEL_IMAGE_Z is not set
+# PTXCONF_KERNEL_IMAGE_XIP is not set
+# PTXCONF_KERNEL_IMAGE_U is not set
+# PTXCONF_KERNEL_IMAGE_VM is not set
+# PTXCONF_KERNEL_IMAGE_VMLINUX is not set
+PTXCONF_KERNEL_IMAGE_VMLINUZ=y
+# PTXCONF_KERNEL_IMAGE_RAW is not set
+# PTXCONF_KERNEL_IMAGE_SIMPLE is not set
+PTXCONF_KERNEL_IMAGE="vmlinuz"
+# PTXCONF_KERNEL_DTB is not set
+# PTXCONF_KERNEL_CODE_SIGNING is not set
+# PTXCONF_KERNEL_ZSTD is not set
+# PTXCONF_KERNEL_XZ is not set
 PTXCONF_KERNEL_LZOP=y
+# PTXCONF_KERNEL_LZ4 is not set
+# PTXCONF_KERNEL_OPENSSL is not set
+# PTXCONF_KERNEL_LIBELF is not set
+# PTXCONF_KERNEL_GCC_PLUGINS is not set
+# PTXCONF_KERNEL_CONFIG_BASE_VERSION is not set
+
+#
+# patching & configuration      
+#
+PTXCONF_KERNEL_SERIES="series"
+PTXCONF_KERNEL_CONFIG="kernelconfig"
+# end of patching & configuration      
+
+#
+# Development features
+#
+PTXCONF_KERNEL_EXTRA_MAKEVARS=""
 PTXCONF_HOST_DTC=y
 PTXCONF_HOST_DTC_VERSION="1.6.0"
 PTXCONF_HOST_DTC_MD5="cd36ac756290597f3cf1c5b6cfe12e77"
@@ -203,4 +236,5 @@ PTXCONF_HOST_LIBKMOD=y
 PTXCONF_HOST_LIBLZO=y
 PTXCONF_HOST_LZOP=y
 PTXCONF_HOST_M4=y
+PTXCONF_HOST_SYSTEM_BC=y
 PTXCONF_HOST_UTIL_LINUX_NG=y
diff --git a/configs/platform-mips/platforms/kernel.in b/configs/platform-mips/platforms/kernel.in
index 1889211a7ae2..06b6e24a6756 100644
--- a/configs/platform-mips/platforms/kernel.in
+++ b/configs/platform-mips/platforms/kernel.in
@@ -3,24 +3,352 @@
 menuconfig KERNEL
 	bool
 	default y
+	select CODE_SIGNING		if KERNEL_CODE_SIGNING
+	select HOST_U_BOOT_TOOLS	if KERNEL_IMAGE_U || (KERNEL_IMAGE_SIMPLE && ARCH_MICROBLAZE)
+	select HOST_ZSTD		if KERNEL_ZSTD
+	select HOST_XZ			if KERNEL_XZ
+	select HOST_LZOP		if KERNEL_LZOP
+	select HOST_LZ4			if KERNEL_LZ4
+	select HOST_LIBKMOD		if KERNEL_MODULES
+	select HOST_SYSTEM_BC
+	select HOST_OPENSSL		if KERNEL_OPENSSL
+	select HOST_LIBELF		if KERNEL_LIBELF
 	prompt "Linux kernel                  "
 
 if KERNEL
 
+config KERNEL_XPKG
+	bool
+	help
+	  Select this symbol if kernel tools or other non kernel
+	  modules are installed.
+
+config KERNEL_INSTALL
+	bool
+	prompt "install kernel into /boot"
+	select KERNEL_XPKG
+
+config KERNEL_MODULES
+	bool
+	default y
+	prompt "build kernel-modules"
+
+config KERNEL_MODULES_INSTALL
+	bool
+	default y
+	prompt "Install modules into /lib/modules"
+	depends on KERNEL_MODULES
+
+config KERNEL_MODULES_SIGN
+	bool
+	depends on KERNEL_MODULES
+	select KERNEL_CODE_SIGNING
+	select KERNEL_MODULES_INSTALL
+	prompt "sign modules"
+	help
+	  If enabled, kernel modules are signed during the install stage with
+	  the key specified by the code signing provider in the "kernel-modules"
+	  role.
+
+	  See the section "Kernel module signing" in the "Daily Work" chapter in
+	  the PTXdist manual for use cases and more infos about what needs to be
+	  enabled in the kernel config file.
+
 config KERNEL_VERSION
 	prompt "kernel version"
 	string
 	default "4.15"
+	help
+	  Fill in the kernel version that you want to use. Normally, you should
+	  use the latest stable version, see <https://kernel.org>.
 
 config KERNEL_MD5
 	prompt "kernel source md5sum"
 	string
+	help
+	  To ensure integrity of the downloaded source tarball, fill in its
+	  MD5 sum here.
 
-config KERNEL_INSTALL
+choice
+	prompt "Image Type          "
+	default KERNEL_IMAGE_BZ
+
+	config KERNEL_IMAGE_BZ
+		bool
+		prompt "bzImage"
+		help
+		 This usually is the target to be used on ia32 platforms. It
+		 is not limited in size (to be more precise: Limited up to 4MiB).
+
+	config KERNEL_IMAGE_Z
+		bool
+		prompt "zImage "
+		help
+		 This usually is a target to be used on ia32 platforms, it
+		 is the older format and limited to about 500k in size due to
+		 low memory size restrictions.
+
+	config KERNEL_IMAGE_XIP
+		bool
+		prompt "xipImage"
+		help
+		  Create eXecute In Place Image.
+
+	config KERNEL_IMAGE_U
+		bool
+		prompt "uImage "
+		help
+		 This is the target for most non ia32 platforms like PowerPC
+		 and ARM architectures. Its a compressed image with additional
+		 embedded information.
+
+	config KERNEL_IMAGE_VM
+		bool
+		prompt "vmImage"
+		help
+		 This is the target for non ia32 platforms like blackfin
+		 architectures.
+
+	config KERNEL_IMAGE_VMLINUX
+		bool
+		prompt "vmlinux"
+		help
+		 This is the target to get the kernel image as an ELF. Mostly
+		 used for debugging purposes.
+
+	config KERNEL_IMAGE_VMLINUZ
+		bool
+		prompt "vmlinuz"
+		help
+		 This is the target to get the compressed kernel image as an ELF.
+		 Mostly used for debugging purposes or for MIPS.
+
+	config KERNEL_IMAGE_RAW
+		bool
+		prompt "Image"
+		help
+		 This is the target to get the kernel image as an raw uncompressed
+		 binary file.
+	config KERNEL_IMAGE_SIMPLE
+		bool
+		prompt "simpleImage"
+		help
+		  Create a simple Image with embedded DTB.
+endchoice
+
+if KERNEL_IMAGE_SIMPLE
+
+config KERNEL_IMAGE_SIMPLE_TARGET
+	prompt "name of simple image"
+	string
+	default "virtex405-xup"
+	help
+	  Name of created simple kernel image e.g.
+	  the "virtex405-xup" of "simpleImage.virtex405-xup.elf"
+
+config KERNEL_IMAGE_SIMPLE_DTS
+	prompt "path to DTS file"
+	string
+	default "${PTXDIST_PLATFORMCONFIGDIR}/simpleImage.dts"
+	help
+	  This specifies the "dts" file used to create your simple
+	  image.
+
+	  The default is "${PTXDIST_PLATFORMCONFIGDIR}/simpleImage.dts".
+
+	  The path "${PTXDIST_PLATFORMCONFIGDIR}" is the directory
+	  where your platformconfig file is located.
+
+endif
+
+config KERNEL_IMAGE
+	string
+	default "bzImage"	if KERNEL_IMAGE_BZ
+	default "Image.gz"	if KERNEL_IMAGE_Z && ARCH_ARM64
+	default "zImage"	if KERNEL_IMAGE_Z
+	default "xipImage"	if KERNEL_IMAGE_XIP
+	default "uImage"	if KERNEL_IMAGE_U
+	default "vmImage"	if KERNEL_IMAGE_VM
+	default "vmlinux"	if KERNEL_IMAGE_VMLINUX
+	default "vmlinuz"	if KERNEL_IMAGE_VMLINUZ
+	default "Image"		if KERNEL_IMAGE_RAW
+	default "simpleImage.${PTXCONF_KERNEL_IMAGE_SIMPLE_TARGET}.elf" if KERNEL_IMAGE_SIMPLE
+
+menuconfig KERNEL_DTB
 	bool
+	prompt "Build device trees            "
+
+if KERNEL_DTB
+
+config KERNEL_DTS_PATH
+	string "path to source dts file"
+	default "${PTXDIST_PLATFORMCONFIG_SUBDIR}/dts:${KERNEL_DIR}/arch/${GENERIC_KERNEL_ARCH}/boot/dts"
+	help
+	  Define path to the dts source file. Multiple directories can be
+	  specified separated by ':'. A relative path will be expanded relative
+	  to the workspace and all other layers. Only on of the specified paths
+	  can be a relative path.
+
+config KERNEL_DTS
+	string "source dts file"
+	default "<yourboard>.dts"
+	help
+	  Select the dts file to use for the device tree binary
+	  blob generation. For relative file names KERNEL_DTS_PATH
+	  is used as a search path for the device tree files specified
+	  here. Multiple dts files can be specified, separated by spaces.
+
+endif
+
+config KERNEL_CODE_SIGNING
+	prompt "use code signing infrastructure"
+	select KERNEL_OPENSSL
+	bool
+	help
+	  Enable this option if you want the kernel to make use of the code
+	  signing infrastructure, e.g. to supply trust roots from the
+	  'kernel-trusted' code signing role.
+
+	  See the section "Using the Code Signing Infrastructure with the Kernel
+	  Recipe" in the "Daily Use" chapter in the PTXdist manual for use
+	  cases and more information.
+
+config KERNEL_ZSTD
+	prompt "build zstd hosttool"
+	bool
+	help
+	  Select this if you're going to build your kernel compressed
+	  with zstd and your host system is lacking the proper tools
+	  (the "zstd" package).
+
+	  Select this if you're unsure, as it won't hurt. It just
+	  increases the build time.
+
+config KERNEL_XZ
+	prompt "build xz-utils hosttool"
+	bool
+	help
+	  Select this if you're going to build your kernel compressed
+	  with lzma and your host system is lacking the proper tools
+	  ("xz-utils" or the deprecated "lzma" package).
+
+	  Select this if you're unsure, as it won't hurt. It just
+	  increases the build time.
 
 config KERNEL_LZOP
 	prompt "build lzop hosttool"
 	bool
+	help
+	  Select this if you're going to build your kernel compressed
+	  with lzo and your host system is lacking the proper tools
+	  (the "lzop" package).
+
+	  Select this if you're unsure, as it won't hurt. It just
+	  increases the build time.
+
+config KERNEL_LZ4
+	prompt "build lz4 hosttool"
+	bool
+	help
+	  Select this if you're going to build your kernel compressed
+	  with lz4 and your host system is lacking the proper tools
+	  (the "lz4" package).
+
+	  Select this if you're unsure, as it won't hurt. It just
+	  increases the build time.
+
+config KERNEL_OPENSSL
+	prompt "build openssl hosttool"
+	bool
+	help
+	  Select this if you're going to build your kernel with support for
+	  module signing, IMA etc. where openssl is need as hosttool.
+
+	  Select this if you're unsure, as it won't hurt. It just
+	  increases the build time.
+
+config KERNEL_LIBELF
+	prompt "build libelf host library"
+	bool
+	help
+	  Select this if you're going to build your kernel with
+	  STACK_VALIDATION enabled. Stack validation is used for the orc
+	  unwinder for kernel version >= v4.14 on x86_64.
+
+config KERNEL_GCC_PLUGINS
+	prompt "allow gcc plugins"
+	bool
+	help
+	  The kernel kconfig options to enable gcc plugins depend on a
+	  sufficiently new host compiler. As a result, the kernel config
+	  may change with a different host compiler version.
+	  If this option is disabled then the environment is manipulated
+	  to ensure that the compiler check always fails. This keeps the
+	  kernel config stable.
+	  Enable this option when the kernel gcc plugins are used.
+
+config KERNEL_CONFIG_BASE_VERSION
+	prompt "use base version in the kernelconfig"
+	bool
+	help
+	  When the BSP contains a patch stack for the kernel, then it is
+	  often useful to modify EXTRAVERSION with one of the patches. This
+	  makes it easier to detect which version of the patch stack was
+	  used to build the currently running kernel.
+	  However, this means that the comment at the beginning of the
+	  kernel config changes with each new revision of the patch stack.
+
+	  When this option is enabled, then the version in the kernel
+	  config is overwritten with the version from
+	  PTXCONF_KERNEL_VERSION. The version built into the kernel remains
+	  unchanged.
+
+menu "patching & configuration      "
+
+config KERNEL_SERIES
+	prompt "patch series file"
+	string
+	default "series"
+	help
+	  This entry specifies a patch series file which has to live in
+	  the kernel patches directory.
+
+	  The series file contains lines with names of patch files which
+	  are then being applied to the kernel.
+
+config KERNEL_CONFIG
+	prompt "kernel config file"
+	string
+	default "kernelconfig"
+	help
+	  This entry specifies the .config file used to compile your kernel.
+	  Specify the path relative to the platformconfig directory.
+
+endmenu
+
+
+comment "Development features"
+
+config KERNEL_EXTRA_MAKEVARS
+	string
+	default ""
+	prompt "Additional kbuild options"
+	help
+	  Specify extra parameters for the kernel build system here. Useful
+	  options include:
+
+	  * CONFIG_DEBUG_SECTION_MISMATCH=y
+	  Enable this feature if you want the kernel's buildsystem to check for
+	  section mismatches (__devinit/__devexit, __init/__exit). This
+	  entry is valid for 2.6.25 kernels and above. Previous kernel versions
+	  do this check automatically. Enabling this feature is recommended
+	  for kernel development only because it changes how code is inlined.
+	  Changing this entry will rebuild the whole kernel.
+
+	  * C=1
+	  Run sparse when compiling.
+
+	  * V=1
+	  Increase verbosity when compiling.
 
 endif	# KERNEL
diff --git a/configs/platform-mips/rules/kernel.make b/configs/platform-mips/rules/kernel.make
index 6d5ca4d4ea0e..9caff677918e 100644
--- a/configs/platform-mips/rules/kernel.make
+++ b/configs/platform-mips/rules/kernel.make
@@ -16,7 +16,7 @@ PACKAGES-$(PTXCONF_KERNEL) += kernel
 # Paths and names
 #
 KERNEL			:= linux-$(KERNEL_VERSION)
-KERNEL_MD5		:= $(call remove_quotes,$(PTXCONF_KERNEL_MD5))
+KERNEL_MD5		:= $(call ptx/config-md5, PTXCONF_KERNEL)
 ifneq ($(KERNEL_NEEDS_GIT_URL),y)
 KERNEL_SUFFIX		:= tar.xz
 KERNEL_URL		:= $(call kernel-url, KERNEL)
@@ -26,24 +26,105 @@ KERNEL_URL		:= https://git.kernel.org/torvalds/t/$(KERNEL).$(KERNEL_SUFFIX)
 endif
 KERNEL_DIR		:= $(BUILDDIR)/$(KERNEL)
 KERNEL_BUILD_DIR	:= $(KERNEL_DIR)-build
-KERNEL_CONFIG		:= $(call ptx/in-platformconfigdir, kernelconfig)
+KERNEL_CONFIG		:= $(call ptx/in-platformconfigdir, $(call remove_quotes, $(PTXCONF_KERNEL_CONFIG)))
+KERNEL_DTS_PATH		:= $(call remove_quotes,$(PTXCONF_KERNEL_DTS_PATH))
+KERNEL_DTS		:= $(call remove_quotes,$(PTXCONF_KERNEL_DTS))
+KERNEL_DTB_FILES	:= $(addsuffix .dtb,$(basename $(KERNEL_DTS)))
 KERNEL_LICENSE		:= GPL-2.0-only
 KERNEL_SOURCE		:= $(SRCDIR)/$(KERNEL).$(KERNEL_SUFFIX)
 KERNEL_DEVPKG		:= NO
 KERNEL_BUILD_OOT	:= KEEP
 
+# track changes to devices-trees in the BSP
+$(call world/dts-cfghash-file, KERNEL)
+
+# in case we migrate some old syntax
+ifneq ($(KERNEL_DTS),$(notdir $(KERNEL_DTS)))
+$(call ptx/error, the device trees in PTXCONF_KERNEL_DTS must be specified without)
+$(call ptx/error, directory. Use PTXCONF_KERNEL_DTS_PATH to provide a list of direcories)
+$(call ptx/error, that will be searched.)
+endif
+
 # ----------------------------------------------------------------------------
 # Prepare
 # ----------------------------------------------------------------------------
 
-KERNEL_CONF_OPT := \
+# use CONFIG_CC_STACKPROTECTOR if available. The rest makes no sense for the kernel
+KERNEL_WRAPPER_BLACKLIST := \
+	$(PTXDIST_LOWLEVEL_WRAPPER_BLACKLIST)
+
+# Note: for some reason, the error is not visible without the dummy '$(shell :)'
+# when running 'ptxdist -j -q go'.
+define kernel/deprecated
+$(if $(strip \
+$(filter $(STATEDIR)/%, \
+$(filter-out $(STATEDIR)/kernel.%,$@)) \
+),$(shell :)$(error $(notdir $@): \
+	use KERNEL_MODULE_OPT instead of $(1) for kernel module packages))
+endef
+
+# check for old kernel modules rules
+KERNEL_MAKEVARS = $(call kernel/deprecated, KERNEL_MAKEVARS)
+
+# like kernel-opts but with different CROSS_COMPILE=
+KERNEL_BASE_OPT		= \
+	$(call kernel-opts, KERNEL,$(KERNEL_CROSS_COMPILE)) \
+	$(call remove_quotes,$(PTXCONF_KERNEL_EXTRA_MAKEVARS))
+
+ifdef PTXCONF_KERNEL_CODE_SIGNING
+KERNEL_BASE_OPT		+= \
+	$(if $(shell cs_get_ca kernel-trusted), \
+		CONFIG_SYSTEM_TRUSTED_KEYS=$(shell cs_get_ca kernel-trusted))
+endif
+ifdef PTXCONF_KERNEL_MODULES_SIGN
+KERNEL_BASE_OPT		+= \
+	CONFIG_MODULE_SIG_KEY='"$(shell cs_get_uri kernel-modules)"'
+endif
+
+# Intermediate option. This will be used by kernel module packages.
+KERNEL_MODULE_OPT	= \
 	-C $(KERNEL_DIR) \
 	O=$(KERNEL_BUILD_DIR) \
-	$(call kernel-opts, KERNEL)
+	$(KERNEL_BASE_OPT)
+
+KERNEL_SHARED_OPT	= \
+	$(KERNEL_MODULE_OPT)
 
+ifndef PTXCONF_KERNEL_GCC_PLUGINS
 # no gcc plugins; avoid config changes depending on the host compiler
-KERNEL_CONF_OPT += \
-	HOSTCXX=false
+KERNEL_SHARED_OPT	+= \
+	HOSTCXX="$(HOSTCXX) -DGENERATOR_FILE" \
+	HOSTCC="$(HOSTCC) -DGENERATOR_FILE"
+KERNEL_CONF_ENV		:= \
+	PTXDIST_NO_GCC_PLUGINS=1
+KERNEL_MAKE_ENV		:= \
+	PTXDIST_NO_GCC_PLUGINS=1
+endif
+
+KERNEL_CONF_TOOL	:= kconfig
+KERNEL_CONF_OPT		= \
+	$(KERNEL_SHARED_OPT)
+
+ifdef PTXCONF_KERNEL_CONFIG_BASE_VERSION
+# force using KERNEL_VERSION in the kernelconfig
+KERNEL_CONF_OPT		+= \
+	KERNELVERSION=$(KERNEL_VERSION)
+endif
+
+#
+# support the different kernel image formats
+#
+KERNEL_IMAGE		:= $(call remove_quotes, $(PTXCONF_KERNEL_IMAGE))
+
+# these are sane defaults
+KERNEL_IMAGE_PATH_y	:= $(KERNEL_BUILD_DIR)/arch/$(GENERIC_KERNEL_ARCH)/boot/$(KERNEL_IMAGE)
+
+# vmlinux and vmlinuz are special
+KERNEL_IMAGE_PATH_$(PTXCONF_KERNEL_IMAGE_VMLINUX) := $(KERNEL_BUILD_DIR)/vmlinux
+KERNEL_IMAGE_PATH_$(PTXCONF_KERNEL_IMAGE_VMLINUZ) := $(KERNEL_BUILD_DIR)/vmlinuz
+# avr32 is also special
+KERNEL_IMAGE_PATH_$(PTXCONF_ARCH_AVR32) := $(KERNEL_BUILD_DIR)/arch/$(GENERIC_KERNEL_ARCH)/boot/images/$(KERNEL_IMAGE)
+
 
 ifdef PTXCONF_KERNEL
 $(KERNEL_CONFIG):
@@ -56,22 +137,228 @@ $(KERNEL_CONFIG):
 	@exit 1
 endif
 
+
+#
+# when compiling the rootfs into the kernel, we just include an empty
+# file for now. the rootfs isn't build yet.
+#
+KERNEL_INITRAMFS_SOURCE_$(PTXCONF_IMAGE_KERNEL_INITRAMFS) += $(STATEDIR)/empty.cpio
+
+$(STATEDIR)/kernel.prepare:
+	@$(call targetinfo)
+#
+# Make sure there is a non empty INITRAMFS_SOURCE in $(KERNEL_CONFIG), but
+# not the real expanded path because it contains local workdir path which
+# is not relevant to other developers.
+#
+ifdef KERNEL_INITRAMFS_SOURCE_y
+	@sed -i -e 's,^CONFIG_INITRAMFS_SOURCE.*$$,CONFIG_INITRAMFS_SOURCE=\"# Automatically set by PTXDist\",g' \
+		"$(KERNEL_CONFIG)"
+endif
+ifdef PTXCONF_KERNEL_IMAGE_SIMPLE
+	cp $(PTXCONF_KERNEL_IMAGE_SIMPLE_DTS) \
+		$(KERNEL_DIR)/arch/$(GENERIC_KERNEL_ARCH)/boot/dts/$(PTXCONF_KERNEL_IMAGE_SIMPLE_TARGET).dts
+endif
+
+	@$(call world/prepare, KERNEL)
+
+#
+# Use an existing dummy INITRAMFS_SOURCE for the first 'make' call. The
+# kernel image will be rebuilt in the image-kernel package with the real
+# initramfs.
+#
+ifdef KERNEL_INITRAMFS_SOURCE_y
+	@touch "$(KERNEL_INITRAMFS_SOURCE_y)"
+	@sed -i -e 's,^CONFIG_INITRAMFS_SOURCE.*$$,CONFIG_INITRAMFS_SOURCE=\"$(KERNEL_INITRAMFS_SOURCE_y)\",g' \
+		"$(KERNEL_BUILD_DIR)/.config"
+endif
+	@$(call touch)
+
+
+# ----------------------------------------------------------------------------
+# tags
+# ----------------------------------------------------------------------------
+
+$(STATEDIR)/kernel.tags:
+	@$(call targetinfo)
+	@$(MAKE) -C $(KERNEL_DIR) $(KERNEL_MAKE_OPT) tags TAGS cscope
+
 # ----------------------------------------------------------------------------
 # Compile
 # ----------------------------------------------------------------------------
 
+KERNEL_MAKE_OPT		= \
+	$(call kernel/deprecated, KERNEL_MAKE_OPT) \
+	$(KERNEL_SHARED_OPT) \
+	$(KERNEL_IMAGE) \
+	$(call ptx/ifdef, PTXCONF_KERNEL_MODULES,modules)
+
+KERNEL_TOOL_PERF_OPTS	:= \
+	-C $(KERNEL_DIR)/tools/perf \
+	O=$(KERNEL_BUILD_DIR)/tools/perf \
+	$(KERNEL_BASE_OPT) \
+	WERROR=0 \
+	NO_LIBPERL=1 \
+	NO_LIBPYTHON=1 \
+	NO_DWARF= \
+	NO_SLANG= \
+	NO_GTK2=1 \
+	NO_DEMANGLE= \
+	NO_LIBELF= \
+	NO_LIBUNWIND=1 \
+	NO_BACKTRACE= \
+	NO_LIBNUMA=1 \
+	NO_LIBAUDIT=1 \
+	NO_LIBBIONIC=1 \
+	NO_LIBCRYPTO=1 \
+	NO_LIBDW_DWARF_UNWIND= \
+	NO_PERF_READ_VDSO32=1 \
+	NO_PERF_READ_VDSOX32=1 \
+	NO_ZLIB= \
+	NO_LIBBABELTRACE=1 \
+	NO_LZMA=1 \
+	NO_LIBZSTD=1 \
+	NO_AUXTRACE= \
+	NO_LIBBPF=1 \
+	NO_SDT=1 \
+	NO_LIBCAP=1
+
+# manual make to handle CPPFLAGS and broken parallel building for some
+# kernel versions
+KERNEL_TOOL_IIO_OPTS	:= \
+	PTXDIST_ICECC=$(PTXDIST_ICERUN) \
+	CPPFLAGS="-D__EXPORTED_HEADERS__ -I$(KERNEL_DIR)/include/uapi -I$(KERNEL_DIR)/include" \
+	-C $(KERNEL_DIR)/tools/iio \
+	O=$(KERNEL_BUILD_DIR)/tools/iio \
+	$(KERNEL_BASE_OPT) \
+	$(PARALLELMFLAGS_BROKEN)
+
 $(STATEDIR)/kernel.compile:
 	@$(call targetinfo)
+	@rm -f \
+		$(KERNEL_BUILD_DIR)/usr/initramfs_data.cpio.* \
+		$(KERNEL_BUILD_DIR)/usr/.initramfs_data.cpio.*
+	@$(call world/compile, KERNEL)
+ifdef PTXCONF_KERNEL_TOOL_PERF
+	@mkdir -p $(KERNEL_BUILD_DIR)/tools/perf
+	@$(call compile, KERNEL, $(KERNEL_TOOL_PERF_OPTS))
+endif
+ifdef PTXCONF_KERNEL_TOOL_IIO
+	@mkdir -p $(KERNEL_BUILD_DIR)/tools/iio
+	@$(call world/execute, KERNEL, \
+		$(MAKE) $(KERNEL_TOOL_IIO_OPTS))
+endif
 	@$(call touch)
 
 # ----------------------------------------------------------------------------
 # Install
 # ----------------------------------------------------------------------------
 
+KERNEL_INSTALL_OPT = \
+	$(KERNEL_BASE_OPT) \
+	modules_install
+
 $(STATEDIR)/kernel.install:
 	@$(call targetinfo)
+ifdef PTXCONF_KERNEL_MODULES_INSTALL
+	@$(call world/install, KERNEL)
+endif
+	@$(call world/dtb, KERNEL)
 	@$(call touch)
 
+# ----------------------------------------------------------------------------
+# Target-Install
+# ----------------------------------------------------------------------------
+
+$(STATEDIR)/kernel.targetinstall:
+	@$(call targetinfo)
+
+	@$(foreach dtb, $(KERNEL_DTB_FILES), \
+		echo -e "Installing $(dtb) ...\n"$(ptx/nl) \
+		install -D -m0644 $(KERNEL_PKGDIR)/boot/$(dtb) \
+			$(IMAGEDIR)/$(dtb)$(ptx/nl))
+
+ifdef PTXCONF_KERNEL_XPKG
+	@$(call install_init,  kernel)
+	@$(call install_fixup, kernel, PRIORITY,optional)
+	@$(call install_fixup, kernel, SECTION,base)
+	@$(call install_fixup, kernel, AUTHOR,"Robert Schwebel <r.schwebel@pengutronix.de>")
+	@$(call install_fixup, kernel, DESCRIPTION,missing)
+
+	@$(call install_copy, kernel, 0, 0, 0755, /boot);
+
+ifdef PTXCONF_KERNEL_INSTALL
+	@$(call install_copy, kernel, 0, 0, 0644, $(KERNEL_IMAGE_PATH_y), /boot/$(KERNEL_IMAGE), n)
+
+	@$(foreach dtb, $(KERNEL_DTB_FILES), \
+		$(call install_copy, kernel, 0, 0, 0644, -, \
+			/boot/$(dtb), n)$(ptx/nl))
+endif
+
+# install the ELF kernel image for debugging purpose
+ifdef PTXCONF_KERNEL_VMLINUX
+	@$(call install_copy, kernel, 0, 0, 0644, $(KERNEL_BUILD_DIR)/vmlinux, /boot/vmlinux, n)
+endif
+
+ifdef PTXCONF_KERNEL_TOOL_PERF
+	@$(call install_copy, kernel, 0, 0, 0755, $(KERNEL_BUILD_DIR)/tools/perf/perf, \
+		/usr/bin/perf)
+endif
+
+ifdef PTXCONF_KERNEL_TOOL_IIO
+	@$(call install_copy, kernel, 0, 0, 0755, $(wildcard $(KERNEL_BUILD_DIR)/tools/iio/*generic_buffer), \
+		/usr/bin/iio_generic_buffer)
+	@$(call install_copy, kernel, 0, 0, 0755, $(KERNEL_BUILD_DIR)/tools/iio/lsiio, \
+		/usr/bin/lsiio)
+	@$(call install_copy, kernel, 0, 0, 0755, $(KERNEL_BUILD_DIR)/tools/iio/iio_event_monitor, \
+		/usr/bin/iio_event_monitor)
+endif
+
+	@$(call install_finish, kernel)
+endif
+
+	@$(call touch)
+
+
+# ----------------------------------------------------------------------------
+# Target-Install-post
+# ----------------------------------------------------------------------------
+
+ifdef PTXCONF_IMAGE_KERNEL_INSTALL_EARLY
+$(STATEDIR)/kernel.targetinstall.post: $(IMAGEDIR)/linuximage
+ifdef PTXCONF_IMAGE_KERNEL_LZOP
+$(STATEDIR)/kernel.targetinstall.post: $(IMAGEDIR)/linuximage.lzo
+endif
+endif
+
+$(STATEDIR)/kernel.targetinstall.post:
+	@$(call targetinfo)
+
+ifdef PTXCONF_KERNEL_MODULES_INSTALL
+	@$(call install_init,  kernel-modules)
+	@$(call install_fixup, kernel-modules, PRIORITY,optional)
+	@$(call install_fixup, kernel-modules, SECTION,base)
+	@$(call install_fixup, kernel-modules, AUTHOR,"Robert Schwebel <r.schwebel@pengutronix.de>")
+	@$(call install_fixup, kernel-modules, DESCRIPTION,missing)
+
+	@$(call install_glob, kernel-modules, 0, 0, -, /lib/modules, *.ko,, n)
+	@$(call install_glob, kernel-modules, 0, 0, -, /lib/modules,, *.ko */build */source, n)
+
+	@$(call install_finish, kernel-modules)
+endif
+
+	@$(call touch)
+
+# ----------------------------------------------------------------------------
+# Clean
+# ----------------------------------------------------------------------------
+
+$(STATEDIR)/kernel.clean:
+	@$(call targetinfo)
+	@$(call clean_pkg, KERNEL)
+	@$(foreach dtb,$(KERNEL_DTB_FILES), \
+		rm -vf $(IMAGEDIR)/$(dtb)$(ptx/nl))
+
 # ----------------------------------------------------------------------------
 # oldconfig / menuconfig
 # ----------------------------------------------------------------------------
diff --git a/configs/platform-mipsel/platformconfig b/configs/platform-mipsel/platformconfig
index dd697379137e..c84569e26d1c 100644
--- a/configs/platform-mipsel/platformconfig
+++ b/configs/platform-mipsel/platformconfig
@@ -109,9 +109,47 @@ PTXCONF_TARGET_EXTRA_LDFLAGS=""
 # end of architecture                  
 
 PTXCONF_KERNEL=y
+
+#
+# NOTE: this kernel only exists for the userspace kernel tools and a REF_CONFIG.
+#
+
+#
+# The actual kernels come from the extra kernel-* packages.
+#
 PTXCONF_KERNEL_VERSION="5.14"
 PTXCONF_KERNEL_MD5="a082ef5748b813abca0649dab8be5f52"
+# PTXCONF_KERNEL_IMAGE_BZ is not set
+# PTXCONF_KERNEL_IMAGE_Z is not set
+# PTXCONF_KERNEL_IMAGE_XIP is not set
+# PTXCONF_KERNEL_IMAGE_U is not set
+# PTXCONF_KERNEL_IMAGE_VM is not set
+# PTXCONF_KERNEL_IMAGE_VMLINUX is not set
+PTXCONF_KERNEL_IMAGE_VMLINUZ=y
+# PTXCONF_KERNEL_IMAGE_RAW is not set
+# PTXCONF_KERNEL_IMAGE_SIMPLE is not set
+PTXCONF_KERNEL_IMAGE="vmlinuz"
+# PTXCONF_KERNEL_CODE_SIGNING is not set
+# PTXCONF_KERNEL_ZSTD is not set
+# PTXCONF_KERNEL_XZ is not set
 PTXCONF_KERNEL_LZOP=y
+# PTXCONF_KERNEL_LZ4 is not set
+# PTXCONF_KERNEL_OPENSSL is not set
+# PTXCONF_KERNEL_LIBELF is not set
+# PTXCONF_KERNEL_GCC_PLUGINS is not set
+# PTXCONF_KERNEL_CONFIG_BASE_VERSION is not set
+
+#
+# patching & configuration      
+#
+PTXCONF_KERNEL_SERIES="series"
+PTXCONF_KERNEL_CONFIG="kernelconfig"
+# end of patching & configuration      
+
+#
+# Development features
+#
+PTXCONF_KERNEL_EXTRA_MAKEVARS=""
 PTXCONF_HOST_DTC=y
 PTXCONF_HOST_DTC_VERSION="1.6.0"
 PTXCONF_HOST_DTC_MD5="cd36ac756290597f3cf1c5b6cfe12e77"
@@ -199,4 +237,5 @@ PTXCONF_HOST_LIBKMOD=y
 PTXCONF_HOST_LIBLZO=y
 PTXCONF_HOST_LZOP=y
 PTXCONF_HOST_M4=y
+PTXCONF_HOST_SYSTEM_BC=y
 PTXCONF_HOST_UTIL_LINUX_NG=y
diff --git a/configs/platform-mipsel/platforms/kernel.in b/configs/platform-mipsel/platforms/kernel.in
index 1889211a7ae2..06b6e24a6756 100644
--- a/configs/platform-mipsel/platforms/kernel.in
+++ b/configs/platform-mipsel/platforms/kernel.in
@@ -3,24 +3,352 @@
 menuconfig KERNEL
 	bool
 	default y
+	select CODE_SIGNING		if KERNEL_CODE_SIGNING
+	select HOST_U_BOOT_TOOLS	if KERNEL_IMAGE_U || (KERNEL_IMAGE_SIMPLE && ARCH_MICROBLAZE)
+	select HOST_ZSTD		if KERNEL_ZSTD
+	select HOST_XZ			if KERNEL_XZ
+	select HOST_LZOP		if KERNEL_LZOP
+	select HOST_LZ4			if KERNEL_LZ4
+	select HOST_LIBKMOD		if KERNEL_MODULES
+	select HOST_SYSTEM_BC
+	select HOST_OPENSSL		if KERNEL_OPENSSL
+	select HOST_LIBELF		if KERNEL_LIBELF
 	prompt "Linux kernel                  "
 
 if KERNEL
 
+config KERNEL_XPKG
+	bool
+	help
+	  Select this symbol if kernel tools or other non kernel
+	  modules are installed.
+
+config KERNEL_INSTALL
+	bool
+	prompt "install kernel into /boot"
+	select KERNEL_XPKG
+
+config KERNEL_MODULES
+	bool
+	default y
+	prompt "build kernel-modules"
+
+config KERNEL_MODULES_INSTALL
+	bool
+	default y
+	prompt "Install modules into /lib/modules"
+	depends on KERNEL_MODULES
+
+config KERNEL_MODULES_SIGN
+	bool
+	depends on KERNEL_MODULES
+	select KERNEL_CODE_SIGNING
+	select KERNEL_MODULES_INSTALL
+	prompt "sign modules"
+	help
+	  If enabled, kernel modules are signed during the install stage with
+	  the key specified by the code signing provider in the "kernel-modules"
+	  role.
+
+	  See the section "Kernel module signing" in the "Daily Work" chapter in
+	  the PTXdist manual for use cases and more infos about what needs to be
+	  enabled in the kernel config file.
+
 config KERNEL_VERSION
 	prompt "kernel version"
 	string
 	default "4.15"
+	help
+	  Fill in the kernel version that you want to use. Normally, you should
+	  use the latest stable version, see <https://kernel.org>.
 
 config KERNEL_MD5
 	prompt "kernel source md5sum"
 	string
+	help
+	  To ensure integrity of the downloaded source tarball, fill in its
+	  MD5 sum here.
 
-config KERNEL_INSTALL
+choice
+	prompt "Image Type          "
+	default KERNEL_IMAGE_BZ
+
+	config KERNEL_IMAGE_BZ
+		bool
+		prompt "bzImage"
+		help
+		 This usually is the target to be used on ia32 platforms. It
+		 is not limited in size (to be more precise: Limited up to 4MiB).
+
+	config KERNEL_IMAGE_Z
+		bool
+		prompt "zImage "
+		help
+		 This usually is a target to be used on ia32 platforms, it
+		 is the older format and limited to about 500k in size due to
+		 low memory size restrictions.
+
+	config KERNEL_IMAGE_XIP
+		bool
+		prompt "xipImage"
+		help
+		  Create eXecute In Place Image.
+
+	config KERNEL_IMAGE_U
+		bool
+		prompt "uImage "
+		help
+		 This is the target for most non ia32 platforms like PowerPC
+		 and ARM architectures. Its a compressed image with additional
+		 embedded information.
+
+	config KERNEL_IMAGE_VM
+		bool
+		prompt "vmImage"
+		help
+		 This is the target for non ia32 platforms like blackfin
+		 architectures.
+
+	config KERNEL_IMAGE_VMLINUX
+		bool
+		prompt "vmlinux"
+		help
+		 This is the target to get the kernel image as an ELF. Mostly
+		 used for debugging purposes.
+
+	config KERNEL_IMAGE_VMLINUZ
+		bool
+		prompt "vmlinuz"
+		help
+		 This is the target to get the compressed kernel image as an ELF.
+		 Mostly used for debugging purposes or for MIPS.
+
+	config KERNEL_IMAGE_RAW
+		bool
+		prompt "Image"
+		help
+		 This is the target to get the kernel image as an raw uncompressed
+		 binary file.
+	config KERNEL_IMAGE_SIMPLE
+		bool
+		prompt "simpleImage"
+		help
+		  Create a simple Image with embedded DTB.
+endchoice
+
+if KERNEL_IMAGE_SIMPLE
+
+config KERNEL_IMAGE_SIMPLE_TARGET
+	prompt "name of simple image"
+	string
+	default "virtex405-xup"
+	help
+	  Name of created simple kernel image e.g.
+	  the "virtex405-xup" of "simpleImage.virtex405-xup.elf"
+
+config KERNEL_IMAGE_SIMPLE_DTS
+	prompt "path to DTS file"
+	string
+	default "${PTXDIST_PLATFORMCONFIGDIR}/simpleImage.dts"
+	help
+	  This specifies the "dts" file used to create your simple
+	  image.
+
+	  The default is "${PTXDIST_PLATFORMCONFIGDIR}/simpleImage.dts".
+
+	  The path "${PTXDIST_PLATFORMCONFIGDIR}" is the directory
+	  where your platformconfig file is located.
+
+endif
+
+config KERNEL_IMAGE
+	string
+	default "bzImage"	if KERNEL_IMAGE_BZ
+	default "Image.gz"	if KERNEL_IMAGE_Z && ARCH_ARM64
+	default "zImage"	if KERNEL_IMAGE_Z
+	default "xipImage"	if KERNEL_IMAGE_XIP
+	default "uImage"	if KERNEL_IMAGE_U
+	default "vmImage"	if KERNEL_IMAGE_VM
+	default "vmlinux"	if KERNEL_IMAGE_VMLINUX
+	default "vmlinuz"	if KERNEL_IMAGE_VMLINUZ
+	default "Image"		if KERNEL_IMAGE_RAW
+	default "simpleImage.${PTXCONF_KERNEL_IMAGE_SIMPLE_TARGET}.elf" if KERNEL_IMAGE_SIMPLE
+
+menuconfig KERNEL_DTB
 	bool
+	prompt "Build device trees            "
+
+if KERNEL_DTB
+
+config KERNEL_DTS_PATH
+	string "path to source dts file"
+	default "${PTXDIST_PLATFORMCONFIG_SUBDIR}/dts:${KERNEL_DIR}/arch/${GENERIC_KERNEL_ARCH}/boot/dts"
+	help
+	  Define path to the dts source file. Multiple directories can be
+	  specified separated by ':'. A relative path will be expanded relative
+	  to the workspace and all other layers. Only on of the specified paths
+	  can be a relative path.
+
+config KERNEL_DTS
+	string "source dts file"
+	default "<yourboard>.dts"
+	help
+	  Select the dts file to use for the device tree binary
+	  blob generation. For relative file names KERNEL_DTS_PATH
+	  is used as a search path for the device tree files specified
+	  here. Multiple dts files can be specified, separated by spaces.
+
+endif
+
+config KERNEL_CODE_SIGNING
+	prompt "use code signing infrastructure"
+	select KERNEL_OPENSSL
+	bool
+	help
+	  Enable this option if you want the kernel to make use of the code
+	  signing infrastructure, e.g. to supply trust roots from the
+	  'kernel-trusted' code signing role.
+
+	  See the section "Using the Code Signing Infrastructure with the Kernel
+	  Recipe" in the "Daily Use" chapter in the PTXdist manual for use
+	  cases and more information.
+
+config KERNEL_ZSTD
+	prompt "build zstd hosttool"
+	bool
+	help
+	  Select this if you're going to build your kernel compressed
+	  with zstd and your host system is lacking the proper tools
+	  (the "zstd" package).
+
+	  Select this if you're unsure, as it won't hurt. It just
+	  increases the build time.
+
+config KERNEL_XZ
+	prompt "build xz-utils hosttool"
+	bool
+	help
+	  Select this if you're going to build your kernel compressed
+	  with lzma and your host system is lacking the proper tools
+	  ("xz-utils" or the deprecated "lzma" package).
+
+	  Select this if you're unsure, as it won't hurt. It just
+	  increases the build time.
 
 config KERNEL_LZOP
 	prompt "build lzop hosttool"
 	bool
+	help
+	  Select this if you're going to build your kernel compressed
+	  with lzo and your host system is lacking the proper tools
+	  (the "lzop" package).
+
+	  Select this if you're unsure, as it won't hurt. It just
+	  increases the build time.
+
+config KERNEL_LZ4
+	prompt "build lz4 hosttool"
+	bool
+	help
+	  Select this if you're going to build your kernel compressed
+	  with lz4 and your host system is lacking the proper tools
+	  (the "lz4" package).
+
+	  Select this if you're unsure, as it won't hurt. It just
+	  increases the build time.
+
+config KERNEL_OPENSSL
+	prompt "build openssl hosttool"
+	bool
+	help
+	  Select this if you're going to build your kernel with support for
+	  module signing, IMA etc. where openssl is need as hosttool.
+
+	  Select this if you're unsure, as it won't hurt. It just
+	  increases the build time.
+
+config KERNEL_LIBELF
+	prompt "build libelf host library"
+	bool
+	help
+	  Select this if you're going to build your kernel with
+	  STACK_VALIDATION enabled. Stack validation is used for the orc
+	  unwinder for kernel version >= v4.14 on x86_64.
+
+config KERNEL_GCC_PLUGINS
+	prompt "allow gcc plugins"
+	bool
+	help
+	  The kernel kconfig options to enable gcc plugins depend on a
+	  sufficiently new host compiler. As a result, the kernel config
+	  may change with a different host compiler version.
+	  If this option is disabled then the environment is manipulated
+	  to ensure that the compiler check always fails. This keeps the
+	  kernel config stable.
+	  Enable this option when the kernel gcc plugins are used.
+
+config KERNEL_CONFIG_BASE_VERSION
+	prompt "use base version in the kernelconfig"
+	bool
+	help
+	  When the BSP contains a patch stack for the kernel, then it is
+	  often useful to modify EXTRAVERSION with one of the patches. This
+	  makes it easier to detect which version of the patch stack was
+	  used to build the currently running kernel.
+	  However, this means that the comment at the beginning of the
+	  kernel config changes with each new revision of the patch stack.
+
+	  When this option is enabled, then the version in the kernel
+	  config is overwritten with the version from
+	  PTXCONF_KERNEL_VERSION. The version built into the kernel remains
+	  unchanged.
+
+menu "patching & configuration      "
+
+config KERNEL_SERIES
+	prompt "patch series file"
+	string
+	default "series"
+	help
+	  This entry specifies a patch series file which has to live in
+	  the kernel patches directory.
+
+	  The series file contains lines with names of patch files which
+	  are then being applied to the kernel.
+
+config KERNEL_CONFIG
+	prompt "kernel config file"
+	string
+	default "kernelconfig"
+	help
+	  This entry specifies the .config file used to compile your kernel.
+	  Specify the path relative to the platformconfig directory.
+
+endmenu
+
+
+comment "Development features"
+
+config KERNEL_EXTRA_MAKEVARS
+	string
+	default ""
+	prompt "Additional kbuild options"
+	help
+	  Specify extra parameters for the kernel build system here. Useful
+	  options include:
+
+	  * CONFIG_DEBUG_SECTION_MISMATCH=y
+	  Enable this feature if you want the kernel's buildsystem to check for
+	  section mismatches (__devinit/__devexit, __init/__exit). This
+	  entry is valid for 2.6.25 kernels and above. Previous kernel versions
+	  do this check automatically. Enabling this feature is recommended
+	  for kernel development only because it changes how code is inlined.
+	  Changing this entry will rebuild the whole kernel.
+
+	  * C=1
+	  Run sparse when compiling.
+
+	  * V=1
+	  Increase verbosity when compiling.
 
 endif	# KERNEL
diff --git a/configs/platform-mipsel/rules/kernel.make b/configs/platform-mipsel/rules/kernel.make
index 6d5ca4d4ea0e..9caff677918e 100644
--- a/configs/platform-mipsel/rules/kernel.make
+++ b/configs/platform-mipsel/rules/kernel.make
@@ -16,7 +16,7 @@ PACKAGES-$(PTXCONF_KERNEL) += kernel
 # Paths and names
 #
 KERNEL			:= linux-$(KERNEL_VERSION)
-KERNEL_MD5		:= $(call remove_quotes,$(PTXCONF_KERNEL_MD5))
+KERNEL_MD5		:= $(call ptx/config-md5, PTXCONF_KERNEL)
 ifneq ($(KERNEL_NEEDS_GIT_URL),y)
 KERNEL_SUFFIX		:= tar.xz
 KERNEL_URL		:= $(call kernel-url, KERNEL)
@@ -26,24 +26,105 @@ KERNEL_URL		:= https://git.kernel.org/torvalds/t/$(KERNEL).$(KERNEL_SUFFIX)
 endif
 KERNEL_DIR		:= $(BUILDDIR)/$(KERNEL)
 KERNEL_BUILD_DIR	:= $(KERNEL_DIR)-build
-KERNEL_CONFIG		:= $(call ptx/in-platformconfigdir, kernelconfig)
+KERNEL_CONFIG		:= $(call ptx/in-platformconfigdir, $(call remove_quotes, $(PTXCONF_KERNEL_CONFIG)))
+KERNEL_DTS_PATH		:= $(call remove_quotes,$(PTXCONF_KERNEL_DTS_PATH))
+KERNEL_DTS		:= $(call remove_quotes,$(PTXCONF_KERNEL_DTS))
+KERNEL_DTB_FILES	:= $(addsuffix .dtb,$(basename $(KERNEL_DTS)))
 KERNEL_LICENSE		:= GPL-2.0-only
 KERNEL_SOURCE		:= $(SRCDIR)/$(KERNEL).$(KERNEL_SUFFIX)
 KERNEL_DEVPKG		:= NO
 KERNEL_BUILD_OOT	:= KEEP
 
+# track changes to devices-trees in the BSP
+$(call world/dts-cfghash-file, KERNEL)
+
+# in case we migrate some old syntax
+ifneq ($(KERNEL_DTS),$(notdir $(KERNEL_DTS)))
+$(call ptx/error, the device trees in PTXCONF_KERNEL_DTS must be specified without)
+$(call ptx/error, directory. Use PTXCONF_KERNEL_DTS_PATH to provide a list of direcories)
+$(call ptx/error, that will be searched.)
+endif
+
 # ----------------------------------------------------------------------------
 # Prepare
 # ----------------------------------------------------------------------------
 
-KERNEL_CONF_OPT := \
+# use CONFIG_CC_STACKPROTECTOR if available. The rest makes no sense for the kernel
+KERNEL_WRAPPER_BLACKLIST := \
+	$(PTXDIST_LOWLEVEL_WRAPPER_BLACKLIST)
+
+# Note: for some reason, the error is not visible without the dummy '$(shell :)'
+# when running 'ptxdist -j -q go'.
+define kernel/deprecated
+$(if $(strip \
+$(filter $(STATEDIR)/%, \
+$(filter-out $(STATEDIR)/kernel.%,$@)) \
+),$(shell :)$(error $(notdir $@): \
+	use KERNEL_MODULE_OPT instead of $(1) for kernel module packages))
+endef
+
+# check for old kernel modules rules
+KERNEL_MAKEVARS = $(call kernel/deprecated, KERNEL_MAKEVARS)
+
+# like kernel-opts but with different CROSS_COMPILE=
+KERNEL_BASE_OPT		= \
+	$(call kernel-opts, KERNEL,$(KERNEL_CROSS_COMPILE)) \
+	$(call remove_quotes,$(PTXCONF_KERNEL_EXTRA_MAKEVARS))
+
+ifdef PTXCONF_KERNEL_CODE_SIGNING
+KERNEL_BASE_OPT		+= \
+	$(if $(shell cs_get_ca kernel-trusted), \
+		CONFIG_SYSTEM_TRUSTED_KEYS=$(shell cs_get_ca kernel-trusted))
+endif
+ifdef PTXCONF_KERNEL_MODULES_SIGN
+KERNEL_BASE_OPT		+= \
+	CONFIG_MODULE_SIG_KEY='"$(shell cs_get_uri kernel-modules)"'
+endif
+
+# Intermediate option. This will be used by kernel module packages.
+KERNEL_MODULE_OPT	= \
 	-C $(KERNEL_DIR) \
 	O=$(KERNEL_BUILD_DIR) \
-	$(call kernel-opts, KERNEL)
+	$(KERNEL_BASE_OPT)
+
+KERNEL_SHARED_OPT	= \
+	$(KERNEL_MODULE_OPT)
 
+ifndef PTXCONF_KERNEL_GCC_PLUGINS
 # no gcc plugins; avoid config changes depending on the host compiler
-KERNEL_CONF_OPT += \
-	HOSTCXX=false
+KERNEL_SHARED_OPT	+= \
+	HOSTCXX="$(HOSTCXX) -DGENERATOR_FILE" \
+	HOSTCC="$(HOSTCC) -DGENERATOR_FILE"
+KERNEL_CONF_ENV		:= \
+	PTXDIST_NO_GCC_PLUGINS=1
+KERNEL_MAKE_ENV		:= \
+	PTXDIST_NO_GCC_PLUGINS=1
+endif
+
+KERNEL_CONF_TOOL	:= kconfig
+KERNEL_CONF_OPT		= \
+	$(KERNEL_SHARED_OPT)
+
+ifdef PTXCONF_KERNEL_CONFIG_BASE_VERSION
+# force using KERNEL_VERSION in the kernelconfig
+KERNEL_CONF_OPT		+= \
+	KERNELVERSION=$(KERNEL_VERSION)
+endif
+
+#
+# support the different kernel image formats
+#
+KERNEL_IMAGE		:= $(call remove_quotes, $(PTXCONF_KERNEL_IMAGE))
+
+# these are sane defaults
+KERNEL_IMAGE_PATH_y	:= $(KERNEL_BUILD_DIR)/arch/$(GENERIC_KERNEL_ARCH)/boot/$(KERNEL_IMAGE)
+
+# vmlinux and vmlinuz are special
+KERNEL_IMAGE_PATH_$(PTXCONF_KERNEL_IMAGE_VMLINUX) := $(KERNEL_BUILD_DIR)/vmlinux
+KERNEL_IMAGE_PATH_$(PTXCONF_KERNEL_IMAGE_VMLINUZ) := $(KERNEL_BUILD_DIR)/vmlinuz
+# avr32 is also special
+KERNEL_IMAGE_PATH_$(PTXCONF_ARCH_AVR32) := $(KERNEL_BUILD_DIR)/arch/$(GENERIC_KERNEL_ARCH)/boot/images/$(KERNEL_IMAGE)
+
 
 ifdef PTXCONF_KERNEL
 $(KERNEL_CONFIG):
@@ -56,22 +137,228 @@ $(KERNEL_CONFIG):
 	@exit 1
 endif
 
+
+#
+# when compiling the rootfs into the kernel, we just include an empty
+# file for now. the rootfs isn't build yet.
+#
+KERNEL_INITRAMFS_SOURCE_$(PTXCONF_IMAGE_KERNEL_INITRAMFS) += $(STATEDIR)/empty.cpio
+
+$(STATEDIR)/kernel.prepare:
+	@$(call targetinfo)
+#
+# Make sure there is a non empty INITRAMFS_SOURCE in $(KERNEL_CONFIG), but
+# not the real expanded path because it contains local workdir path which
+# is not relevant to other developers.
+#
+ifdef KERNEL_INITRAMFS_SOURCE_y
+	@sed -i -e 's,^CONFIG_INITRAMFS_SOURCE.*$$,CONFIG_INITRAMFS_SOURCE=\"# Automatically set by PTXDist\",g' \
+		"$(KERNEL_CONFIG)"
+endif
+ifdef PTXCONF_KERNEL_IMAGE_SIMPLE
+	cp $(PTXCONF_KERNEL_IMAGE_SIMPLE_DTS) \
+		$(KERNEL_DIR)/arch/$(GENERIC_KERNEL_ARCH)/boot/dts/$(PTXCONF_KERNEL_IMAGE_SIMPLE_TARGET).dts
+endif
+
+	@$(call world/prepare, KERNEL)
+
+#
+# Use an existing dummy INITRAMFS_SOURCE for the first 'make' call. The
+# kernel image will be rebuilt in the image-kernel package with the real
+# initramfs.
+#
+ifdef KERNEL_INITRAMFS_SOURCE_y
+	@touch "$(KERNEL_INITRAMFS_SOURCE_y)"
+	@sed -i -e 's,^CONFIG_INITRAMFS_SOURCE.*$$,CONFIG_INITRAMFS_SOURCE=\"$(KERNEL_INITRAMFS_SOURCE_y)\",g' \
+		"$(KERNEL_BUILD_DIR)/.config"
+endif
+	@$(call touch)
+
+
+# ----------------------------------------------------------------------------
+# tags
+# ----------------------------------------------------------------------------
+
+$(STATEDIR)/kernel.tags:
+	@$(call targetinfo)
+	@$(MAKE) -C $(KERNEL_DIR) $(KERNEL_MAKE_OPT) tags TAGS cscope
+
 # ----------------------------------------------------------------------------
 # Compile
 # ----------------------------------------------------------------------------
 
+KERNEL_MAKE_OPT		= \
+	$(call kernel/deprecated, KERNEL_MAKE_OPT) \
+	$(KERNEL_SHARED_OPT) \
+	$(KERNEL_IMAGE) \
+	$(call ptx/ifdef, PTXCONF_KERNEL_MODULES,modules)
+
+KERNEL_TOOL_PERF_OPTS	:= \
+	-C $(KERNEL_DIR)/tools/perf \
+	O=$(KERNEL_BUILD_DIR)/tools/perf \
+	$(KERNEL_BASE_OPT) \
+	WERROR=0 \
+	NO_LIBPERL=1 \
+	NO_LIBPYTHON=1 \
+	NO_DWARF= \
+	NO_SLANG= \
+	NO_GTK2=1 \
+	NO_DEMANGLE= \
+	NO_LIBELF= \
+	NO_LIBUNWIND=1 \
+	NO_BACKTRACE= \
+	NO_LIBNUMA=1 \
+	NO_LIBAUDIT=1 \
+	NO_LIBBIONIC=1 \
+	NO_LIBCRYPTO=1 \
+	NO_LIBDW_DWARF_UNWIND= \
+	NO_PERF_READ_VDSO32=1 \
+	NO_PERF_READ_VDSOX32=1 \
+	NO_ZLIB= \
+	NO_LIBBABELTRACE=1 \
+	NO_LZMA=1 \
+	NO_LIBZSTD=1 \
+	NO_AUXTRACE= \
+	NO_LIBBPF=1 \
+	NO_SDT=1 \
+	NO_LIBCAP=1
+
+# manual make to handle CPPFLAGS and broken parallel building for some
+# kernel versions
+KERNEL_TOOL_IIO_OPTS	:= \
+	PTXDIST_ICECC=$(PTXDIST_ICERUN) \
+	CPPFLAGS="-D__EXPORTED_HEADERS__ -I$(KERNEL_DIR)/include/uapi -I$(KERNEL_DIR)/include" \
+	-C $(KERNEL_DIR)/tools/iio \
+	O=$(KERNEL_BUILD_DIR)/tools/iio \
+	$(KERNEL_BASE_OPT) \
+	$(PARALLELMFLAGS_BROKEN)
+
 $(STATEDIR)/kernel.compile:
 	@$(call targetinfo)
+	@rm -f \
+		$(KERNEL_BUILD_DIR)/usr/initramfs_data.cpio.* \
+		$(KERNEL_BUILD_DIR)/usr/.initramfs_data.cpio.*
+	@$(call world/compile, KERNEL)
+ifdef PTXCONF_KERNEL_TOOL_PERF
+	@mkdir -p $(KERNEL_BUILD_DIR)/tools/perf
+	@$(call compile, KERNEL, $(KERNEL_TOOL_PERF_OPTS))
+endif
+ifdef PTXCONF_KERNEL_TOOL_IIO
+	@mkdir -p $(KERNEL_BUILD_DIR)/tools/iio
+	@$(call world/execute, KERNEL, \
+		$(MAKE) $(KERNEL_TOOL_IIO_OPTS))
+endif
 	@$(call touch)
 
 # ----------------------------------------------------------------------------
 # Install
 # ----------------------------------------------------------------------------
 
+KERNEL_INSTALL_OPT = \
+	$(KERNEL_BASE_OPT) \
+	modules_install
+
 $(STATEDIR)/kernel.install:
 	@$(call targetinfo)
+ifdef PTXCONF_KERNEL_MODULES_INSTALL
+	@$(call world/install, KERNEL)
+endif
+	@$(call world/dtb, KERNEL)
 	@$(call touch)
 
+# ----------------------------------------------------------------------------
+# Target-Install
+# ----------------------------------------------------------------------------
+
+$(STATEDIR)/kernel.targetinstall:
+	@$(call targetinfo)
+
+	@$(foreach dtb, $(KERNEL_DTB_FILES), \
+		echo -e "Installing $(dtb) ...\n"$(ptx/nl) \
+		install -D -m0644 $(KERNEL_PKGDIR)/boot/$(dtb) \
+			$(IMAGEDIR)/$(dtb)$(ptx/nl))
+
+ifdef PTXCONF_KERNEL_XPKG
+	@$(call install_init,  kernel)
+	@$(call install_fixup, kernel, PRIORITY,optional)
+	@$(call install_fixup, kernel, SECTION,base)
+	@$(call install_fixup, kernel, AUTHOR,"Robert Schwebel <r.schwebel@pengutronix.de>")
+	@$(call install_fixup, kernel, DESCRIPTION,missing)
+
+	@$(call install_copy, kernel, 0, 0, 0755, /boot);
+
+ifdef PTXCONF_KERNEL_INSTALL
+	@$(call install_copy, kernel, 0, 0, 0644, $(KERNEL_IMAGE_PATH_y), /boot/$(KERNEL_IMAGE), n)
+
+	@$(foreach dtb, $(KERNEL_DTB_FILES), \
+		$(call install_copy, kernel, 0, 0, 0644, -, \
+			/boot/$(dtb), n)$(ptx/nl))
+endif
+
+# install the ELF kernel image for debugging purpose
+ifdef PTXCONF_KERNEL_VMLINUX
+	@$(call install_copy, kernel, 0, 0, 0644, $(KERNEL_BUILD_DIR)/vmlinux, /boot/vmlinux, n)
+endif
+
+ifdef PTXCONF_KERNEL_TOOL_PERF
+	@$(call install_copy, kernel, 0, 0, 0755, $(KERNEL_BUILD_DIR)/tools/perf/perf, \
+		/usr/bin/perf)
+endif
+
+ifdef PTXCONF_KERNEL_TOOL_IIO
+	@$(call install_copy, kernel, 0, 0, 0755, $(wildcard $(KERNEL_BUILD_DIR)/tools/iio/*generic_buffer), \
+		/usr/bin/iio_generic_buffer)
+	@$(call install_copy, kernel, 0, 0, 0755, $(KERNEL_BUILD_DIR)/tools/iio/lsiio, \
+		/usr/bin/lsiio)
+	@$(call install_copy, kernel, 0, 0, 0755, $(KERNEL_BUILD_DIR)/tools/iio/iio_event_monitor, \
+		/usr/bin/iio_event_monitor)
+endif
+
+	@$(call install_finish, kernel)
+endif
+
+	@$(call touch)
+
+
+# ----------------------------------------------------------------------------
+# Target-Install-post
+# ----------------------------------------------------------------------------
+
+ifdef PTXCONF_IMAGE_KERNEL_INSTALL_EARLY
+$(STATEDIR)/kernel.targetinstall.post: $(IMAGEDIR)/linuximage
+ifdef PTXCONF_IMAGE_KERNEL_LZOP
+$(STATEDIR)/kernel.targetinstall.post: $(IMAGEDIR)/linuximage.lzo
+endif
+endif
+
+$(STATEDIR)/kernel.targetinstall.post:
+	@$(call targetinfo)
+
+ifdef PTXCONF_KERNEL_MODULES_INSTALL
+	@$(call install_init,  kernel-modules)
+	@$(call install_fixup, kernel-modules, PRIORITY,optional)
+	@$(call install_fixup, kernel-modules, SECTION,base)
+	@$(call install_fixup, kernel-modules, AUTHOR,"Robert Schwebel <r.schwebel@pengutronix.de>")
+	@$(call install_fixup, kernel-modules, DESCRIPTION,missing)
+
+	@$(call install_glob, kernel-modules, 0, 0, -, /lib/modules, *.ko,, n)
+	@$(call install_glob, kernel-modules, 0, 0, -, /lib/modules,, *.ko */build */source, n)
+
+	@$(call install_finish, kernel-modules)
+endif
+
+	@$(call touch)
+
+# ----------------------------------------------------------------------------
+# Clean
+# ----------------------------------------------------------------------------
+
+$(STATEDIR)/kernel.clean:
+	@$(call targetinfo)
+	@$(call clean_pkg, KERNEL)
+	@$(foreach dtb,$(KERNEL_DTB_FILES), \
+		rm -vf $(IMAGEDIR)/$(dtb)$(ptx/nl))
+
 # ----------------------------------------------------------------------------
 # oldconfig / menuconfig
 # ----------------------------------------------------------------------------
-- 
2.30.2


_______________________________________________
DistroKit mailing list
DistroKit@pengutronix.de


^ permalink raw reply	[flat|nested] 12+ messages in thread

* [DistroKit] [PATCH 7/8] mips, mipsel: don't actually compile the kernel
  2021-10-24 19:45 [DistroKit] [PATCH 1/8] mips, mipsel: kernel-*: bring back KERNEL_*_PATH Roland Hieber
                   ` (4 preceding siblings ...)
  2021-10-24 19:45 ` [DistroKit] [PATCH 6/8] mips, mipsel: kernel: re-fork from PTXdist 2021.10.0 Roland Hieber
@ 2021-10-24 19:45 ` Roland Hieber
  2021-10-25  7:37   ` Michael Olbrich
  2021-10-24 19:45 ` [DistroKit] [PATCH 8/8] mips, mipsel: update kernel configs Roland Hieber
  6 siblings, 1 reply; 12+ messages in thread
From: Roland Hieber @ 2021-10-24 19:45 UTC (permalink / raw)
  To: distrokit; +Cc: Roland Hieber

The kernel package only exists to serve a REF_CONFIG for the extra
kernel packages, and to compile the userspace kernel tools for debugging
purposes. Make the actual kernel compilation and install steps a no-op
to save time during the build process, but leave the respective lines in
to make porting upstream patches to the kernel recipe easier in the
future.

Signed-off-by: Roland Hieber <rhi@pengutronix.de>
---
 configs/platform-mips/platforms/kernel.in   | 103 ++++++++++---------
 configs/platform-mips/rules/kernel.make     | 107 +++++++++++---------
 configs/platform-mipsel/platforms/kernel.in | 103 ++++++++++---------
 configs/platform-mipsel/rules/kernel.make   | 107 +++++++++++---------
 4 files changed, 222 insertions(+), 198 deletions(-)

diff --git a/configs/platform-mips/platforms/kernel.in b/configs/platform-mips/platforms/kernel.in
index 06b6e24a6756..d84d0122ec41 100644
--- a/configs/platform-mips/platforms/kernel.in
+++ b/configs/platform-mips/platforms/kernel.in
@@ -23,36 +23,39 @@ config KERNEL_XPKG
 	  Select this symbol if kernel tools or other non kernel
 	  modules are installed.
 
-config KERNEL_INSTALL
-	bool
-	prompt "install kernel into /boot"
-	select KERNEL_XPKG
-
-config KERNEL_MODULES
-	bool
-	default y
-	prompt "build kernel-modules"
+comment "NOTE: this kernel only exists for the userspace kernel tools and a REF_CONFIG."
+comment "The actual kernels come from the extra kernel-* packages."
+#
+ config KERNEL_INSTALL
+	 bool
+# 	prompt "install kernel into /boot"
+# 	select KERNEL_XPKG
+
+ config KERNEL_MODULES
+	 bool
+# 	default y
+# 	prompt "build kernel-modules"
 
 config KERNEL_MODULES_INSTALL
 	bool
-	default y
-	prompt "Install modules into /lib/modules"
-	depends on KERNEL_MODULES
-
+#	default y
+#	prompt "Install modules into /lib/modules"
+#	depends on KERNEL_MODULES
+#
 config KERNEL_MODULES_SIGN
 	bool
-	depends on KERNEL_MODULES
-	select KERNEL_CODE_SIGNING
-	select KERNEL_MODULES_INSTALL
-	prompt "sign modules"
-	help
-	  If enabled, kernel modules are signed during the install stage with
-	  the key specified by the code signing provider in the "kernel-modules"
-	  role.
-
-	  See the section "Kernel module signing" in the "Daily Work" chapter in
-	  the PTXdist manual for use cases and more infos about what needs to be
-	  enabled in the kernel config file.
+#	depends on KERNEL_MODULES
+#	select KERNEL_CODE_SIGNING
+#	select KERNEL_MODULES_INSTALL
+#	prompt "sign modules"
+#	help
+#	  If enabled, kernel modules are signed during the install stage with
+#	  the key specified by the code signing provider in the "kernel-modules"
+#	  role.
+#
+#	  See the section "Kernel module signing" in the "Daily Work" chapter in
+#	  the PTXdist manual for use cases and more infos about what needs to be
+#	  enabled in the kernel config file.
 
 config KERNEL_VERSION
 	prompt "kernel version"
@@ -174,31 +177,31 @@ config KERNEL_IMAGE
 	default "Image"		if KERNEL_IMAGE_RAW
 	default "simpleImage.${PTXCONF_KERNEL_IMAGE_SIMPLE_TARGET}.elf" if KERNEL_IMAGE_SIMPLE
 
-menuconfig KERNEL_DTB
-	bool
-	prompt "Build device trees            "
-
-if KERNEL_DTB
-
-config KERNEL_DTS_PATH
-	string "path to source dts file"
-	default "${PTXDIST_PLATFORMCONFIG_SUBDIR}/dts:${KERNEL_DIR}/arch/${GENERIC_KERNEL_ARCH}/boot/dts"
-	help
-	  Define path to the dts source file. Multiple directories can be
-	  specified separated by ':'. A relative path will be expanded relative
-	  to the workspace and all other layers. Only on of the specified paths
-	  can be a relative path.
-
-config KERNEL_DTS
-	string "source dts file"
-	default "<yourboard>.dts"
-	help
-	  Select the dts file to use for the device tree binary
-	  blob generation. For relative file names KERNEL_DTS_PATH
-	  is used as a search path for the device tree files specified
-	  here. Multiple dts files can be specified, separated by spaces.
-
-endif
+#menuconfig KERNEL_DTB
+#	bool
+#	prompt "Build device trees            "
+#
+#if KERNEL_DTB
+#
+#config KERNEL_DTS_PATH
+#	string "path to source dts file"
+#	default "${PTXDIST_PLATFORMCONFIG_SUBDIR}/dts:${KERNEL_DIR}/arch/${GENERIC_KERNEL_ARCH}/boot/dts"
+#	help
+#	  Define path to the dts source file. Multiple directories can be
+#	  specified separated by ':'. A relative path will be expanded relative
+#	  to the workspace and all other layers. Only on of the specified paths
+#	  can be a relative path.
+#
+#config KERNEL_DTS
+#	string "source dts file"
+#	default "<yourboard>.dts"
+#	help
+#	  Select the dts file to use for the device tree binary
+#	  blob generation. For relative file names KERNEL_DTS_PATH
+#	  is used as a search path for the device tree files specified
+#	  here. Multiple dts files can be specified, separated by spaces.
+#
+#endif
 
 config KERNEL_CODE_SIGNING
 	prompt "use code signing infrastructure"
diff --git a/configs/platform-mips/rules/kernel.make b/configs/platform-mips/rules/kernel.make
index 9caff677918e..d422ecf1030b 100644
--- a/configs/platform-mips/rules/kernel.make
+++ b/configs/platform-mips/rules/kernel.make
@@ -235,10 +235,12 @@ KERNEL_TOOL_IIO_OPTS	:= \
 
 $(STATEDIR)/kernel.compile:
 	@$(call targetinfo)
-	@rm -f \
-		$(KERNEL_BUILD_DIR)/usr/initramfs_data.cpio.* \
-		$(KERNEL_BUILD_DIR)/usr/.initramfs_data.cpio.*
-	@$(call world/compile, KERNEL)
+# NOTE: this kernel only exists for the userspace kernel tools and a REF_CONFIG.
+# The actual kernels come from the extra kernel-* packages.
+#	@rm -f \
+#		$(KERNEL_BUILD_DIR)/usr/initramfs_data.cpio.* \
+#		$(KERNEL_BUILD_DIR)/usr/.initramfs_data.cpio.*
+#	@$(call world/compile, KERNEL)
 ifdef PTXCONF_KERNEL_TOOL_PERF
 	@mkdir -p $(KERNEL_BUILD_DIR)/tools/perf
 	@$(call compile, KERNEL, $(KERNEL_TOOL_PERF_OPTS))
@@ -260,10 +262,12 @@ KERNEL_INSTALL_OPT = \
 
 $(STATEDIR)/kernel.install:
 	@$(call targetinfo)
-ifdef PTXCONF_KERNEL_MODULES_INSTALL
-	@$(call world/install, KERNEL)
-endif
-	@$(call world/dtb, KERNEL)
+# NOTE: this kernel only exists for the userspace kernel tools and a REF_CONFIG.
+# The actual kernels come from the extra kernel-* packages.
+#ifdef PTXCONF_KERNEL_MODULES_INSTALL
+#	@$(call world/install, KERNEL)
+#endif
+#	@$(call world/dtb, KERNEL)
 	@$(call touch)
 
 # ----------------------------------------------------------------------------
@@ -272,11 +276,13 @@ endif
 
 $(STATEDIR)/kernel.targetinstall:
 	@$(call targetinfo)
-
-	@$(foreach dtb, $(KERNEL_DTB_FILES), \
-		echo -e "Installing $(dtb) ...\n"$(ptx/nl) \
-		install -D -m0644 $(KERNEL_PKGDIR)/boot/$(dtb) \
-			$(IMAGEDIR)/$(dtb)$(ptx/nl))
+# NOTE: this kernel only exists for the userspace kernel tools and a REF_CONFIG.
+# The actual kernels come from the extra kernel-* packages.
+#
+#	@$(foreach dtb, $(KERNEL_DTB_FILES), \
+#		echo -e "Installing $(dtb) ...\n"$(ptx/nl) \
+#		install -D -m0644 $(KERNEL_PKGDIR)/boot/$(dtb) \
+#			$(IMAGEDIR)/$(dtb)$(ptx/nl))
 
 ifdef PTXCONF_KERNEL_XPKG
 	@$(call install_init,  kernel)
@@ -285,20 +291,20 @@ ifdef PTXCONF_KERNEL_XPKG
 	@$(call install_fixup, kernel, AUTHOR,"Robert Schwebel <r.schwebel@pengutronix.de>")
 	@$(call install_fixup, kernel, DESCRIPTION,missing)
 
-	@$(call install_copy, kernel, 0, 0, 0755, /boot);
-
-ifdef PTXCONF_KERNEL_INSTALL
-	@$(call install_copy, kernel, 0, 0, 0644, $(KERNEL_IMAGE_PATH_y), /boot/$(KERNEL_IMAGE), n)
-
-	@$(foreach dtb, $(KERNEL_DTB_FILES), \
-		$(call install_copy, kernel, 0, 0, 0644, -, \
-			/boot/$(dtb), n)$(ptx/nl))
-endif
+#	@$(call install_copy, kernel, 0, 0, 0755, /boot);
+#
+#ifdef PTXCONF_KERNEL_INSTALL
+#	@$(call install_copy, kernel, 0, 0, 0644, $(KERNEL_IMAGE_PATH_y), /boot/$(KERNEL_IMAGE), n)
+#
+#	@$(foreach dtb, $(KERNEL_DTB_FILES), \
+#		$(call install_copy, kernel, 0, 0, 0644, -, \
+#			/boot/$(dtb), n)$(ptx/nl))
+#endif
 
 # install the ELF kernel image for debugging purpose
-ifdef PTXCONF_KERNEL_VMLINUX
-	@$(call install_copy, kernel, 0, 0, 0644, $(KERNEL_BUILD_DIR)/vmlinux, /boot/vmlinux, n)
-endif
+#ifdef PTXCONF_KERNEL_VMLINUX
+#	@$(call install_copy, kernel, 0, 0, 0644, $(KERNEL_BUILD_DIR)/vmlinux, /boot/vmlinux, n)
+#endif
 
 ifdef PTXCONF_KERNEL_TOOL_PERF
 	@$(call install_copy, kernel, 0, 0, 0755, $(KERNEL_BUILD_DIR)/tools/perf/perf, \
@@ -324,30 +330,33 @@ endif
 # Target-Install-post
 # ----------------------------------------------------------------------------
 
-ifdef PTXCONF_IMAGE_KERNEL_INSTALL_EARLY
-$(STATEDIR)/kernel.targetinstall.post: $(IMAGEDIR)/linuximage
-ifdef PTXCONF_IMAGE_KERNEL_LZOP
-$(STATEDIR)/kernel.targetinstall.post: $(IMAGEDIR)/linuximage.lzo
-endif
-endif
-
-$(STATEDIR)/kernel.targetinstall.post:
-	@$(call targetinfo)
-
-ifdef PTXCONF_KERNEL_MODULES_INSTALL
-	@$(call install_init,  kernel-modules)
-	@$(call install_fixup, kernel-modules, PRIORITY,optional)
-	@$(call install_fixup, kernel-modules, SECTION,base)
-	@$(call install_fixup, kernel-modules, AUTHOR,"Robert Schwebel <r.schwebel@pengutronix.de>")
-	@$(call install_fixup, kernel-modules, DESCRIPTION,missing)
-
-	@$(call install_glob, kernel-modules, 0, 0, -, /lib/modules, *.ko,, n)
-	@$(call install_glob, kernel-modules, 0, 0, -, /lib/modules,, *.ko */build */source, n)
-
-	@$(call install_finish, kernel-modules)
-endif
-
-	@$(call touch)
+# NOTE: this kernel only exists for the userspace kernel tools and a REF_CONFIG.
+# The actual kernels come from the extra kernel-* packages.
+#
+#ifdef PTXCONF_IMAGE_KERNEL_INSTALL_EARLY
+#$(STATEDIR)/kernel.targetinstall.post: $(IMAGEDIR)/linuximage
+#ifdef PTXCONF_IMAGE_KERNEL_LZOP
+#$(STATEDIR)/kernel.targetinstall.post: $(IMAGEDIR)/linuximage.lzo
+#endif
+#endif
+#
+#$(STATEDIR)/kernel.targetinstall.post:
+#	@$(call targetinfo)
+#
+#ifdef PTXCONF_KERNEL_MODULES_INSTALL
+#	@$(call install_init,  kernel-modules)
+#	@$(call install_fixup, kernel-modules, PRIORITY,optional)
+#	@$(call install_fixup, kernel-modules, SECTION,base)
+#	@$(call install_fixup, kernel-modules, AUTHOR,"Robert Schwebel <r.schwebel@pengutronix.de>")
+#	@$(call install_fixup, kernel-modules, DESCRIPTION,missing)
+#
+#	@$(call install_glob, kernel-modules, 0, 0, -, /lib/modules, *.ko,, n)
+#	@$(call install_glob, kernel-modules, 0, 0, -, /lib/modules,, *.ko */build */source, n)
+#
+#	@$(call install_finish, kernel-modules)
+#endif
+#
+#	@$(call touch)
 
 # ----------------------------------------------------------------------------
 # Clean
diff --git a/configs/platform-mipsel/platforms/kernel.in b/configs/platform-mipsel/platforms/kernel.in
index 06b6e24a6756..d84d0122ec41 100644
--- a/configs/platform-mipsel/platforms/kernel.in
+++ b/configs/platform-mipsel/platforms/kernel.in
@@ -23,36 +23,39 @@ config KERNEL_XPKG
 	  Select this symbol if kernel tools or other non kernel
 	  modules are installed.
 
-config KERNEL_INSTALL
-	bool
-	prompt "install kernel into /boot"
-	select KERNEL_XPKG
-
-config KERNEL_MODULES
-	bool
-	default y
-	prompt "build kernel-modules"
+comment "NOTE: this kernel only exists for the userspace kernel tools and a REF_CONFIG."
+comment "The actual kernels come from the extra kernel-* packages."
+#
+ config KERNEL_INSTALL
+	 bool
+# 	prompt "install kernel into /boot"
+# 	select KERNEL_XPKG
+
+ config KERNEL_MODULES
+	 bool
+# 	default y
+# 	prompt "build kernel-modules"
 
 config KERNEL_MODULES_INSTALL
 	bool
-	default y
-	prompt "Install modules into /lib/modules"
-	depends on KERNEL_MODULES
-
+#	default y
+#	prompt "Install modules into /lib/modules"
+#	depends on KERNEL_MODULES
+#
 config KERNEL_MODULES_SIGN
 	bool
-	depends on KERNEL_MODULES
-	select KERNEL_CODE_SIGNING
-	select KERNEL_MODULES_INSTALL
-	prompt "sign modules"
-	help
-	  If enabled, kernel modules are signed during the install stage with
-	  the key specified by the code signing provider in the "kernel-modules"
-	  role.
-
-	  See the section "Kernel module signing" in the "Daily Work" chapter in
-	  the PTXdist manual for use cases and more infos about what needs to be
-	  enabled in the kernel config file.
+#	depends on KERNEL_MODULES
+#	select KERNEL_CODE_SIGNING
+#	select KERNEL_MODULES_INSTALL
+#	prompt "sign modules"
+#	help
+#	  If enabled, kernel modules are signed during the install stage with
+#	  the key specified by the code signing provider in the "kernel-modules"
+#	  role.
+#
+#	  See the section "Kernel module signing" in the "Daily Work" chapter in
+#	  the PTXdist manual for use cases and more infos about what needs to be
+#	  enabled in the kernel config file.
 
 config KERNEL_VERSION
 	prompt "kernel version"
@@ -174,31 +177,31 @@ config KERNEL_IMAGE
 	default "Image"		if KERNEL_IMAGE_RAW
 	default "simpleImage.${PTXCONF_KERNEL_IMAGE_SIMPLE_TARGET}.elf" if KERNEL_IMAGE_SIMPLE
 
-menuconfig KERNEL_DTB
-	bool
-	prompt "Build device trees            "
-
-if KERNEL_DTB
-
-config KERNEL_DTS_PATH
-	string "path to source dts file"
-	default "${PTXDIST_PLATFORMCONFIG_SUBDIR}/dts:${KERNEL_DIR}/arch/${GENERIC_KERNEL_ARCH}/boot/dts"
-	help
-	  Define path to the dts source file. Multiple directories can be
-	  specified separated by ':'. A relative path will be expanded relative
-	  to the workspace and all other layers. Only on of the specified paths
-	  can be a relative path.
-
-config KERNEL_DTS
-	string "source dts file"
-	default "<yourboard>.dts"
-	help
-	  Select the dts file to use for the device tree binary
-	  blob generation. For relative file names KERNEL_DTS_PATH
-	  is used as a search path for the device tree files specified
-	  here. Multiple dts files can be specified, separated by spaces.
-
-endif
+#menuconfig KERNEL_DTB
+#	bool
+#	prompt "Build device trees            "
+#
+#if KERNEL_DTB
+#
+#config KERNEL_DTS_PATH
+#	string "path to source dts file"
+#	default "${PTXDIST_PLATFORMCONFIG_SUBDIR}/dts:${KERNEL_DIR}/arch/${GENERIC_KERNEL_ARCH}/boot/dts"
+#	help
+#	  Define path to the dts source file. Multiple directories can be
+#	  specified separated by ':'. A relative path will be expanded relative
+#	  to the workspace and all other layers. Only on of the specified paths
+#	  can be a relative path.
+#
+#config KERNEL_DTS
+#	string "source dts file"
+#	default "<yourboard>.dts"
+#	help
+#	  Select the dts file to use for the device tree binary
+#	  blob generation. For relative file names KERNEL_DTS_PATH
+#	  is used as a search path for the device tree files specified
+#	  here. Multiple dts files can be specified, separated by spaces.
+#
+#endif
 
 config KERNEL_CODE_SIGNING
 	prompt "use code signing infrastructure"
diff --git a/configs/platform-mipsel/rules/kernel.make b/configs/platform-mipsel/rules/kernel.make
index 9caff677918e..d422ecf1030b 100644
--- a/configs/platform-mipsel/rules/kernel.make
+++ b/configs/platform-mipsel/rules/kernel.make
@@ -235,10 +235,12 @@ KERNEL_TOOL_IIO_OPTS	:= \
 
 $(STATEDIR)/kernel.compile:
 	@$(call targetinfo)
-	@rm -f \
-		$(KERNEL_BUILD_DIR)/usr/initramfs_data.cpio.* \
-		$(KERNEL_BUILD_DIR)/usr/.initramfs_data.cpio.*
-	@$(call world/compile, KERNEL)
+# NOTE: this kernel only exists for the userspace kernel tools and a REF_CONFIG.
+# The actual kernels come from the extra kernel-* packages.
+#	@rm -f \
+#		$(KERNEL_BUILD_DIR)/usr/initramfs_data.cpio.* \
+#		$(KERNEL_BUILD_DIR)/usr/.initramfs_data.cpio.*
+#	@$(call world/compile, KERNEL)
 ifdef PTXCONF_KERNEL_TOOL_PERF
 	@mkdir -p $(KERNEL_BUILD_DIR)/tools/perf
 	@$(call compile, KERNEL, $(KERNEL_TOOL_PERF_OPTS))
@@ -260,10 +262,12 @@ KERNEL_INSTALL_OPT = \
 
 $(STATEDIR)/kernel.install:
 	@$(call targetinfo)
-ifdef PTXCONF_KERNEL_MODULES_INSTALL
-	@$(call world/install, KERNEL)
-endif
-	@$(call world/dtb, KERNEL)
+# NOTE: this kernel only exists for the userspace kernel tools and a REF_CONFIG.
+# The actual kernels come from the extra kernel-* packages.
+#ifdef PTXCONF_KERNEL_MODULES_INSTALL
+#	@$(call world/install, KERNEL)
+#endif
+#	@$(call world/dtb, KERNEL)
 	@$(call touch)
 
 # ----------------------------------------------------------------------------
@@ -272,11 +276,13 @@ endif
 
 $(STATEDIR)/kernel.targetinstall:
 	@$(call targetinfo)
-
-	@$(foreach dtb, $(KERNEL_DTB_FILES), \
-		echo -e "Installing $(dtb) ...\n"$(ptx/nl) \
-		install -D -m0644 $(KERNEL_PKGDIR)/boot/$(dtb) \
-			$(IMAGEDIR)/$(dtb)$(ptx/nl))
+# NOTE: this kernel only exists for the userspace kernel tools and a REF_CONFIG.
+# The actual kernels come from the extra kernel-* packages.
+#
+#	@$(foreach dtb, $(KERNEL_DTB_FILES), \
+#		echo -e "Installing $(dtb) ...\n"$(ptx/nl) \
+#		install -D -m0644 $(KERNEL_PKGDIR)/boot/$(dtb) \
+#			$(IMAGEDIR)/$(dtb)$(ptx/nl))
 
 ifdef PTXCONF_KERNEL_XPKG
 	@$(call install_init,  kernel)
@@ -285,20 +291,20 @@ ifdef PTXCONF_KERNEL_XPKG
 	@$(call install_fixup, kernel, AUTHOR,"Robert Schwebel <r.schwebel@pengutronix.de>")
 	@$(call install_fixup, kernel, DESCRIPTION,missing)
 
-	@$(call install_copy, kernel, 0, 0, 0755, /boot);
-
-ifdef PTXCONF_KERNEL_INSTALL
-	@$(call install_copy, kernel, 0, 0, 0644, $(KERNEL_IMAGE_PATH_y), /boot/$(KERNEL_IMAGE), n)
-
-	@$(foreach dtb, $(KERNEL_DTB_FILES), \
-		$(call install_copy, kernel, 0, 0, 0644, -, \
-			/boot/$(dtb), n)$(ptx/nl))
-endif
+#	@$(call install_copy, kernel, 0, 0, 0755, /boot);
+#
+#ifdef PTXCONF_KERNEL_INSTALL
+#	@$(call install_copy, kernel, 0, 0, 0644, $(KERNEL_IMAGE_PATH_y), /boot/$(KERNEL_IMAGE), n)
+#
+#	@$(foreach dtb, $(KERNEL_DTB_FILES), \
+#		$(call install_copy, kernel, 0, 0, 0644, -, \
+#			/boot/$(dtb), n)$(ptx/nl))
+#endif
 
 # install the ELF kernel image for debugging purpose
-ifdef PTXCONF_KERNEL_VMLINUX
-	@$(call install_copy, kernel, 0, 0, 0644, $(KERNEL_BUILD_DIR)/vmlinux, /boot/vmlinux, n)
-endif
+#ifdef PTXCONF_KERNEL_VMLINUX
+#	@$(call install_copy, kernel, 0, 0, 0644, $(KERNEL_BUILD_DIR)/vmlinux, /boot/vmlinux, n)
+#endif
 
 ifdef PTXCONF_KERNEL_TOOL_PERF
 	@$(call install_copy, kernel, 0, 0, 0755, $(KERNEL_BUILD_DIR)/tools/perf/perf, \
@@ -324,30 +330,33 @@ endif
 # Target-Install-post
 # ----------------------------------------------------------------------------
 
-ifdef PTXCONF_IMAGE_KERNEL_INSTALL_EARLY
-$(STATEDIR)/kernel.targetinstall.post: $(IMAGEDIR)/linuximage
-ifdef PTXCONF_IMAGE_KERNEL_LZOP
-$(STATEDIR)/kernel.targetinstall.post: $(IMAGEDIR)/linuximage.lzo
-endif
-endif
-
-$(STATEDIR)/kernel.targetinstall.post:
-	@$(call targetinfo)
-
-ifdef PTXCONF_KERNEL_MODULES_INSTALL
-	@$(call install_init,  kernel-modules)
-	@$(call install_fixup, kernel-modules, PRIORITY,optional)
-	@$(call install_fixup, kernel-modules, SECTION,base)
-	@$(call install_fixup, kernel-modules, AUTHOR,"Robert Schwebel <r.schwebel@pengutronix.de>")
-	@$(call install_fixup, kernel-modules, DESCRIPTION,missing)
-
-	@$(call install_glob, kernel-modules, 0, 0, -, /lib/modules, *.ko,, n)
-	@$(call install_glob, kernel-modules, 0, 0, -, /lib/modules,, *.ko */build */source, n)
-
-	@$(call install_finish, kernel-modules)
-endif
-
-	@$(call touch)
+# NOTE: this kernel only exists for the userspace kernel tools and a REF_CONFIG.
+# The actual kernels come from the extra kernel-* packages.
+#
+#ifdef PTXCONF_IMAGE_KERNEL_INSTALL_EARLY
+#$(STATEDIR)/kernel.targetinstall.post: $(IMAGEDIR)/linuximage
+#ifdef PTXCONF_IMAGE_KERNEL_LZOP
+#$(STATEDIR)/kernel.targetinstall.post: $(IMAGEDIR)/linuximage.lzo
+#endif
+#endif
+#
+#$(STATEDIR)/kernel.targetinstall.post:
+#	@$(call targetinfo)
+#
+#ifdef PTXCONF_KERNEL_MODULES_INSTALL
+#	@$(call install_init,  kernel-modules)
+#	@$(call install_fixup, kernel-modules, PRIORITY,optional)
+#	@$(call install_fixup, kernel-modules, SECTION,base)
+#	@$(call install_fixup, kernel-modules, AUTHOR,"Robert Schwebel <r.schwebel@pengutronix.de>")
+#	@$(call install_fixup, kernel-modules, DESCRIPTION,missing)
+#
+#	@$(call install_glob, kernel-modules, 0, 0, -, /lib/modules, *.ko,, n)
+#	@$(call install_glob, kernel-modules, 0, 0, -, /lib/modules,, *.ko */build */source, n)
+#
+#	@$(call install_finish, kernel-modules)
+#endif
+#
+#	@$(call touch)
 
 # ----------------------------------------------------------------------------
 # Clean
-- 
2.30.2


_______________________________________________
DistroKit mailing list
DistroKit@pengutronix.de


^ permalink raw reply	[flat|nested] 12+ messages in thread

* [DistroKit] [PATCH 8/8] mips, mipsel: update kernel configs
  2021-10-24 19:45 [DistroKit] [PATCH 1/8] mips, mipsel: kernel-*: bring back KERNEL_*_PATH Roland Hieber
                   ` (5 preceding siblings ...)
  2021-10-24 19:45 ` [DistroKit] [PATCH 7/8] mips, mipsel: don't actually compile the kernel Roland Hieber
@ 2021-10-24 19:45 ` Roland Hieber
  6 siblings, 0 replies; 12+ messages in thread
From: Roland Hieber @ 2021-10-24 19:45 UTC (permalink / raw)
  To: distrokit; +Cc: Roland Hieber

GCC plugins are now properly disabled again.

Signed-off-by: Roland Hieber <rhi@pengutronix.de>
---
 configs/platform-mips/kernelconfig              | 1 -
 configs/platform-mips/kernelconfig-ar9331       | 1 -
 configs/platform-mips/kernelconfig-ar9331.diff  | 2 +-
 configs/platform-mips/kernelconfig-malta        | 1 -
 configs/platform-mips/kernelconfig-malta.diff   | 2 +-
 configs/platform-mipsel/kernelconfig            | 1 -
 configs/platform-mipsel/kernelconfig-malta      | 1 -
 configs/platform-mipsel/kernelconfig-malta.diff | 2 +-
 8 files changed, 3 insertions(+), 8 deletions(-)

diff --git a/configs/platform-mips/kernelconfig b/configs/platform-mips/kernelconfig
index f97bb83e7e44..ea54e190cd34 100644
--- a/configs/platform-mips/kernelconfig
+++ b/configs/platform-mips/kernelconfig
@@ -478,7 +478,6 @@ CONFIG_ARCH_HAS_GCOV_PROFILE_ALL=y
 # end of GCOV-based kernel profiling
 
 CONFIG_HAVE_GCC_PLUGINS=y
-# CONFIG_GCC_PLUGINS is not set
 # end of General architecture-dependent options
 
 CONFIG_RT_MUTEXES=y
diff --git a/configs/platform-mips/kernelconfig-ar9331 b/configs/platform-mips/kernelconfig-ar9331
index a4d3e0a39b57..8acc1a577377 100644
--- a/configs/platform-mips/kernelconfig-ar9331
+++ b/configs/platform-mips/kernelconfig-ar9331
@@ -478,7 +478,6 @@ CONFIG_ARCH_HAS_GCOV_PROFILE_ALL=y
 # end of GCOV-based kernel profiling
 
 CONFIG_HAVE_GCC_PLUGINS=y
-# CONFIG_GCC_PLUGINS is not set
 # end of General architecture-dependent options
 
 CONFIG_RT_MUTEXES=y
diff --git a/configs/platform-mips/kernelconfig-ar9331.diff b/configs/platform-mips/kernelconfig-ar9331.diff
index 41c0d6fd0d8a..db03c3577ebf 100644
--- a/configs/platform-mips/kernelconfig-ar9331.diff
+++ b/configs/platform-mips/kernelconfig-ar9331.diff
@@ -1,4 +1,4 @@
-50b8cc1645dcb5b3264208c9b7991796
+bda4e2cd04f4661d285cf45536d4aa9b
 # CONFIG_ACORN_PARTITION is undefined
 # CONFIG_AIX_PARTITION is undefined
 # CONFIG_AMIGA_PARTITION is undefined
diff --git a/configs/platform-mips/kernelconfig-malta b/configs/platform-mips/kernelconfig-malta
index 34867d0fde2d..80a06bf7226d 100644
--- a/configs/platform-mips/kernelconfig-malta
+++ b/configs/platform-mips/kernelconfig-malta
@@ -547,7 +547,6 @@ CONFIG_ARCH_HAS_GCOV_PROFILE_ALL=y
 # end of GCOV-based kernel profiling
 
 CONFIG_HAVE_GCC_PLUGINS=y
-# CONFIG_GCC_PLUGINS is not set
 # end of General architecture-dependent options
 
 CONFIG_RT_MUTEXES=y
diff --git a/configs/platform-mips/kernelconfig-malta.diff b/configs/platform-mips/kernelconfig-malta.diff
index 07dda18f522c..95831df20558 100644
--- a/configs/platform-mips/kernelconfig-malta.diff
+++ b/configs/platform-mips/kernelconfig-malta.diff
@@ -1,4 +1,4 @@
-50b8cc1645dcb5b3264208c9b7991796
+bda4e2cd04f4661d285cf45536d4aa9b
 # CONFIG_8139CP is not set
 # CONFIG_8139TOO is not set
 # CONFIG_ACENIC is not set
diff --git a/configs/platform-mipsel/kernelconfig b/configs/platform-mipsel/kernelconfig
index ed1d57928562..71d5d04a96f3 100644
--- a/configs/platform-mipsel/kernelconfig
+++ b/configs/platform-mipsel/kernelconfig
@@ -484,7 +484,6 @@ CONFIG_ARCH_HAS_GCOV_PROFILE_ALL=y
 # end of GCOV-based kernel profiling
 
 CONFIG_HAVE_GCC_PLUGINS=y
-# CONFIG_GCC_PLUGINS is not set
 # end of General architecture-dependent options
 
 CONFIG_RT_MUTEXES=y
diff --git a/configs/platform-mipsel/kernelconfig-malta b/configs/platform-mipsel/kernelconfig-malta
index d72745a1148e..10710077eb2b 100644
--- a/configs/platform-mipsel/kernelconfig-malta
+++ b/configs/platform-mipsel/kernelconfig-malta
@@ -539,7 +539,6 @@ CONFIG_ARCH_HAS_GCOV_PROFILE_ALL=y
 # end of GCOV-based kernel profiling
 
 CONFIG_HAVE_GCC_PLUGINS=y
-# CONFIG_GCC_PLUGINS is not set
 # end of General architecture-dependent options
 
 CONFIG_RT_MUTEXES=y
diff --git a/configs/platform-mipsel/kernelconfig-malta.diff b/configs/platform-mipsel/kernelconfig-malta.diff
index 436792419c0e..4fbaac22dd96 100644
--- a/configs/platform-mipsel/kernelconfig-malta.diff
+++ b/configs/platform-mipsel/kernelconfig-malta.diff
@@ -1,4 +1,4 @@
-5f63546ba13779edf8b16ebf51268bd9
+74ef80b509aa881a4e93d2bd7522961a
 CONFIG_32BIT=y
 # CONFIG_3C515 is undefined
 # CONFIG_64BIT is undefined
-- 
2.30.2


_______________________________________________
DistroKit mailing list
DistroKit@pengutronix.de


^ permalink raw reply	[flat|nested] 12+ messages in thread

* [DistroKit] [PATCH v2 6/8] mips, mipsel: kernel: re-fork from PTXdist 2021.10.0
  2021-10-24 19:45 ` [DistroKit] [PATCH 6/8] mips, mipsel: kernel: re-fork from PTXdist 2021.10.0 Roland Hieber
@ 2021-10-24 19:54   ` Roland Hieber
  0 siblings, 0 replies; 12+ messages in thread
From: Roland Hieber @ 2021-10-24 19:54 UTC (permalink / raw)
  To: distrokit; +Cc: Roland Hieber

The kernel recipe is currently only used for its config file, which
serves as a REF_CONFIG for the extra kernel packages. However the kernel
recipe has changed quite a bit upstream since it was last forked, and
especially the KERNEL_*_OPT variables form a public interface for other
recipes too (even though we currently don't have any in DistroKit). More
importantly, upstream has introduced options to keep the config diffs
clean when using newer GCC versions in combination with newer kernel
versions:

  * commit d57abb42 ("kernel: fix disabling gcc plugins for >= v5.11")
  * commit 114fecbd ("kernel: really fix disabling gcc plugins for >= v5.11")
  * commit 533f7709 ("kernel/kernel-template: set PTXDIST_NO_GCC_PLUGINS=1 in _MAKE_ENV as well")

Furthermore, the upstream recipe also installs the perf and iio
userspace tools, which could be helpful for debugging.

To make porting upstream patches to the kernel recipe easier in the
future, re-fork it from the current PTXdist version, and then re-do our
changes cleanly in the next commit. Update the platformconfig with all
new selectable features disabled.

Link: https://git.pengutronix.de/cgit/ptxdist/commit/?id=d57abb428d360e0
Link: https://git.pengutronix.de/cgit/ptxdist/commit/?id=114fecbd4e97e97
Link: https://git.pengutronix.de/cgit/ptxdist/commit/?id=533f7709f61c54a

Signed-off-by: Roland Hieber <rhi@pengutronix.de>
---
v1 -> v2:
 * remove the sentence about symlinking the files, which turned out to
   generate errors during the build. Rest of the series stays the same.

 configs/platform-mips/platformconfig        |  34 ++
 configs/platform-mips/platforms/kernel.in   | 330 +++++++++++++++++++-
 configs/platform-mips/rules/kernel.make     | 299 +++++++++++++++++-
 configs/platform-mipsel/platformconfig      |  39 +++
 configs/platform-mipsel/platforms/kernel.in | 330 +++++++++++++++++++-
 configs/platform-mipsel/rules/kernel.make   | 299 +++++++++++++++++-
 6 files changed, 1317 insertions(+), 14 deletions(-)

diff --git a/configs/platform-mips/platformconfig b/configs/platform-mips/platformconfig
index bae6671624c6..5ca070a4a0ab 100644
--- a/configs/platform-mips/platformconfig
+++ b/configs/platform-mips/platformconfig
@@ -109,9 +109,42 @@ PTXCONF_TARGET_EXTRA_LDFLAGS=""
 # end of architecture                  
 
 PTXCONF_KERNEL=y
+# PTXCONF_KERNEL_INSTALL is not set
+# PTXCONF_KERNEL_MODULES is not set
 PTXCONF_KERNEL_VERSION="5.14"
 PTXCONF_KERNEL_MD5="a082ef5748b813abca0649dab8be5f52"
+# PTXCONF_KERNEL_IMAGE_BZ is not set
+# PTXCONF_KERNEL_IMAGE_Z is not set
+# PTXCONF_KERNEL_IMAGE_XIP is not set
+# PTXCONF_KERNEL_IMAGE_U is not set
+# PTXCONF_KERNEL_IMAGE_VM is not set
+# PTXCONF_KERNEL_IMAGE_VMLINUX is not set
+PTXCONF_KERNEL_IMAGE_VMLINUZ=y
+# PTXCONF_KERNEL_IMAGE_RAW is not set
+# PTXCONF_KERNEL_IMAGE_SIMPLE is not set
+PTXCONF_KERNEL_IMAGE="vmlinuz"
+# PTXCONF_KERNEL_DTB is not set
+# PTXCONF_KERNEL_CODE_SIGNING is not set
+# PTXCONF_KERNEL_ZSTD is not set
+# PTXCONF_KERNEL_XZ is not set
 PTXCONF_KERNEL_LZOP=y
+# PTXCONF_KERNEL_LZ4 is not set
+# PTXCONF_KERNEL_OPENSSL is not set
+# PTXCONF_KERNEL_LIBELF is not set
+# PTXCONF_KERNEL_GCC_PLUGINS is not set
+# PTXCONF_KERNEL_CONFIG_BASE_VERSION is not set
+
+#
+# patching & configuration      
+#
+PTXCONF_KERNEL_SERIES="series"
+PTXCONF_KERNEL_CONFIG="kernelconfig"
+# end of patching & configuration      
+
+#
+# Development features
+#
+PTXCONF_KERNEL_EXTRA_MAKEVARS=""
 PTXCONF_HOST_DTC=y
 PTXCONF_HOST_DTC_VERSION="1.6.0"
 PTXCONF_HOST_DTC_MD5="cd36ac756290597f3cf1c5b6cfe12e77"
@@ -203,4 +236,5 @@ PTXCONF_HOST_LIBKMOD=y
 PTXCONF_HOST_LIBLZO=y
 PTXCONF_HOST_LZOP=y
 PTXCONF_HOST_M4=y
+PTXCONF_HOST_SYSTEM_BC=y
 PTXCONF_HOST_UTIL_LINUX_NG=y
diff --git a/configs/platform-mips/platforms/kernel.in b/configs/platform-mips/platforms/kernel.in
index 1889211a7ae2..06b6e24a6756 100644
--- a/configs/platform-mips/platforms/kernel.in
+++ b/configs/platform-mips/platforms/kernel.in
@@ -3,24 +3,352 @@
 menuconfig KERNEL
 	bool
 	default y
+	select CODE_SIGNING		if KERNEL_CODE_SIGNING
+	select HOST_U_BOOT_TOOLS	if KERNEL_IMAGE_U || (KERNEL_IMAGE_SIMPLE && ARCH_MICROBLAZE)
+	select HOST_ZSTD		if KERNEL_ZSTD
+	select HOST_XZ			if KERNEL_XZ
+	select HOST_LZOP		if KERNEL_LZOP
+	select HOST_LZ4			if KERNEL_LZ4
+	select HOST_LIBKMOD		if KERNEL_MODULES
+	select HOST_SYSTEM_BC
+	select HOST_OPENSSL		if KERNEL_OPENSSL
+	select HOST_LIBELF		if KERNEL_LIBELF
 	prompt "Linux kernel                  "
 
 if KERNEL
 
+config KERNEL_XPKG
+	bool
+	help
+	  Select this symbol if kernel tools or other non kernel
+	  modules are installed.
+
+config KERNEL_INSTALL
+	bool
+	prompt "install kernel into /boot"
+	select KERNEL_XPKG
+
+config KERNEL_MODULES
+	bool
+	default y
+	prompt "build kernel-modules"
+
+config KERNEL_MODULES_INSTALL
+	bool
+	default y
+	prompt "Install modules into /lib/modules"
+	depends on KERNEL_MODULES
+
+config KERNEL_MODULES_SIGN
+	bool
+	depends on KERNEL_MODULES
+	select KERNEL_CODE_SIGNING
+	select KERNEL_MODULES_INSTALL
+	prompt "sign modules"
+	help
+	  If enabled, kernel modules are signed during the install stage with
+	  the key specified by the code signing provider in the "kernel-modules"
+	  role.
+
+	  See the section "Kernel module signing" in the "Daily Work" chapter in
+	  the PTXdist manual for use cases and more infos about what needs to be
+	  enabled in the kernel config file.
+
 config KERNEL_VERSION
 	prompt "kernel version"
 	string
 	default "4.15"
+	help
+	  Fill in the kernel version that you want to use. Normally, you should
+	  use the latest stable version, see <https://kernel.org>.
 
 config KERNEL_MD5
 	prompt "kernel source md5sum"
 	string
+	help
+	  To ensure integrity of the downloaded source tarball, fill in its
+	  MD5 sum here.
 
-config KERNEL_INSTALL
+choice
+	prompt "Image Type          "
+	default KERNEL_IMAGE_BZ
+
+	config KERNEL_IMAGE_BZ
+		bool
+		prompt "bzImage"
+		help
+		 This usually is the target to be used on ia32 platforms. It
+		 is not limited in size (to be more precise: Limited up to 4MiB).
+
+	config KERNEL_IMAGE_Z
+		bool
+		prompt "zImage "
+		help
+		 This usually is a target to be used on ia32 platforms, it
+		 is the older format and limited to about 500k in size due to
+		 low memory size restrictions.
+
+	config KERNEL_IMAGE_XIP
+		bool
+		prompt "xipImage"
+		help
+		  Create eXecute In Place Image.
+
+	config KERNEL_IMAGE_U
+		bool
+		prompt "uImage "
+		help
+		 This is the target for most non ia32 platforms like PowerPC
+		 and ARM architectures. Its a compressed image with additional
+		 embedded information.
+
+	config KERNEL_IMAGE_VM
+		bool
+		prompt "vmImage"
+		help
+		 This is the target for non ia32 platforms like blackfin
+		 architectures.
+
+	config KERNEL_IMAGE_VMLINUX
+		bool
+		prompt "vmlinux"
+		help
+		 This is the target to get the kernel image as an ELF. Mostly
+		 used for debugging purposes.
+
+	config KERNEL_IMAGE_VMLINUZ
+		bool
+		prompt "vmlinuz"
+		help
+		 This is the target to get the compressed kernel image as an ELF.
+		 Mostly used for debugging purposes or for MIPS.
+
+	config KERNEL_IMAGE_RAW
+		bool
+		prompt "Image"
+		help
+		 This is the target to get the kernel image as an raw uncompressed
+		 binary file.
+	config KERNEL_IMAGE_SIMPLE
+		bool
+		prompt "simpleImage"
+		help
+		  Create a simple Image with embedded DTB.
+endchoice
+
+if KERNEL_IMAGE_SIMPLE
+
+config KERNEL_IMAGE_SIMPLE_TARGET
+	prompt "name of simple image"
+	string
+	default "virtex405-xup"
+	help
+	  Name of created simple kernel image e.g.
+	  the "virtex405-xup" of "simpleImage.virtex405-xup.elf"
+
+config KERNEL_IMAGE_SIMPLE_DTS
+	prompt "path to DTS file"
+	string
+	default "${PTXDIST_PLATFORMCONFIGDIR}/simpleImage.dts"
+	help
+	  This specifies the "dts" file used to create your simple
+	  image.
+
+	  The default is "${PTXDIST_PLATFORMCONFIGDIR}/simpleImage.dts".
+
+	  The path "${PTXDIST_PLATFORMCONFIGDIR}" is the directory
+	  where your platformconfig file is located.
+
+endif
+
+config KERNEL_IMAGE
+	string
+	default "bzImage"	if KERNEL_IMAGE_BZ
+	default "Image.gz"	if KERNEL_IMAGE_Z && ARCH_ARM64
+	default "zImage"	if KERNEL_IMAGE_Z
+	default "xipImage"	if KERNEL_IMAGE_XIP
+	default "uImage"	if KERNEL_IMAGE_U
+	default "vmImage"	if KERNEL_IMAGE_VM
+	default "vmlinux"	if KERNEL_IMAGE_VMLINUX
+	default "vmlinuz"	if KERNEL_IMAGE_VMLINUZ
+	default "Image"		if KERNEL_IMAGE_RAW
+	default "simpleImage.${PTXCONF_KERNEL_IMAGE_SIMPLE_TARGET}.elf" if KERNEL_IMAGE_SIMPLE
+
+menuconfig KERNEL_DTB
 	bool
+	prompt "Build device trees            "
+
+if KERNEL_DTB
+
+config KERNEL_DTS_PATH
+	string "path to source dts file"
+	default "${PTXDIST_PLATFORMCONFIG_SUBDIR}/dts:${KERNEL_DIR}/arch/${GENERIC_KERNEL_ARCH}/boot/dts"
+	help
+	  Define path to the dts source file. Multiple directories can be
+	  specified separated by ':'. A relative path will be expanded relative
+	  to the workspace and all other layers. Only on of the specified paths
+	  can be a relative path.
+
+config KERNEL_DTS
+	string "source dts file"
+	default "<yourboard>.dts"
+	help
+	  Select the dts file to use for the device tree binary
+	  blob generation. For relative file names KERNEL_DTS_PATH
+	  is used as a search path for the device tree files specified
+	  here. Multiple dts files can be specified, separated by spaces.
+
+endif
+
+config KERNEL_CODE_SIGNING
+	prompt "use code signing infrastructure"
+	select KERNEL_OPENSSL
+	bool
+	help
+	  Enable this option if you want the kernel to make use of the code
+	  signing infrastructure, e.g. to supply trust roots from the
+	  'kernel-trusted' code signing role.
+
+	  See the section "Using the Code Signing Infrastructure with the Kernel
+	  Recipe" in the "Daily Use" chapter in the PTXdist manual for use
+	  cases and more information.
+
+config KERNEL_ZSTD
+	prompt "build zstd hosttool"
+	bool
+	help
+	  Select this if you're going to build your kernel compressed
+	  with zstd and your host system is lacking the proper tools
+	  (the "zstd" package).
+
+	  Select this if you're unsure, as it won't hurt. It just
+	  increases the build time.
+
+config KERNEL_XZ
+	prompt "build xz-utils hosttool"
+	bool
+	help
+	  Select this if you're going to build your kernel compressed
+	  with lzma and your host system is lacking the proper tools
+	  ("xz-utils" or the deprecated "lzma" package).
+
+	  Select this if you're unsure, as it won't hurt. It just
+	  increases the build time.
 
 config KERNEL_LZOP
 	prompt "build lzop hosttool"
 	bool
+	help
+	  Select this if you're going to build your kernel compressed
+	  with lzo and your host system is lacking the proper tools
+	  (the "lzop" package).
+
+	  Select this if you're unsure, as it won't hurt. It just
+	  increases the build time.
+
+config KERNEL_LZ4
+	prompt "build lz4 hosttool"
+	bool
+	help
+	  Select this if you're going to build your kernel compressed
+	  with lz4 and your host system is lacking the proper tools
+	  (the "lz4" package).
+
+	  Select this if you're unsure, as it won't hurt. It just
+	  increases the build time.
+
+config KERNEL_OPENSSL
+	prompt "build openssl hosttool"
+	bool
+	help
+	  Select this if you're going to build your kernel with support for
+	  module signing, IMA etc. where openssl is need as hosttool.
+
+	  Select this if you're unsure, as it won't hurt. It just
+	  increases the build time.
+
+config KERNEL_LIBELF
+	prompt "build libelf host library"
+	bool
+	help
+	  Select this if you're going to build your kernel with
+	  STACK_VALIDATION enabled. Stack validation is used for the orc
+	  unwinder for kernel version >= v4.14 on x86_64.
+
+config KERNEL_GCC_PLUGINS
+	prompt "allow gcc plugins"
+	bool
+	help
+	  The kernel kconfig options to enable gcc plugins depend on a
+	  sufficiently new host compiler. As a result, the kernel config
+	  may change with a different host compiler version.
+	  If this option is disabled then the environment is manipulated
+	  to ensure that the compiler check always fails. This keeps the
+	  kernel config stable.
+	  Enable this option when the kernel gcc plugins are used.
+
+config KERNEL_CONFIG_BASE_VERSION
+	prompt "use base version in the kernelconfig"
+	bool
+	help
+	  When the BSP contains a patch stack for the kernel, then it is
+	  often useful to modify EXTRAVERSION with one of the patches. This
+	  makes it easier to detect which version of the patch stack was
+	  used to build the currently running kernel.
+	  However, this means that the comment at the beginning of the
+	  kernel config changes with each new revision of the patch stack.
+
+	  When this option is enabled, then the version in the kernel
+	  config is overwritten with the version from
+	  PTXCONF_KERNEL_VERSION. The version built into the kernel remains
+	  unchanged.
+
+menu "patching & configuration      "
+
+config KERNEL_SERIES
+	prompt "patch series file"
+	string
+	default "series"
+	help
+	  This entry specifies a patch series file which has to live in
+	  the kernel patches directory.
+
+	  The series file contains lines with names of patch files which
+	  are then being applied to the kernel.
+
+config KERNEL_CONFIG
+	prompt "kernel config file"
+	string
+	default "kernelconfig"
+	help
+	  This entry specifies the .config file used to compile your kernel.
+	  Specify the path relative to the platformconfig directory.
+
+endmenu
+
+
+comment "Development features"
+
+config KERNEL_EXTRA_MAKEVARS
+	string
+	default ""
+	prompt "Additional kbuild options"
+	help
+	  Specify extra parameters for the kernel build system here. Useful
+	  options include:
+
+	  * CONFIG_DEBUG_SECTION_MISMATCH=y
+	  Enable this feature if you want the kernel's buildsystem to check for
+	  section mismatches (__devinit/__devexit, __init/__exit). This
+	  entry is valid for 2.6.25 kernels and above. Previous kernel versions
+	  do this check automatically. Enabling this feature is recommended
+	  for kernel development only because it changes how code is inlined.
+	  Changing this entry will rebuild the whole kernel.
+
+	  * C=1
+	  Run sparse when compiling.
+
+	  * V=1
+	  Increase verbosity when compiling.
 
 endif	# KERNEL
diff --git a/configs/platform-mips/rules/kernel.make b/configs/platform-mips/rules/kernel.make
index 6d5ca4d4ea0e..9caff677918e 100644
--- a/configs/platform-mips/rules/kernel.make
+++ b/configs/platform-mips/rules/kernel.make
@@ -16,7 +16,7 @@ PACKAGES-$(PTXCONF_KERNEL) += kernel
 # Paths and names
 #
 KERNEL			:= linux-$(KERNEL_VERSION)
-KERNEL_MD5		:= $(call remove_quotes,$(PTXCONF_KERNEL_MD5))
+KERNEL_MD5		:= $(call ptx/config-md5, PTXCONF_KERNEL)
 ifneq ($(KERNEL_NEEDS_GIT_URL),y)
 KERNEL_SUFFIX		:= tar.xz
 KERNEL_URL		:= $(call kernel-url, KERNEL)
@@ -26,24 +26,105 @@ KERNEL_URL		:= https://git.kernel.org/torvalds/t/$(KERNEL).$(KERNEL_SUFFIX)
 endif
 KERNEL_DIR		:= $(BUILDDIR)/$(KERNEL)
 KERNEL_BUILD_DIR	:= $(KERNEL_DIR)-build
-KERNEL_CONFIG		:= $(call ptx/in-platformconfigdir, kernelconfig)
+KERNEL_CONFIG		:= $(call ptx/in-platformconfigdir, $(call remove_quotes, $(PTXCONF_KERNEL_CONFIG)))
+KERNEL_DTS_PATH		:= $(call remove_quotes,$(PTXCONF_KERNEL_DTS_PATH))
+KERNEL_DTS		:= $(call remove_quotes,$(PTXCONF_KERNEL_DTS))
+KERNEL_DTB_FILES	:= $(addsuffix .dtb,$(basename $(KERNEL_DTS)))
 KERNEL_LICENSE		:= GPL-2.0-only
 KERNEL_SOURCE		:= $(SRCDIR)/$(KERNEL).$(KERNEL_SUFFIX)
 KERNEL_DEVPKG		:= NO
 KERNEL_BUILD_OOT	:= KEEP
 
+# track changes to devices-trees in the BSP
+$(call world/dts-cfghash-file, KERNEL)
+
+# in case we migrate some old syntax
+ifneq ($(KERNEL_DTS),$(notdir $(KERNEL_DTS)))
+$(call ptx/error, the device trees in PTXCONF_KERNEL_DTS must be specified without)
+$(call ptx/error, directory. Use PTXCONF_KERNEL_DTS_PATH to provide a list of direcories)
+$(call ptx/error, that will be searched.)
+endif
+
 # ----------------------------------------------------------------------------
 # Prepare
 # ----------------------------------------------------------------------------
 
-KERNEL_CONF_OPT := \
+# use CONFIG_CC_STACKPROTECTOR if available. The rest makes no sense for the kernel
+KERNEL_WRAPPER_BLACKLIST := \
+	$(PTXDIST_LOWLEVEL_WRAPPER_BLACKLIST)
+
+# Note: for some reason, the error is not visible without the dummy '$(shell :)'
+# when running 'ptxdist -j -q go'.
+define kernel/deprecated
+$(if $(strip \
+$(filter $(STATEDIR)/%, \
+$(filter-out $(STATEDIR)/kernel.%,$@)) \
+),$(shell :)$(error $(notdir $@): \
+	use KERNEL_MODULE_OPT instead of $(1) for kernel module packages))
+endef
+
+# check for old kernel modules rules
+KERNEL_MAKEVARS = $(call kernel/deprecated, KERNEL_MAKEVARS)
+
+# like kernel-opts but with different CROSS_COMPILE=
+KERNEL_BASE_OPT		= \
+	$(call kernel-opts, KERNEL,$(KERNEL_CROSS_COMPILE)) \
+	$(call remove_quotes,$(PTXCONF_KERNEL_EXTRA_MAKEVARS))
+
+ifdef PTXCONF_KERNEL_CODE_SIGNING
+KERNEL_BASE_OPT		+= \
+	$(if $(shell cs_get_ca kernel-trusted), \
+		CONFIG_SYSTEM_TRUSTED_KEYS=$(shell cs_get_ca kernel-trusted))
+endif
+ifdef PTXCONF_KERNEL_MODULES_SIGN
+KERNEL_BASE_OPT		+= \
+	CONFIG_MODULE_SIG_KEY='"$(shell cs_get_uri kernel-modules)"'
+endif
+
+# Intermediate option. This will be used by kernel module packages.
+KERNEL_MODULE_OPT	= \
 	-C $(KERNEL_DIR) \
 	O=$(KERNEL_BUILD_DIR) \
-	$(call kernel-opts, KERNEL)
+	$(KERNEL_BASE_OPT)
+
+KERNEL_SHARED_OPT	= \
+	$(KERNEL_MODULE_OPT)
 
+ifndef PTXCONF_KERNEL_GCC_PLUGINS
 # no gcc plugins; avoid config changes depending on the host compiler
-KERNEL_CONF_OPT += \
-	HOSTCXX=false
+KERNEL_SHARED_OPT	+= \
+	HOSTCXX="$(HOSTCXX) -DGENERATOR_FILE" \
+	HOSTCC="$(HOSTCC) -DGENERATOR_FILE"
+KERNEL_CONF_ENV		:= \
+	PTXDIST_NO_GCC_PLUGINS=1
+KERNEL_MAKE_ENV		:= \
+	PTXDIST_NO_GCC_PLUGINS=1
+endif
+
+KERNEL_CONF_TOOL	:= kconfig
+KERNEL_CONF_OPT		= \
+	$(KERNEL_SHARED_OPT)
+
+ifdef PTXCONF_KERNEL_CONFIG_BASE_VERSION
+# force using KERNEL_VERSION in the kernelconfig
+KERNEL_CONF_OPT		+= \
+	KERNELVERSION=$(KERNEL_VERSION)
+endif
+
+#
+# support the different kernel image formats
+#
+KERNEL_IMAGE		:= $(call remove_quotes, $(PTXCONF_KERNEL_IMAGE))
+
+# these are sane defaults
+KERNEL_IMAGE_PATH_y	:= $(KERNEL_BUILD_DIR)/arch/$(GENERIC_KERNEL_ARCH)/boot/$(KERNEL_IMAGE)
+
+# vmlinux and vmlinuz are special
+KERNEL_IMAGE_PATH_$(PTXCONF_KERNEL_IMAGE_VMLINUX) := $(KERNEL_BUILD_DIR)/vmlinux
+KERNEL_IMAGE_PATH_$(PTXCONF_KERNEL_IMAGE_VMLINUZ) := $(KERNEL_BUILD_DIR)/vmlinuz
+# avr32 is also special
+KERNEL_IMAGE_PATH_$(PTXCONF_ARCH_AVR32) := $(KERNEL_BUILD_DIR)/arch/$(GENERIC_KERNEL_ARCH)/boot/images/$(KERNEL_IMAGE)
+
 
 ifdef PTXCONF_KERNEL
 $(KERNEL_CONFIG):
@@ -56,22 +137,228 @@ $(KERNEL_CONFIG):
 	@exit 1
 endif
 
+
+#
+# when compiling the rootfs into the kernel, we just include an empty
+# file for now. the rootfs isn't build yet.
+#
+KERNEL_INITRAMFS_SOURCE_$(PTXCONF_IMAGE_KERNEL_INITRAMFS) += $(STATEDIR)/empty.cpio
+
+$(STATEDIR)/kernel.prepare:
+	@$(call targetinfo)
+#
+# Make sure there is a non empty INITRAMFS_SOURCE in $(KERNEL_CONFIG), but
+# not the real expanded path because it contains local workdir path which
+# is not relevant to other developers.
+#
+ifdef KERNEL_INITRAMFS_SOURCE_y
+	@sed -i -e 's,^CONFIG_INITRAMFS_SOURCE.*$$,CONFIG_INITRAMFS_SOURCE=\"# Automatically set by PTXDist\",g' \
+		"$(KERNEL_CONFIG)"
+endif
+ifdef PTXCONF_KERNEL_IMAGE_SIMPLE
+	cp $(PTXCONF_KERNEL_IMAGE_SIMPLE_DTS) \
+		$(KERNEL_DIR)/arch/$(GENERIC_KERNEL_ARCH)/boot/dts/$(PTXCONF_KERNEL_IMAGE_SIMPLE_TARGET).dts
+endif
+
+	@$(call world/prepare, KERNEL)
+
+#
+# Use an existing dummy INITRAMFS_SOURCE for the first 'make' call. The
+# kernel image will be rebuilt in the image-kernel package with the real
+# initramfs.
+#
+ifdef KERNEL_INITRAMFS_SOURCE_y
+	@touch "$(KERNEL_INITRAMFS_SOURCE_y)"
+	@sed -i -e 's,^CONFIG_INITRAMFS_SOURCE.*$$,CONFIG_INITRAMFS_SOURCE=\"$(KERNEL_INITRAMFS_SOURCE_y)\",g' \
+		"$(KERNEL_BUILD_DIR)/.config"
+endif
+	@$(call touch)
+
+
+# ----------------------------------------------------------------------------
+# tags
+# ----------------------------------------------------------------------------
+
+$(STATEDIR)/kernel.tags:
+	@$(call targetinfo)
+	@$(MAKE) -C $(KERNEL_DIR) $(KERNEL_MAKE_OPT) tags TAGS cscope
+
 # ----------------------------------------------------------------------------
 # Compile
 # ----------------------------------------------------------------------------
 
+KERNEL_MAKE_OPT		= \
+	$(call kernel/deprecated, KERNEL_MAKE_OPT) \
+	$(KERNEL_SHARED_OPT) \
+	$(KERNEL_IMAGE) \
+	$(call ptx/ifdef, PTXCONF_KERNEL_MODULES,modules)
+
+KERNEL_TOOL_PERF_OPTS	:= \
+	-C $(KERNEL_DIR)/tools/perf \
+	O=$(KERNEL_BUILD_DIR)/tools/perf \
+	$(KERNEL_BASE_OPT) \
+	WERROR=0 \
+	NO_LIBPERL=1 \
+	NO_LIBPYTHON=1 \
+	NO_DWARF= \
+	NO_SLANG= \
+	NO_GTK2=1 \
+	NO_DEMANGLE= \
+	NO_LIBELF= \
+	NO_LIBUNWIND=1 \
+	NO_BACKTRACE= \
+	NO_LIBNUMA=1 \
+	NO_LIBAUDIT=1 \
+	NO_LIBBIONIC=1 \
+	NO_LIBCRYPTO=1 \
+	NO_LIBDW_DWARF_UNWIND= \
+	NO_PERF_READ_VDSO32=1 \
+	NO_PERF_READ_VDSOX32=1 \
+	NO_ZLIB= \
+	NO_LIBBABELTRACE=1 \
+	NO_LZMA=1 \
+	NO_LIBZSTD=1 \
+	NO_AUXTRACE= \
+	NO_LIBBPF=1 \
+	NO_SDT=1 \
+	NO_LIBCAP=1
+
+# manual make to handle CPPFLAGS and broken parallel building for some
+# kernel versions
+KERNEL_TOOL_IIO_OPTS	:= \
+	PTXDIST_ICECC=$(PTXDIST_ICERUN) \
+	CPPFLAGS="-D__EXPORTED_HEADERS__ -I$(KERNEL_DIR)/include/uapi -I$(KERNEL_DIR)/include" \
+	-C $(KERNEL_DIR)/tools/iio \
+	O=$(KERNEL_BUILD_DIR)/tools/iio \
+	$(KERNEL_BASE_OPT) \
+	$(PARALLELMFLAGS_BROKEN)
+
 $(STATEDIR)/kernel.compile:
 	@$(call targetinfo)
+	@rm -f \
+		$(KERNEL_BUILD_DIR)/usr/initramfs_data.cpio.* \
+		$(KERNEL_BUILD_DIR)/usr/.initramfs_data.cpio.*
+	@$(call world/compile, KERNEL)
+ifdef PTXCONF_KERNEL_TOOL_PERF
+	@mkdir -p $(KERNEL_BUILD_DIR)/tools/perf
+	@$(call compile, KERNEL, $(KERNEL_TOOL_PERF_OPTS))
+endif
+ifdef PTXCONF_KERNEL_TOOL_IIO
+	@mkdir -p $(KERNEL_BUILD_DIR)/tools/iio
+	@$(call world/execute, KERNEL, \
+		$(MAKE) $(KERNEL_TOOL_IIO_OPTS))
+endif
 	@$(call touch)
 
 # ----------------------------------------------------------------------------
 # Install
 # ----------------------------------------------------------------------------
 
+KERNEL_INSTALL_OPT = \
+	$(KERNEL_BASE_OPT) \
+	modules_install
+
 $(STATEDIR)/kernel.install:
 	@$(call targetinfo)
+ifdef PTXCONF_KERNEL_MODULES_INSTALL
+	@$(call world/install, KERNEL)
+endif
+	@$(call world/dtb, KERNEL)
 	@$(call touch)
 
+# ----------------------------------------------------------------------------
+# Target-Install
+# ----------------------------------------------------------------------------
+
+$(STATEDIR)/kernel.targetinstall:
+	@$(call targetinfo)
+
+	@$(foreach dtb, $(KERNEL_DTB_FILES), \
+		echo -e "Installing $(dtb) ...\n"$(ptx/nl) \
+		install -D -m0644 $(KERNEL_PKGDIR)/boot/$(dtb) \
+			$(IMAGEDIR)/$(dtb)$(ptx/nl))
+
+ifdef PTXCONF_KERNEL_XPKG
+	@$(call install_init,  kernel)
+	@$(call install_fixup, kernel, PRIORITY,optional)
+	@$(call install_fixup, kernel, SECTION,base)
+	@$(call install_fixup, kernel, AUTHOR,"Robert Schwebel <r.schwebel@pengutronix.de>")
+	@$(call install_fixup, kernel, DESCRIPTION,missing)
+
+	@$(call install_copy, kernel, 0, 0, 0755, /boot);
+
+ifdef PTXCONF_KERNEL_INSTALL
+	@$(call install_copy, kernel, 0, 0, 0644, $(KERNEL_IMAGE_PATH_y), /boot/$(KERNEL_IMAGE), n)
+
+	@$(foreach dtb, $(KERNEL_DTB_FILES), \
+		$(call install_copy, kernel, 0, 0, 0644, -, \
+			/boot/$(dtb), n)$(ptx/nl))
+endif
+
+# install the ELF kernel image for debugging purpose
+ifdef PTXCONF_KERNEL_VMLINUX
+	@$(call install_copy, kernel, 0, 0, 0644, $(KERNEL_BUILD_DIR)/vmlinux, /boot/vmlinux, n)
+endif
+
+ifdef PTXCONF_KERNEL_TOOL_PERF
+	@$(call install_copy, kernel, 0, 0, 0755, $(KERNEL_BUILD_DIR)/tools/perf/perf, \
+		/usr/bin/perf)
+endif
+
+ifdef PTXCONF_KERNEL_TOOL_IIO
+	@$(call install_copy, kernel, 0, 0, 0755, $(wildcard $(KERNEL_BUILD_DIR)/tools/iio/*generic_buffer), \
+		/usr/bin/iio_generic_buffer)
+	@$(call install_copy, kernel, 0, 0, 0755, $(KERNEL_BUILD_DIR)/tools/iio/lsiio, \
+		/usr/bin/lsiio)
+	@$(call install_copy, kernel, 0, 0, 0755, $(KERNEL_BUILD_DIR)/tools/iio/iio_event_monitor, \
+		/usr/bin/iio_event_monitor)
+endif
+
+	@$(call install_finish, kernel)
+endif
+
+	@$(call touch)
+
+
+# ----------------------------------------------------------------------------
+# Target-Install-post
+# ----------------------------------------------------------------------------
+
+ifdef PTXCONF_IMAGE_KERNEL_INSTALL_EARLY
+$(STATEDIR)/kernel.targetinstall.post: $(IMAGEDIR)/linuximage
+ifdef PTXCONF_IMAGE_KERNEL_LZOP
+$(STATEDIR)/kernel.targetinstall.post: $(IMAGEDIR)/linuximage.lzo
+endif
+endif
+
+$(STATEDIR)/kernel.targetinstall.post:
+	@$(call targetinfo)
+
+ifdef PTXCONF_KERNEL_MODULES_INSTALL
+	@$(call install_init,  kernel-modules)
+	@$(call install_fixup, kernel-modules, PRIORITY,optional)
+	@$(call install_fixup, kernel-modules, SECTION,base)
+	@$(call install_fixup, kernel-modules, AUTHOR,"Robert Schwebel <r.schwebel@pengutronix.de>")
+	@$(call install_fixup, kernel-modules, DESCRIPTION,missing)
+
+	@$(call install_glob, kernel-modules, 0, 0, -, /lib/modules, *.ko,, n)
+	@$(call install_glob, kernel-modules, 0, 0, -, /lib/modules,, *.ko */build */source, n)
+
+	@$(call install_finish, kernel-modules)
+endif
+
+	@$(call touch)
+
+# ----------------------------------------------------------------------------
+# Clean
+# ----------------------------------------------------------------------------
+
+$(STATEDIR)/kernel.clean:
+	@$(call targetinfo)
+	@$(call clean_pkg, KERNEL)
+	@$(foreach dtb,$(KERNEL_DTB_FILES), \
+		rm -vf $(IMAGEDIR)/$(dtb)$(ptx/nl))
+
 # ----------------------------------------------------------------------------
 # oldconfig / menuconfig
 # ----------------------------------------------------------------------------
diff --git a/configs/platform-mipsel/platformconfig b/configs/platform-mipsel/platformconfig
index dd697379137e..c84569e26d1c 100644
--- a/configs/platform-mipsel/platformconfig
+++ b/configs/platform-mipsel/platformconfig
@@ -109,9 +109,47 @@ PTXCONF_TARGET_EXTRA_LDFLAGS=""
 # end of architecture                  
 
 PTXCONF_KERNEL=y
+
+#
+# NOTE: this kernel only exists for the userspace kernel tools and a REF_CONFIG.
+#
+
+#
+# The actual kernels come from the extra kernel-* packages.
+#
 PTXCONF_KERNEL_VERSION="5.14"
 PTXCONF_KERNEL_MD5="a082ef5748b813abca0649dab8be5f52"
+# PTXCONF_KERNEL_IMAGE_BZ is not set
+# PTXCONF_KERNEL_IMAGE_Z is not set
+# PTXCONF_KERNEL_IMAGE_XIP is not set
+# PTXCONF_KERNEL_IMAGE_U is not set
+# PTXCONF_KERNEL_IMAGE_VM is not set
+# PTXCONF_KERNEL_IMAGE_VMLINUX is not set
+PTXCONF_KERNEL_IMAGE_VMLINUZ=y
+# PTXCONF_KERNEL_IMAGE_RAW is not set
+# PTXCONF_KERNEL_IMAGE_SIMPLE is not set
+PTXCONF_KERNEL_IMAGE="vmlinuz"
+# PTXCONF_KERNEL_CODE_SIGNING is not set
+# PTXCONF_KERNEL_ZSTD is not set
+# PTXCONF_KERNEL_XZ is not set
 PTXCONF_KERNEL_LZOP=y
+# PTXCONF_KERNEL_LZ4 is not set
+# PTXCONF_KERNEL_OPENSSL is not set
+# PTXCONF_KERNEL_LIBELF is not set
+# PTXCONF_KERNEL_GCC_PLUGINS is not set
+# PTXCONF_KERNEL_CONFIG_BASE_VERSION is not set
+
+#
+# patching & configuration      
+#
+PTXCONF_KERNEL_SERIES="series"
+PTXCONF_KERNEL_CONFIG="kernelconfig"
+# end of patching & configuration      
+
+#
+# Development features
+#
+PTXCONF_KERNEL_EXTRA_MAKEVARS=""
 PTXCONF_HOST_DTC=y
 PTXCONF_HOST_DTC_VERSION="1.6.0"
 PTXCONF_HOST_DTC_MD5="cd36ac756290597f3cf1c5b6cfe12e77"
@@ -199,4 +237,5 @@ PTXCONF_HOST_LIBKMOD=y
 PTXCONF_HOST_LIBLZO=y
 PTXCONF_HOST_LZOP=y
 PTXCONF_HOST_M4=y
+PTXCONF_HOST_SYSTEM_BC=y
 PTXCONF_HOST_UTIL_LINUX_NG=y
diff --git a/configs/platform-mipsel/platforms/kernel.in b/configs/platform-mipsel/platforms/kernel.in
index 1889211a7ae2..06b6e24a6756 100644
--- a/configs/platform-mipsel/platforms/kernel.in
+++ b/configs/platform-mipsel/platforms/kernel.in
@@ -3,24 +3,352 @@
 menuconfig KERNEL
 	bool
 	default y
+	select CODE_SIGNING		if KERNEL_CODE_SIGNING
+	select HOST_U_BOOT_TOOLS	if KERNEL_IMAGE_U || (KERNEL_IMAGE_SIMPLE && ARCH_MICROBLAZE)
+	select HOST_ZSTD		if KERNEL_ZSTD
+	select HOST_XZ			if KERNEL_XZ
+	select HOST_LZOP		if KERNEL_LZOP
+	select HOST_LZ4			if KERNEL_LZ4
+	select HOST_LIBKMOD		if KERNEL_MODULES
+	select HOST_SYSTEM_BC
+	select HOST_OPENSSL		if KERNEL_OPENSSL
+	select HOST_LIBELF		if KERNEL_LIBELF
 	prompt "Linux kernel                  "
 
 if KERNEL
 
+config KERNEL_XPKG
+	bool
+	help
+	  Select this symbol if kernel tools or other non kernel
+	  modules are installed.
+
+config KERNEL_INSTALL
+	bool
+	prompt "install kernel into /boot"
+	select KERNEL_XPKG
+
+config KERNEL_MODULES
+	bool
+	default y
+	prompt "build kernel-modules"
+
+config KERNEL_MODULES_INSTALL
+	bool
+	default y
+	prompt "Install modules into /lib/modules"
+	depends on KERNEL_MODULES
+
+config KERNEL_MODULES_SIGN
+	bool
+	depends on KERNEL_MODULES
+	select KERNEL_CODE_SIGNING
+	select KERNEL_MODULES_INSTALL
+	prompt "sign modules"
+	help
+	  If enabled, kernel modules are signed during the install stage with
+	  the key specified by the code signing provider in the "kernel-modules"
+	  role.
+
+	  See the section "Kernel module signing" in the "Daily Work" chapter in
+	  the PTXdist manual for use cases and more infos about what needs to be
+	  enabled in the kernel config file.
+
 config KERNEL_VERSION
 	prompt "kernel version"
 	string
 	default "4.15"
+	help
+	  Fill in the kernel version that you want to use. Normally, you should
+	  use the latest stable version, see <https://kernel.org>.
 
 config KERNEL_MD5
 	prompt "kernel source md5sum"
 	string
+	help
+	  To ensure integrity of the downloaded source tarball, fill in its
+	  MD5 sum here.
 
-config KERNEL_INSTALL
+choice
+	prompt "Image Type          "
+	default KERNEL_IMAGE_BZ
+
+	config KERNEL_IMAGE_BZ
+		bool
+		prompt "bzImage"
+		help
+		 This usually is the target to be used on ia32 platforms. It
+		 is not limited in size (to be more precise: Limited up to 4MiB).
+
+	config KERNEL_IMAGE_Z
+		bool
+		prompt "zImage "
+		help
+		 This usually is a target to be used on ia32 platforms, it
+		 is the older format and limited to about 500k in size due to
+		 low memory size restrictions.
+
+	config KERNEL_IMAGE_XIP
+		bool
+		prompt "xipImage"
+		help
+		  Create eXecute In Place Image.
+
+	config KERNEL_IMAGE_U
+		bool
+		prompt "uImage "
+		help
+		 This is the target for most non ia32 platforms like PowerPC
+		 and ARM architectures. Its a compressed image with additional
+		 embedded information.
+
+	config KERNEL_IMAGE_VM
+		bool
+		prompt "vmImage"
+		help
+		 This is the target for non ia32 platforms like blackfin
+		 architectures.
+
+	config KERNEL_IMAGE_VMLINUX
+		bool
+		prompt "vmlinux"
+		help
+		 This is the target to get the kernel image as an ELF. Mostly
+		 used for debugging purposes.
+
+	config KERNEL_IMAGE_VMLINUZ
+		bool
+		prompt "vmlinuz"
+		help
+		 This is the target to get the compressed kernel image as an ELF.
+		 Mostly used for debugging purposes or for MIPS.
+
+	config KERNEL_IMAGE_RAW
+		bool
+		prompt "Image"
+		help
+		 This is the target to get the kernel image as an raw uncompressed
+		 binary file.
+	config KERNEL_IMAGE_SIMPLE
+		bool
+		prompt "simpleImage"
+		help
+		  Create a simple Image with embedded DTB.
+endchoice
+
+if KERNEL_IMAGE_SIMPLE
+
+config KERNEL_IMAGE_SIMPLE_TARGET
+	prompt "name of simple image"
+	string
+	default "virtex405-xup"
+	help
+	  Name of created simple kernel image e.g.
+	  the "virtex405-xup" of "simpleImage.virtex405-xup.elf"
+
+config KERNEL_IMAGE_SIMPLE_DTS
+	prompt "path to DTS file"
+	string
+	default "${PTXDIST_PLATFORMCONFIGDIR}/simpleImage.dts"
+	help
+	  This specifies the "dts" file used to create your simple
+	  image.
+
+	  The default is "${PTXDIST_PLATFORMCONFIGDIR}/simpleImage.dts".
+
+	  The path "${PTXDIST_PLATFORMCONFIGDIR}" is the directory
+	  where your platformconfig file is located.
+
+endif
+
+config KERNEL_IMAGE
+	string
+	default "bzImage"	if KERNEL_IMAGE_BZ
+	default "Image.gz"	if KERNEL_IMAGE_Z && ARCH_ARM64
+	default "zImage"	if KERNEL_IMAGE_Z
+	default "xipImage"	if KERNEL_IMAGE_XIP
+	default "uImage"	if KERNEL_IMAGE_U
+	default "vmImage"	if KERNEL_IMAGE_VM
+	default "vmlinux"	if KERNEL_IMAGE_VMLINUX
+	default "vmlinuz"	if KERNEL_IMAGE_VMLINUZ
+	default "Image"		if KERNEL_IMAGE_RAW
+	default "simpleImage.${PTXCONF_KERNEL_IMAGE_SIMPLE_TARGET}.elf" if KERNEL_IMAGE_SIMPLE
+
+menuconfig KERNEL_DTB
 	bool
+	prompt "Build device trees            "
+
+if KERNEL_DTB
+
+config KERNEL_DTS_PATH
+	string "path to source dts file"
+	default "${PTXDIST_PLATFORMCONFIG_SUBDIR}/dts:${KERNEL_DIR}/arch/${GENERIC_KERNEL_ARCH}/boot/dts"
+	help
+	  Define path to the dts source file. Multiple directories can be
+	  specified separated by ':'. A relative path will be expanded relative
+	  to the workspace and all other layers. Only on of the specified paths
+	  can be a relative path.
+
+config KERNEL_DTS
+	string "source dts file"
+	default "<yourboard>.dts"
+	help
+	  Select the dts file to use for the device tree binary
+	  blob generation. For relative file names KERNEL_DTS_PATH
+	  is used as a search path for the device tree files specified
+	  here. Multiple dts files can be specified, separated by spaces.
+
+endif
+
+config KERNEL_CODE_SIGNING
+	prompt "use code signing infrastructure"
+	select KERNEL_OPENSSL
+	bool
+	help
+	  Enable this option if you want the kernel to make use of the code
+	  signing infrastructure, e.g. to supply trust roots from the
+	  'kernel-trusted' code signing role.
+
+	  See the section "Using the Code Signing Infrastructure with the Kernel
+	  Recipe" in the "Daily Use" chapter in the PTXdist manual for use
+	  cases and more information.
+
+config KERNEL_ZSTD
+	prompt "build zstd hosttool"
+	bool
+	help
+	  Select this if you're going to build your kernel compressed
+	  with zstd and your host system is lacking the proper tools
+	  (the "zstd" package).
+
+	  Select this if you're unsure, as it won't hurt. It just
+	  increases the build time.
+
+config KERNEL_XZ
+	prompt "build xz-utils hosttool"
+	bool
+	help
+	  Select this if you're going to build your kernel compressed
+	  with lzma and your host system is lacking the proper tools
+	  ("xz-utils" or the deprecated "lzma" package).
+
+	  Select this if you're unsure, as it won't hurt. It just
+	  increases the build time.
 
 config KERNEL_LZOP
 	prompt "build lzop hosttool"
 	bool
+	help
+	  Select this if you're going to build your kernel compressed
+	  with lzo and your host system is lacking the proper tools
+	  (the "lzop" package).
+
+	  Select this if you're unsure, as it won't hurt. It just
+	  increases the build time.
+
+config KERNEL_LZ4
+	prompt "build lz4 hosttool"
+	bool
+	help
+	  Select this if you're going to build your kernel compressed
+	  with lz4 and your host system is lacking the proper tools
+	  (the "lz4" package).
+
+	  Select this if you're unsure, as it won't hurt. It just
+	  increases the build time.
+
+config KERNEL_OPENSSL
+	prompt "build openssl hosttool"
+	bool
+	help
+	  Select this if you're going to build your kernel with support for
+	  module signing, IMA etc. where openssl is need as hosttool.
+
+	  Select this if you're unsure, as it won't hurt. It just
+	  increases the build time.
+
+config KERNEL_LIBELF
+	prompt "build libelf host library"
+	bool
+	help
+	  Select this if you're going to build your kernel with
+	  STACK_VALIDATION enabled. Stack validation is used for the orc
+	  unwinder for kernel version >= v4.14 on x86_64.
+
+config KERNEL_GCC_PLUGINS
+	prompt "allow gcc plugins"
+	bool
+	help
+	  The kernel kconfig options to enable gcc plugins depend on a
+	  sufficiently new host compiler. As a result, the kernel config
+	  may change with a different host compiler version.
+	  If this option is disabled then the environment is manipulated
+	  to ensure that the compiler check always fails. This keeps the
+	  kernel config stable.
+	  Enable this option when the kernel gcc plugins are used.
+
+config KERNEL_CONFIG_BASE_VERSION
+	prompt "use base version in the kernelconfig"
+	bool
+	help
+	  When the BSP contains a patch stack for the kernel, then it is
+	  often useful to modify EXTRAVERSION with one of the patches. This
+	  makes it easier to detect which version of the patch stack was
+	  used to build the currently running kernel.
+	  However, this means that the comment at the beginning of the
+	  kernel config changes with each new revision of the patch stack.
+
+	  When this option is enabled, then the version in the kernel
+	  config is overwritten with the version from
+	  PTXCONF_KERNEL_VERSION. The version built into the kernel remains
+	  unchanged.
+
+menu "patching & configuration      "
+
+config KERNEL_SERIES
+	prompt "patch series file"
+	string
+	default "series"
+	help
+	  This entry specifies a patch series file which has to live in
+	  the kernel patches directory.
+
+	  The series file contains lines with names of patch files which
+	  are then being applied to the kernel.
+
+config KERNEL_CONFIG
+	prompt "kernel config file"
+	string
+	default "kernelconfig"
+	help
+	  This entry specifies the .config file used to compile your kernel.
+	  Specify the path relative to the platformconfig directory.
+
+endmenu
+
+
+comment "Development features"
+
+config KERNEL_EXTRA_MAKEVARS
+	string
+	default ""
+	prompt "Additional kbuild options"
+	help
+	  Specify extra parameters for the kernel build system here. Useful
+	  options include:
+
+	  * CONFIG_DEBUG_SECTION_MISMATCH=y
+	  Enable this feature if you want the kernel's buildsystem to check for
+	  section mismatches (__devinit/__devexit, __init/__exit). This
+	  entry is valid for 2.6.25 kernels and above. Previous kernel versions
+	  do this check automatically. Enabling this feature is recommended
+	  for kernel development only because it changes how code is inlined.
+	  Changing this entry will rebuild the whole kernel.
+
+	  * C=1
+	  Run sparse when compiling.
+
+	  * V=1
+	  Increase verbosity when compiling.
 
 endif	# KERNEL
diff --git a/configs/platform-mipsel/rules/kernel.make b/configs/platform-mipsel/rules/kernel.make
index 6d5ca4d4ea0e..9caff677918e 100644
--- a/configs/platform-mipsel/rules/kernel.make
+++ b/configs/platform-mipsel/rules/kernel.make
@@ -16,7 +16,7 @@ PACKAGES-$(PTXCONF_KERNEL) += kernel
 # Paths and names
 #
 KERNEL			:= linux-$(KERNEL_VERSION)
-KERNEL_MD5		:= $(call remove_quotes,$(PTXCONF_KERNEL_MD5))
+KERNEL_MD5		:= $(call ptx/config-md5, PTXCONF_KERNEL)
 ifneq ($(KERNEL_NEEDS_GIT_URL),y)
 KERNEL_SUFFIX		:= tar.xz
 KERNEL_URL		:= $(call kernel-url, KERNEL)
@@ -26,24 +26,105 @@ KERNEL_URL		:= https://git.kernel.org/torvalds/t/$(KERNEL).$(KERNEL_SUFFIX)
 endif
 KERNEL_DIR		:= $(BUILDDIR)/$(KERNEL)
 KERNEL_BUILD_DIR	:= $(KERNEL_DIR)-build
-KERNEL_CONFIG		:= $(call ptx/in-platformconfigdir, kernelconfig)
+KERNEL_CONFIG		:= $(call ptx/in-platformconfigdir, $(call remove_quotes, $(PTXCONF_KERNEL_CONFIG)))
+KERNEL_DTS_PATH		:= $(call remove_quotes,$(PTXCONF_KERNEL_DTS_PATH))
+KERNEL_DTS		:= $(call remove_quotes,$(PTXCONF_KERNEL_DTS))
+KERNEL_DTB_FILES	:= $(addsuffix .dtb,$(basename $(KERNEL_DTS)))
 KERNEL_LICENSE		:= GPL-2.0-only
 KERNEL_SOURCE		:= $(SRCDIR)/$(KERNEL).$(KERNEL_SUFFIX)
 KERNEL_DEVPKG		:= NO
 KERNEL_BUILD_OOT	:= KEEP
 
+# track changes to devices-trees in the BSP
+$(call world/dts-cfghash-file, KERNEL)
+
+# in case we migrate some old syntax
+ifneq ($(KERNEL_DTS),$(notdir $(KERNEL_DTS)))
+$(call ptx/error, the device trees in PTXCONF_KERNEL_DTS must be specified without)
+$(call ptx/error, directory. Use PTXCONF_KERNEL_DTS_PATH to provide a list of direcories)
+$(call ptx/error, that will be searched.)
+endif
+
 # ----------------------------------------------------------------------------
 # Prepare
 # ----------------------------------------------------------------------------
 
-KERNEL_CONF_OPT := \
+# use CONFIG_CC_STACKPROTECTOR if available. The rest makes no sense for the kernel
+KERNEL_WRAPPER_BLACKLIST := \
+	$(PTXDIST_LOWLEVEL_WRAPPER_BLACKLIST)
+
+# Note: for some reason, the error is not visible without the dummy '$(shell :)'
+# when running 'ptxdist -j -q go'.
+define kernel/deprecated
+$(if $(strip \
+$(filter $(STATEDIR)/%, \
+$(filter-out $(STATEDIR)/kernel.%,$@)) \
+),$(shell :)$(error $(notdir $@): \
+	use KERNEL_MODULE_OPT instead of $(1) for kernel module packages))
+endef
+
+# check for old kernel modules rules
+KERNEL_MAKEVARS = $(call kernel/deprecated, KERNEL_MAKEVARS)
+
+# like kernel-opts but with different CROSS_COMPILE=
+KERNEL_BASE_OPT		= \
+	$(call kernel-opts, KERNEL,$(KERNEL_CROSS_COMPILE)) \
+	$(call remove_quotes,$(PTXCONF_KERNEL_EXTRA_MAKEVARS))
+
+ifdef PTXCONF_KERNEL_CODE_SIGNING
+KERNEL_BASE_OPT		+= \
+	$(if $(shell cs_get_ca kernel-trusted), \
+		CONFIG_SYSTEM_TRUSTED_KEYS=$(shell cs_get_ca kernel-trusted))
+endif
+ifdef PTXCONF_KERNEL_MODULES_SIGN
+KERNEL_BASE_OPT		+= \
+	CONFIG_MODULE_SIG_KEY='"$(shell cs_get_uri kernel-modules)"'
+endif
+
+# Intermediate option. This will be used by kernel module packages.
+KERNEL_MODULE_OPT	= \
 	-C $(KERNEL_DIR) \
 	O=$(KERNEL_BUILD_DIR) \
-	$(call kernel-opts, KERNEL)
+	$(KERNEL_BASE_OPT)
+
+KERNEL_SHARED_OPT	= \
+	$(KERNEL_MODULE_OPT)
 
+ifndef PTXCONF_KERNEL_GCC_PLUGINS
 # no gcc plugins; avoid config changes depending on the host compiler
-KERNEL_CONF_OPT += \
-	HOSTCXX=false
+KERNEL_SHARED_OPT	+= \
+	HOSTCXX="$(HOSTCXX) -DGENERATOR_FILE" \
+	HOSTCC="$(HOSTCC) -DGENERATOR_FILE"
+KERNEL_CONF_ENV		:= \
+	PTXDIST_NO_GCC_PLUGINS=1
+KERNEL_MAKE_ENV		:= \
+	PTXDIST_NO_GCC_PLUGINS=1
+endif
+
+KERNEL_CONF_TOOL	:= kconfig
+KERNEL_CONF_OPT		= \
+	$(KERNEL_SHARED_OPT)
+
+ifdef PTXCONF_KERNEL_CONFIG_BASE_VERSION
+# force using KERNEL_VERSION in the kernelconfig
+KERNEL_CONF_OPT		+= \
+	KERNELVERSION=$(KERNEL_VERSION)
+endif
+
+#
+# support the different kernel image formats
+#
+KERNEL_IMAGE		:= $(call remove_quotes, $(PTXCONF_KERNEL_IMAGE))
+
+# these are sane defaults
+KERNEL_IMAGE_PATH_y	:= $(KERNEL_BUILD_DIR)/arch/$(GENERIC_KERNEL_ARCH)/boot/$(KERNEL_IMAGE)
+
+# vmlinux and vmlinuz are special
+KERNEL_IMAGE_PATH_$(PTXCONF_KERNEL_IMAGE_VMLINUX) := $(KERNEL_BUILD_DIR)/vmlinux
+KERNEL_IMAGE_PATH_$(PTXCONF_KERNEL_IMAGE_VMLINUZ) := $(KERNEL_BUILD_DIR)/vmlinuz
+# avr32 is also special
+KERNEL_IMAGE_PATH_$(PTXCONF_ARCH_AVR32) := $(KERNEL_BUILD_DIR)/arch/$(GENERIC_KERNEL_ARCH)/boot/images/$(KERNEL_IMAGE)
+
 
 ifdef PTXCONF_KERNEL
 $(KERNEL_CONFIG):
@@ -56,22 +137,228 @@ $(KERNEL_CONFIG):
 	@exit 1
 endif
 
+
+#
+# when compiling the rootfs into the kernel, we just include an empty
+# file for now. the rootfs isn't build yet.
+#
+KERNEL_INITRAMFS_SOURCE_$(PTXCONF_IMAGE_KERNEL_INITRAMFS) += $(STATEDIR)/empty.cpio
+
+$(STATEDIR)/kernel.prepare:
+	@$(call targetinfo)
+#
+# Make sure there is a non empty INITRAMFS_SOURCE in $(KERNEL_CONFIG), but
+# not the real expanded path because it contains local workdir path which
+# is not relevant to other developers.
+#
+ifdef KERNEL_INITRAMFS_SOURCE_y
+	@sed -i -e 's,^CONFIG_INITRAMFS_SOURCE.*$$,CONFIG_INITRAMFS_SOURCE=\"# Automatically set by PTXDist\",g' \
+		"$(KERNEL_CONFIG)"
+endif
+ifdef PTXCONF_KERNEL_IMAGE_SIMPLE
+	cp $(PTXCONF_KERNEL_IMAGE_SIMPLE_DTS) \
+		$(KERNEL_DIR)/arch/$(GENERIC_KERNEL_ARCH)/boot/dts/$(PTXCONF_KERNEL_IMAGE_SIMPLE_TARGET).dts
+endif
+
+	@$(call world/prepare, KERNEL)
+
+#
+# Use an existing dummy INITRAMFS_SOURCE for the first 'make' call. The
+# kernel image will be rebuilt in the image-kernel package with the real
+# initramfs.
+#
+ifdef KERNEL_INITRAMFS_SOURCE_y
+	@touch "$(KERNEL_INITRAMFS_SOURCE_y)"
+	@sed -i -e 's,^CONFIG_INITRAMFS_SOURCE.*$$,CONFIG_INITRAMFS_SOURCE=\"$(KERNEL_INITRAMFS_SOURCE_y)\",g' \
+		"$(KERNEL_BUILD_DIR)/.config"
+endif
+	@$(call touch)
+
+
+# ----------------------------------------------------------------------------
+# tags
+# ----------------------------------------------------------------------------
+
+$(STATEDIR)/kernel.tags:
+	@$(call targetinfo)
+	@$(MAKE) -C $(KERNEL_DIR) $(KERNEL_MAKE_OPT) tags TAGS cscope
+
 # ----------------------------------------------------------------------------
 # Compile
 # ----------------------------------------------------------------------------
 
+KERNEL_MAKE_OPT		= \
+	$(call kernel/deprecated, KERNEL_MAKE_OPT) \
+	$(KERNEL_SHARED_OPT) \
+	$(KERNEL_IMAGE) \
+	$(call ptx/ifdef, PTXCONF_KERNEL_MODULES,modules)
+
+KERNEL_TOOL_PERF_OPTS	:= \
+	-C $(KERNEL_DIR)/tools/perf \
+	O=$(KERNEL_BUILD_DIR)/tools/perf \
+	$(KERNEL_BASE_OPT) \
+	WERROR=0 \
+	NO_LIBPERL=1 \
+	NO_LIBPYTHON=1 \
+	NO_DWARF= \
+	NO_SLANG= \
+	NO_GTK2=1 \
+	NO_DEMANGLE= \
+	NO_LIBELF= \
+	NO_LIBUNWIND=1 \
+	NO_BACKTRACE= \
+	NO_LIBNUMA=1 \
+	NO_LIBAUDIT=1 \
+	NO_LIBBIONIC=1 \
+	NO_LIBCRYPTO=1 \
+	NO_LIBDW_DWARF_UNWIND= \
+	NO_PERF_READ_VDSO32=1 \
+	NO_PERF_READ_VDSOX32=1 \
+	NO_ZLIB= \
+	NO_LIBBABELTRACE=1 \
+	NO_LZMA=1 \
+	NO_LIBZSTD=1 \
+	NO_AUXTRACE= \
+	NO_LIBBPF=1 \
+	NO_SDT=1 \
+	NO_LIBCAP=1
+
+# manual make to handle CPPFLAGS and broken parallel building for some
+# kernel versions
+KERNEL_TOOL_IIO_OPTS	:= \
+	PTXDIST_ICECC=$(PTXDIST_ICERUN) \
+	CPPFLAGS="-D__EXPORTED_HEADERS__ -I$(KERNEL_DIR)/include/uapi -I$(KERNEL_DIR)/include" \
+	-C $(KERNEL_DIR)/tools/iio \
+	O=$(KERNEL_BUILD_DIR)/tools/iio \
+	$(KERNEL_BASE_OPT) \
+	$(PARALLELMFLAGS_BROKEN)
+
 $(STATEDIR)/kernel.compile:
 	@$(call targetinfo)
+	@rm -f \
+		$(KERNEL_BUILD_DIR)/usr/initramfs_data.cpio.* \
+		$(KERNEL_BUILD_DIR)/usr/.initramfs_data.cpio.*
+	@$(call world/compile, KERNEL)
+ifdef PTXCONF_KERNEL_TOOL_PERF
+	@mkdir -p $(KERNEL_BUILD_DIR)/tools/perf
+	@$(call compile, KERNEL, $(KERNEL_TOOL_PERF_OPTS))
+endif
+ifdef PTXCONF_KERNEL_TOOL_IIO
+	@mkdir -p $(KERNEL_BUILD_DIR)/tools/iio
+	@$(call world/execute, KERNEL, \
+		$(MAKE) $(KERNEL_TOOL_IIO_OPTS))
+endif
 	@$(call touch)
 
 # ----------------------------------------------------------------------------
 # Install
 # ----------------------------------------------------------------------------
 
+KERNEL_INSTALL_OPT = \
+	$(KERNEL_BASE_OPT) \
+	modules_install
+
 $(STATEDIR)/kernel.install:
 	@$(call targetinfo)
+ifdef PTXCONF_KERNEL_MODULES_INSTALL
+	@$(call world/install, KERNEL)
+endif
+	@$(call world/dtb, KERNEL)
 	@$(call touch)
 
+# ----------------------------------------------------------------------------
+# Target-Install
+# ----------------------------------------------------------------------------
+
+$(STATEDIR)/kernel.targetinstall:
+	@$(call targetinfo)
+
+	@$(foreach dtb, $(KERNEL_DTB_FILES), \
+		echo -e "Installing $(dtb) ...\n"$(ptx/nl) \
+		install -D -m0644 $(KERNEL_PKGDIR)/boot/$(dtb) \
+			$(IMAGEDIR)/$(dtb)$(ptx/nl))
+
+ifdef PTXCONF_KERNEL_XPKG
+	@$(call install_init,  kernel)
+	@$(call install_fixup, kernel, PRIORITY,optional)
+	@$(call install_fixup, kernel, SECTION,base)
+	@$(call install_fixup, kernel, AUTHOR,"Robert Schwebel <r.schwebel@pengutronix.de>")
+	@$(call install_fixup, kernel, DESCRIPTION,missing)
+
+	@$(call install_copy, kernel, 0, 0, 0755, /boot);
+
+ifdef PTXCONF_KERNEL_INSTALL
+	@$(call install_copy, kernel, 0, 0, 0644, $(KERNEL_IMAGE_PATH_y), /boot/$(KERNEL_IMAGE), n)
+
+	@$(foreach dtb, $(KERNEL_DTB_FILES), \
+		$(call install_copy, kernel, 0, 0, 0644, -, \
+			/boot/$(dtb), n)$(ptx/nl))
+endif
+
+# install the ELF kernel image for debugging purpose
+ifdef PTXCONF_KERNEL_VMLINUX
+	@$(call install_copy, kernel, 0, 0, 0644, $(KERNEL_BUILD_DIR)/vmlinux, /boot/vmlinux, n)
+endif
+
+ifdef PTXCONF_KERNEL_TOOL_PERF
+	@$(call install_copy, kernel, 0, 0, 0755, $(KERNEL_BUILD_DIR)/tools/perf/perf, \
+		/usr/bin/perf)
+endif
+
+ifdef PTXCONF_KERNEL_TOOL_IIO
+	@$(call install_copy, kernel, 0, 0, 0755, $(wildcard $(KERNEL_BUILD_DIR)/tools/iio/*generic_buffer), \
+		/usr/bin/iio_generic_buffer)
+	@$(call install_copy, kernel, 0, 0, 0755, $(KERNEL_BUILD_DIR)/tools/iio/lsiio, \
+		/usr/bin/lsiio)
+	@$(call install_copy, kernel, 0, 0, 0755, $(KERNEL_BUILD_DIR)/tools/iio/iio_event_monitor, \
+		/usr/bin/iio_event_monitor)
+endif
+
+	@$(call install_finish, kernel)
+endif
+
+	@$(call touch)
+
+
+# ----------------------------------------------------------------------------
+# Target-Install-post
+# ----------------------------------------------------------------------------
+
+ifdef PTXCONF_IMAGE_KERNEL_INSTALL_EARLY
+$(STATEDIR)/kernel.targetinstall.post: $(IMAGEDIR)/linuximage
+ifdef PTXCONF_IMAGE_KERNEL_LZOP
+$(STATEDIR)/kernel.targetinstall.post: $(IMAGEDIR)/linuximage.lzo
+endif
+endif
+
+$(STATEDIR)/kernel.targetinstall.post:
+	@$(call targetinfo)
+
+ifdef PTXCONF_KERNEL_MODULES_INSTALL
+	@$(call install_init,  kernel-modules)
+	@$(call install_fixup, kernel-modules, PRIORITY,optional)
+	@$(call install_fixup, kernel-modules, SECTION,base)
+	@$(call install_fixup, kernel-modules, AUTHOR,"Robert Schwebel <r.schwebel@pengutronix.de>")
+	@$(call install_fixup, kernel-modules, DESCRIPTION,missing)
+
+	@$(call install_glob, kernel-modules, 0, 0, -, /lib/modules, *.ko,, n)
+	@$(call install_glob, kernel-modules, 0, 0, -, /lib/modules,, *.ko */build */source, n)
+
+	@$(call install_finish, kernel-modules)
+endif
+
+	@$(call touch)
+
+# ----------------------------------------------------------------------------
+# Clean
+# ----------------------------------------------------------------------------
+
+$(STATEDIR)/kernel.clean:
+	@$(call targetinfo)
+	@$(call clean_pkg, KERNEL)
+	@$(foreach dtb,$(KERNEL_DTB_FILES), \
+		rm -vf $(IMAGEDIR)/$(dtb)$(ptx/nl))
+
 # ----------------------------------------------------------------------------
 # oldconfig / menuconfig
 # ----------------------------------------------------------------------------
-- 
2.30.2


_______________________________________________
DistroKit mailing list
DistroKit@pengutronix.de


^ permalink raw reply	[flat|nested] 12+ messages in thread

* Re: [DistroKit] [PATCH 7/8] mips, mipsel: don't actually compile the kernel
  2021-10-24 19:45 ` [DistroKit] [PATCH 7/8] mips, mipsel: don't actually compile the kernel Roland Hieber
@ 2021-10-25  7:37   ` Michael Olbrich
  2021-11-24 14:53     ` Robert Schwebel
  0 siblings, 1 reply; 12+ messages in thread
From: Michael Olbrich @ 2021-10-25  7:37 UTC (permalink / raw)
  To: Roland Hieber; +Cc: distrokit

On Sun, Oct 24, 2021 at 09:45:33PM +0200, Roland Hieber wrote:
> The kernel package only exists to serve a REF_CONFIG for the extra
> kernel packages, and to compile the userspace kernel tools for debugging
> purposes. Make the actual kernel compilation and install steps a no-op
> to save time during the build process, but leave the respective lines in
> to make porting upstream patches to the kernel recipe easier in the
> future.

Why is it easier? The kernel package is completely different now. It serves
a different purpose and the lines that are commented mean that patches
won't apply either. And I don't think it's actually useful to backport
anything.

> 
> Signed-off-by: Roland Hieber <rhi@pengutronix.de>
> ---
>  configs/platform-mips/platforms/kernel.in   | 103 ++++++++++---------
>  configs/platform-mips/rules/kernel.make     | 107 +++++++++++---------
>  configs/platform-mipsel/platforms/kernel.in | 103 ++++++++++---------
>  configs/platform-mipsel/rules/kernel.make   | 107 +++++++++++---------
>  4 files changed, 222 insertions(+), 198 deletions(-)
> 
> diff --git a/configs/platform-mips/platforms/kernel.in b/configs/platform-mips/platforms/kernel.in
> index 06b6e24a6756..d84d0122ec41 100644
> --- a/configs/platform-mips/platforms/kernel.in
> +++ b/configs/platform-mips/platforms/kernel.in
> @@ -23,36 +23,39 @@ config KERNEL_XPKG
>  	  Select this symbol if kernel tools or other non kernel
>  	  modules are installed.
>  
> -config KERNEL_INSTALL
> -	bool
> -	prompt "install kernel into /boot"
> -	select KERNEL_XPKG
> -
> -config KERNEL_MODULES
> -	bool
> -	default y
> -	prompt "build kernel-modules"
> +comment "NOTE: this kernel only exists for the userspace kernel tools and a REF_CONFIG."
> +comment "The actual kernels come from the extra kernel-* packages."
> +#
> + config KERNEL_INSTALL
> +	 bool
> +# 	prompt "install kernel into /boot"

Do you need to keep the symbol? I would prefer to remove all of this
stuff.

Michael

> +# 	select KERNEL_XPKG
> +
> + config KERNEL_MODULES
> +	 bool
> +# 	default y
> +# 	prompt "build kernel-modules"
>  
>  config KERNEL_MODULES_INSTALL
>  	bool
> -	default y
> -	prompt "Install modules into /lib/modules"
> -	depends on KERNEL_MODULES
> -
> +#	default y
> +#	prompt "Install modules into /lib/modules"
> +#	depends on KERNEL_MODULES
> +#
>  config KERNEL_MODULES_SIGN
>  	bool
> -	depends on KERNEL_MODULES
> -	select KERNEL_CODE_SIGNING
> -	select KERNEL_MODULES_INSTALL
> -	prompt "sign modules"
> -	help
> -	  If enabled, kernel modules are signed during the install stage with
> -	  the key specified by the code signing provider in the "kernel-modules"
> -	  role.
> -
> -	  See the section "Kernel module signing" in the "Daily Work" chapter in
> -	  the PTXdist manual for use cases and more infos about what needs to be
> -	  enabled in the kernel config file.
> +#	depends on KERNEL_MODULES
> +#	select KERNEL_CODE_SIGNING
> +#	select KERNEL_MODULES_INSTALL
> +#	prompt "sign modules"
> +#	help
> +#	  If enabled, kernel modules are signed during the install stage with
> +#	  the key specified by the code signing provider in the "kernel-modules"
> +#	  role.
> +#
> +#	  See the section "Kernel module signing" in the "Daily Work" chapter in
> +#	  the PTXdist manual for use cases and more infos about what needs to be
> +#	  enabled in the kernel config file.
>  
>  config KERNEL_VERSION
>  	prompt "kernel version"
> @@ -174,31 +177,31 @@ config KERNEL_IMAGE
>  	default "Image"		if KERNEL_IMAGE_RAW
>  	default "simpleImage.${PTXCONF_KERNEL_IMAGE_SIMPLE_TARGET}.elf" if KERNEL_IMAGE_SIMPLE
>  
> -menuconfig KERNEL_DTB
> -	bool
> -	prompt "Build device trees            "
> -
> -if KERNEL_DTB
> -
> -config KERNEL_DTS_PATH
> -	string "path to source dts file"
> -	default "${PTXDIST_PLATFORMCONFIG_SUBDIR}/dts:${KERNEL_DIR}/arch/${GENERIC_KERNEL_ARCH}/boot/dts"
> -	help
> -	  Define path to the dts source file. Multiple directories can be
> -	  specified separated by ':'. A relative path will be expanded relative
> -	  to the workspace and all other layers. Only on of the specified paths
> -	  can be a relative path.
> -
> -config KERNEL_DTS
> -	string "source dts file"
> -	default "<yourboard>.dts"
> -	help
> -	  Select the dts file to use for the device tree binary
> -	  blob generation. For relative file names KERNEL_DTS_PATH
> -	  is used as a search path for the device tree files specified
> -	  here. Multiple dts files can be specified, separated by spaces.
> -
> -endif
> +#menuconfig KERNEL_DTB
> +#	bool
> +#	prompt "Build device trees            "
> +#
> +#if KERNEL_DTB
> +#
> +#config KERNEL_DTS_PATH
> +#	string "path to source dts file"
> +#	default "${PTXDIST_PLATFORMCONFIG_SUBDIR}/dts:${KERNEL_DIR}/arch/${GENERIC_KERNEL_ARCH}/boot/dts"
> +#	help
> +#	  Define path to the dts source file. Multiple directories can be
> +#	  specified separated by ':'. A relative path will be expanded relative
> +#	  to the workspace and all other layers. Only on of the specified paths
> +#	  can be a relative path.
> +#
> +#config KERNEL_DTS
> +#	string "source dts file"
> +#	default "<yourboard>.dts"
> +#	help
> +#	  Select the dts file to use for the device tree binary
> +#	  blob generation. For relative file names KERNEL_DTS_PATH
> +#	  is used as a search path for the device tree files specified
> +#	  here. Multiple dts files can be specified, separated by spaces.
> +#
> +#endif
>  
>  config KERNEL_CODE_SIGNING
>  	prompt "use code signing infrastructure"
> diff --git a/configs/platform-mips/rules/kernel.make b/configs/platform-mips/rules/kernel.make
> index 9caff677918e..d422ecf1030b 100644
> --- a/configs/platform-mips/rules/kernel.make
> +++ b/configs/platform-mips/rules/kernel.make
> @@ -235,10 +235,12 @@ KERNEL_TOOL_IIO_OPTS	:= \
>  
>  $(STATEDIR)/kernel.compile:
>  	@$(call targetinfo)
> -	@rm -f \
> -		$(KERNEL_BUILD_DIR)/usr/initramfs_data.cpio.* \
> -		$(KERNEL_BUILD_DIR)/usr/.initramfs_data.cpio.*
> -	@$(call world/compile, KERNEL)
> +# NOTE: this kernel only exists for the userspace kernel tools and a REF_CONFIG.
> +# The actual kernels come from the extra kernel-* packages.
> +#	@rm -f \
> +#		$(KERNEL_BUILD_DIR)/usr/initramfs_data.cpio.* \
> +#		$(KERNEL_BUILD_DIR)/usr/.initramfs_data.cpio.*
> +#	@$(call world/compile, KERNEL)
>  ifdef PTXCONF_KERNEL_TOOL_PERF
>  	@mkdir -p $(KERNEL_BUILD_DIR)/tools/perf
>  	@$(call compile, KERNEL, $(KERNEL_TOOL_PERF_OPTS))
> @@ -260,10 +262,12 @@ KERNEL_INSTALL_OPT = \
>  
>  $(STATEDIR)/kernel.install:
>  	@$(call targetinfo)
> -ifdef PTXCONF_KERNEL_MODULES_INSTALL
> -	@$(call world/install, KERNEL)
> -endif
> -	@$(call world/dtb, KERNEL)
> +# NOTE: this kernel only exists for the userspace kernel tools and a REF_CONFIG.
> +# The actual kernels come from the extra kernel-* packages.
> +#ifdef PTXCONF_KERNEL_MODULES_INSTALL
> +#	@$(call world/install, KERNEL)
> +#endif
> +#	@$(call world/dtb, KERNEL)
>  	@$(call touch)
>  
>  # ----------------------------------------------------------------------------
> @@ -272,11 +276,13 @@ endif
>  
>  $(STATEDIR)/kernel.targetinstall:
>  	@$(call targetinfo)
> -
> -	@$(foreach dtb, $(KERNEL_DTB_FILES), \
> -		echo -e "Installing $(dtb) ...\n"$(ptx/nl) \
> -		install -D -m0644 $(KERNEL_PKGDIR)/boot/$(dtb) \
> -			$(IMAGEDIR)/$(dtb)$(ptx/nl))
> +# NOTE: this kernel only exists for the userspace kernel tools and a REF_CONFIG.
> +# The actual kernels come from the extra kernel-* packages.
> +#
> +#	@$(foreach dtb, $(KERNEL_DTB_FILES), \
> +#		echo -e "Installing $(dtb) ...\n"$(ptx/nl) \
> +#		install -D -m0644 $(KERNEL_PKGDIR)/boot/$(dtb) \
> +#			$(IMAGEDIR)/$(dtb)$(ptx/nl))
>  
>  ifdef PTXCONF_KERNEL_XPKG
>  	@$(call install_init,  kernel)
> @@ -285,20 +291,20 @@ ifdef PTXCONF_KERNEL_XPKG
>  	@$(call install_fixup, kernel, AUTHOR,"Robert Schwebel <r.schwebel@pengutronix.de>")
>  	@$(call install_fixup, kernel, DESCRIPTION,missing)
>  
> -	@$(call install_copy, kernel, 0, 0, 0755, /boot);
> -
> -ifdef PTXCONF_KERNEL_INSTALL
> -	@$(call install_copy, kernel, 0, 0, 0644, $(KERNEL_IMAGE_PATH_y), /boot/$(KERNEL_IMAGE), n)
> -
> -	@$(foreach dtb, $(KERNEL_DTB_FILES), \
> -		$(call install_copy, kernel, 0, 0, 0644, -, \
> -			/boot/$(dtb), n)$(ptx/nl))
> -endif
> +#	@$(call install_copy, kernel, 0, 0, 0755, /boot);
> +#
> +#ifdef PTXCONF_KERNEL_INSTALL
> +#	@$(call install_copy, kernel, 0, 0, 0644, $(KERNEL_IMAGE_PATH_y), /boot/$(KERNEL_IMAGE), n)
> +#
> +#	@$(foreach dtb, $(KERNEL_DTB_FILES), \
> +#		$(call install_copy, kernel, 0, 0, 0644, -, \
> +#			/boot/$(dtb), n)$(ptx/nl))
> +#endif
>  
>  # install the ELF kernel image for debugging purpose
> -ifdef PTXCONF_KERNEL_VMLINUX
> -	@$(call install_copy, kernel, 0, 0, 0644, $(KERNEL_BUILD_DIR)/vmlinux, /boot/vmlinux, n)
> -endif
> +#ifdef PTXCONF_KERNEL_VMLINUX
> +#	@$(call install_copy, kernel, 0, 0, 0644, $(KERNEL_BUILD_DIR)/vmlinux, /boot/vmlinux, n)
> +#endif
>  
>  ifdef PTXCONF_KERNEL_TOOL_PERF
>  	@$(call install_copy, kernel, 0, 0, 0755, $(KERNEL_BUILD_DIR)/tools/perf/perf, \
> @@ -324,30 +330,33 @@ endif
>  # Target-Install-post
>  # ----------------------------------------------------------------------------
>  
> -ifdef PTXCONF_IMAGE_KERNEL_INSTALL_EARLY
> -$(STATEDIR)/kernel.targetinstall.post: $(IMAGEDIR)/linuximage
> -ifdef PTXCONF_IMAGE_KERNEL_LZOP
> -$(STATEDIR)/kernel.targetinstall.post: $(IMAGEDIR)/linuximage.lzo
> -endif
> -endif
> -
> -$(STATEDIR)/kernel.targetinstall.post:
> -	@$(call targetinfo)
> -
> -ifdef PTXCONF_KERNEL_MODULES_INSTALL
> -	@$(call install_init,  kernel-modules)
> -	@$(call install_fixup, kernel-modules, PRIORITY,optional)
> -	@$(call install_fixup, kernel-modules, SECTION,base)
> -	@$(call install_fixup, kernel-modules, AUTHOR,"Robert Schwebel <r.schwebel@pengutronix.de>")
> -	@$(call install_fixup, kernel-modules, DESCRIPTION,missing)
> -
> -	@$(call install_glob, kernel-modules, 0, 0, -, /lib/modules, *.ko,, n)
> -	@$(call install_glob, kernel-modules, 0, 0, -, /lib/modules,, *.ko */build */source, n)
> -
> -	@$(call install_finish, kernel-modules)
> -endif
> -
> -	@$(call touch)
> +# NOTE: this kernel only exists for the userspace kernel tools and a REF_CONFIG.
> +# The actual kernels come from the extra kernel-* packages.
> +#
> +#ifdef PTXCONF_IMAGE_KERNEL_INSTALL_EARLY
> +#$(STATEDIR)/kernel.targetinstall.post: $(IMAGEDIR)/linuximage
> +#ifdef PTXCONF_IMAGE_KERNEL_LZOP
> +#$(STATEDIR)/kernel.targetinstall.post: $(IMAGEDIR)/linuximage.lzo
> +#endif
> +#endif
> +#
> +#$(STATEDIR)/kernel.targetinstall.post:
> +#	@$(call targetinfo)
> +#
> +#ifdef PTXCONF_KERNEL_MODULES_INSTALL
> +#	@$(call install_init,  kernel-modules)
> +#	@$(call install_fixup, kernel-modules, PRIORITY,optional)
> +#	@$(call install_fixup, kernel-modules, SECTION,base)
> +#	@$(call install_fixup, kernel-modules, AUTHOR,"Robert Schwebel <r.schwebel@pengutronix.de>")
> +#	@$(call install_fixup, kernel-modules, DESCRIPTION,missing)
> +#
> +#	@$(call install_glob, kernel-modules, 0, 0, -, /lib/modules, *.ko,, n)
> +#	@$(call install_glob, kernel-modules, 0, 0, -, /lib/modules,, *.ko */build */source, n)
> +#
> +#	@$(call install_finish, kernel-modules)
> +#endif
> +#
> +#	@$(call touch)
>  
>  # ----------------------------------------------------------------------------
>  # Clean
> diff --git a/configs/platform-mipsel/platforms/kernel.in b/configs/platform-mipsel/platforms/kernel.in
> index 06b6e24a6756..d84d0122ec41 100644
> --- a/configs/platform-mipsel/platforms/kernel.in
> +++ b/configs/platform-mipsel/platforms/kernel.in
> @@ -23,36 +23,39 @@ config KERNEL_XPKG
>  	  Select this symbol if kernel tools or other non kernel
>  	  modules are installed.
>  
> -config KERNEL_INSTALL
> -	bool
> -	prompt "install kernel into /boot"
> -	select KERNEL_XPKG
> -
> -config KERNEL_MODULES
> -	bool
> -	default y
> -	prompt "build kernel-modules"
> +comment "NOTE: this kernel only exists for the userspace kernel tools and a REF_CONFIG."
> +comment "The actual kernels come from the extra kernel-* packages."
> +#
> + config KERNEL_INSTALL
> +	 bool
> +# 	prompt "install kernel into /boot"
> +# 	select KERNEL_XPKG
> +
> + config KERNEL_MODULES
> +	 bool
> +# 	default y
> +# 	prompt "build kernel-modules"
>  
>  config KERNEL_MODULES_INSTALL
>  	bool
> -	default y
> -	prompt "Install modules into /lib/modules"
> -	depends on KERNEL_MODULES
> -
> +#	default y
> +#	prompt "Install modules into /lib/modules"
> +#	depends on KERNEL_MODULES
> +#
>  config KERNEL_MODULES_SIGN
>  	bool
> -	depends on KERNEL_MODULES
> -	select KERNEL_CODE_SIGNING
> -	select KERNEL_MODULES_INSTALL
> -	prompt "sign modules"
> -	help
> -	  If enabled, kernel modules are signed during the install stage with
> -	  the key specified by the code signing provider in the "kernel-modules"
> -	  role.
> -
> -	  See the section "Kernel module signing" in the "Daily Work" chapter in
> -	  the PTXdist manual for use cases and more infos about what needs to be
> -	  enabled in the kernel config file.
> +#	depends on KERNEL_MODULES
> +#	select KERNEL_CODE_SIGNING
> +#	select KERNEL_MODULES_INSTALL
> +#	prompt "sign modules"
> +#	help
> +#	  If enabled, kernel modules are signed during the install stage with
> +#	  the key specified by the code signing provider in the "kernel-modules"
> +#	  role.
> +#
> +#	  See the section "Kernel module signing" in the "Daily Work" chapter in
> +#	  the PTXdist manual for use cases and more infos about what needs to be
> +#	  enabled in the kernel config file.
>  
>  config KERNEL_VERSION
>  	prompt "kernel version"
> @@ -174,31 +177,31 @@ config KERNEL_IMAGE
>  	default "Image"		if KERNEL_IMAGE_RAW
>  	default "simpleImage.${PTXCONF_KERNEL_IMAGE_SIMPLE_TARGET}.elf" if KERNEL_IMAGE_SIMPLE
>  
> -menuconfig KERNEL_DTB
> -	bool
> -	prompt "Build device trees            "
> -
> -if KERNEL_DTB
> -
> -config KERNEL_DTS_PATH
> -	string "path to source dts file"
> -	default "${PTXDIST_PLATFORMCONFIG_SUBDIR}/dts:${KERNEL_DIR}/arch/${GENERIC_KERNEL_ARCH}/boot/dts"
> -	help
> -	  Define path to the dts source file. Multiple directories can be
> -	  specified separated by ':'. A relative path will be expanded relative
> -	  to the workspace and all other layers. Only on of the specified paths
> -	  can be a relative path.
> -
> -config KERNEL_DTS
> -	string "source dts file"
> -	default "<yourboard>.dts"
> -	help
> -	  Select the dts file to use for the device tree binary
> -	  blob generation. For relative file names KERNEL_DTS_PATH
> -	  is used as a search path for the device tree files specified
> -	  here. Multiple dts files can be specified, separated by spaces.
> -
> -endif
> +#menuconfig KERNEL_DTB
> +#	bool
> +#	prompt "Build device trees            "
> +#
> +#if KERNEL_DTB
> +#
> +#config KERNEL_DTS_PATH
> +#	string "path to source dts file"
> +#	default "${PTXDIST_PLATFORMCONFIG_SUBDIR}/dts:${KERNEL_DIR}/arch/${GENERIC_KERNEL_ARCH}/boot/dts"
> +#	help
> +#	  Define path to the dts source file. Multiple directories can be
> +#	  specified separated by ':'. A relative path will be expanded relative
> +#	  to the workspace and all other layers. Only on of the specified paths
> +#	  can be a relative path.
> +#
> +#config KERNEL_DTS
> +#	string "source dts file"
> +#	default "<yourboard>.dts"
> +#	help
> +#	  Select the dts file to use for the device tree binary
> +#	  blob generation. For relative file names KERNEL_DTS_PATH
> +#	  is used as a search path for the device tree files specified
> +#	  here. Multiple dts files can be specified, separated by spaces.
> +#
> +#endif
>  
>  config KERNEL_CODE_SIGNING
>  	prompt "use code signing infrastructure"
> diff --git a/configs/platform-mipsel/rules/kernel.make b/configs/platform-mipsel/rules/kernel.make
> index 9caff677918e..d422ecf1030b 100644
> --- a/configs/platform-mipsel/rules/kernel.make
> +++ b/configs/platform-mipsel/rules/kernel.make
> @@ -235,10 +235,12 @@ KERNEL_TOOL_IIO_OPTS	:= \
>  
>  $(STATEDIR)/kernel.compile:
>  	@$(call targetinfo)
> -	@rm -f \
> -		$(KERNEL_BUILD_DIR)/usr/initramfs_data.cpio.* \
> -		$(KERNEL_BUILD_DIR)/usr/.initramfs_data.cpio.*
> -	@$(call world/compile, KERNEL)
> +# NOTE: this kernel only exists for the userspace kernel tools and a REF_CONFIG.
> +# The actual kernels come from the extra kernel-* packages.
> +#	@rm -f \
> +#		$(KERNEL_BUILD_DIR)/usr/initramfs_data.cpio.* \
> +#		$(KERNEL_BUILD_DIR)/usr/.initramfs_data.cpio.*
> +#	@$(call world/compile, KERNEL)
>  ifdef PTXCONF_KERNEL_TOOL_PERF
>  	@mkdir -p $(KERNEL_BUILD_DIR)/tools/perf
>  	@$(call compile, KERNEL, $(KERNEL_TOOL_PERF_OPTS))
> @@ -260,10 +262,12 @@ KERNEL_INSTALL_OPT = \
>  
>  $(STATEDIR)/kernel.install:
>  	@$(call targetinfo)
> -ifdef PTXCONF_KERNEL_MODULES_INSTALL
> -	@$(call world/install, KERNEL)
> -endif
> -	@$(call world/dtb, KERNEL)
> +# NOTE: this kernel only exists for the userspace kernel tools and a REF_CONFIG.
> +# The actual kernels come from the extra kernel-* packages.
> +#ifdef PTXCONF_KERNEL_MODULES_INSTALL
> +#	@$(call world/install, KERNEL)
> +#endif
> +#	@$(call world/dtb, KERNEL)
>  	@$(call touch)
>  
>  # ----------------------------------------------------------------------------
> @@ -272,11 +276,13 @@ endif
>  
>  $(STATEDIR)/kernel.targetinstall:
>  	@$(call targetinfo)
> -
> -	@$(foreach dtb, $(KERNEL_DTB_FILES), \
> -		echo -e "Installing $(dtb) ...\n"$(ptx/nl) \
> -		install -D -m0644 $(KERNEL_PKGDIR)/boot/$(dtb) \
> -			$(IMAGEDIR)/$(dtb)$(ptx/nl))
> +# NOTE: this kernel only exists for the userspace kernel tools and a REF_CONFIG.
> +# The actual kernels come from the extra kernel-* packages.
> +#
> +#	@$(foreach dtb, $(KERNEL_DTB_FILES), \
> +#		echo -e "Installing $(dtb) ...\n"$(ptx/nl) \
> +#		install -D -m0644 $(KERNEL_PKGDIR)/boot/$(dtb) \
> +#			$(IMAGEDIR)/$(dtb)$(ptx/nl))
>  
>  ifdef PTXCONF_KERNEL_XPKG
>  	@$(call install_init,  kernel)
> @@ -285,20 +291,20 @@ ifdef PTXCONF_KERNEL_XPKG
>  	@$(call install_fixup, kernel, AUTHOR,"Robert Schwebel <r.schwebel@pengutronix.de>")
>  	@$(call install_fixup, kernel, DESCRIPTION,missing)
>  
> -	@$(call install_copy, kernel, 0, 0, 0755, /boot);
> -
> -ifdef PTXCONF_KERNEL_INSTALL
> -	@$(call install_copy, kernel, 0, 0, 0644, $(KERNEL_IMAGE_PATH_y), /boot/$(KERNEL_IMAGE), n)
> -
> -	@$(foreach dtb, $(KERNEL_DTB_FILES), \
> -		$(call install_copy, kernel, 0, 0, 0644, -, \
> -			/boot/$(dtb), n)$(ptx/nl))
> -endif
> +#	@$(call install_copy, kernel, 0, 0, 0755, /boot);
> +#
> +#ifdef PTXCONF_KERNEL_INSTALL
> +#	@$(call install_copy, kernel, 0, 0, 0644, $(KERNEL_IMAGE_PATH_y), /boot/$(KERNEL_IMAGE), n)
> +#
> +#	@$(foreach dtb, $(KERNEL_DTB_FILES), \
> +#		$(call install_copy, kernel, 0, 0, 0644, -, \
> +#			/boot/$(dtb), n)$(ptx/nl))
> +#endif
>  
>  # install the ELF kernel image for debugging purpose
> -ifdef PTXCONF_KERNEL_VMLINUX
> -	@$(call install_copy, kernel, 0, 0, 0644, $(KERNEL_BUILD_DIR)/vmlinux, /boot/vmlinux, n)
> -endif
> +#ifdef PTXCONF_KERNEL_VMLINUX
> +#	@$(call install_copy, kernel, 0, 0, 0644, $(KERNEL_BUILD_DIR)/vmlinux, /boot/vmlinux, n)
> +#endif
>  
>  ifdef PTXCONF_KERNEL_TOOL_PERF
>  	@$(call install_copy, kernel, 0, 0, 0755, $(KERNEL_BUILD_DIR)/tools/perf/perf, \
> @@ -324,30 +330,33 @@ endif
>  # Target-Install-post
>  # ----------------------------------------------------------------------------
>  
> -ifdef PTXCONF_IMAGE_KERNEL_INSTALL_EARLY
> -$(STATEDIR)/kernel.targetinstall.post: $(IMAGEDIR)/linuximage
> -ifdef PTXCONF_IMAGE_KERNEL_LZOP
> -$(STATEDIR)/kernel.targetinstall.post: $(IMAGEDIR)/linuximage.lzo
> -endif
> -endif
> -
> -$(STATEDIR)/kernel.targetinstall.post:
> -	@$(call targetinfo)
> -
> -ifdef PTXCONF_KERNEL_MODULES_INSTALL
> -	@$(call install_init,  kernel-modules)
> -	@$(call install_fixup, kernel-modules, PRIORITY,optional)
> -	@$(call install_fixup, kernel-modules, SECTION,base)
> -	@$(call install_fixup, kernel-modules, AUTHOR,"Robert Schwebel <r.schwebel@pengutronix.de>")
> -	@$(call install_fixup, kernel-modules, DESCRIPTION,missing)
> -
> -	@$(call install_glob, kernel-modules, 0, 0, -, /lib/modules, *.ko,, n)
> -	@$(call install_glob, kernel-modules, 0, 0, -, /lib/modules,, *.ko */build */source, n)
> -
> -	@$(call install_finish, kernel-modules)
> -endif
> -
> -	@$(call touch)
> +# NOTE: this kernel only exists for the userspace kernel tools and a REF_CONFIG.
> +# The actual kernels come from the extra kernel-* packages.
> +#
> +#ifdef PTXCONF_IMAGE_KERNEL_INSTALL_EARLY
> +#$(STATEDIR)/kernel.targetinstall.post: $(IMAGEDIR)/linuximage
> +#ifdef PTXCONF_IMAGE_KERNEL_LZOP
> +#$(STATEDIR)/kernel.targetinstall.post: $(IMAGEDIR)/linuximage.lzo
> +#endif
> +#endif
> +#
> +#$(STATEDIR)/kernel.targetinstall.post:
> +#	@$(call targetinfo)
> +#
> +#ifdef PTXCONF_KERNEL_MODULES_INSTALL
> +#	@$(call install_init,  kernel-modules)
> +#	@$(call install_fixup, kernel-modules, PRIORITY,optional)
> +#	@$(call install_fixup, kernel-modules, SECTION,base)
> +#	@$(call install_fixup, kernel-modules, AUTHOR,"Robert Schwebel <r.schwebel@pengutronix.de>")
> +#	@$(call install_fixup, kernel-modules, DESCRIPTION,missing)
> +#
> +#	@$(call install_glob, kernel-modules, 0, 0, -, /lib/modules, *.ko,, n)
> +#	@$(call install_glob, kernel-modules, 0, 0, -, /lib/modules,, *.ko */build */source, n)
> +#
> +#	@$(call install_finish, kernel-modules)
> +#endif
> +#
> +#	@$(call touch)
>  
>  # ----------------------------------------------------------------------------
>  # Clean
> -- 
> 2.30.2
> 
> 
> _______________________________________________
> DistroKit mailing list
> DistroKit@pengutronix.de
> 

-- 
Pengutronix e.K.                           |                             |
Steuerwalder Str. 21                       | http://www.pengutronix.de/  |
31137 Hildesheim, Germany                  | Phone: +49-5121-206917-0    |
Amtsgericht Hildesheim, HRA 2686           | Fax:   +49-5121-206917-5555 |

_______________________________________________
DistroKit mailing list
DistroKit@pengutronix.de


^ permalink raw reply	[flat|nested] 12+ messages in thread

* Re: [DistroKit] [PATCH 7/8] mips, mipsel: don't actually compile the kernel
  2021-10-25  7:37   ` Michael Olbrich
@ 2021-11-24 14:53     ` Robert Schwebel
  2021-11-25 11:42       ` Roland Hieber
  0 siblings, 1 reply; 12+ messages in thread
From: Robert Schwebel @ 2021-11-24 14:53 UTC (permalink / raw)
  To: Roland Hieber, distrokit

On Mon, Oct 25, 2021 at 09:37:35AM +0200, Michael Olbrich wrote:
> On Sun, Oct 24, 2021 at 09:45:33PM +0200, Roland Hieber wrote:
> > The kernel package only exists to serve a REF_CONFIG for the extra
> > kernel packages, and to compile the userspace kernel tools for debugging
> > purposes. Make the actual kernel compilation and install steps a no-op
> > to save time during the build process, but leave the respective lines in
> > to make porting upstream patches to the kernel recipe easier in the
> > future.
> 
> Why is it easier? The kernel package is completely different now. It serves
> a different purpose and the lines that are commented mean that patches
> won't apply either. And I don't think it's actually useful to backport
> anything.

Any feedback?

> > Signed-off-by: Roland Hieber <rhi@pengutronix.de>

rsc
-- 
Pengutronix e.K.                           | Dipl.-Ing. Robert Schwebel  |
Steuerwalder Str. 21                       | https://www.pengutronix.de/ |
31137 Hildesheim, Germany                  | Phone: +49-5121-206917-0    |
Amtsgericht Hildesheim, HRA 2686           | Fax:   +49-5121-206917-9    |

_______________________________________________
DistroKit mailing list
DistroKit@pengutronix.de


^ permalink raw reply	[flat|nested] 12+ messages in thread

* Re: [DistroKit] [PATCH 7/8] mips, mipsel: don't actually compile the kernel
  2021-11-24 14:53     ` Robert Schwebel
@ 2021-11-25 11:42       ` Roland Hieber
  0 siblings, 0 replies; 12+ messages in thread
From: Roland Hieber @ 2021-11-25 11:42 UTC (permalink / raw)
  To: Robert Schwebel; +Cc: distrokit

On Wed, Nov 24, 2021 at 03:53:38PM +0100, Robert Schwebel wrote:
> On Mon, Oct 25, 2021 at 09:37:35AM +0200, Michael Olbrich wrote:
> > On Sun, Oct 24, 2021 at 09:45:33PM +0200, Roland Hieber wrote:
> > > The kernel package only exists to serve a REF_CONFIG for the extra
> > > kernel packages, and to compile the userspace kernel tools for debugging
> > > purposes. Make the actual kernel compilation and install steps a no-op
> > > to save time during the build process, but leave the respective lines in
> > > to make porting upstream patches to the kernel recipe easier in the
> > > future.
> > 
> > Why is it easier? The kernel package is completely different now. It serves
> > a different purpose and the lines that are commented mean that patches
> > won't apply either. And I don't think it's actually useful to backport
> > anything.
> 
> Any feedback?

I can leave out the kernel.make patches in the next iteration, but it
will change the kernelconfig due to GCC plugins. You still need the
first patches for the mips kernels, or they will probably cause
oldconfig issues during the build.

 - Roland


-- 
Roland Hieber, Pengutronix e.K.          | r.hieber@pengutronix.de     |
Steuerwalder Str. 21                     | https://www.pengutronix.de/ |
31137 Hildesheim, Germany                | Phone: +49-5121-206917-0    |
Amtsgericht Hildesheim, HRA 2686         | Fax:   +49-5121-206917-5555 |

_______________________________________________
DistroKit mailing list
DistroKit@pengutronix.de


^ permalink raw reply	[flat|nested] 12+ messages in thread

end of thread, other threads:[~2021-11-25 11:42 UTC | newest]

Thread overview: 12+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2021-10-24 19:45 [DistroKit] [PATCH 1/8] mips, mipsel: kernel-*: bring back KERNEL_*_PATH Roland Hieber
2021-10-24 19:45 ` [DistroKit] [PATCH 2/8] mips, mipsel: kernel-*: bring up-to-date with PTXdist 2021.07.0 template Roland Hieber
2021-10-24 19:45 ` [DistroKit] [PATCH 3/8] mips, mipsel: kernel-*: rework device-tree handling Roland Hieber
2021-10-24 19:45 ` [DistroKit] [PATCH 4/8] mips, mipsel: kernel-*: use ptx/config-version and ptx/config-md5 Roland Hieber
2021-10-24 19:45 ` [DistroKit] [PATCH 5/8] ptxdist: migrate 2021.06.0 -> 2021.10.0 Roland Hieber
2021-10-24 19:45 ` [DistroKit] [PATCH 6/8] mips, mipsel: kernel: re-fork from PTXdist 2021.10.0 Roland Hieber
2021-10-24 19:54   ` [DistroKit] [PATCH v2 " Roland Hieber
2021-10-24 19:45 ` [DistroKit] [PATCH 7/8] mips, mipsel: don't actually compile the kernel Roland Hieber
2021-10-25  7:37   ` Michael Olbrich
2021-11-24 14:53     ` Robert Schwebel
2021-11-25 11:42       ` Roland Hieber
2021-10-24 19:45 ` [DistroKit] [PATCH 8/8] mips, mipsel: update kernel configs Roland Hieber

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox