build: add a config option for enabling a testing version of the target kernel
authorFelix Fietkau <nbd@nbd.name>
Sat, 27 Apr 2019 17:13:07 +0000 (19:13 +0200)
committerFelix Fietkau <nbd@nbd.name>
Sat, 11 May 2019 09:37:10 +0000 (11:37 +0200)
If the target supports a newer kernel version that is not used by default
yet, it can be enabled with this option

Signed-off-by: Felix Fietkau <nbd@nbd.name>
20 files changed:
config/Config-build.in
include/kernel-version.mk
include/target.mk
scripts/metadata.pm
scripts/target-metadata.pl
target/Config.in
target/linux/apm821xx/Makefile
target/linux/ath79/Makefile
target/linux/bcm53xx/Makefile
target/linux/brcm47xx/Makefile
target/linux/cns3xxx/Makefile
target/linux/gemini/Makefile
target/linux/imx6/Makefile
target/linux/ipq40xx/Makefile
target/linux/kirkwood/Makefile
target/linux/mpc85xx/Makefile
target/linux/octeon/Makefile
target/linux/sunxi/Makefile
target/linux/tegra/Makefile
target/linux/x86/Makefile

index 6d749476db78daf25e7b85d47c139053b80a8e43..5132497e1d3c23b40914594c2d4cfb8cb728f4a0 100644 (file)
@@ -36,6 +36,15 @@ menu "Global build settings"
 
        comment "General build options"
 
+       config TESTING_KERNEL
+               bool "Use the testing kernel version"
+               depends on HAS_TESTING_KERNEL
+               default n
+               help
+                 If the target supports a newer kernel version than the default,
+                 you can use this config option to enable it
+
+
        config DISPLAY_SUPPORT
                bool "Show packages that require graphics support (local or remote)"
                default n
index 81ec2bd25267e30650fc31bef00e22e6ca02c166..c978294ecf929d75032413726eb2836094683e3b 100644 (file)
@@ -2,6 +2,10 @@
 
 LINUX_RELEASE?=1
 
+ifdef CONFIG_TESTING_KERNEL
+  KERNEL_PATCHVER:=$(KERNEL_TESTING_PATCHVER)
+endif
+
 LINUX_VERSION-4.9 = .172
 LINUX_VERSION-4.14 = .115
 LINUX_VERSION-4.19 = .38
@@ -23,6 +27,9 @@ else
 ifdef KERNEL_PATCHVER
   LINUX_VERSION:=$(KERNEL_PATCHVER)$(strip $(LINUX_VERSION-$(KERNEL_PATCHVER)))
 endif
+ifdef KERNEL_TESTING_PATCHVER
+  LINUX_TESTING_VERSION:=$(KERNEL_TESTING_PATCHVER)$(strip $(LINUX_VERSION-$(KERNEL_TESTING_PATCHVER)))
+endif
 endif
 
 split_version=$(subst ., ,$(1))
index d24bb9cd111c886750068ceb552dccce25f7f418..4f3bd43e6cb662bc78904087f953e4d19b36ccc0 100644 (file)
@@ -225,6 +225,9 @@ ifeq ($(DUMP),1)
     .SILENT: $(TMP_CONFIG)
     .PRECIOUS: $(TMP_CONFIG)
 
+    ifdef KERNEL_TESTING_PATCHVER
+      FEATURES += testing-kernel
+    endif
     ifneq ($(CONFIG_OF),)
       FEATURES += dt
     endif
@@ -283,6 +286,7 @@ define BuildTargets/DumpCurrent
         echo 'Target-Optimization: $(if $(CFLAGS),$(CFLAGS),$(DEFAULT_CFLAGS))'; \
         echo 'CPU-Type: $(CPU_TYPE)$(if $(CPU_SUBTYPE),+$(CPU_SUBTYPE))'; \
         echo 'Linux-Version: $(LINUX_VERSION)'; \
+       $(if $(LINUX_TESTING_VERSION),echo 'Linux-Testing-Version: $(LINUX_TESTING_VERSION)';) \
         echo 'Linux-Release: $(LINUX_RELEASE)'; \
         echo 'Linux-Kernel-Arch: $(LINUX_KARCH)'; \
        $(if $(SUBTARGET),,$(if $(DEFAULT_SUBTARGET), echo 'Default-Subtarget: $(DEFAULT_SUBTARGET)'; )) \
index a338b8caadbcb0fd8d99686260a3eb2a82e531f3..d088332152794ed05188ae74d32e785e305a3ec7 100644 (file)
@@ -131,6 +131,7 @@ sub parse_target_metadata($) {
                /^Target-Optimization:\s*(.+)\s*$/ and $target->{cflags} = $1;
                /^CPU-Type:\s*(.+)\s*$/ and $target->{cputype} = $1;
                /^Linux-Version:\s*(.+)\s*$/ and $target->{version} = $1;
+               /^Linux-Testing-Version:\s*(.+)\s*$/ and $target->{testing_version} = $1;
                /^Linux-Release:\s*(.+)\s*$/ and $target->{release} = $1;
                /^Linux-Kernel-Arch:\s*(.+)\s*$/ and $target->{karch} = $1;
                /^Default-Subtarget:\s*(.+)\s*$/ and $target->{def_subtarget} = $1;
index 123958799fe3fc0ca34192f175bccd92622c96a9..d183e943f6c03e42b7df9874de8059042c8a7d8e 100755 (executable)
@@ -42,6 +42,7 @@ sub target_config_features(@) {
                /^virtio$/ and $ret .= "\tselect VIRTIO_SUPPORT\n";
                /^rootfs-part$/ and $ret .= "\tselect USES_ROOTFS_PART\n";
                /^boot-part$/ and $ret .= "\tselect USES_BOOT_PART\n";
+               /^testing-kernel$/ and $ret .= "\tselect HAS_TESTING_KERNEL\n";
        }
        return $ret;
 }
@@ -83,11 +84,14 @@ sub print_target($) {
        }
 
        my $v = kver($target->{version});
+       my $tv = kver($target->{testing_version});
+       $tv or $tv = $v;
        if (@{$target->{subtargets}} == 0) {
        $confstr = <<EOF;
 config TARGET_$target->{conf}
        bool "$target->{name}"
-       select LINUX_$v
+       select LINUX_$v if !TESTING_KERNEL
+       select LINUX_$tv if TESTING_KERNEL
 EOF
        }
        else {
@@ -387,15 +391,18 @@ EOF
 
        my %kver;
        foreach my $target (@target) {
-               my $v = kver($target->{version});
-               next if $kver{$v};
-               $kver{$v} = 1;
-               print <<EOF;
+               foreach my $tv ($target->{version}, $target->{testing_version}) {
+                       next unless $tv;
+                       my $v = kver($tv);
+                       next if $kver{$v};
+                       $kver{$v} = 1;
+                       print <<EOF;
 
 config LINUX_$v
        bool
 
 EOF
+               }
        }
        foreach my $def (sort keys %defaults) {
                print <<EOF;
index 3cf4231f2aad3e9bdcee9d715e5366d697b3b490..3ee23ebf7f06a9637a3adc770a8e79008f384437 100644 (file)
@@ -2,6 +2,9 @@ source "tmp/.config-target.in"
 
 # Kernel/Hardware features
 
+config HAS_TESTING_KERNEL
+       bool
+
 config HAS_SPE_FPU
        depends on powerpc
        select HAS_FPU
index c3253322f2add7bdd407be5dda00f0a9f8fd7d7d..a67aee3b8cb0bfeaddd5d335ea662aa9aa23d9f6 100644 (file)
@@ -14,6 +14,7 @@ MAINTAINER:=Chris Blake <chrisrblake93@gmail.com>, \
 SUBTARGETS:=nand sata
 
 KERNEL_PATCHVER:=4.14
+KERNEL_TESTING_PATCHVER := 4.19
 
 define Target/Description
        Build images for AppliedMicro APM821xx based boards.
index 82f6317ac669e742054bb2b8ad276533a5fdbedf..0ccc0bed1ce05f7c5a71c8251850742f4216bbcc 100644 (file)
@@ -9,6 +9,7 @@ SUBTARGETS:=generic nand tiny
 FEATURES:=ramdisk
 
 KERNEL_PATCHVER:=4.14
+KERNEL_TESTING_PATCHVER := 4.19
 
 include $(INCLUDE_DIR)/target.mk
 
index 2af1c7e719d6f55f244576cda1a2f01d5a9ae717..4171a04ee4c858607a7c3fd6b32a20dbd5db3439 100644 (file)
@@ -14,6 +14,7 @@ MAINTAINER:=Hauke Mehrtens <hauke@hauke-m.de>
 CPU_TYPE:=cortex-a9
 
 KERNEL_PATCHVER:=4.14
+KERNEL_TESTING_PATCHVER := 4.19
 
 define Target/Description
        Build firmware images for Broadcom based BCM47xx/53xx routers with ARM CPU, *not* MIPS.
index af91d8bada52a58264b1cb2d5b34555c35c2f1db..b991770e12cb1a11512c59c03403c5f6051bb5ac 100644 (file)
@@ -14,6 +14,7 @@ SUBTARGETS:=generic mips74k legacy
 MAINTAINER:=Hauke Mehrtens <hauke@hauke-m.de>
 
 KERNEL_PATCHVER:=4.14
+KERNEL_TESTING_PATCHVER := 4.19
 
 define Target/Description
        Build firmware images for Broadcom based BCM47xx/53xx routers with MIPS CPU, *not* ARM.
index abb1fccf322c8f8e455bbe191c38e5a14f0cffd4..785b06f596b4df15c96e78f9fc7a7016541babe1 100644 (file)
@@ -15,6 +15,7 @@ CPU_SUBTYPE:=vfp
 MAINTAINER:=Felix Fietkau <nbd@nbd.name>, \
            Koen Vandeputte <koen.vandeputte@ncentric.com>
 KERNEL_PATCHVER:=4.14
+KERNEL_TESTING_PATCHVER := 4.19
 
 define Target/Description
        Build images for Cavium Networks Econa CNS3xxx based boards,
index 304e515980a5181cc5b8ffd708273c7a11ff7ec1..867e284714a995be38143ce32eac0775dc046643 100644 (file)
@@ -14,6 +14,7 @@ CPU_TYPE:=fa526
 MAINTAINER:=Roman Yeryomin <roman@advem.lv>
 
 KERNEL_PATCHVER:=4.14
+KERNEL_TESTING_PATCHVER := 4.19
 
 define Target/Description
        Build firmware images for the StorLink/Cortina Gemini CS351x ARM FA526 CPU
index 49e44870262d05d4f4432ac8bff68aa0cdbb3e70..457e767c05a5e35a5e7188dbb50249671e91d961 100644 (file)
@@ -15,6 +15,7 @@ CPU_SUBTYPE:=neon
 MAINTAINER:=Luka Perkov <luka@openwrt.org>
 
 KERNEL_PATCHVER:=4.14
+KERNEL_TESTING_PATCHVER := 4.19
 
 include $(INCLUDE_DIR)/target.mk
 
index ab7b174e4000063e585d53368d48174663b52014..2785b73ed1583fa8cab13c1e072012c23b72392a 100644 (file)
@@ -10,6 +10,7 @@ MAINTAINER:=John Crispin <john@phrozen.org>
 
 # TODO: drop kmod-usb-dwc3-of-simple when migrating to 4.19
 KERNEL_PATCHVER:=4.14
+KERNEL_TESTING_PATCHVER := 4.19
 
 KERNELNAME:=zImage Image dtbs
 
index 3eac246a42ed0984593be480f00a228c3bcd9110..adc7a496e12f1c4fbb92c73602d61bf5d74d04f7 100644 (file)
@@ -14,6 +14,7 @@ CPU_TYPE:=xscale
 MAINTAINER:=Luka Perkov <luka@openwrt.org>
 
 KERNEL_PATCHVER:=4.14
+KERNEL_TESTING_PATCHVER := 4.19
 
 include $(INCLUDE_DIR)/target.mk
 
index e08b00ab8e9baf31d440e82310b91d10824a5e80..9db478d87b99a978cbba459ef4edd8dc5a753b10 100644 (file)
@@ -15,6 +15,7 @@ MAINTAINER:=Imre Kaloz <kaloz@openwrt.org>
 SUBTARGETS:=generic p1020 p2020
 
 KERNEL_PATCHVER:=4.14
+KERNEL_TESTING_PATCHVER := 4.19
 
 KERNELNAME:=zImage
 
index 6c0623cb9bfac4d1169c7fb8cbdae6e47ae40ba6..202ed39be7376e50e014784b12976c717d60cff3 100644 (file)
@@ -14,6 +14,7 @@ CPU_TYPE:=octeonplus
 MAINTAINER:=John Crispin <john@phrozen.org>
 
 KERNEL_PATCHVER:=4.14
+KERNEL_TESTING_PATCHVER := 4.19
 
 define Target/Description
        Build firmware images for Cavium Networks Octeon-based boards.
index 8d09d4e9397ce459b11d648e6735f218151a8069..aae7df1b443d3a84d99d91a3d3c653e1799f0ce4 100644 (file)
@@ -15,6 +15,7 @@ SUBTARGETS:=cortexa8 cortexa7 cortexa53
 MAINTAINER:=Zoltan HERPAI <wigyori@uid0.hu>
 
 KERNEL_PATCHVER:=4.14
+KERNEL_TESTING_PATCHVER := 4.19
 KERNELNAME:=zImage dtbs
 
 # A10: Cortex-A8
index 57cb902cfd52bbe06191263534a2d4dda324476e..8a611e29abb4814ce7ed4d55b46b7afab2b74c85 100644 (file)
@@ -15,6 +15,7 @@ CPU_SUBTYPE := vfpv3
 MAINTAINER := Tomasz Maciej Nowak <tomek_n@o2.pl>
 
 KERNEL_PATCHVER := 4.14
+KERNEL_TESTING_PATCHVER := 4.19
 
 include $(INCLUDE_DIR)/target.mk
 
index 533c0e524807ec452175fbdafcedfc05e1c28c83..509ccb47a2a677fbdd2ac46da81a0641337435a8 100644 (file)
@@ -14,6 +14,7 @@ SUBTARGETS:=generic legacy geode 64
 MAINTAINER:=Felix Fietkau <nbd@nbd.name>
 
 KERNEL_PATCHVER:=4.14
+KERNEL_TESTING_PATCHVER:=4.19
 
 KERNELNAME:=bzImage