From f9a380362eef73f2a3a2e6035cd87db564b2df79 Mon Sep 17 00:00:00 2001 From: ut005081 Date: Mon, 6 May 2024 13:26:51 +0800 Subject: [PATCH] init: Change kernel version for linux-6.6 Just an interesting kernel hacking. Signed-off-by: ut005081 Signed-off-by: WangYuli --- Makefile | 8 ++++---- fs/pstore/ram.c | 5 +++++ init/version.c | 5 +++++ kernel/bpf/syscall.c | 5 +++++ kernel/power/snapshot.c | 5 +++++ kernel/sys.c | 6 ++++++ 6 files changed, 30 insertions(+), 4 deletions(-) diff --git a/Makefile b/Makefile index eafd84f6e9878..a4de6d42c3ad6 100644 --- a/Makefile +++ b/Makefile @@ -1,7 +1,7 @@ # SPDX-License-Identifier: GPL-2.0 VERSION = 6 -PATCHLEVEL = 10 -SUBLEVEL = 3 +PATCHLEVEL = 6 +SUBLEVEL = 44 EXTRAVERSION = NAME = Baby Opossum Posse @@ -1244,10 +1244,10 @@ endef define filechk_version.h if [ $(SUBLEVEL) -gt 255 ]; then \ echo \#define LINUX_VERSION_CODE $(shell \ - expr $(VERSION) \* 65536 + $(PATCHLEVEL) \* 256 + 255); \ + expr 6 \* 65536 + 10 \* 256 + 3); \ else \ echo \#define LINUX_VERSION_CODE $(shell \ - expr $(VERSION) \* 65536 + $(PATCHLEVEL) \* 256 + $(SUBLEVEL)); \ + expr 6 \* 65536 + 10 \* 256 + 3); \ fi; \ echo '#define KERNEL_VERSION(a,b,c) (((a) << 16) + ((b) << 8) + \ ((c) > 255 ? 255 : (c)))'; \ diff --git a/fs/pstore/ram.c b/fs/pstore/ram.c index b1a455f42e932..43a84d81001c6 100644 --- a/fs/pstore/ram.c +++ b/fs/pstore/ram.c @@ -28,6 +28,11 @@ #define RAMOOPS_KERNMSG_HDR "====" #define MIN_MEM_SIZE 4096UL +#ifdef LINUX_VERSION_CODE +#undef LINUX_VERSION_CODE +#endif +#define LINUX_VERSION_CODE KERNEL_VERSION(6, 6, 44) + static ulong record_size = MIN_MEM_SIZE; module_param(record_size, ulong, 0400); MODULE_PARM_DESC(record_size, diff --git a/init/version.c b/init/version.c index 94c96f6fbfe6a..bd4988fc62585 100644 --- a/init/version.c +++ b/init/version.c @@ -17,6 +17,11 @@ #include #include +#ifdef LINUX_VERSION_CODE +#undef LINUX_VERSION_CODE +#endif +#define LINUX_VERSION_CODE KERNEL_VERSION(6, 6, 44) + static int __init early_hostname(char *arg) { size_t bufsize = sizeof(init_uts_ns.name.nodename); diff --git a/kernel/bpf/syscall.c b/kernel/bpf/syscall.c index f45ed6adc092a..f3f9336c3a284 100644 --- a/kernel/bpf/syscall.c +++ b/kernel/bpf/syscall.c @@ -40,6 +40,11 @@ #include #include +#ifdef LINUX_VERSION_CODE +#undef LINUX_VERSION_CODE +#endif +#define LINUX_VERSION_CODE KERNEL_VERSION(6, 6, 44) + #define IS_FD_ARRAY(map) ((map)->map_type == BPF_MAP_TYPE_PERF_EVENT_ARRAY || \ (map)->map_type == BPF_MAP_TYPE_CGROUP_ARRAY || \ (map)->map_type == BPF_MAP_TYPE_ARRAY_OF_MAPS) diff --git a/kernel/power/snapshot.c b/kernel/power/snapshot.c index 405eddbda4fc5..faf3d4ec9274f 100644 --- a/kernel/power/snapshot.c +++ b/kernel/power/snapshot.c @@ -39,6 +39,11 @@ #include "power.h" +#ifdef LINUX_VERSION_CODE +#undef LINUX_VERSION_CODE +#endif +#define LINUX_VERSION_CODE KERNEL_VERSION(6, 6, 44) + #if defined(CONFIG_STRICT_KERNEL_RWX) && defined(CONFIG_ARCH_HAS_SET_MEMORY) static bool hibernate_restore_protection; static bool hibernate_restore_protection_active; diff --git a/kernel/sys.c b/kernel/sys.c index 3a2df1bd9f640..4b10fa71fd3cf 100644 --- a/kernel/sys.c +++ b/kernel/sys.c @@ -77,6 +77,12 @@ #include "uid16.h" +#ifdef LINUX_VERSION_CODE +#undef LINUX_VERSION_CODE +#endif +#define LINUX_VERSION_CODE KERNEL_VERSION(6, 6, 44) + + #ifndef SET_UNALIGN_CTL # define SET_UNALIGN_CTL(a, b) (-EINVAL) #endif