diff options
author | archdevlab | 2023-11-02 22:20:08 -0400 |
---|---|---|
committer | archdevlab | 2023-11-02 22:20:08 -0400 |
commit | d06605b813e230fd70dcd1c1cb0c4f0b03c400ba (patch) | |
tree | 822d7246143e957a7df02111f8d87fe2acdce7e2 | |
parent | 9cf0f3562931ef4b26b59dca08763299ea5c1124 (diff) | |
download | aur-d06605b813e230fd70dcd1c1cb0c4f0b03c400ba.tar.gz |
update to 6.6 and sync with official Archlinux package
-rw-r--r-- | .SRCINFO | 83 | ||||
-rw-r--r-- | 0001-ZEN-Add-sysctl-and-CONFIG-to-disallow-unprivileged-C.patch | 154 | ||||
-rw-r--r-- | 0002-drivers-firmware-skip-simpledrm-if-nvidia-drm.modese.patch | 89 | ||||
-rw-r--r-- | PKGBUILD | 249 |
4 files changed, 297 insertions, 278 deletions
@@ -1,5 +1,5 @@ pkgbase = linux-llvm - pkgver = 6.4.0 + pkgver = 6.6.0 pkgrel = 1 url = https://www.kernel.org/ arch = x86_64 @@ -11,6 +11,7 @@ pkgbase = linux-llvm makedepends = libelf makedepends = pahole makedepends = perl + makedepends = python makedepends = tar makedepends = xz makedepends = kmod @@ -30,79 +31,17 @@ pkgbase = linux-llvm makedepends = lld makedepends = python options = !strip - source = https://cdn.kernel.org/pub/linux/kernel/v6.x/linux-6.4.tar.xz - source = https://gitlab.archlinux.org/archlinux/packaging/packages/linux/-/raw/1b45fa8cd58990bf455b429c598b6d4bad155172/config - source = https://raw.githubusercontent.com/blacksky3/patches/main/6.4/arch/v6.4-arch1/0001-ZEN-Add-sysctl-and-CONFIG-to-disallow-unprivileged-C.patch - source = https://raw.githubusercontent.com/blacksky3/patches/main/6.4/sirlucjan/amd/0001-amd-6.4-merge-changes-from-dev-tree-v2.patch - source = https://raw.githubusercontent.com/blacksky3/patches/main/6.4/sirlucjan/bfq/0001-bfq-cachyos-patches-v1.patch - source = https://raw.githubusercontent.com/blacksky3/patches/main/6.4/sirlucjan/block/0001-block-set-rq_affinity-to-force-full-multithreading-I-v1.patch - source = https://raw.githubusercontent.com/blacksky3/patches/main/6.4/sirlucjan/btrfs/0001-btrfs-6.4-merge-changes-from-dev-tree-v1.patch - source = https://raw.githubusercontent.com/blacksky3/patches/main/6.4/sirlucjan/clang/0001-clang-6.4-add-miscellaneous-fixes-for-clang-v1.patch - source = https://raw.githubusercontent.com/blacksky3/patches/main/6.4/sirlucjan/drm/0001-drm-6.4-Add-HDR-patches-v1.patch - source = https://raw.githubusercontent.com/blacksky3/patches/main/6.4/sirlucjan/hid/0001-hid-6.4-merge-changes-from-dev-tree-v1.patch - source = https://raw.githubusercontent.com/blacksky3/patches/main/6.4/sirlucjan/x86/0001-x86-Avoid-relocation-information-in-final-vmlinux-v1.patch - source = https://raw.githubusercontent.com/blacksky3/patches/main/6.4/sirlucjan/zstd/0001-zstd-6.4-import-v1.5.5-v1.patch - source = https://raw.githubusercontent.com/blacksky3/patches/main/6.4/sirlucjan/zstd/0001-zstd-modules-cachyos-patches-v1.patch - source = https://raw.githubusercontent.com/blacksky3/patches/main/6.4/tkg/0001-mm-Support-soft-dirty-flag-reset-for-VA-range.patch - source = https://raw.githubusercontent.com/blacksky3/patches/main/6.4/tkg/0002-mm-Support-soft-dirty-flag-read-with-reset.patch - source = https://raw.githubusercontent.com/blacksky3/patches/main/6.4/tkg/0013-optimize_harder_O3.patch - source = https://raw.githubusercontent.com/blacksky3/patches/main/6.4/xanmod/0001-PCI-Enable-overrides-for-missing-ACS-capabilities.patch - source = https://raw.githubusercontent.com/blacksky3/patches/main/6.4/xanmod/0001-futex-Add-entry-point-for-FUTEX_WAIT_MULTIPLE-opcode.patch - source = https://raw.githubusercontent.com/blacksky3/patches/main/6.4/xanmod/0001-winesync-Introduce-the-winesync-driver-and-character.patch - source = https://raw.githubusercontent.com/blacksky3/patches/main/6.4/xanmod/0001-x86-kconfig-more-uarches-for-kernel-5.17-xm_rev2.patch - source = https://raw.githubusercontent.com/blacksky3/patches/main/6.4/xanmod/0001-XANMOD-x86-build-Add-more-x86_64-optimizations.patch - source = https://raw.githubusercontent.com/blacksky3/patches/main/6.4/xanmod/0002-XANMOD-Makefile-Move-ARM-and-x86-instruction-set-sel.patch - source = https://raw.githubusercontent.com/blacksky3/patches/main/6.4/xanmod/0003-XANMOD-fair-Increase-wake-up-granularity-time-to-3ms.patch - source = https://raw.githubusercontent.com/blacksky3/patches/main/6.4/xanmod/0011-XANMOD-dcache-cache_pressure-50-decreases-the-rate-a.patch - source = https://raw.githubusercontent.com/blacksky3/patches/main/6.4/xanmod/0012-XANMOD-mm-vmscan-vm_swappiness-30-decreases-the-amou.patch - source = https://raw.githubusercontent.com/blacksky3/patches/main/6.4/xanmod/0016-XANMOD-Makefile-Disable-GCC-vectorization-on-trees.patch - source = https://raw.githubusercontent.com/blacksky3/patches/main/6.4/xanmod/intel/0001-sched-fair-Record-the-average-duration-of-a-task.patch - source = https://raw.githubusercontent.com/blacksky3/patches/main/6.4/xanmod/intel/0002-sched-fair-Introduce-SIS_CURRENT-to-wake-up-short-ta.patch - source = https://raw.githubusercontent.com/blacksky3/patches/main/6.4/xanmod/intel/0003-x86-vdso-Use-lfence-instead-of-rep-and-nop.patch - source = https://raw.githubusercontent.com/blacksky3/patches/main/6.4/xanmod/intel/0004-sched-wait-Do-accept-in-LIFO-order-for-cache-efficie.patch - source = https://raw.githubusercontent.com/blacksky3/patches/main/6.4/xanmod/intel/0005-intel_rapl-Silence-rapl-trace-debug.patch - source = https://raw.githubusercontent.com/blacksky3/patches/main/6.4/xanmod/intel/0006-firmware-Enable-stateless-firmware-loading.patch - source = https://raw.githubusercontent.com/blacksky3/patches/main/6.4/xanmod/intel/0007-locking-rwsem-spin-faster.patch - source = https://raw.githubusercontent.com/blacksky3/patches/main/6.4/xanmod/intel/0008-drivers-initialize-ata-before-graphics.patch - source = https://raw.githubusercontent.com/blacksky3/patches/main/6.4/xanmod/intel/0009-init-wait-for-partition-and-retry-scan.patch - sha256sums = 8fa0588f0c2ceca44cac77a0e39ba48c9f00a6b9dc69761c02a5d3efac8da7f3 - sha256sums = ab8e459ac900f4f2b2677d9692177afdfb215e75b8315259ef8bdd0a1ea032e1 - sha256sums = db411b01a5896283fdaf1cf30733d41e9740320a3f422b23ee8b376b8a5e8930 - sha256sums = 1827e974d83d452c8a07bf1a6a1593d214f9a9fe61d3dba8a072c2b1c42673d2 - sha256sums = 12de7fe29e482e6f0edfd48123c468a309b69d3cca1be4a773c1b96ef6697d22 - sha256sums = 5d0faf58c6c9e58d709ec2e136bdd576ebd4c0f7d630bef5a05bf188dd482579 - sha256sums = 2cab3863f3e21a8f8e83b3f86743c57c3f37bf086cc01ebf4573c218df229655 - sha256sums = 47b6485d9a31eba9589d3ea295239411fc5ae71972cf2e5b94172290d8c12186 - sha256sums = 5b9a5d0c5c81960d981d01febe201689794b58bb835b2cadadfbdda42b74f47f - sha256sums = 0867b5cb21a0765fd7b76d3724fc8a258bedbba974b6e4dbd62348f6ce7d9cee - sha256sums = 81cc1547d62933e04aed15c57b9e93101e546298b1fef5f63a6b1469471acebe - sha256sums = dd20963020f83e30497ebeccdeace10e98b74ebffa5847de334eeaaae80f5046 - sha256sums = de7a2748545b2b5d0082c09373c14d9ee41110dfa5e30a3be02e3500c2a8118c - sha256sums = 7c913c3b58001d3534b1f1828e920ca61707b545c228714420237af51f2ec77b - sha256sums = 1fbf26545a49ce297434fa2c39217361cdd90285b2c5ff04c505008037ede6c5 - sha256sums = 85669071475af9e4ca74cb15c1f277dadd5ea7b3050f443712da77230a4aa488 - sha256sums = b4b4f1c20891d1b104354dd574dda80d2f3c5e4f49c76f361c058ffb5b973fd4 - sha256sums = 4fd244250dad9949dffad6a42b702384c1b1197297f87ffe80cb45496c29cb25 - sha256sums = f440d27364ad757ea3cf36454a590f0329f8a6e29f630aa497705840f72e214a - sha256sums = 75b4f9c09aeaa34f14677ccf8dffe30d786b12235eaf4a0cd9654eaa14e63bbb - sha256sums = 5756ce78a788e58f6986640f4699bdb0672742e264b8702997ef5e7feadfc6db - sha256sums = f3008b53ec36dba2d71640d8605f6cbf4c5951beadb62f1b614eeefd74d7bdb2 - sha256sums = 5e7549f6f4d1f5a2f414f9d7c5a28e8079196084942a9d3e95c074cfcc984977 - sha256sums = 71e4fae21123107f00b5e08f0345591f41c61aa918d3e3680c025ce3a78a8a64 - sha256sums = 9a1eb034d4a142be9686835d47ebe1998d8f618436756c89b4521fa1a7f13e0f - sha256sums = ab6409a7a582ef65bd44519bc56b06eb796c450468a88c7d4fdd67f972488b1b - sha256sums = b10fed04277d5808998c5db0ed3147dd003dc74ff548218fe75d6eda985d68c0 - sha256sums = d1b2e2db347114ccb13ca9c8aaff65e7180cb722f4dc46c82bc5df248edebe63 - sha256sums = 1e8d4ddba087aeac79c54acee0f37b4ee5d2c7f43f064b2c8cf29d668f798e3f - sha256sums = 6579c78554b1f1e97a6a439b4287cd542747208774af4070b6d116456e575429 - sha256sums = 0ad556c65afca9688ea495106c632d7e479e60e4e2241007a7ef4120f65b27a0 - sha256sums = 217791179fcf7d522ed8065b4cf49fb9097522b936a8852901dde0702ea90954 - sha256sums = 9a0fd7b40032514b83ec200cd7aeffccf835889c4b86c012e1b9f50fffbfd1a2 - sha256sums = 8b7be40de00645ca42ee5c7079bf7d7531de75ecdff97a30914d5d604d7efb58 - sha256sums = 7352643e67f651d322b2443e25f7b6ab30a667e3dde6fc2688cb75c24ef0ae84 + source = https://cdn.kernel.org/pub/linux/kernel/v6.x/linux-6.6.tar.xz + source = https://gitlab.archlinux.org/archlinux/packaging/packages/linux/-/raw/3175f498d244950892b9c8ef2c3093d01a491047/config + source = 0001-ZEN-Add-sysctl-and-CONFIG-to-disallow-unprivileged-C.patch + source = 0002-drivers-firmware-skip-simpledrm-if-nvidia-drm.modese.patch + sha256sums = d926a06c63dd8ac7df3f86ee1ffc2ce2a3b81a2d168484e76b5b389aba8e56d0 + sha256sums = d2060f5045a30832d70a7747c780f1358a9f4cfc1811c8ccaeaab9c027b59ee4 + sha256sums = 5d5a766ea646d6b6e64f56867cbd10c64704107ac6f15123387c4b65e49d71c3 + sha256sums = cf80842fc0b2df079905c3212faeecddde7a4c4fd0742364564f10df4f7f6aa3 pkgname = linux-llvm - pkgdesc = The Linux kernel and modules with Arch and other improvement patches - Build with LLVM/CLANG + pkgdesc = The Linux kernel and modules - Build with LLVM/CLANG depends = coreutils depends = initramfs depends = kmod diff --git a/0001-ZEN-Add-sysctl-and-CONFIG-to-disallow-unprivileged-C.patch b/0001-ZEN-Add-sysctl-and-CONFIG-to-disallow-unprivileged-C.patch new file mode 100644 index 000000000000..9e62ab5a25a8 --- /dev/null +++ b/0001-ZEN-Add-sysctl-and-CONFIG-to-disallow-unprivileged-C.patch @@ -0,0 +1,154 @@ +From 0f5f96ad4cb82b68c1f6669227b21ad887e8a469 Mon Sep 17 00:00:00 2001 +From: "Jan Alexander Steffens (heftig)" <jan.steffens@gmail.com> +Date: Mon, 16 Sep 2019 04:53:20 +0200 +Subject: [PATCH 1/2] ZEN: Add sysctl and CONFIG to disallow unprivileged + CLONE_NEWUSER + +Our default behavior continues to match the vanilla kernel. +--- + include/linux/user_namespace.h | 4 ++++ + init/Kconfig | 16 ++++++++++++++++ + kernel/fork.c | 14 ++++++++++++++ + kernel/sysctl.c | 12 ++++++++++++ + kernel/user_namespace.c | 7 +++++++ + 5 files changed, 53 insertions(+) + +diff --git a/include/linux/user_namespace.h b/include/linux/user_namespace.h +index 45f09bec0..87b20e2ee 100644 +--- a/include/linux/user_namespace.h ++++ b/include/linux/user_namespace.h +@@ -148,6 +148,8 @@ static inline void set_userns_rlimit_max(struct user_namespace *ns, + + #ifdef CONFIG_USER_NS + ++extern int unprivileged_userns_clone; ++ + static inline struct user_namespace *get_user_ns(struct user_namespace *ns) + { + if (ns) +@@ -181,6 +183,8 @@ extern bool current_in_userns(const struct user_namespace *target_ns); + struct ns_common *ns_get_owner(struct ns_common *ns); + #else + ++#define unprivileged_userns_clone 0 ++ + static inline struct user_namespace *get_user_ns(struct user_namespace *ns) + { + return &init_user_ns; +diff --git a/init/Kconfig b/init/Kconfig +index 6d35728b9..0562c8ca7 100644 +--- a/init/Kconfig ++++ b/init/Kconfig +@@ -1226,6 +1226,22 @@ config USER_NS + + If unsure, say N. + ++config USER_NS_UNPRIVILEGED ++ bool "Allow unprivileged users to create namespaces" ++ default y ++ depends on USER_NS ++ help ++ When disabled, unprivileged users will not be able to create ++ new namespaces. Allowing users to create their own namespaces ++ has been part of several recent local privilege escalation ++ exploits, so if you need user namespaces but are ++ paranoid^Wsecurity-conscious you want to disable this. ++ ++ This setting can be overridden at runtime via the ++ kernel.unprivileged_userns_clone sysctl. ++ ++ If unsure, say Y. ++ + config PID_NS + bool "PID Namespaces" + default y +diff --git a/kernel/fork.c b/kernel/fork.c +index 3b6d20dfb..200a77738 100644 +--- a/kernel/fork.c ++++ b/kernel/fork.c +@@ -100,6 +100,10 @@ + #include <linux/user_events.h> + #include <linux/iommu.h> + ++#ifdef CONFIG_USER_NS ++#include <linux/user_namespace.h> ++#endif ++ + #include <asm/pgalloc.h> + #include <linux/uaccess.h> + #include <asm/mmu_context.h> +@@ -2260,6 +2264,10 @@ __latent_entropy struct task_struct *copy_process( + if ((clone_flags & (CLONE_NEWUSER|CLONE_FS)) == (CLONE_NEWUSER|CLONE_FS)) + return ERR_PTR(-EINVAL); + ++ if ((clone_flags & CLONE_NEWUSER) && !unprivileged_userns_clone) ++ if (!capable(CAP_SYS_ADMIN)) ++ return ERR_PTR(-EPERM); ++ + /* + * Thread groups must share signals as well, and detached threads + * can only be started up within the thread group. +@@ -3413,6 +3421,12 @@ int ksys_unshare(unsigned long unshare_flags) + if (unshare_flags & CLONE_NEWNS) + unshare_flags |= CLONE_FS; + ++ if ((unshare_flags & CLONE_NEWUSER) && !unprivileged_userns_clone) { ++ err = -EPERM; ++ if (!capable(CAP_SYS_ADMIN)) ++ goto bad_unshare_out; ++ } ++ + err = check_unshare_flags(unshare_flags); + if (err) + goto bad_unshare_out; +diff --git a/kernel/sysctl.c b/kernel/sysctl.c +index 354a2d294..5bc5605e7 100644 +--- a/kernel/sysctl.c ++++ b/kernel/sysctl.c +@@ -80,6 +80,9 @@ + #ifdef CONFIG_RT_MUTEXES + #include <linux/rtmutex.h> + #endif ++#ifdef CONFIG_USER_NS ++#include <linux/user_namespace.h> ++#endif + + /* shared constants to be used in various sysctls */ + const int sysctl_vals[] = { 0, 1, 2, 3, 4, 100, 200, 1000, 3000, INT_MAX, 65535, -1 }; +@@ -1623,6 +1626,15 @@ static struct ctl_table kern_table[] = { + .mode = 0644, + .proc_handler = proc_dointvec, + }, ++#ifdef CONFIG_USER_NS ++ { ++ .procname = "unprivileged_userns_clone", ++ .data = &unprivileged_userns_clone, ++ .maxlen = sizeof(int), ++ .mode = 0644, ++ .proc_handler = proc_dointvec, ++ }, ++#endif + #ifdef CONFIG_PROC_SYSCTL + { + .procname = "tainted", +diff --git a/kernel/user_namespace.c b/kernel/user_namespace.c +index 1d8e47bed..fec01d016 100644 +--- a/kernel/user_namespace.c ++++ b/kernel/user_namespace.c +@@ -22,6 +22,13 @@ + #include <linux/bsearch.h> + #include <linux/sort.h> + ++/* sysctl */ ++#ifdef CONFIG_USER_NS_UNPRIVILEGED ++int unprivileged_userns_clone = 1; ++#else ++int unprivileged_userns_clone; ++#endif ++ + static struct kmem_cache *user_ns_cachep __read_mostly; + static DEFINE_MUTEX(userns_state_mutex); + +-- +2.42.1 + diff --git a/0002-drivers-firmware-skip-simpledrm-if-nvidia-drm.modese.patch b/0002-drivers-firmware-skip-simpledrm-if-nvidia-drm.modese.patch new file mode 100644 index 000000000000..124bbe3367cc --- /dev/null +++ b/0002-drivers-firmware-skip-simpledrm-if-nvidia-drm.modese.patch @@ -0,0 +1,89 @@ +From 8a9ec6e76ff5600e467775b0173b6f96cb1b62ca Mon Sep 17 00:00:00 2001 +From: Javier Martinez Canillas <javierm@redhat.com> +Date: Thu, 19 May 2022 14:40:07 +0200 +Subject: [PATCH 2/2] drivers/firmware: skip simpledrm if nvidia-drm.modeset=1 + is set + +The Nvidia proprietary driver has some bugs that leads to issues if used +with the simpledrm driver. The most noticeable is that does not register +an emulated fbdev device. + +It just relies on a fbdev to be registered by another driver, that could +be that could be attached to the framebuffer console. On UEFI machines, +this is the efifb driver. + +This means that disabling the efifb driver will cause virtual consoles to +not be present in the system when using the Nvidia driver. Legacy BIOS is +not affected just because fbcon is not used there, but instead vgacon. + +Unless a VGA mode is specified using the vga= kernel command line option, +in that case the vesafb driver is used instead and its fbdev attached to +the fbcon. + +This is a problem because with CONFIG_SYSFB_SIMPLEFB=y, the sysfb platform +code attempts to register a "simple-framebuffer" platform device (that is +matched against simpledrm) and only registers either an "efi-framebuffer" +or "vesa-framebuffer" if this fails to be registered due the video modes +not being compatible. + +The Nvidia driver relying on another driver to register the fbdev is quite +fragile, since it can't really assume those will stick around. For example +there are patches posted to remove the EFI and VESA platform devices once +a real DRM or fbdev driver probes. + +But in any case, moving to a simpledrm + emulated fbdev only breaks this +assumption and causes users to not have VT if the Nvidia driver is used. + +So to prevent this, let's add a workaround and make the sysfb to skip the +"simple-framebuffer" registration when nvidia-drm.modeset=1 option is set. + +This is quite horrible, but honestly I can't think of any other approach. + +For this to work, the CONFIG_FB_EFI and CONFIG_FB_VESA config options must +be enabled besides CONFIG_DRM_SIMPLEDRM. + +Signed-off-by: Javier Martinez Canillas <javierm@redhat.com> +Cherry-picked-for: https://bugs.archlinux.org/task/73720 +--- + drivers/firmware/sysfb.c | 18 +++++++++++++++++- + 1 file changed, 17 insertions(+), 1 deletion(-) + +diff --git a/drivers/firmware/sysfb.c b/drivers/firmware/sysfb.c +index 82fcfd29b..17b7e096b 100644 +--- a/drivers/firmware/sysfb.c ++++ b/drivers/firmware/sysfb.c +@@ -34,6 +34,22 @@ + #include <linux/screen_info.h> + #include <linux/sysfb.h> + ++static int skip_simpledrm; ++ ++static int __init simpledrm_disable(char *opt) ++{ ++ if (!opt) ++ return -EINVAL; ++ ++ get_option(&opt, &skip_simpledrm); ++ ++ if (skip_simpledrm) ++ pr_info("The simpledrm driver will not be probed\n"); ++ ++ return 0; ++} ++early_param("nvidia-drm.modeset", simpledrm_disable); ++ + static struct platform_device *pd; + static DEFINE_MUTEX(disable_lock); + static bool disabled; +@@ -85,7 +101,7 @@ static __init int sysfb_init(void) + + /* try to create a simple-framebuffer device */ + compatible = sysfb_parse_mode(si, &mode); +- if (compatible) { ++ if (compatible && !skip_simpledrm) { + pd = sysfb_create_simplefb(si, &mode); + if (!IS_ERR(pd)) + goto unlock_mutex; +-- +2.42.1 + @@ -1,10 +1,4 @@ -#_ _ _ _____ -#| |__ | | __ _ ___| | ___ __ ___ ___ ___ _ __ |___ / -#| '_ \| |/ _` |/ __| |/ / '_ ` _ \ / _ \ / _ \| '_ \ |_ \ -#| |_) | | (_| | (__| <| | | | | | (_) | (_) | | | |___) | -#|_.__/|_|\__,_|\___|_|\_\_| |_| |_|\___/ \___/|_| |_|____/ - -#Maintainer: blackmoon3 <https://github.com/blacksky3> +#Maintainer: archdevlab <https://github.com/archdevlab> #Credits: Jan Alexander Steffens (heftig) <heftig@archlinux.org> #Credits: Andreas Radke <andyrtr@archlinux.org> #Credits: Luca Stefani <luca.stefani.ge1@gmail.com> @@ -25,65 +19,27 @@ BUILD_FLAGS=(CC=clang CXX=clang++ HOSTCC=clang HOSTCXX=clang++ LD=ld.lld LLVM=1 ################################################################################### pkgbase=linux-llvm -pkgver=6.4.0 -_pkgver=6.4 +pkgver=6.6.0 +_pkgver=6.6 pkgrel=1 -major=6.4 -commit=1b45fa8cd58990bf455b429c598b6d4bad155172 +major=6.6 +commit=3175f498d244950892b9c8ef2c3093d01a491047 arch=(x86_64) url='https://www.kernel.org/' license=(GPL2) -makedepends=(bc cpio gettext git libelf pahole perl tar xz kmod xmlto) +makedepends=(bc cpio gettext git libelf pahole perl python tar xz kmod xmlto) makepends+=(graphviz imagemagick python-sphinx texlive-latexextra) # htmldocs makedepends+=(bison flex zstd make patch gcc gcc-libs glibc binutils) makedepends+=(clang llvm llvm-libs lld python) options=(!strip) archlinuxpath=https://gitlab.archlinux.org/archlinux/packaging/packages/linux/-/raw/$commit -patchpath=https://raw.githubusercontent.com/blacksky3/patches/main/$major source=(https://cdn.kernel.org/pub/linux/kernel/v6.x/linux-$_pkgver.tar.xz ${archlinuxpath}/config # Arch patches - ${patchpath}/arch/v6.4-arch1/0001-ZEN-Add-sysctl-and-CONFIG-to-disallow-unprivileged-C.patch - # Other patches - # Sirlucjan - ${patchpath}/sirlucjan/amd/0001-amd-6.4-merge-changes-from-dev-tree-v2.patch - ${patchpath}/sirlucjan/bfq/0001-bfq-cachyos-patches-v1.patch - ${patchpath}/sirlucjan/block/0001-block-set-rq_affinity-to-force-full-multithreading-I-v1.patch - ${patchpath}/sirlucjan/btrfs/0001-btrfs-6.4-merge-changes-from-dev-tree-v1.patch - ${patchpath}/sirlucjan/clang/0001-clang-6.4-add-miscellaneous-fixes-for-clang-v1.patch - ${patchpath}/sirlucjan/drm/0001-drm-6.4-Add-HDR-patches-v1.patch - ${patchpath}/sirlucjan/hid/0001-hid-6.4-merge-changes-from-dev-tree-v1.patch - ${patchpath}/sirlucjan/x86/0001-x86-Avoid-relocation-information-in-final-vmlinux-v1.patch - ${patchpath}/sirlucjan/zstd/0001-zstd-6.4-import-v1.5.5-v1.patch - ${patchpath}/sirlucjan/zstd/0001-zstd-modules-cachyos-patches-v1.patch - # TKG - ${patchpath}/tkg/0001-mm-Support-soft-dirty-flag-reset-for-VA-range.patch - ${patchpath}/tkg/0002-mm-Support-soft-dirty-flag-read-with-reset.patch - ${patchpath}/tkg/0013-optimize_harder_O3.patch - # Xanmod - ${patchpath}/xanmod/0001-PCI-Enable-overrides-for-missing-ACS-capabilities.patch - ${patchpath}/xanmod/0001-futex-Add-entry-point-for-FUTEX_WAIT_MULTIPLE-opcode.patch - ${patchpath}/xanmod/0001-winesync-Introduce-the-winesync-driver-and-character.patch - ${patchpath}/xanmod/0001-x86-kconfig-more-uarches-for-kernel-5.17-xm_rev2.patch - ${patchpath}/xanmod/0001-XANMOD-x86-build-Add-more-x86_64-optimizations.patch - ${patchpath}/xanmod/0002-XANMOD-Makefile-Move-ARM-and-x86-instruction-set-sel.patch\ - #${patchpath}/xanmod/0002-XANMOD-fair-Remove-all-energy-efficiency-functions.patch - ${patchpath}/xanmod/0003-XANMOD-fair-Increase-wake-up-granularity-time-to-3ms.patch - ${patchpath}/xanmod/0011-XANMOD-dcache-cache_pressure-50-decreases-the-rate-a.patch - ${patchpath}/xanmod/0012-XANMOD-mm-vmscan-vm_swappiness-30-decreases-the-amou.patch - ${patchpath}/xanmod/0016-XANMOD-Makefile-Disable-GCC-vectorization-on-trees.patch - # Xanmod Intel - ${patchpath}/xanmod/intel/0001-sched-fair-Record-the-average-duration-of-a-task.patch - ${patchpath}/xanmod/intel/0002-sched-fair-Introduce-SIS_CURRENT-to-wake-up-short-ta.patch - ${patchpath}/xanmod/intel/0003-x86-vdso-Use-lfence-instead-of-rep-and-nop.patch - ${patchpath}/xanmod/intel/0004-sched-wait-Do-accept-in-LIFO-order-for-cache-efficie.patch - ${patchpath}/xanmod/intel/0005-intel_rapl-Silence-rapl-trace-debug.patch - ${patchpath}/xanmod/intel/0006-firmware-Enable-stateless-firmware-loading.patch - ${patchpath}/xanmod/intel/0007-locking-rwsem-spin-faster.patch - ${patchpath}/xanmod/intel/0008-drivers-initialize-ata-before-graphics.patch - ${patchpath}/xanmod/intel/0009-init-wait-for-partition-and-retry-scan.patch) + 0001-ZEN-Add-sysctl-and-CONFIG-to-disallow-unprivileged-C.patch + 0002-drivers-firmware-skip-simpledrm-if-nvidia-drm.modese.patch) export KBUILD_BUILD_HOST=archlinux export KBUILD_BUILD_USER=$pkgbase @@ -124,36 +80,35 @@ prepare(){ # fi # Set LTO with CLANG/LLVM - if [[ "$_compiler" = "2" ]]; then - - msg "Enable THIN LTO" - scripts/config --enable CONFIG_LTO - scripts/config --enable CONFIG_LTO_CLANG - scripts/config --enable CONFIG_ARCH_SUPPORTS_LTO_CLANG - scripts/config --enable CONFIG_ARCH_SUPPORTS_LTO_CLANG_THIN - scripts/config --disable CONFIG_LTO_NONE - scripts/config --enable CONFIG_HAS_LTO_CLANG - scripts/config --disable CONFIG_LTO_CLANG_FULL - scripts/config --enable CONFIG_LTO_CLANG_THIN - scripts/config --enable CONFIG_HAVE_GCC_PLUGINS - - #msg "Enable FULL LTO" - #scripts/config --enable CONFIG_LTO - #scripts/config --enable CONFIG_LTO_CLANG - #scripts/config --enable CONFIG_ARCH_SUPPORTS_LTO_CLANG - #scripts/config --enable CONFIG_ARCH_SUPPORTS_LTO_CLANG_THIN - #scripts/config --disable CONFIG_LTO_NONE - #scripts/config --enable CONFIG_HAS_LTO_CLANG - #scripts/config --enable CONFIG_LTO_CLANG_FULL - #scripts/config --disable CONFIG_LTO_CLANG_THIN - #scripts/config --enable CONFIG_HAVE_GCC_PLUGINS - - #msg "Disable LTO" - #scripts/config --enable CONFIG_LTO_NONE - - sleep 2s - plain "" - fi + + msg "Enable THIN LTO" + scripts/config --enable CONFIG_LTO + scripts/config --enable CONFIG_LTO_CLANG + scripts/config --enable CONFIG_ARCH_SUPPORTS_LTO_CLANG + scripts/config --enable CONFIG_ARCH_SUPPORTS_LTO_CLANG_THIN + scripts/config --disable CONFIG_LTO_NONE + scripts/config --enable CONFIG_HAS_LTO_CLANG + scripts/config --disable CONFIG_LTO_CLANG_FULL + scripts/config --enable CONFIG_LTO_CLANG_THIN + scripts/config --enable CONFIG_HAVE_GCC_PLUGINS + + #msg "Enable FULL LTO" + #scripts/config --enable CONFIG_LTO + #scripts/config --enable CONFIG_LTO_CLANG + #scripts/config --enable CONFIG_ARCH_SUPPORTS_LTO_CLANG + #scripts/config --enable CONFIG_ARCH_SUPPORTS_LTO_CLANG_THIN + #scripts/config --disable CONFIG_LTO_NONE + #scripts/config --enable CONFIG_HAS_LTO_CLANG + #scripts/config --enable CONFIG_LTO_CLANG_FULL + #scripts/config --disable CONFIG_LTO_CLANG_THIN + #scripts/config --enable CONFIG_HAVE_GCC_PLUGINS + + #msg "Disable LTO" + #scripts/config --enable CONFIG_LTO_NONE + + sleep 2s + + plain "" msg "Apply some Archlinux config" @@ -184,91 +139,6 @@ prepare(){ sleep 2s - msg "Apply config from Cachyos" - - # NUMA is optimized for multi-socket motherboards. - # A single multi-core CPU actually runs slower with NUMA enabled. - # See, https://bugs.archlinux.org/task/31187 - msg2 "Disable NUMA" - scripts/config --disable CONFIG_NUMA - scripts/config --disable CONFIG_AMD_NUMA - scripts/config --disable CONFIG_X86_64_ACPI_NUMA - scripts/config --disable CONFIG_NODES_SPAN_OTHER_NODES - scripts/config --disable CONFIG_NUMA_EMU - scripts/config --disable CONFIG_USE_PERCPU_NUMA_NODE_ID - scripts/config --disable CONFIG_ACPI_NUMA - scripts/config --disable CONFIG_ARCH_SUPPORTS_NUMA_BALANCING - scripts/config --disable CONFIG_NODES_SHIFT - scripts/config --disable CONFIG_NODES_SHIFT - scripts/config --disable CONFIG_NEED_MULTIPLE_NODES - scripts/config --disable CONFIG_NUMA_BALANCING - scripts/config --disable CONFIG_NUMA_BALANCING_DEFAULT_ENABLED - - sleep 2s - - # Disable debug to lower the size of the kernel - msg2 "Disable debug to lower the size of the kernel" - scripts/config --disable CONFIG_DEBUG_INFO - scripts/config --disable CONFIG_DEBUG_INFO_BTF - scripts/config --disable CONFIG_DEBUG_INFO_DWARF4 - scripts/config --disable CONFIG_DEBUG_INFO_DWARF5 - scripts/config --disable CONFIG_PAHOLE_HAS_SPLIT_BTF - scripts/config --disable CONFIG_DEBUG_INFO_BTF_MODULES - scripts/config --disable CONFIG_SLUB_DEBUG - scripts/config --disable CONFIG_PM_DEBUG - scripts/config --disable CONFIG_PM_ADVANCED_DEBUG - scripts/config --disable CONFIG_PM_SLEEP_DEBUG - scripts/config --disable CONFIG_ACPI_DEBUG - scripts/config --disable CONFIG_SCHED_DEBUG - scripts/config --disable CONFIG_LATENCYTOP - scripts/config --disable CONFIG_DEBUG_PREEMPT - - sleep 2s - - msg "Apply config from linux-prjc (AUR)" - - # Disable CONFIG_DEBUG_INFO=y at build time otherwise memory usage blows up - # And can easily overwhelm a system with 32 GB of memory using a tmpfs build - # partition ... this was introduced by FS#66260, see: - # https://git.archlinux.org/svntogit/packages.git/commit/trunk?h=packages/linux&id=663b08666b269eeeeaafbafaee07fd03389ac8d7 - msg2 "Disable debug to lower the size of the kernel" - scripts/config --disable CONFIG_CGROUP_BPF - scripts/config --disable CONFIG_BPF_LSM - scripts/config --disable CONFIG_BPF_PRELOAD - scripts/config --disable CONFIG_BPF_LIRC_MODE2 - scripts/config --disable CONFIG_BPF_KPROBE_OVERRIDE - - sleep 2s - - msg "Patch addition config" - - msg2 "Enable CONFIG_CC_OPTIMIZE_FOR_PERFORMANCE (O3) (0013-optimize_harder_O3.patch) (Replace O2 by O3)" - scripts/config --disable CONFIG_CC_OPTIMIZE_FOR_SIZE - scripts/config --enable CONFIG_CC_OPTIMIZE_FOR_PERFORMANCE - - sleep 2s - - msg2 "Enable Winesync" - scripts/config --enable CONFIG_WINESYNC - - sleep 2s - - msg2 "Set ZSTD modules and kernel compression level" - scripts/config --enable CONFIG_KERNEL_ZSTD - scripts/config --set-val CONFIG_ZSTD_COMP_VAL 19 - scripts/config --set-val CONFIG_MODULE_COMPRESS_ZSTD_LVL 19 - scripts/config --enable CONFIG_MODULE_COMPRESS_ZSTD_ULTRA - scripts/config --set-val CONFIG_MODULE_COMPRESS_ZSTD_LEVEL_ULTRA 22 - - sleep 2s - - msg2 "Add NVIDIA Shield and Google Stadia support" - scripts/config --module CONFIG_HID_SHIELD - scripts/config --enable CONFIG_SHIELD_FF - scripts/config --enable CONFIG_HID_STADIA_FF - - sleep 2s - plain "" msg "Supress depmod" @@ -306,7 +176,7 @@ build(){ } _package(){ - pkgdesc='The Linux kernel and modules with Arch and other improvement patches - Build with LLVM/CLANG' + pkgdesc='The Linux kernel and modules - Build with LLVM/CLANG' depends=(coreutils initramfs kmod) optdepends=('wireless-regdb: to set the correct wireless channels of your country' 'linux-firmware: firmware images needed for some devices') @@ -327,9 +197,7 @@ _package(){ echo "$pkgbase" | install -Dm644 /dev/stdin "$modulesdir/pkgbase" msg "Installing modules..." - # ZSTD_CLEVEL=19 - # Keep it not far away Arch use it in official repo, since we use sirlucjan xstd patch - make ARCH=${ARCH} ${BUILD_FLAGS[*]} INSTALL_MOD_PATH="${pkgdir}"/usr INSTALL_MOD_STRIP=1 -j$(nproc) modules_install + ZSTD_CLEVEL=19 make ARCH=${ARCH} ${BUILD_FLAGS[*]} INSTALL_MOD_PATH="${pkgdir}"/usr INSTALL_MOD_STRIP=1 -j$(nproc) modules_install # remove build and source links msg "Remove build dir and source dir..." @@ -420,41 +288,10 @@ _package-headers(){ ln -sr "$builddir" "$pkgdir/usr/src/$pkgbase" } -sha256sums=('8fa0588f0c2ceca44cac77a0e39ba48c9f00a6b9dc69761c02a5d3efac8da7f3' - 'ab8e459ac900f4f2b2677d9692177afdfb215e75b8315259ef8bdd0a1ea032e1' - 'db411b01a5896283fdaf1cf30733d41e9740320a3f422b23ee8b376b8a5e8930' - '1827e974d83d452c8a07bf1a6a1593d214f9a9fe61d3dba8a072c2b1c42673d2' - '12de7fe29e482e6f0edfd48123c468a309b69d3cca1be4a773c1b96ef6697d22' - '5d0faf58c6c9e58d709ec2e136bdd576ebd4c0f7d630bef5a05bf188dd482579' - '2cab3863f3e21a8f8e83b3f86743c57c3f37bf086cc01ebf4573c218df229655' - '47b6485d9a31eba9589d3ea295239411fc5ae71972cf2e5b94172290d8c12186' - '5b9a5d0c5c81960d981d01febe201689794b58bb835b2cadadfbdda42b74f47f' - '0867b5cb21a0765fd7b76d3724fc8a258bedbba974b6e4dbd62348f6ce7d9cee' - '81cc1547d62933e04aed15c57b9e93101e546298b1fef5f63a6b1469471acebe' - 'dd20963020f83e30497ebeccdeace10e98b74ebffa5847de334eeaaae80f5046' - 'de7a2748545b2b5d0082c09373c14d9ee41110dfa5e30a3be02e3500c2a8118c' - '7c913c3b58001d3534b1f1828e920ca61707b545c228714420237af51f2ec77b' - '1fbf26545a49ce297434fa2c39217361cdd90285b2c5ff04c505008037ede6c5' - '85669071475af9e4ca74cb15c1f277dadd5ea7b3050f443712da77230a4aa488' - 'b4b4f1c20891d1b104354dd574dda80d2f3c5e4f49c76f361c058ffb5b973fd4' - '4fd244250dad9949dffad6a42b702384c1b1197297f87ffe80cb45496c29cb25' - 'f440d27364ad757ea3cf36454a590f0329f8a6e29f630aa497705840f72e214a' - '75b4f9c09aeaa34f14677ccf8dffe30d786b12235eaf4a0cd9654eaa14e63bbb' - '5756ce78a788e58f6986640f4699bdb0672742e264b8702997ef5e7feadfc6db' - 'f3008b53ec36dba2d71640d8605f6cbf4c5951beadb62f1b614eeefd74d7bdb2' - '5e7549f6f4d1f5a2f414f9d7c5a28e8079196084942a9d3e95c074cfcc984977' - '71e4fae21123107f00b5e08f0345591f41c61aa918d3e3680c025ce3a78a8a64' - '9a1eb034d4a142be9686835d47ebe1998d8f618436756c89b4521fa1a7f13e0f' - 'ab6409a7a582ef65bd44519bc56b06eb796c450468a88c7d4fdd67f972488b1b' - 'b10fed04277d5808998c5db0ed3147dd003dc74ff548218fe75d6eda985d68c0' - 'd1b2e2db347114ccb13ca9c8aaff65e7180cb722f4dc46c82bc5df248edebe63' - '1e8d4ddba087aeac79c54acee0f37b4ee5d2c7f43f064b2c8cf29d668f798e3f' - '6579c78554b1f1e97a6a439b4287cd542747208774af4070b6d116456e575429' - '0ad556c65afca9688ea495106c632d7e479e60e4e2241007a7ef4120f65b27a0' - '217791179fcf7d522ed8065b4cf49fb9097522b936a8852901dde0702ea90954' - '9a0fd7b40032514b83ec200cd7aeffccf835889c4b86c012e1b9f50fffbfd1a2' - '8b7be40de00645ca42ee5c7079bf7d7531de75ecdff97a30914d5d604d7efb58' - '7352643e67f651d322b2443e25f7b6ab30a667e3dde6fc2688cb75c24ef0ae84') +sha256sums=('d926a06c63dd8ac7df3f86ee1ffc2ce2a3b81a2d168484e76b5b389aba8e56d0' + 'd2060f5045a30832d70a7747c780f1358a9f4cfc1811c8ccaeaab9c027b59ee4' + '5d5a766ea646d6b6e64f56867cbd10c64704107ac6f15123387c4b65e49d71c3' + 'cf80842fc0b2df079905c3212faeecddde7a4c4fd0742364564f10df4f7f6aa3') pkgname=($pkgbase $pkgbase-headers) for _p in "${pkgname[@]}"; do |