feat: upgrade linux to v7.3.1 #60

Merged
sisungo merged 1 commits from sisungo/ports:linux-v7.3.1 into main 2026-11-18 01:12:00 +00:00
3 changed files with 101 additions and 10 deletions

No files matched your search

+2 -2
View File
@@ -1,7 +1,7 @@
from lib import cpp, arch
from lib.make import *
version("1.34")
version("1.34+1")
description("a set of tools to handle common tasks with Linux kernel modules like insert, remove, list, check properties, resolve dependencies and aliases")
maintainer("sisungo <[email protected]>")
source_managed("github://kmod-project/kmod#v34")
@@ -23,7 +23,7 @@ def build():
f"-Dincludedir={get_prefix('libkmod-dev')}/include",
f"-Dbindir={get_prefix('kmod')}/bin",
f"-Ddistconfdir={get_prefix('libkmod')}/share",
"-Dmoduledir=/lib/lkm",
"-Dmoduledir=/lib/modules",
"-Dtools=true",
"-Ddlopen=all",
"-Dmanpages=false",
@@ -0,0 +1,45 @@
--- a/scripts/sign-file.c 2026-10-30 12:09:52.000000000 +0000
+++ b/scripts/sign-file.c 2026-11-16 12:19:52.001911278 +0000
@@ -201,9 +201,9 @@
X509 *x509;
BIO *bd, *bm;
int opt, n;
- OpenSSL_add_all_algorithms();
- ERR_load_crypto_strings();
- ERR_clear_error();
+ //OpenSSL_add_all_algorithms();
+ //ERR_load_crypto_strings();
+ //ERR_clear_error();
key_pass = getenv("KBUILD_SIGN_PIN");
--- a/scripts/sign-file.c 2026-11-16 12:21:08.614514667 +0000
+++ b/scripts/sign-file.c 2026-11-16 12:21:45.134000624 +0000
@@ -254,7 +254,7 @@
x509 = read_x509(x509_name);
/* Digest the module data. */
- OpenSSL_add_all_digests();
+ //OpenSSL_add_all_digests();
drain_openssl_errors(__LINE__, 0);
digest_algo = EVP_get_digestbyname(hash_algo);
ERR(!digest_algo, "EVP_get_digestbyname");
--- a/certs/extract-cert.c 2026-11-16 12:39:29.726151104 +0000
+++ b/certs/extract-cert.c 2026-11-16 12:50:19.821752865 +0000
@@ -127,9 +127,9 @@
char *cert_src;
char *verbose_env;
- OpenSSL_add_all_algorithms();
- ERR_load_crypto_strings();
- ERR_clear_error();
+ //OpenSSL_add_all_algorithms();
+ //ERR_load_crypto_strings();
+ //ERR_clear_error();
verbose_env = getenv("KBUILD_VERBOSE");
if (verbose_env && strchr(verbose_env, '1'))
+54 -8
View File
@@ -6,7 +6,7 @@ from lib import cpp, arch, packie
from lib.make import *
upstream_version = "7.2.12"
upstream_version = "7.3.1"
version(f"{upstream_version}")
description("the Linux operating system kernel")
@@ -16,15 +16,22 @@ source_url(f"https://cdn.kernel.org/pub/linux/kernel/v7.x/linux-{upstream_versio
builddep("shortcut/c")
builddep("shortcut/autotools")
builddep("libncurses-dev")
builddep("aws-lc-dev @target")
builddep("aws-lc-tools")
builddep("airboot-linux-stage2-mkinitramfs")
builddep("airboot-linux-stage2-arch @target")
builddep("libexpat")
builddep("openssl-dev")
builddep("openssl-tools")
builddep("flex")
builddep("bison")
builddep("bc")
builddep("gzip")
builddep("zstd")
builddep("bash")
builddep("util-linux-text")
builddep("rsync (=3.5.2)")
builddep("kmod")
builddep("airboot-linux-stage2-mkinitramfs")
builddep("airboot-linux-stage2-arch @target")
builddep("libgelf-dev @target")
builddep("libtraceevent-dev @target")
def get_arch():
@@ -34,6 +41,12 @@ def get_variant():
return os.environ.get("LINUX_VARIANT")
def prepare_atomenv():
if in_atomic():
packie.select("/bin/openssl", "openssl-tools")
# FIXME: Currently, `bash` do not provide link `/bin/sh`
os.system("ln -sf /bin/bash /bin/sh")
def prepare_config():
config_name = get_arch()
if get_variant():
@@ -43,7 +56,13 @@ def prepare_config():
shutil.copy2(config_file, ".config")
def make_install_everything():
makeopts = [f"ARCH={get_arch()}", "LLVM=1", f"HOSTCC={os.environ.get('HOSTCC', 'cc')}"]
makeopts = [
f"ARCH={get_arch()}",
"LLVM=1",
f"CC={packie.prefix_of('clang')}/bin/clang",
f"HOSTCC={os.environ.get('HOSTCC', 'cc')}",
f"KCFLAGS=-isystem {packie.prefix_of('clang')}/lib/clang/23/include",
]
cpp.make(makeopts + ["olddefconfig"])
cpp.make(makeopts)
@@ -54,6 +73,19 @@ def make_install_everything():
)
os.remove(f"../kmod_install/lib/modules/{upstream_version}/build")
def make_perf():
oldpwd = os.getcwd()
os.chdir("tools/perf")
cpp.make([
f"ARCH={get_arch()}",
"LLVM=1",
"NO_LIBDW=1",
"NO_LIBELF=0",
"NO_JEVENTS=1",
"EXTRA_CFLAGS=-Wno-error=unused-but-set-global -Wno-error=initializer-overrides",
])
os.chdir(oldpwd)
def create_initramfs():
asp_prefix = packie.prefix_of(f"airboot-linux-stage2-arch @{arch.get_target()}")
subprocess.run([
@@ -69,15 +101,17 @@ def generate_info():
info += f"KERNEL_INFO_UPSTREAM_VERSION={upstream_version}\n"
info += f"KERNEL_INFO_VARIANT={get_variant() or ''}\n"
info += f"KERNEL_INFO_ARCHITECTURE={get_arch()}\n"
with open(f"../KernelInfo.txt", "wt+") as fd:
with open("../KernelInfo.txt", "wt+") as fd:
fd.write(info)
def build():
prepare_atomenv()
prepare_config()
make_install_everything()
create_initramfs()
generate_info()
make_perf()
on_build(build)
@@ -104,16 +138,28 @@ def pack_linux(composer):
composer.addfile(initramfs_origin, "initramfs.img")
composer.addfile("../KernelInfo.txt", "KernelInfo.txt")
def pack_perf(composer):
composer.makedir("bin")
composer.add("tools/perf/perf", "bin/perf")
base_name = "linux"
if os.environ.get("LINUX_VARIANT"):
base_name += "-" + os.environ["LINUX_VARIANT"]
package(f"{base_name}")
configure_script("configure/kernel-install")
configure_script("configure/kernel-remove")
link("modules", f"/lib/modules/{upstream_version}")
on_pack(pack_linux)
package(f"{base_name}-dev")
description("the Linux operating system kernel -- development files (e.g. headers)")
on_pack(pack_linux_dev)
if base_name == "linux":
package("perf")
description("the Linux operating system kernel -- performance counter tool")
dep("semi-libc @same-arch")
dep("libgelf @same-arch")
dep("libtraceevent @same-arch")
on_pack(pack_perf)