diff --git a/docs/kernels.md b/docs/kernels.md index d35b4cd1b..409ef5c28 100644 --- a/docs/kernels.md +++ b/docs/kernels.md @@ -333,7 +333,8 @@ Finally, test that you can build the kernel with that config as `make build-`, e.g. `make build-5.15.148`. ## Adding a new kernel series @@ -360,12 +360,10 @@ KERNEL_VERSION= KERNEL_SERIES= BUILD_IMAGE=linuxkit/alpine: ``` -1. Update the list of kernels to build in the `Makefile` Since the last major series likely is the best basis for the new one, subject to additional modifications, you can use the previous one as a starting point. -1. Modify the list of kernels inside the `Makefile` to include the new version. You do not need to specify the series anywhere, as the `Makefile` calculates it. E.g. adding `7.0.5` will cause it to calculate the series as `7.0.x` automatically. 1. Make the directory for the new series, e.g. `mkdir 7.0.x` 1. Create a new `linuxkit/kconfig` container image: `make kconfig`. This is not pushed out. 1. Run a container based on `linuxkit/kconfig`. diff --git a/kernel/5.10.x/deprecated b/kernel/5.10.x/deprecated new file mode 100644 index 000000000..e69de29bb diff --git a/kernel/5.11.x-rt/deprecated b/kernel/5.11.x-rt/deprecated new file mode 100644 index 000000000..e69de29bb diff --git a/kernel/5.11.x/deprecated b/kernel/5.11.x/deprecated new file mode 100644 index 000000000..e69de29bb diff --git a/kernel/5.15.x/build-args b/kernel/5.15.x/build-args new file mode 100644 index 000000000..90388930f --- /dev/null +++ b/kernel/5.15.x/build-args @@ -0,0 +1,3 @@ +KERNEL_VERSION=5.15.27 +KERNEL_SERIES=5.15.x +BUILD_IMAGE=linuxkit/alpine:146f540f25cd92ec8ff0c5b0c98342a9a95e479e diff --git a/kernel/5.15.x/deprecated b/kernel/5.15.x/deprecated new file mode 100644 index 000000000..e69de29bb diff --git a/kernel/5.4.x/deprecated b/kernel/5.4.x/deprecated new file mode 100644 index 000000000..e69de29bb diff --git a/kernel/Makefile b/kernel/Makefile index 5ba82057e..17e0d9b8a 100644 --- a/kernel/Makefile +++ b/kernel/Makefile @@ -76,21 +76,22 @@ baseimage = $(ORG)/$(IMAGE)$(call baseimageextension,$(1)) uniq = $(if $1,$(firstword $1) $(call uniq,$(filter-out $(firstword $1),$1))) +# DEPRECATED : all kernel versions (actually series) marked as deprecated +# You might still be able to build them, but they are not built by default or supported +DEPRECATED_list=$(wildcard */deprecated) +DEPRECATED := $(patsubst %/deprecated,%,$(DEPRECATED_list)) # -# Kernel versions to build. -# Use all for kernels to be built on all platforms; use KERNELS_x86_64 or KERNELS_aarch64 for platform-specific kernels -KERNELS_all=6.6.13 5.15.27 -KERNELS_x86_64= -KERNELS_aarch64= +# KERNELS : all potential kernel versions, based on the build-args files -# deprecated versions. You might still be able to build them, but they are not built by default or supported -# Use all for kernels to be built on all platforms; use DEPRECATED_x86_64 or DEPRECATED_aarch64 for platform-specific kernels -DEPRECATED_all=5.10.104 5.11.4-rt -DEPRECATED_x86_64=5.4.172 -DEPRECATED_aarch64= +# first find all known build-args files +KERNELS_buildargfiles=$(wildcard */build-args) +# get their directories +KERNELS_alldirs=$(patsubst %/build-args,%,$(KERNELS_buildargfiles)) +# remove any directories that are marked as deprecated; what is left is valid dirs +KERNELS_validdirs=$(filter-out $(DEPRECATED),$(KERNELS_alldirs)) +# get the values from the valid dirs +KERNELS=$(shell awk -F= '/^KERNEL_VERSION=/ {print $$2}' $(addsuffix /build-args,$(KERNELS_validdirs))) -KERNELS?=$(KERNELS_all) $(KERNELS_$(ARCH)) -DEPRECATED?=$(DEPRECATED_all) $(DEPRECATED_$(ARCH)) # we build all tools across all platforms and kernels that we build TOOLS=bcc perf