From 414f0c79a0fac86020f220b6feba518926420491 Mon Sep 17 00:00:00 2001
From: John Crispin <john@phrozen.org>
Date: Sat, 7 May 2022 19:50:33 +0200
Subject: [PATCH 4/4] kernel-headers: add v3.18->v5.10 support

Signed-off-by: John Crispin <john@phrozen.org>
---
 toolchain/kernel-headers/Makefile | 12 ++++++++++++
 1 file changed, 12 insertions(+)

diff --git a/toolchain/kernel-headers/Makefile b/toolchain/kernel-headers/Makefile
index c33f26d46d..a97f230d57 100644
--- a/toolchain/kernel-headers/Makefile
+++ b/toolchain/kernel-headers/Makefile
@@ -14,6 +14,18 @@ override HOST_QUILT:=
 
 include $(INCLUDE_DIR)/kernel.mk
 
+ifneq ($(KERNEL_NAME_SUFFIX),)
+  KERNEL_PATCHVER := 5.10
+  KERNEL_NAME_SUFFIX:=
+  GENERIC_BACKPORT_DIR := $(GENERIC_PLATFORM_DIR)/backport$(if $(wildcard $(GENERIC_PLATFORM_DIR)/backport-$(KERNEL_PATCHVER)),-$(KERNEL_PATCHVER))
+  GENERIC_PATCH_DIR := $(GENERIC_PLATFORM_DIR)/pending$(if $(wildcard $(GENERIC_PLATFORM_DIR)/pending-$(KERNEL_PATCHVER)),-$(KERNEL_PATCHVER))
+  GENERIC_HACK_DIR := $(GENERIC_PLATFORM_DIR)/hack$(if $(wildcard $(GENERIC_PLATFORM_DIR)/hack-$(KERNEL_PATCHVER)),-$(KERNEL_PATCHVER))
+  GENERIC_FILES_DIR := $(foreach dir,$(wildcard $(GENERIC_PLATFORM_DIR)/files $(GENERIC_PLATFORM_DIR)/files-$(KERNEL_PATCHVER)),"$(dir)")
+  $(warning GENERIC_BACKPORT_DIR = $(GENERIC_BACKPORT_DIR))
+  include $(INCLUDE_DIR)/kernel-version.mk
+  include $(INCLUDE_DIR)/kernel.mk
+endif
+
 PKG_NAME:=linux
 PKG_VERSION:=$(LINUX_VERSION)
 PKG_SOURCE:=$(LINUX_SOURCE)
-- 
2.25.1

