├── Files ├── README.md ├── depends ├── README.md ├── mkinitcpio-lucjan │ ├── .SRCINFO │ ├── 0001-Merge-mkinitcpio-libalpm-scripts-into-one.patch │ ├── 0002-functions-allow-tailing-for-custom-kernel-build-upon.patch │ ├── 0003-Fix-ability-to-manually-specify-uefistub.patch │ ├── 0004-Add-support-for-post-generation-hooks.patch │ ├── 0005-Allow-overriding-hooks.patch │ ├── 0006-mkinitcpio-add-VERSION_ID-to-EFISTUB.patch │ ├── 0007-functions-no-progress-for-zstd-decompression.patch │ ├── 0008-mkinitcpio-Support-etc-kernel-cmdline.d.patch │ ├── 0009-presets-when-using-_efi_image-make-_image-optional.patch │ ├── 0010-Revert-functions-no-progress-for-zstd-decompression.patch │ ├── 0011-add-zst-compressed-firmware-support-fpr-future-kerne.patch │ ├── 0012-add-real-symlink-support.patch │ ├── 0013-add-real-symlink-support.patch │ ├── 0014-add-MODULES_DECOMPRESS-switch.patch │ ├── 0015-fix-reproducibility-in-case-of-var-cache-is-included.patch │ ├── 0016-Good-idea-add-the-default-value.patch │ ├── 0017-mkinitcpio-improve-MODULES_DECOMPRESS.patch │ ├── 0018-Replace-check-with-rm-f.patch │ ├── 0019-Fix-typo-in-commit-reproducibility.patch │ ├── 0020-mkinitcpio-preserve-module-dir-by-the-kernel-remove-.patch │ ├── 0021-Typo-correction.patch │ ├── 0022-Revert-presets-when-using-_efi_image-make-_image-opt.patch │ ├── 0023-preset-Change-unified-image-generation-options.patch │ ├── 0024-fixed-missing-uefistub-detection.patch │ ├── 0025-Fix-the-warning-about-missing-modules.builtin.modinf.patch │ ├── 0026-Expand-as-it-fails-when-extglob-is-not-set.patch │ ├── 0027-autodetect-does-not-work-for-overlay-fs-set-autodete.patch │ ├── PKGBUILD │ └── mkinitcpio.install └── uksmd-git │ ├── .SRCINFO │ ├── PKGBUILD │ └── uksmdstats ├── lucjan-kernels-rolling └── linux-lucjan-git │ ├── .SRCINFO │ ├── PKGBUILD │ └── config ├── lucjan-kernels-testing ├── linux-lucjan-git │ ├── .SRCINFO │ ├── PKGBUILD │ └── config └── linux-lucjan │ ├── .SRCINFO │ ├── PKGBUILD │ └── config └── lucjan-kernels-unstable ├── linux-lucjan-git ├── .SRCINFO ├── PKGBUILD └── config └── linux-lucjan ├── .SRCINFO ├── PKGBUILD └── config /Files: -------------------------------------------------------------------------------- 1 | . 2 | ├── depends 3 | │   ├── mkinitcpio-lucjan 4 | │   │   ├── 0001-Merge-mkinitcpio-libalpm-scripts-into-one.patch 5 | │   │   ├── 0002-functions-allow-tailing-for-custom-kernel-build-upon.patch 6 | │   │   ├── 0003-Fix-ability-to-manually-specify-uefistub.patch 7 | │   │   ├── 0004-Add-support-for-post-generation-hooks.patch 8 | │   │   ├── 0005-Allow-overriding-hooks.patch 9 | │   │   ├── 0006-mkinitcpio-add-VERSION_ID-to-EFISTUB.patch 10 | │   │   ├── 0007-functions-no-progress-for-zstd-decompression.patch 11 | │   │   ├── 0008-mkinitcpio-Support-etc-kernel-cmdline.d.patch 12 | │   │   ├── 0009-presets-when-using-_efi_image-make-_image-optional.patch 13 | │   │   ├── 0010-Revert-functions-no-progress-for-zstd-decompression.patch 14 | │   │   ├── 0011-add-zst-compressed-firmware-support-fpr-future-kerne.patch 15 | │   │   ├── 0012-add-real-symlink-support.patch 16 | │   │   ├── 0013-add-real-symlink-support.patch 17 | │   │   ├── 0014-add-MODULES_DECOMPRESS-switch.patch 18 | │   │   ├── 0015-fix-reproducibility-in-case-of-var-cache-is-included.patch 19 | │   │   ├── 0016-Good-idea-add-the-default-value.patch 20 | │   │   ├── 0017-mkinitcpio-improve-MODULES_DECOMPRESS.patch 21 | │   │   ├── 0018-Replace-check-with-rm-f.patch 22 | │   │   ├── 0019-Fix-typo-in-commit-reproducibility.patch 23 | │   │   ├── 0020-mkinitcpio-preserve-module-dir-by-the-kernel-remove-.patch 24 | │   │   ├── 0021-Typo-correction.patch 25 | │   │   ├── 0022-Revert-presets-when-using-_efi_image-make-_image-opt.patch 26 | │   │   ├── 0023-preset-Change-unified-image-generation-options.patch 27 | │   │   ├── 0024-fixed-missing-uefistub-detection.patch 28 | │   │   ├── 0025-Fix-the-warning-about-missing-modules.builtin.modinf.patch 29 | │   │   ├── 0026-Expand-as-it-fails-when-extglob-is-not-set.patch 30 | │   │   ├── 0027-autodetect-does-not-work-for-overlay-fs-set-autodete.patch 31 | │   │   ├── mkinitcpio.install 32 | │   │   └── PKGBUILD 33 | │   ├── README.md 34 | │   └── uksmd-git 35 | │   ├── PKGBUILD 36 | │   └── uksmdstats 37 | ├── Files 38 | ├── lucjan-kernels-rolling 39 | │   └── linux-lucjan-git 40 | │   ├── config 41 | │   └── PKGBUILD 42 | ├── lucjan-kernels-testing 43 | │   ├── linux-lucjan 44 | │   │   ├── config 45 | │   │   └── PKGBUILD 46 | │   └── linux-lucjan-git 47 | │   ├── config 48 | │   └── PKGBUILD 49 | ├── lucjan-kernels-unstable 50 | │   ├── linux-lucjan 51 | │   │   ├── config 52 | │   │   └── PKGBUILD 53 | │   └── linux-lucjan-git 54 | │   ├── config 55 | │   └── PKGBUILD 56 | └── README.md 57 | 58 | 11 directories, 44 files 59 | -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | # My own kernels. Use at your own risk. 2 | ###### HP 850 G3 with Sixth Gen Intel Core i3/i5/i7 optimized. 3 | ###### linux-lucjan varies considerably from stock kernel. 4 | *** 5 | 6 | # As of July 19, 2022, the project will cease to be developed. Thank you to all users for their willingness to use the project and bug reports. 7 | # I encourage all users to use [CachyOS kernels](https://github.com/CachyOS/linux-cachyos), in the development of which I will take an active part from now on. 8 | 9 | ###### linux-lucjan incorporates: 10 | 11 | * [bfq improvements](https://groups.google.com/forum/#!forum/bfq-iosched) - latest fixes authored by Paolo Valente and BFQ Team 12 | 13 | * ~~[bfq-dev](https://github.com/Algodev-github/bfq-mq/tree/dev-bfq-on-5.17) - latest fixes authored by Paolo Valente and BFQ Team~~ 14 | 15 | * ~~[bfq-dev-lucjan](https://github.com/sirlucjan/bfq-mq-lucjan/tree/dev-bfq-on-5.17-lucjan) - latest fixes authored by Paolo Valente and BFQ Team and forked by Piotr Gorski~~ 16 | 17 | * ~~[bfq-dev-lucjan-patches](https://github.com/sirlucjan/kernel-patches/tree/master/5.17/bfq-dev-lucjan) / [bfq-dev-lucjan-patches](https://gitlab.com/sirlucjan/kernel-patches/tree/master/5.17/bfq-dev-lucjan) - specific patches authored by Paolo Valente and Piotr Gorski~~ 18 | 19 | * [bfq-lucjan](https://github.com/sirlucjan/kernel-patches/tree/master/5.18/bfq-lucjan) / [bfq-lucjan](https://gitlab.com/sirlucjan/kernel-patches/tree/master/5.18/bfq-lucjan) - specific patches authored by Paolo Valente and Piotr Gorski 20 | 21 | * [graysky's GCC/Clang patch](https://github.com/graysky2/kernel_compiler_patch) - version for gcc v12/clang v13 22 | 23 | * [Project C](https://gitlab.com/alfredchen/linux-prjc/tree/linux-5.18.y-prjc) / [Project C blog](http://cchalpha.blogspot.com) - contains the newest vesion with latest fixes 24 | 25 | * [random fixes from zen-kernel](https://github.com/zen-kernel/zen-kernel/tree/5.18/master) - specific patches authored by Jan Alexander Steffens and ZEN Kernel Team 26 | 27 | * [random fixes from xanmod-linux](https://github.com/xanmod/linux/tree/5.18) - specific patches authored by Alexandre Frade 28 | 29 | * [random fixes from pfkernel](https://codeberg.org/pf-kernel/linux/src/branch/pf-5.18) - for example patches from Arch Linux or specific patches authored by Oleksandr Natalenko 30 | 31 | * [random fixes from CachyOS](https://github.com/CachyOS/linux-cachyos) - specific patches authored by CachyOS Team 32 | 33 | * [UKSMD](https://codeberg.org/pf-kernel/uksmd) - Userspace KSM helper daemon authored by Oleksandr Natalenko 34 | 35 | * [LL-patches](https://github.com/sirlucjan/kernel-patches/tree/master/5.18/ll-patches) / [LL-patches](https://gitlab.com/sirlucjan/kernel-patches/tree/master/5.18/ll-patches) - specific patches authored by Piotr Gorski 36 | 37 | * [LL-branding](https://github.com/sirlucjan/kernel-patches/tree/master/5.18/ll-branding) / [LL-branding](https://gitlab.com/sirlucjan/kernel-patches/tree/master/5.18/ll-branding) - specific patches authored by Piotr Gorski 38 | 39 | *** 40 | 41 | ###### Some patches for BFQ/block-stable conflict with patches for BFQ-dev/block-mainline. 42 | 43 | ###### To use lucjan-kernels smoothly apply ll-reverts before linux-lucjan patch. Otherwise the kernel will not compile. 44 | 45 | * ~~[ll-reverts](https://github.com/sirlucjan/kernel-patches/tree/master/5.11-dev/ll-reverts) / [ll-reverts](https://gitlab.com/sirlucjan/kernel-patches/tree/master/5.11-dev/ll-reverts) - specific patches authored by Piotr Gorski~~ 46 | 47 | *** 48 | # Download: 49 | 50 | ``` 51 | git clone https://github.com/sirlucjan/lucjan-kernels.git 52 | 53 | ``` 54 | 55 | or 56 | 57 | ``` 58 | git clone https://gitlab.com/sirlucjan/lucjan-kernels.git 59 | 60 | ``` 61 | 62 | # Install: 63 | 64 | 65 | ### Testing 66 | 67 | ``` 68 | cd /some_path/lucjan-kernels/lucjan-kernels-testing/package_name 69 | makepkg -srci 70 | 71 | ``` 72 | 73 | ### Unstable 74 | 75 | ``` 76 | cd /some_path/lucjan-kernels/lucjan-kernels-unstable/package_name 77 | makepkg -srci 78 | 79 | ``` 80 | 81 | ### Rolling 82 | 83 | ``` 84 | cd /some_path/lucjan-kernels/lucjan-kernels-rolling/package_name 85 | makepkg -srci 86 | 87 | ``` 88 | 89 | *** 90 | # Enable bfq 91 | 92 | ~~For now, you can use `sudo tee /sys/block/sda/queue/scheduler <<< bfq` to enable "bfq".~~ 93 | 94 | ~~You can also add this to file `60-schedulers.rules`:~~ 95 | 96 | ``` 97 | # Non-rotational disks 98 | ACTION=="add|change", KERNEL=="sd[a-z]", ATTR{queue/rotational}=="0", ATTR{queue/scheduler}="bfq" 99 | # Rotational disks 100 | ACTION=="add|change", KERNEL=="sd[a-z]", ATTR{queue/rotational}=="1", ATTR{queue/scheduler}="bfq" 101 | ``` 102 | 103 | ~~and run a command `sudo udevadm control --reload && sudo udevadm trigger`~~ 104 | 105 | For now, bfq is enabled by default! [(since 5.0-lucjan-ll1-rc1.patch and LL-elevator-set-default-scheduler-to-bfq-for-blk-mq.patch)](https://github.com/sirlucjan/kernel-patches/blob/master/5.0/ll-patches/0002-LL-elevator-set-default-scheduler-to-bfq-for-blk-mq.patch) 106 | 107 | 108 | *** 109 | 110 | # You've been warned. 111 | -------------------------------------------------------------------------------- /depends/README.md: -------------------------------------------------------------------------------- 1 | # mkinitcpio-lucjan 2 | 3 | ###### NOTE: mkinitcpio-lucjan will overwrite the mkinitcpio.conf file and the old one will be saved as mkinitcpio.conf.pacsave - however, I recommend backing up this file before installing the modified mkinitcpio version. 4 | 5 | ##### Patchset linux-lucjan adds support for firmware compressed in zstd format. 6 | ##### Unfortunately, the current version of mkinitcpio does NOT support such functionality. 7 | ##### mkinitcpio-lucjan contains the appropriate patches to support firmware compressed in the zstd format. 8 | 9 | ## Selecting the ZSTD modules and kernel compression level 10 | 11 | ###### To select the compression level, choose between "normal" and "ultra". 12 | 13 | ``` 14 | ### Selecting the ZSTD kernel and modules compression level 15 | # ATTENTION - one of two predefined values should be selected! 16 | # 'ultra' - highest compression ratio 17 | # 'normal' - standard compression ratio 18 | # WARNING: the ultra settings can sometimes 19 | # be counterproductive in both size and speed. 20 | _zstd_level_value='' 21 | ``` 22 | ###### The normal flag allows you to select a value between 1 and 19 (the default value zstd offers is 3), while the ultra flag allows you to select a value between 20 and 22. Values other than those suggested (so 19 for the normal flag and 22 for the ultra flag) should be entered here: 23 | 24 | ``` 25 | ### Selecting the ZSTD modules and kernel compression level 26 | if [ "$_zstd_level_value" = "ultra" ]; then 27 | echo "Enabling highest ZSTD modules compression ratio..." 28 | scripts/config --set-val CONFIG_MODULE_COMPRESS_ZSTD_LEVEL 19 29 | scripts/config --enable CONFIG_MODULE_COMPRESS_ZSTD_ULTRA 30 | scripts/config --set-val CONFIG_MODULE_COMPRESS_ZSTD_LEVEL_ULTRA 22 31 | echo "Enabling highest ZSTD kernel compression ratio..." 32 | scripts/config --set-val CONFIG_ZSTD_COMP_VAL 22 33 | elif [ "$__zstd_level_value" = "normal" ]; then 34 | echo "Enabling standard ZSTD modules compression ratio..." 35 | scripts/config --set-val CONFIG_MODULE_COMPRESS_ZSTD_LEVEL 19 36 | scripts/config --disable CONFIG_MODULE_COMPRESS_ZSTD_ULTRA 37 | echo "Enabling standard ZSTD kernel compression ratio..." 38 | scripts/config --set-val CONFIG_ZSTD_COMP_VAL 19 39 | else 40 | if [ -n "$__zstd_level_value" ]; then 41 | error "The value $_zstd_level_value is invalid. Choose the correct one again." 42 | else 43 | error "The value is empty. Choose the correct one again." 44 | fi 45 | error "Selecting the ZSTD modules and kernel compression level failed!" 46 | exit 47 | fi 48 | ``` 49 | 50 | ###### Entering any values other than "normal" and "ultra" as well as leaving the checkbox empty will immediately abort the compilation. 51 | 52 | ###### It is worth mentioning once again that the ultra flag does not guarantee that you will build significantly smaller modules - on the contrary, you may achieve the counterproductive effect. 53 | 54 | # UKSMD 55 | 56 | ## Userspace KSM helper daemon. 57 | 58 | ###### Install uksmd-git and run the command: 59 | 60 | ```systemctl enable uksmd.service && systemctl start uksmd.service``` 61 | 62 | ###### Upstream info: 63 | 64 | https://codeberg.org/pf-kernel/uksmd 65 | -------------------------------------------------------------------------------- /depends/mkinitcpio-lucjan/.SRCINFO: -------------------------------------------------------------------------------- 1 | # Generated by makepkg 6.0.1 2 | # Tue Jul 5 07:05:06 UTC 2022 3 | pkgbase = mkinitcpio-lucjan 4 | pkgdesc = Modular initramfs image creation utility 5 | pkgver = 31 6 | pkgrel = 13 7 | url = https://github.com/archlinux/mkinitcpio 8 | install = mkinitcpio.install 9 | arch = any 10 | license = GPL 11 | makedepends = asciidoc 12 | depends = awk 13 | depends = mkinitcpio-busybox>=1.19.4-2 14 | depends = kmod 15 | depends = util-linux>=2.23 16 | depends = libarchive 17 | depends = coreutils 18 | depends = bash 19 | depends = binutils 20 | depends = diffutils 21 | depends = findutils 22 | depends = grep 23 | depends = filesystem>=2011.10-1 24 | depends = zstd 25 | depends = systemd 26 | optdepends = gzip: Use gzip compression for the initramfs image 27 | optdepends = xz: Use lzma or xz compression for the initramfs image 28 | optdepends = bzip2: Use bzip2 compression for the initramfs image 29 | optdepends = lzop: Use lzo compression for the initramfs image 30 | optdepends = lz4: Use lz4 compression for the initramfs image 31 | optdepends = mkinitcpio-nfs-utils: Support for root filesystem on NFS 32 | provides = initramfs 33 | provides = initramfs-lucjan 34 | provides = initramfs-zstd 35 | provides = mkinitcpio=31 36 | conflicts = mkinitcpio 37 | replaces = mkinitcpio-zstd 38 | backup = etc/mkinitcpio.conf 39 | source = https://sources.archlinux.org/other/mkinitcpio/mkinitcpio-31.tar.gz 40 | source = https://sources.archlinux.org/other/mkinitcpio/mkinitcpio-31.tar.gz.sig 41 | source = 0001-Merge-mkinitcpio-libalpm-scripts-into-one.patch 42 | source = 0002-functions-allow-tailing-for-custom-kernel-build-upon.patch 43 | source = 0003-Fix-ability-to-manually-specify-uefistub.patch 44 | source = 0004-Add-support-for-post-generation-hooks.patch 45 | source = 0005-Allow-overriding-hooks.patch 46 | source = 0006-mkinitcpio-add-VERSION_ID-to-EFISTUB.patch 47 | source = 0007-functions-no-progress-for-zstd-decompression.patch 48 | source = 0008-mkinitcpio-Support-etc-kernel-cmdline.d.patch 49 | source = 0009-presets-when-using-_efi_image-make-_image-optional.patch 50 | source = 0010-Revert-functions-no-progress-for-zstd-decompression.patch 51 | source = 0011-add-zst-compressed-firmware-support-fpr-future-kerne.patch 52 | source = 0012-add-real-symlink-support.patch 53 | source = 0013-add-real-symlink-support.patch 54 | source = 0014-add-MODULES_DECOMPRESS-switch.patch 55 | source = 0015-fix-reproducibility-in-case-of-var-cache-is-included.patch 56 | source = 0016-Good-idea-add-the-default-value.patch 57 | source = 0017-mkinitcpio-improve-MODULES_DECOMPRESS.patch 58 | source = 0018-Replace-check-with-rm-f.patch 59 | source = 0019-Fix-typo-in-commit-reproducibility.patch 60 | source = 0020-mkinitcpio-preserve-module-dir-by-the-kernel-remove-.patch 61 | source = 0021-Typo-correction.patch 62 | source = 0022-Revert-presets-when-using-_efi_image-make-_image-opt.patch 63 | source = 0023-preset-Change-unified-image-generation-options.patch 64 | source = 0024-fixed-missing-uefistub-detection.patch 65 | source = 0025-Fix-the-warning-about-missing-modules.builtin.modinf.patch 66 | source = 0026-Expand-as-it-fails-when-extglob-is-not-set.patch 67 | source = 0027-autodetect-does-not-work-for-overlay-fs-set-autodete.patch 68 | validpgpkeys = ECCAC84C1BA08A6CC8E63FBBF22FB1D78A77AEAB 69 | sha512sums = 4ef87c2e4f579b292c38f9c487e78b3b99f6db77909cab322e860e5ca70aca3747fcfc272e2e15c9a3605c924ab178057b8b23151f98debc5d96e65f3c0c49d5 70 | sha512sums = SKIP 71 | sha512sums = 6b4a903726a45a4a8a1e5106c62e5b5d69b077b3260eb413735b5f8be0c56d777a6e9e4b24770617720c73aa3c6420c080700fbc8fb44ec60705dcd7dd1218cb 72 | sha512sums = ab9702c2beabdc6a4e20e516f68b5c18e67470d8ed9d17baa4272db72e4d7dcb7b7de8e632e4c266fc2b12bdecfdc9ad811340da96aa9f25c337984859f84743 73 | sha512sums = a37e792661a47c175f82f42fbb1bacb4b3d0408aec64589131d08985a97f1f5f4ecb73f6186cfcb36cdc716c1ca8189114e4939bc6904adb6ac678a5f7721735 74 | sha512sums = 03f351072ffd62181734f3ed9851fb773f0db91cdb9f04fbbcdcf7f7293794752609fe978f0a306f8f58e055823ec87a907ec972459d5359d9475b7158846f21 75 | sha512sums = a88d3076585be5b5e0ca1f8958ffe710d4d0e8c7571c703eeaf3b445c88dcdd9cbac6016956f8946b851c0a6faa2a7bbacc642f77e75f60af64032ce818a0039 76 | sha512sums = b1617310a9ce4d185be70d222c19b9bcb55e90692988ea6821e83a9db7567151b1bb60dc18a76a6e9cb817b0f50b9a45132a11a0f214a50e9e81ef8eb32fc0bc 77 | sha512sums = 881a4e608b94ff348e0e6b3de4712fc769215751c8a8018b9ea9f1f197676f5f2e2608b248f10ca71d0fbd45f21892a2773745af40344fc1791bf535b554c0f1 78 | sha512sums = 58d4ade0998e7266be136e9dd9b2bad720619bf1576353044f3efefd6cd69389a2829cc2d46747974deaeaf98317fccc32927d34de8ef42873e9f7e528e5c8de 79 | sha512sums = ba7a4e463dfb7ea950418b4f6173aec1885cb56567dfd26bd27a675041666d93a223d1ca2ebeaad5460f6b74318c184ee72065733ce6e4727caf3b23a9f5b966 80 | sha512sums = e1b747d074aac449d0e6164a8f47b823da7e8e987194ea8696fb82e51d2559ec043d1a25aa0b5423bf3e5e4c42e2c95e0bbc3bc9ba295891621ef7158086ce77 81 | sha512sums = 491fcc33a1d2cabf77f4fd475633efc8bccf86f7b294330086c3436575e19163b30525bdf7e1251581ade6548b8380f91b89be30c0fe57a68e3b7f696c7a4a34 82 | sha512sums = 865cee91aeeb0fd4da02d706f1371968701e703837901d4ef85ce76bb1242c84d3ae4c3fc32e6516798de87f70c97427dfac8896f7cfbccaa852366f215f89eb 83 | sha512sums = e00d6a169643f7dd1a5365069dfba7186890d65ddcf408fa2f1a4e8a7d8c964b08f608d1f0730d4bd4bf4f0b0fd29e3a14c563d4202ee324a139e61d54fb2722 84 | sha512sums = 470492afe84efece7e1779bebd6e999f667c3663ccdb6141ce2d136cda048b34cdc0a48dae84e69befc527035221ff3a0afd7db1a6b8c7a4ee9fa79d6e239356 85 | sha512sums = ad909a0d2d0d579a79481acb9685b2736da0858859e17318966e230f74090bc0c61b75e266070c13a0c4bf5ed480e718f8374298f73995baf181b9309227261b 86 | sha512sums = 569f9174830b379deae16fac49a2cc8db11cea6a5cb763bf9b6cb803247fabd7e2ee6b767fd886a0b19718dbc0c828e9385de76a213e50945de1e13d2ab3cd99 87 | sha512sums = 14237ce6b8346d3b404431b6e34ead973274e7b738ac227da10f8a2d101faa2c1c3be066eb3fd5f496971e503f1ab77115770d60a21d71b97ae0092993784784 88 | sha512sums = bd8c32e32dc03f3c7246c932979a99c6ea6084494cf902835178086505430449dc382a872a2a13994e7efc8e7c220b0fed2e9a7a369b1e513da0da0385294828 89 | sha512sums = 63e6d131c563349ff466723259d9b0ca7af3e24abc2310f4924ac67356c903e63dfb2ef424ac111c751da1e922a42349672271d195e03ec82a72a31a344b28e2 90 | sha512sums = 4d8c0bc3949b05a520c86d4ab5b6dd59de9ba9c9f3030064983b23cc1f6a833ee25e40235537133c3086cc38a82f195461a356f5a25f297d15fa1d8deb660cba 91 | sha512sums = 9af4a956313aa4dd907454c916a8f718691b591dbd63bec3bcbb42e05d877c281464bc2cc86daac196c0333c1d548360cac09347cb9317dcca2a1098a769c8a7 92 | sha512sums = 89a41b9ff1593e9c428c03dfa0b52f8f9ccc7e2f49f953c95c8c8d865f58d03596cf1ed4a84898b0f68e24d36dde6f39075036f947c69d36ef0750eede4d1d59 93 | sha512sums = 053bb8430208895707f95d763351cfe1a02edb888204478e28f3635b9ecabb2c1a04de4f53e99928c52de4f718459e784029e6301692c7c7a732325a290f9558 94 | sha512sums = e16ada4cfdd4b39d09450e239a84e7fc322c930246b4ba5979db12824ce0c4ae5c8da19b25596b893570e47be5c7cd3173de8a8230db774365b76d7c9aed453f 95 | sha512sums = 18f4e1735734b75b37b0220e15073fd29ab35edd5ed9640e07aa4d4bb84402b641126bbc992bf9b6eb5b8010102939ce7bb06ef5df343665080cdac799677ffc 96 | sha512sums = 871b08ed18d099ccababebdb9b127eb4f8e03d55aea284e87dcf35a9eb7a9f90a1b40abfb1e54e51264be9172c323d8a92efb41b23c935862a85dbbc209bfc76 97 | sha512sums = f267b10f5c2d08e02d8d4dcd75f50f5ce46b8aed3eed898b97eb3c3b12db63656ea03eb9993b28c125bb1e200f1b8c7e77f93ef0813b0b35b60cfcba5482cbc0 98 | b2sums = 0113e288906e3b5fa485c29c00e7df60d85addd96718c45531031a686f18c739fa18303b6cac374d35b85edb7b663e221c8dc9158dff08c75858a4ed4dd154bf 99 | b2sums = SKIP 100 | b2sums = 872d043d963dfe69abb71f14cdd8d3adff222d53606ea07bedaf87e104fa23ee636daa914ae64e140b8fbc216d06d56c50b32afe22a36ca71d02e32c01f659b3 101 | b2sums = 425e64a8810d57d2d82efdef54e964828a2ab3f1142c73db37e21e0365b0a9d4a520d9f4a54baf1f9870c6b62afa20070125da90d0e91bbcaf6b55331538ab88 102 | b2sums = 8e4a79c0bc242b3145c90dadc03ff65a041b264f8c47495f36735df6bceb53239c08906f6e5d9b779b65c75d0bb9dca5e90c9ac4d5dab32c41a9208218936e92 103 | b2sums = 91af56014ae8b57a9bfd5c7fee09a49682449a47bda64b98ae33d64cb166a15bbbea351e35e1407fdd71351c9d26d504d57f5519f7b0f1c0488ada142d5d784b 104 | b2sums = 55cf714d122b11ce57c8a0a7fc5977199bb9b88cb465e6482b590929a29a709354b015dff15422bf3d37d0931a75d88578543613a6e5bb9fc76ccdb29d313de0 105 | b2sums = 2b6367d8b16ba499fefeb791fa9cf732877e029433933930977bdf69afe6696a187bc8ddbcc4627e793e7f66cc2f38c7b68ee1954a7e004380df1c78b7a1c25f 106 | b2sums = a823fbba187281e348928a98e932848119382a5081e810d9c4350ab5d7cd68cc8cf3e52259e9ee5a8445aa0e47285de894fd23d88f4448c64e370681011d5063 107 | b2sums = b29894f394ed9c70028581aa1e5469bbd131af646ed33ab8ce2a80859e83a13cb06d0dad4018a2e75914ec5b2c552dadbed3a43f28f18caf5e562686939a8cbb 108 | b2sums = 164c969693fba5f97e4a4a3e5da20048a2121a663d0b9a7fb889e3d1c924bbb83aef858f6395f91e724c8c0df6428ceb96cf69c1e051f87acb101beaf98f07e3 109 | b2sums = 6440220ce74f34bcc98c01d3586cfab997002b672302b0d48192d3b102c757418cedf086da3535a0062de18e727bbcf6050470f9a9350d7e9c84eaaa00a39690 110 | b2sums = b9f88fcd32f84f559c462d12215b7d00f09a1d067adf07336df2db8b8e89c0c837a768a63a9b20923b279f4d3292f88b11a117a26cbc45019b48167e313f1b5d 111 | b2sums = 5b597fc0ea63cb5285abea9c4bc7637e711efb5655cc5a77122f9c18d536b5bc34bc78876c73087dd0de16d9ac8b3ddcc47a8083b245bbcc4a6bc40d7d9c0aa3 112 | b2sums = 51acc62f00abc4500e32d0591d5e934445f8e89ce6c3816aff880b94bc1d3be1c431ae90c477e375307be9811c38f1bfda86296e96859251ab07acf446648858 113 | b2sums = 03dfb78b6e05c43355b45e733ed084bf3f1ceb34032c0337c6c2f313319197f44245e7e12ff223094d959024b7ce2e3a52e96b6f879e426a90c94836cd661367 114 | b2sums = 4bf38bb576a4e5719df2c72ef300acd9ab68a59c1da0602d502292c6275a5da4b23343c00906bdd0124d785bed3777a5b482e21b4249f737a33e5d909fa18e0b 115 | b2sums = 1f419c9d7f3974b3900c4c281db123c037349fc1b79c63f9666b734c4ca781b7d0851ba367d1557fecc499bfcaf6e15b484cb503c5f7253973b9d849c8d55575 116 | b2sums = a0c0ffaf04fa4ccb8611144bdb3daa866ec5355b91095e2b5a4f0d84a67f1d0fd57861385fc8e11f1b61287ba80317b8850510bf7ff416608ef2446560ea3dd1 117 | b2sums = 29d688568c476ea3844bb195b5d0b0f06d0907a0a5a3be25387f45b1148ad378e34dc71cca1ba39a8bf91ec2b2ac8b60eccfc0f56e07948201d2db65a503d42b 118 | b2sums = 45d539b5f11306b2068337ff25994d85cbcaa7b4ef6eec9c6f034197ebe230c5efc0bcfbf27a5938eec80d45f2dad9f6c41614f4194b7a81e1d321c9555c807f 119 | b2sums = bed2649b3a76f8dfa40a65675a1752b8cea178abb87506909e42f9ed2042e211b935f3efdb955fa119d6c73d4dc7704f38cc2a86d7646bcb36253636bf54d210 120 | b2sums = 425b32afbe91162acf9ed0cbe50578827d4ec2de7e34e61c3a2fed2cb48e459faad1d6d973d477166104e63b4a3deaa9cbda838d59ec43b84ad57a17792a28e9 121 | b2sums = a57b823600f178dbaff39ca956dbcff26ca207029a0c33e09c3ed672d0cba5d9b8ee6b108de5cda453ef3221beaab21408df5d12aeb301be204aede539126622 122 | b2sums = d9b4dfa8533a39e9a0c588d23dbca436af6211a0c0956c508b6c06a53e4dd666be3299f261ed2907a479cd5802e12b17a51fd14978951a6162e322927f3595f6 123 | b2sums = d5c44cd70537db3decbae2fe8710ec928847c88534da602938caf65d71c223f0687b4d427a6da94d5b32f029cf5fb3705c48c97b7d69cf51ba3e5b0a406761ba 124 | b2sums = 671a2ab5a0b7a239819ab21c434d5f345f0a5a26457088d3bbedecbb11ddb61b37e66030b8f2d80a6886d10ce5df4e8270800242f7070cd46009ae7bf8294792 125 | b2sums = fb1d0825f18f485d16f9c83e7f1b38cbbcfce29e81bedffbebf7c9262d614be59b51514541585ae7479161fb2bf9f7b49d07f26448cc2bf650ef4eb7fe95db26 126 | b2sums = 8e2e6d3c90375b131c3b117ae440dcad575286d8e11c9b421fe5fff5f2a66677bdebd5604119ebabc675c1f6134e2ab10521e349ac53e8b40de86bff4e6c7a8f 127 | 128 | pkgname = mkinitcpio-lucjan 129 | -------------------------------------------------------------------------------- /depends/mkinitcpio-lucjan/0001-Merge-mkinitcpio-libalpm-scripts-into-one.patch: -------------------------------------------------------------------------------- 1 | From d401601518da2eb05a8394dc0045af2cf615928a Mon Sep 17 00:00:00 2001 2 | From: Hugo Osvaldo Barrera 3 | Date: Sun, 29 Aug 2021 18:55:30 +0200 4 | Subject: [PATCH 01/27] Merge mkinitcpio libalpm scripts into one 5 | 6 | Fixes #10 7 | 8 | Signed-off-by: Hugo Osvaldo Barrera 9 | --- 10 | Makefile | 3 +- 11 | libalpm/hooks/60-mkinitcpio-remove.hook | 2 +- 12 | libalpm/hooks/90-mkinitcpio-install.hook | 2 +- 13 | libalpm/scripts/mkinitcpio | 99 ++++++++++++++++++++++++ 14 | libalpm/scripts/mkinitcpio-install | 44 ----------- 15 | libalpm/scripts/mkinitcpio-remove | 61 --------------- 16 | 6 files changed, 102 insertions(+), 109 deletions(-) 17 | create mode 100644 libalpm/scripts/mkinitcpio 18 | delete mode 100644 libalpm/scripts/mkinitcpio-install 19 | delete mode 100644 libalpm/scripts/mkinitcpio-remove 20 | 21 | diff --git a/Makefile b/Makefile 22 | index 9ef0f6a..e6f3789 100644 23 | --- a/Makefile 24 | +++ b/Makefile 25 | @@ -73,9 +73,8 @@ install: all 26 | install -m644 shell/zsh-completion $(DESTDIR)/usr/share/zsh/site-functions/_mkinitcpio 27 | 28 | install -m644 libalpm/hooks/90-mkinitcpio-install.hook $(DESTDIR)/usr/share/libalpm/hooks/90-mkinitcpio-install.hook 29 | - install -m755 libalpm/scripts/mkinitcpio-install $(DESTDIR)/usr/share/libalpm/scripts/mkinitcpio-install 30 | install -m644 libalpm/hooks/60-mkinitcpio-remove.hook $(DESTDIR)/usr/share/libalpm/hooks/60-mkinitcpio-remove.hook 31 | - install -m755 libalpm/scripts/mkinitcpio-remove $(DESTDIR)/usr/share/libalpm/scripts/mkinitcpio-remove 32 | + install -m755 libalpm/scripts/mkinitcpio $(DESTDIR)/usr/share/libalpm/scripts/mkinitcpio 33 | 34 | doc: $(MANPAGES) 35 | man/%: man/%.txt Makefile 36 | diff --git a/libalpm/hooks/60-mkinitcpio-remove.hook b/libalpm/hooks/60-mkinitcpio-remove.hook 37 | index 9827afc..9600ce1 100644 38 | --- a/libalpm/hooks/60-mkinitcpio-remove.hook 39 | +++ b/libalpm/hooks/60-mkinitcpio-remove.hook 40 | @@ -12,5 +12,5 @@ Target = mkinitcpio-git 41 | [Action] 42 | Description = Removing linux initcpios... 43 | When = PreTransaction 44 | -Exec = /usr/share/libalpm/scripts/mkinitcpio-remove 45 | +Exec = /usr/share/libalpm/scripts/mkinitcpio remove 46 | NeedsTargets 47 | diff --git a/libalpm/hooks/90-mkinitcpio-install.hook b/libalpm/hooks/90-mkinitcpio-install.hook 48 | index cf480bd..5b02fb8 100644 49 | --- a/libalpm/hooks/90-mkinitcpio-install.hook 50 | +++ b/libalpm/hooks/90-mkinitcpio-install.hook 51 | @@ -8,5 +8,5 @@ Target = usr/lib/initcpio/* 52 | [Action] 53 | Description = Updating linux initcpios... 54 | When = PostTransaction 55 | -Exec = /usr/share/libalpm/scripts/mkinitcpio-install 56 | +Exec = /usr/share/libalpm/scripts/mkinitcpio install 57 | NeedsTargets 58 | diff --git a/libalpm/scripts/mkinitcpio b/libalpm/scripts/mkinitcpio 59 | new file mode 100644 60 | index 0000000..5e31f96 61 | --- /dev/null 62 | +++ b/libalpm/scripts/mkinitcpio 63 | @@ -0,0 +1,99 @@ 64 | +#!/bin/bash -e 65 | + 66 | +args=() 67 | +package=0 68 | + 69 | +process_preset() { 70 | + if [[ -n "${pkgbase}" && -e $preset ]]; then 71 | + if ! cmp $preset > /dev/null 2>&1 <(sed "s|%PKGBASE%|${pkgbase}|g" /usr/share/mkinitcpio/hook.preset); then 72 | + if [[ ! -e $preset.pacsave ]]; then 73 | + # save the preset as pacsave 74 | + mv $preset $preset.pacsave && return 0 75 | + fi 76 | + else 77 | + # remove the preset 78 | + rm $preset && return 0 79 | + fi 80 | + fi 81 | +} 82 | + 83 | +install_kernel() { 84 | + preset="/etc/mkinitcpio.d/${1}.preset" 85 | + if [[ ! -e $preset ]]; then 86 | + if [[ -e $preset.pacsave ]]; then 87 | + # move the pacsave to the template 88 | + mv "${preset}.pacsave" "$preset" 89 | + else 90 | + # create the preset from the template 91 | + sed "s|%PKGBASE%|${1}|g" /usr/share/mkinitcpio/hook.preset \ 92 | + | install -Dm644 /dev/stdin "$preset" 93 | + fi 94 | + fi 95 | + 96 | + # always install the kernel 97 | + install -Dm644 "${line}" "/boot/vmlinuz-${1}" 98 | + 99 | + # compound args for each kernel 100 | + args+=(-p "${1}") 101 | +} 102 | + 103 | +remove_kernel() { 104 | + # remove the actual kernel and images for the package being removed 105 | + kernel="/boot/vmlinuz-${1}" 106 | + preset="/etc/mkinitcpio.d/${1}.preset" 107 | + initramfs="/boot/initramfs-${1}.img" 108 | + fallback_initramfs="/boot/initramfs-${1}-fallback.img" 109 | + if [[ -e $kernel ]]; then 110 | + # remove the installed kernel 111 | + rm $kernel 112 | + fi 113 | + 114 | + process_preset "${1}" $preset 115 | + 116 | + if [[ -e $initramfs ]]; then 117 | + # remove the main image 118 | + rm $initramfs 119 | + fi 120 | + if [[ -e $fallback_initramfs ]]; then 121 | + # remove the fallback image 122 | + rm $fallback_initramfs 123 | + fi 124 | +} 125 | + 126 | +while read -r line; do 127 | + if [[ $line != */vmlinuz ]]; then 128 | + # triggers when it's a change to usr/lib/initcpio/* 129 | + package=1 130 | + continue 131 | + fi 132 | + 133 | + if ! read -r pkgbase > /dev/null 2>&1 < "${line%/vmlinuz}/pkgbase"; then 134 | + # if the kernel has no pkgbase, we skip it 135 | + continue 136 | + fi 137 | + 138 | + if [ "$1" = "install" ]; then 139 | + install_kernel "$pkgbase" 140 | + elif [ "$1" = "remove" ]; then 141 | + remove_kernel "$pkgbase" 142 | + fi 143 | +done 144 | + 145 | +if (( package )) && compgen -G /etc/mkinitcpio.d/"*.preset" > /dev/null; then 146 | + if [ "$1" = "install" ]; then 147 | + # change to use all presets 148 | + args=(-P) 149 | + elif [ "$1" = "remove" ]; then 150 | + shopt -s nullglob 151 | + for preset in /etc/mkinitcpio.d/*.preset; do 152 | + pkgbase=${preset##*/} 153 | + pkgbase=${pkgbase%.preset} 154 | + process_preset "${pkgbase}" "$preset" 155 | + done 156 | + shopt -u nullglob 157 | + fi 158 | +fi 159 | + 160 | +if [ "$1" = "install" ] && (( ${#args[@]} )); then 161 | + mkinitcpio "${args[@]}" 162 | +fi 163 | diff --git a/libalpm/scripts/mkinitcpio-install b/libalpm/scripts/mkinitcpio-install 164 | deleted file mode 100644 165 | index d2e5041..0000000 166 | --- a/libalpm/scripts/mkinitcpio-install 167 | +++ /dev/null 168 | @@ -1,44 +0,0 @@ 169 | -#!/bin/bash -e 170 | - 171 | -args=() 172 | -all=0 173 | - 174 | -while read -r line; do 175 | - if [[ $line != */vmlinuz ]]; then 176 | - # triggers when it's a change to usr/lib/initcpio/* 177 | - all=1 178 | - continue 179 | - fi 180 | - 181 | - if ! read -r pkgbase > /dev/null 2>&1 < "${line%/vmlinuz}/pkgbase"; then 182 | - # if the kernel has no pkgbase, we skip it 183 | - continue 184 | - fi 185 | - 186 | - preset="/etc/mkinitcpio.d/${pkgbase}.preset" 187 | - if [[ ! -e $preset ]]; then 188 | - if [[ -e $preset.pacsave ]]; then 189 | - # move the pacsave to the template 190 | - mv "${preset}.pacsave" "$preset" 191 | - else 192 | - # create the preset from the template 193 | - sed "s|%PKGBASE%|${pkgbase}|g" /usr/share/mkinitcpio/hook.preset \ 194 | - | install -Dm644 /dev/stdin "$preset" 195 | - fi 196 | - fi 197 | - 198 | - # always install the kernel 199 | - install -Dm644 "${line}" "/boot/vmlinuz-${pkgbase}" 200 | - 201 | - # compound args for each kernel 202 | - args+=(-p "${pkgbase}") 203 | -done 204 | - 205 | -if (( all )) && compgen -G /etc/mkinitcpio.d/"*.preset" > /dev/null; then 206 | - # change to use all presets 207 | - args=(-P) 208 | -fi 209 | - 210 | -if (( ${#args[@]} )); then 211 | - mkinitcpio "${args[@]}" 212 | -fi 213 | diff --git a/libalpm/scripts/mkinitcpio-remove b/libalpm/scripts/mkinitcpio-remove 214 | deleted file mode 100644 215 | index 17b4b31..0000000 216 | --- a/libalpm/scripts/mkinitcpio-remove 217 | +++ /dev/null 218 | @@ -1,61 +0,0 @@ 219 | -#!/bin/bash -e 220 | - 221 | -package=0 222 | - 223 | -process_preset() { 224 | - if [[ -n "${pkgbase}" && -e $preset ]]; then 225 | - if ! cmp $preset > /dev/null 2>&1 <(sed "s|%PKGBASE%|${pkgbase}|g" /usr/share/mkinitcpio/hook.preset); then 226 | - if [[ ! -e $preset.pacsave ]]; then 227 | - # save the preset as pacsave 228 | - mv $preset $preset.pacsave && return 0 229 | - fi 230 | - else 231 | - # remove the preset 232 | - rm $preset && return 0 233 | - fi 234 | - fi 235 | -} 236 | - 237 | -while read -r line; do 238 | - if [[ $line != */vmlinuz ]]; then 239 | - # triggers when it's a change to usr/lib/initcpio/* 240 | - package=1 241 | - continue 242 | - fi 243 | - 244 | - if ! read -r pkgbase > /dev/null 2>&1 < "${line%/vmlinuz}/pkgbase"; then 245 | - # if the kernel has no pkgbase, we skip it 246 | - continue 247 | - fi 248 | - 249 | - # remove the actual kernel and images for the package being removed 250 | - kernel="/boot/vmlinuz-${pkgbase}" 251 | - preset="/etc/mkinitcpio.d/${pkgbase}.preset" 252 | - initramfs="/boot/initramfs-${pkgbase}.img" 253 | - fallback_initramfs="/boot/initramfs-${pkgbase}-fallback.img" 254 | - if [[ -e $kernel ]]; then 255 | - # remove the installed kernel 256 | - rm $kernel 257 | - fi 258 | - 259 | - process_preset "${pkgbase}" $preset 260 | - 261 | - if [[ -e $initramfs ]]; then 262 | - # remove the main image 263 | - rm $initramfs 264 | - fi 265 | - if [[ -e $fallback_initramfs ]]; then 266 | - # remove the fallback image 267 | - rm $fallback_initramfs 268 | - fi 269 | -done 270 | - 271 | -if (( package )) && compgen -G /etc/mkinitcpio.d/"*.preset" > /dev/null; then 272 | - shopt -s nullglob 273 | - for preset in /etc/mkinitcpio.d/*.preset; do 274 | - pkgbase=${preset##*/} 275 | - pkgbase=${pkgbase%.preset} 276 | - process_preset "${pkgbase}" $preset 277 | - done 278 | - shopt -u nullglob 279 | -fi 280 | -- 281 | 2.37.0.rc0.15.g3b9a5a33c2 282 | 283 | -------------------------------------------------------------------------------- /depends/mkinitcpio-lucjan/0002-functions-allow-tailing-for-custom-kernel-build-upon.patch: -------------------------------------------------------------------------------- 1 | From 0cbf3d5f008bb8ee052fd9bc524c20728aa261ca Mon Sep 17 00:00:00 2001 2 | From: Qu Wenruo 3 | Date: Thu, 9 Dec 2021 17:42:27 +0800 4 | Subject: [PATCH 02/27] functions: allow tailing `+` for custom kernel build 5 | upon git trees 6 | 7 | For kernels build upon git trees, any non-tag commit will append a '+' 8 | char to kernel version. 9 | 10 | This means the current fallback method will cut off the tailing '+' and 11 | cause mkinitcpio failure for suck cases. 12 | 13 | Signed-off-by: Qu Wenruo 14 | --- 15 | functions | 2 +- 16 | 1 file changed, 1 insertion(+), 1 deletion(-) 17 | 18 | diff --git a/functions b/functions 19 | index 48cfd7a..5b18b9c 100644 20 | --- a/functions 21 | +++ b/functions 22 | @@ -158,7 +158,7 @@ kver_generic() { 23 | # https://elixir.bootlin.com/linux/v5.7.2/source/init/version.c#L46 24 | local kver= 25 | 26 | - read _ _ kver _ < <(grep -m1 -aoE 'Linux version .(\.[-[:alnum:]]+)+' "$1") 27 | + read _ _ kver _ < <(grep -m1 -aoE 'Linux version .(\.[-[:alnum:]+]+)+' "$1") 28 | 29 | printf '%s' "$kver" 30 | } 31 | -- 32 | 2.37.0.rc0.15.g3b9a5a33c2 33 | 34 | -------------------------------------------------------------------------------- /depends/mkinitcpio-lucjan/0003-Fix-ability-to-manually-specify-uefistub.patch: -------------------------------------------------------------------------------- 1 | From 3cef85406a26cc2449ee2cea22e1bab04048b4cf Mon Sep 17 00:00:00 2001 2 | From: Markus Weippert 3 | Date: Mon, 20 Dec 2021 13:41:11 +0100 4 | Subject: [PATCH 03/27] Fix ability to manually specify uefistub 5 | 6 | --- 7 | mkinitcpio | 6 +++--- 8 | 1 file changed, 3 insertions(+), 3 deletions(-) 9 | 10 | diff --git a/mkinitcpio b/mkinitcpio 11 | index 549f381..c912685 100755 12 | --- a/mkinitcpio 13 | +++ b/mkinitcpio 14 | @@ -264,7 +264,7 @@ build_image() { 15 | } 16 | 17 | build_uefi(){ 18 | - local out=$1 initramfs=$2 cmdline=$3 osrelease=$4 splash=$5 kernelimg=$6 uefistub=$7 microcode=(${@:7}) errmsg= 19 | + local out=$1 initramfs=$2 cmdline=$3 osrelease=$4 splash=$5 kernelimg=$6 uefistub=$7 microcode=(${@:8}) errmsg= 20 | OBJCOPYARGS=() 21 | 22 | msg "Creating UEFI executable: %s" "$out" 23 | @@ -277,7 +277,7 @@ build_uefi(){ 24 | break 25 | fi 26 | done 27 | - elif [[ ! -f "$uefisub" ]]; then 28 | + elif [[ ! -f "$uefistub" ]]; then 29 | error "UEFI stub '%s' not found" "$uefistub" 30 | return 1 31 | fi 32 | @@ -559,7 +559,7 @@ while :; do 33 | ;; 34 | --uefistub) 35 | shift 36 | - _optkernelimage=$1 37 | + _optuefistub=$1 38 | ;; 39 | -M|--automods) 40 | _optshowautomods=1 41 | -- 42 | 2.37.0.rc0.15.g3b9a5a33c2 43 | 44 | -------------------------------------------------------------------------------- /depends/mkinitcpio-lucjan/0004-Add-support-for-post-generation-hooks.patch: -------------------------------------------------------------------------------- 1 | From ad0b2f3681f3c75849f157b361174e672c66229e Mon Sep 17 00:00:00 2001 2 | From: Markus Weippert 3 | Date: Mon, 20 Dec 2021 16:09:14 +0100 4 | Subject: [PATCH 04/27] Add support for post generation hooks 5 | 6 | --- 7 | Makefile | 3 +++ 8 | man/mkinitcpio.8.txt | 11 +++++++++++ 9 | mkinitcpio | 43 +++++++++++++++++++++++++++++++++++++++---- 10 | 3 files changed, 53 insertions(+), 4 deletions(-) 11 | 12 | diff --git a/Makefile b/Makefile 13 | index e6f3789..3ca01c8 100644 14 | --- a/Makefile 15 | +++ b/Makefile 16 | @@ -9,8 +9,10 @@ DIRS = \ 17 | /etc/mkinitcpio.d \ 18 | /etc/initcpio/hooks \ 19 | /etc/initcpio/install \ 20 | + /etc/initcpio/post \ 21 | /usr/lib/initcpio/hooks \ 22 | /usr/lib/initcpio/install \ 23 | + /usr/lib/initcpio/post \ 24 | /usr/lib/initcpio/udev \ 25 | /usr/lib/kernel/install.d \ 26 | /usr/share/man/man8 \ 27 | @@ -40,6 +42,7 @@ install: all 28 | -e 's|\(^_f_functions\)=.*|\1=/usr/lib/initcpio/functions|' \ 29 | -e 's|\(^_d_hooks\)=.*|\1=/etc/initcpio/hooks:/usr/lib/initcpio/hooks|' \ 30 | -e 's|\(^_d_install\)=.*|\1=/etc/initcpio/install:/usr/lib/initcpio/install|' \ 31 | + -e 's|\(^_d_post\)=.*|\1=/etc/initcpio/post:/usr/lib/initcpio/post|' \ 32 | -e 's|\(^_d_presets\)=.*|\1=/etc/mkinitcpio.d|' \ 33 | -e 's|%VERSION%|$(VERSION)|g' \ 34 | < mkinitcpio > $(DESTDIR)/usr/bin/mkinitcpio 35 | diff --git a/man/mkinitcpio.8.txt b/man/mkinitcpio.8.txt 36 | index 0360a6b..759d736 100644 37 | --- a/man/mkinitcpio.8.txt 38 | +++ b/man/mkinitcpio.8.txt 39 | @@ -254,6 +254,13 @@ run in reverse. 40 | from a run_earlyhook function should be shut down here in preparation for 41 | switching to the real root. 42 | 43 | +About Post Hooks 44 | +---------------- 45 | +Post hooks are executables or scripts that get executed after the image has been 46 | +successfully generated and can be used for further processing (i.e. signing). 47 | +They receive the image as the first argument and optionally the UEFI executable 48 | +as a second. 49 | + 50 | Early Init Environment 51 | ---------------------- 52 | mkinitcpio gives special treatment to certain environment variables passed on 53 | @@ -372,6 +379,10 @@ Files 54 | '/usr/lib/initcpio/hooks':: 55 | Search path for early userspace runtime hooks. 56 | 57 | +'/etc/initcpio/post':: 58 | +'/usr/lib/initcpio/post':: 59 | + Search path for post generation hooks. 60 | + 61 | Examples 62 | -------- 63 | *mkinitcpio*:: 64 | diff --git a/mkinitcpio b/mkinitcpio 65 | index c912685..4e6805c 100755 66 | --- a/mkinitcpio 67 | +++ b/mkinitcpio 68 | @@ -14,8 +14,10 @@ _f_functions=functions 69 | _f_config=mkinitcpio.conf 70 | _d_hooks="$PWD/hooks:/usr/lib/initcpio/hooks:/lib/initcpio/hooks" 71 | _d_install="$PWD/install:/usr/lib/initcpio/install:/lib/initcpio/install" 72 | +_d_post="$PWD/post:/usr/lib/initcpio/post:/lib/initcpio/post" 73 | _d_flag_hooks= 74 | _d_flag_install= 75 | +_d_flag_post= 76 | _d_firmware=({/usr,}/lib/firmware/updates {/usr,}/lib/firmware) 77 | _d_presets=mkinitcpio.d 78 | 79 | @@ -26,7 +28,7 @@ _optosrelease= 80 | _optuefi= _optmicrocode=() _optcmdline= _optsplash= _optkernelimage= _optuefistub= 81 | _optshowautomods=0 _optsavetree=0 _optshowmods=0 82 | _optquiet=1 _optcolor=1 83 | -_optskiphooks=() _optaddhooks=() _hooks=() _optpreset=() 84 | +_optskiphooks=() _optaddhooks=() _hooks=() _optpreset=() _generated=() 85 | declare -A _runhooks _addedmodules _modpaths _autodetect_cache 86 | 87 | # export a sane PATH 88 | @@ -458,6 +460,31 @@ preload_builtin_modules() { 89 | fi 90 | } 91 | 92 | +run_post_hooks() { 93 | + local args=("$@") 94 | + local hook status 95 | + local -i count=0 96 | + local -a paths 97 | + 98 | + IFS=: read -ra paths <<<"$_d_post" 99 | + 100 | + for path in "${paths[@]}"; do 101 | + for hook in "$path"/*; do 102 | + [[ -x $hook ]] || continue 103 | + 104 | + (( count++ )) || msg "Running post hooks" 105 | + msg2 "Running post hook: %s" "$hook" 106 | + 107 | + KERNELVERSION="$KERNELVERSION" "$hook" "${args[@]}" 108 | + status=$? 109 | + 110 | + (( status )) && warning "'%s' failed with exit code %d" "$hook" "$status" 111 | + done 112 | + done 113 | + 114 | + ! (( count )) || msg "Post processing done" 115 | +} 116 | + 117 | . "$_f_functions" 118 | 119 | trap 'cleanup 130' INT 120 | @@ -593,6 +620,7 @@ while :; do 121 | shift 122 | _d_flag_hooks+="$1/hooks:" 123 | _d_flag_install+="$1/install:" 124 | + _d_flag_post+="$1/post:" 125 | ;; 126 | --) 127 | shift 128 | @@ -608,9 +636,10 @@ if [[ -t 1 ]] && (( _optcolor )); then 129 | try_enable_color 130 | fi 131 | 132 | -if [[ -n $_d_flag_hooks && -n $_d_flag_install ]]; then 133 | +if [[ -n $_d_flag_hooks && -n $_d_flag_install && -n $_d_flag_post ]]; then 134 | _d_hooks=${_d_flag_hooks%:} 135 | _d_install=${_d_flag_install%:} 136 | + _d_post=${_d_flag_post%:} 137 | fi 138 | 139 | 140 | @@ -714,7 +743,8 @@ ldconfig -r "$BUILDROOT" &>/dev/null 141 | umask 077 142 | 143 | if [[ $_optgenimg ]]; then 144 | - build_image "$_optgenimg" "$_optcompress" 145 | + build_image "$_optgenimg" "$_optcompress" && 146 | + _generated+=("$_optgenimg") 147 | elif [[ $_opttargetdir ]]; then 148 | msg "Build complete." 149 | else 150 | @@ -722,7 +752,12 @@ else 151 | fi 152 | 153 | if [[ $_optuefi && $_optgenimg ]]; then 154 | - build_uefi "$_optuefi" "$_optgenimg" "$_optcmdline" "$_optosrelease" "$_optsplash" "$_optkernelimage" "$_optuefistub" "${_optmicrocode[@]}" 155 | + build_uefi "$_optuefi" "$_optgenimg" "$_optcmdline" "$_optosrelease" "$_optsplash" "$_optkernelimage" "$_optuefistub" "${_optmicrocode[@]}" && 156 | + (( ${#_generated[*]} )) && _generated+=("$_optuefi") 157 | +fi 158 | + 159 | +if (( ${#_generated[*]} )); then 160 | + run_post_hooks "${_generated[@]}" 161 | fi 162 | 163 | cleanup $(( !!_builderrors )) 164 | -- 165 | 2.37.0.rc0.15.g3b9a5a33c2 166 | 167 | -------------------------------------------------------------------------------- /depends/mkinitcpio-lucjan/0005-Allow-overriding-hooks.patch: -------------------------------------------------------------------------------- 1 | From cabb40d4748a376557ebde55fb0b04b610b4decc Mon Sep 17 00:00:00 2001 2 | From: Markus Weippert 3 | Date: Tue, 21 Dec 2021 09:31:09 +0100 4 | Subject: [PATCH 05/27] Allow overriding hooks 5 | 6 | --- 7 | mkinitcpio | 7 +++++-- 8 | 1 file changed, 5 insertions(+), 2 deletions(-) 9 | 10 | diff --git a/mkinitcpio b/mkinitcpio 11 | index 4e6805c..01f8fcb 100755 12 | --- a/mkinitcpio 13 | +++ b/mkinitcpio 14 | @@ -464,16 +464,19 @@ run_post_hooks() { 15 | local args=("$@") 16 | local hook status 17 | local -i count=0 18 | - local -a paths 19 | + local -a paths seen 20 | 21 | IFS=: read -ra paths <<<"$_d_post" 22 | 23 | for path in "${paths[@]}"; do 24 | for hook in "$path"/*; do 25 | + [[ -e $hook ]] && ! in_array "${hook##*/}" "${seen[@]}" || continue 26 | + seen+=("${hook##*/}") 27 | + 28 | [[ -x $hook ]] || continue 29 | 30 | (( count++ )) || msg "Running post hooks" 31 | - msg2 "Running post hook: %s" "$hook" 32 | + msg2 "Running post hook: [%s]" "${hook##*/}" 33 | 34 | KERNELVERSION="$KERNELVERSION" "$hook" "${args[@]}" 35 | status=$? 36 | -- 37 | 2.37.0.rc0.15.g3b9a5a33c2 38 | 39 | -------------------------------------------------------------------------------- /depends/mkinitcpio-lucjan/0006-mkinitcpio-add-VERSION_ID-to-EFISTUB.patch: -------------------------------------------------------------------------------- 1 | From 9bbccee2ead77a4c411a3bc4ca247453d964b15c Mon Sep 17 00:00:00 2001 2 | From: Morten Linderud 3 | Date: Tue, 30 Nov 2021 09:09:38 +0100 4 | Subject: [PATCH 06/27] mkinitcpio: add VERSION_ID to EFISTUB 5 | 6 | This patch adds VERSION_ID to the built images. This helps distinguish 7 | between several kernel versions instead of having it fallback to showing 8 | file names. The sd-boot menu shows the new entires with the given kernel 9 | ID: 10 | 11 | Old menu: 12 | * Arch Linux (arch-systemd.efi) 13 | * Arch Linux (test-efi.efi) 14 | 15 | New menu: 16 | * Arch Linux (rolling) 17 | * Arch Linux (5.15.5-arch1-1) 18 | 19 | Signed-off-by: Morten Linderud 20 | --- 21 | mkinitcpio | 2 +- 22 | 1 file changed, 1 insertion(+), 1 deletion(-) 23 | 24 | diff --git a/mkinitcpio b/mkinitcpio 25 | index 01f8fcb..99830f4 100755 26 | --- a/mkinitcpio 27 | +++ b/mkinitcpio 28 | @@ -343,7 +343,7 @@ build_uefi(){ 29 | done 30 | 31 | objcopy \ 32 | - --add-section .osrel="$osrelease" --change-section-vma .osrel=0x20000 \ 33 | + --add-section .osrel=<(cat "$osrelease" && echo "VERSION_ID=$KERNELVERSION") --change-section-vma .osrel=0x20000 \ 34 | --add-section .cmdline=<(grep '^[^#]' "$cmdline" | tr -s '\n' ' ') --change-section-vma .cmdline=0x30000 \ 35 | --add-section .linux="$kernelimg" --change-section-vma .linux=0x2000000 \ 36 | --add-section .initrd=<(cat ${microcode[@]} "$initramfs") --change-section-vma .initrd=0x3000000 \ 37 | -- 38 | 2.37.0.rc0.15.g3b9a5a33c2 39 | 40 | -------------------------------------------------------------------------------- /depends/mkinitcpio-lucjan/0007-functions-no-progress-for-zstd-decompression.patch: -------------------------------------------------------------------------------- 1 | From b1dc6e82e257544a89bc3d1da7cd2b6cb4e188b9 Mon Sep 17 00:00:00 2001 2 | From: Christian Hesse 3 | Date: Thu, 30 Dec 2021 00:48:50 +0100 4 | Subject: [PATCH 07/27] functions: no progress for zstd decompression 5 | 6 | --- 7 | functions | 2 +- 8 | 1 file changed, 1 insertion(+), 1 deletion(-) 9 | 10 | diff --git a/functions b/functions 11 | index 5b18b9c..389e1b9 100644 12 | --- a/functions 13 | +++ b/functions 14 | @@ -873,7 +873,7 @@ install_modules() { 15 | done 16 | (( ${#xz_comp[*]} )) && xz -d "${xz_comp[@]}" 17 | (( ${#gz_comp[*]} )) && gzip -d "${gz_comp[@]}" 18 | - (( ${#zst_comp[*]} )) && zstd -d --rm -q "${zst_comp[@]}" 19 | + (( ${#zst_comp[*]} )) && zstd -d --rm -q --no-progress "${zst_comp[@]}" 20 | 21 | msg "Generating module dependencies" 22 | install -m644 -t "$moduledest" "$_d_kmoduledir"/modules.builtin 23 | -- 24 | 2.37.0.rc0.15.g3b9a5a33c2 25 | 26 | -------------------------------------------------------------------------------- /depends/mkinitcpio-lucjan/0008-mkinitcpio-Support-etc-kernel-cmdline.d.patch: -------------------------------------------------------------------------------- 1 | From 629cb23b7438fa18d042c32bf7112d635e42f472 Mon Sep 17 00:00:00 2001 2 | From: Morten Linderud 3 | Date: Sat, 4 Dec 2021 15:10:41 +0100 4 | Subject: [PATCH 08/27] mkinitcpio: Support /etc/kernel/cmdline.d 5 | 6 | Signed-off-by: Morten Linderud 7 | --- 8 | mkinitcpio | 16 +++++++++------- 9 | 1 file changed, 9 insertions(+), 7 deletions(-) 10 | 11 | diff --git a/mkinitcpio b/mkinitcpio 12 | index 99830f4..970f3d2 100755 13 | --- a/mkinitcpio 14 | +++ b/mkinitcpio 15 | @@ -266,7 +266,7 @@ build_image() { 16 | } 17 | 18 | build_uefi(){ 19 | - local out=$1 initramfs=$2 cmdline=$3 osrelease=$4 splash=$5 kernelimg=$6 uefistub=$7 microcode=(${@:8}) errmsg= 20 | + local out=$1 initramfs=$2 cmdline=($3) osrelease=$4 splash=$5 kernelimg=$6 uefistub=$7 microcode=(${@:8}) errmsg= 21 | OBJCOPYARGS=() 22 | 23 | msg "Creating UEFI executable: %s" "$out" 24 | @@ -300,15 +300,18 @@ build_uefi(){ 25 | 26 | if [[ -z "$cmdline" ]]; then 27 | if [[ -f "/etc/kernel/cmdline" ]]; then 28 | - cmdline="/etc/kernel/cmdline" 29 | + cmdline+=("/etc/kernel/cmdline") 30 | elif [[ -f "/usr/lib/kernel/cmdline" ]]; then 31 | - cmdline="/usr/lib/kernel/cmdline" 32 | + cmdline+=("/usr/lib/kernel/cmdline") 33 | else 34 | warning "Note: /etc/kernel/cmdline does not exist and --cmdline is unset!" 35 | - cmdline="/proc/cmdline" 36 | + cmdline+=("/proc/cmdline") 37 | warning "Reusing current kernel cmdline from $cmdline" 38 | fi 39 | - msg2 "Using cmdline file: %s" "$cmdline" 40 | + if [[ -d "/etc/kernel/cmdline.d" ]]; then 41 | + cmdline+=(/etc/kernel/cmdline.d/*.conf) 42 | + fi 43 | + msg2 "Using cmdline file: %s" "${cmdline[@]}" 44 | fi 45 | if [[ ! -f "$cmdline" ]]; then 46 | error "Kernel cmdline file '%s' not found" "$cmdline" 47 | @@ -341,10 +344,9 @@ build_uefi(){ 48 | for image in "${microcode[@]}"; do 49 | msg2 "Using microcode image: %s" "$image" 50 | done 51 | - 52 | objcopy \ 53 | --add-section .osrel=<(cat "$osrelease" && echo "VERSION_ID=$KERNELVERSION") --change-section-vma .osrel=0x20000 \ 54 | - --add-section .cmdline=<(grep '^[^#]' "$cmdline" | tr -s '\n' ' ') --change-section-vma .cmdline=0x30000 \ 55 | + --add-section .cmdline=<(grep -h '^[^#]' "${cmdline[@]}" | tr -s '\n' ' ') --change-section-vma .cmdline=0x30000 \ 56 | --add-section .linux="$kernelimg" --change-section-vma .linux=0x2000000 \ 57 | --add-section .initrd=<(cat ${microcode[@]} "$initramfs") --change-section-vma .initrd=0x3000000 \ 58 | ${OBJCOPYARGS[@]} "$uefistub" "$out" 59 | -- 60 | 2.37.0.rc0.15.g3b9a5a33c2 61 | 62 | -------------------------------------------------------------------------------- /depends/mkinitcpio-lucjan/0009-presets-when-using-_efi_image-make-_image-optional.patch: -------------------------------------------------------------------------------- 1 | From 6a655d69bc9c029000104025325edc6fc38ec42b Mon Sep 17 00:00:00 2001 2 | From: =?UTF-8?q?=D0=94=D0=B0=D0=BC=D1=98=D0=B0=D0=BD=20=D0=93=D0=B5=D0=BE?= 3 | =?UTF-8?q?=D1=80=D0=B3=D0=B8=D0=B5=D0=B2=D1=81=D0=BA=D0=B8?= 4 | 5 | Date: Wed, 15 Dec 2021 16:19:19 +0100 6 | Subject: [PATCH 09/27] presets: when using _efi_image, make _image optional 7 | 8 | fixes #77 9 | --- 10 | mkinitcpio | 16 +++++++++------- 11 | 1 file changed, 9 insertions(+), 7 deletions(-) 12 | 13 | diff --git a/mkinitcpio b/mkinitcpio 14 | index 970f3d2..e0535b0 100755 15 | --- a/mkinitcpio 16 | +++ b/mkinitcpio 17 | @@ -403,11 +403,18 @@ process_preset() ( 18 | continue 19 | fi 20 | 21 | + preset_efi_image=${p}_efi_image 22 | + if [[ ${!preset_efi_image:-$ALL_efi_image} ]]; then 23 | + preset_cmd+=(-U "${!preset_efi_image:-$ALL_efi_image}") 24 | + fi 25 | + 26 | preset_image=${p}_image 27 | if [[ ${!preset_image} ]]; then 28 | preset_cmd+=(-g "${!preset_image}") 29 | - else 30 | - warning "No image file specified. Skipping image \`%s'" "$p" 31 | + fi 32 | + 33 | + if [[ "${!preset_efi_image:-$ALL_efi_image}" == "" && "${!preset_image}" == "" ]]; then 34 | + warning "No UEFI or CPIO image file specified. Skipping image \`%s'" "$p" 35 | continue 36 | fi 37 | 38 | @@ -416,11 +423,6 @@ process_preset() ( 39 | preset_cmd+=(${!preset_options}) # intentional word splitting 40 | fi 41 | 42 | - preset_efi_image=${p}_efi_image 43 | - if [[ ${!preset_efi_image:-$ALL_efi_image} ]]; then 44 | - preset_cmd+=(-U "${!preset_efi_image:-$ALL_efi_image}") 45 | - fi 46 | - 47 | preset_microcode=${p}_microcode[@] 48 | if [[ ${!preset_microcode:-$ALL_microcode} ]]; then 49 | for mc in "${!preset_microcode:-${ALL_microcode[@]}}"; do 50 | -- 51 | 2.37.0.rc0.15.g3b9a5a33c2 52 | 53 | -------------------------------------------------------------------------------- /depends/mkinitcpio-lucjan/0010-Revert-functions-no-progress-for-zstd-decompression.patch: -------------------------------------------------------------------------------- 1 | From 42a3e36702f6636cb506265a2e59de03da34bc0b Mon Sep 17 00:00:00 2001 2 | From: Piotr Gorski 3 | Date: Fri, 11 Mar 2022 18:43:36 +0100 4 | Subject: [PATCH 10/27] Revert "functions: no progress for zstd decompression" 5 | 6 | This reverts commit 689ce7b16e49c5eaa2f569345a0d1c6e03a8409a. 7 | 8 | Signed-off-by: Piotr Gorski 9 | --- 10 | functions | 2 +- 11 | 1 file changed, 1 insertion(+), 1 deletion(-) 12 | 13 | diff --git a/functions b/functions 14 | index 389e1b9..5b18b9c 100644 15 | --- a/functions 16 | +++ b/functions 17 | @@ -873,7 +873,7 @@ install_modules() { 18 | done 19 | (( ${#xz_comp[*]} )) && xz -d "${xz_comp[@]}" 20 | (( ${#gz_comp[*]} )) && gzip -d "${gz_comp[@]}" 21 | - (( ${#zst_comp[*]} )) && zstd -d --rm -q --no-progress "${zst_comp[@]}" 22 | + (( ${#zst_comp[*]} )) && zstd -d --rm -q "${zst_comp[@]}" 23 | 24 | msg "Generating module dependencies" 25 | install -m644 -t "$moduledest" "$_d_kmoduledir"/modules.builtin 26 | -- 27 | 2.37.0.rc0.15.g3b9a5a33c2 28 | 29 | -------------------------------------------------------------------------------- /depends/mkinitcpio-lucjan/0011-add-zst-compressed-firmware-support-fpr-future-kerne.patch: -------------------------------------------------------------------------------- 1 | From 4c20cdee8897615f8691ff846c51926fc4ce285f Mon Sep 17 00:00:00 2001 2 | From: Tobias Powalowski 3 | Date: Fri, 11 Mar 2022 15:01:22 +0100 4 | Subject: [PATCH 11/27] add zst compressed firmware support fpr future kernel 5 | versions 6 | 7 | --- 8 | functions | 3 +++ 9 | 1 file changed, 3 insertions(+) 10 | 11 | diff --git a/functions b/functions 12 | index 5b18b9c..36c773a 100644 13 | --- a/functions 14 | +++ b/functions 15 | @@ -376,6 +376,9 @@ add_firmware() { 16 | elif [[ -f $fwpath/$fw ]]; then 17 | add_file "$fwpath/$fw" "$fwpath/$fw" 644 && r=0 18 | break 19 | + elif [[ -f $fwpath/$fw.zst ]]; then 20 | + add_file "$fwpath/$fw.zst" "$fwpath/$fw.zst" 644 && r=0 21 | + break 22 | fi 23 | done 24 | done 25 | -- 26 | 2.37.0.rc0.15.g3b9a5a33c2 27 | 28 | -------------------------------------------------------------------------------- /depends/mkinitcpio-lucjan/0012-add-real-symlink-support.patch: -------------------------------------------------------------------------------- 1 | From 6d6d52f57a1e58f6c3e23624a3c7d56e22ca3063 Mon Sep 17 00:00:00 2001 2 | From: Tobias Powalowski 3 | Date: Fri, 11 Mar 2022 15:47:59 +0100 4 | Subject: [PATCH 12/27] add real symlink support 5 | 6 | --- 7 | functions | 10 +++++++++- 8 | 1 file changed, 9 insertions(+), 1 deletion(-) 9 | 10 | diff --git a/functions b/functions 11 | index 36c773a..88bd563 100644 12 | --- a/functions 13 | +++ b/functions 14 | @@ -574,7 +574,15 @@ add_file() { 15 | else 16 | quiet "adding file: %s" "$dest" 17 | fi 18 | - command install -Dm$mode "$src" "$BUILDROOT$dest" 19 | + #check if $src is a symlink 20 | + if [[ -L $src ]]; then 21 | + # add the symlink 22 | + add_file "$(realpath $src)" 23 | + # create the symlink 24 | + add_symlink "$src" "$(realpath $src)" 25 | + else 26 | + command install -Dm$mode "$src" "$BUILDROOT$dest" 27 | + fi 28 | } 29 | 30 | add_runscript() { 31 | -- 32 | 2.37.0.rc0.15.g3b9a5a33c2 33 | 34 | -------------------------------------------------------------------------------- /depends/mkinitcpio-lucjan/0013-add-real-symlink-support.patch: -------------------------------------------------------------------------------- 1 | From 5c3392023b426d2b08f9202d92645e22322e12b9 Mon Sep 17 00:00:00 2001 2 | From: Tobias Powalowski 3 | Date: Fri, 11 Mar 2022 15:53:09 +0100 4 | Subject: [PATCH 13/27] add real symlink support 5 | 6 | --- 7 | functions | 10 +++++++++- 8 | 1 file changed, 9 insertions(+), 1 deletion(-) 9 | 10 | diff --git a/functions b/functions 11 | index 88bd563..4dce711 100644 12 | --- a/functions 13 | +++ b/functions 14 | @@ -642,7 +642,15 @@ add_binary() { 15 | mode=$(stat -c %a "$binary") 16 | 17 | # always add the binary itself 18 | - add_file "$binary" "$dest" "$mode" 19 | + # check if binary is a symlink 20 | + if [[ -L $binary ]]; then 21 | + # add the binary 22 | + add_file "$(realpath $binary)" 23 | + # create the symlink 24 | + add_symlink "$binary" "$(realpath $binary)" 25 | + else 26 | + add_file "$binary" "$dest" "$mode" 27 | + fi 28 | 29 | # negate this so that the RETURN trap is not fired on non-binaries 30 | ! lddout=$(ldd "$binary" 2>/dev/null) && return 0 31 | -- 32 | 2.37.0.rc0.15.g3b9a5a33c2 33 | 34 | -------------------------------------------------------------------------------- /depends/mkinitcpio-lucjan/0014-add-MODULES_DECOMPRESS-switch.patch: -------------------------------------------------------------------------------- 1 | From 0bb76f728b0c35dc00cd3d606923965de42cbe63 Mon Sep 17 00:00:00 2001 2 | From: Tobias Powalowski 3 | Date: Fri, 11 Mar 2022 15:59:45 +0100 4 | Subject: [PATCH 14/27] add MODULES_DECOMPRESS switch 5 | 6 | --- 7 | functions | 32 +++++++++++++++++--------------- 8 | man/mkinitcpio.conf.5.txt | 8 +++++++- 9 | mkinitcpio | 2 ++ 10 | mkinitcpio.conf | 6 ++++++ 11 | 4 files changed, 32 insertions(+), 16 deletions(-) 12 | 13 | diff --git a/functions b/functions 14 | index 4dce711..f523b53 100644 15 | --- a/functions 16 | +++ b/functions 17 | @@ -865,7 +865,7 @@ try_enable_color() { 18 | 19 | install_modules() { 20 | local m moduledest=$BUILDROOT/lib/modules/$KERNELVERSION 21 | - local -a xz_comp gz_comp zst_comp 22 | + MODULES_DECOMPRESS="yes" && local -a xz_comp gz_comp zst_comp 23 | 24 | [[ $KERNELVERSION == none ]] && return 0 25 | 26 | @@ -876,20 +876,22 @@ install_modules() { 27 | 28 | cp "$@" "$moduledest/kernel" 29 | 30 | - # unzip modules prior to recompression 31 | - for m in "$@"; do 32 | - case $m in 33 | - *.xz) 34 | - xz_comp+=("$moduledest/kernel/${m##*/}") 35 | - ;; 36 | - *.gz) 37 | - gz_comp+=("$moduledest/kernel/${m##*/}") 38 | - ;; 39 | - *.zst) 40 | - zst_comp+=("$moduledest/kernel/${m##*/}") 41 | - ;; 42 | - esac 43 | - done 44 | + if [[ $MODULES_DECOMPRESS == yes ]]; then 45 | + # unzip modules prior to recompression 46 | + for m in "$@"; do 47 | + case $m in 48 | + *.xz) 49 | + xz_comp+=("$moduledest/kernel/${m##*/}") 50 | + ;; 51 | + *.gz) 52 | + gz_comp+=("$moduledest/kernel/${m##*/}") 53 | + ;; 54 | + *.zst) 55 | + zst_comp+=("$moduledest/kernel/${m##*/}") 56 | + ;; 57 | + esac 58 | + done 59 | + fi 60 | (( ${#xz_comp[*]} )) && xz -d "${xz_comp[@]}" 61 | (( ${#gz_comp[*]} )) && gzip -d "${gz_comp[@]}" 62 | (( ${#zst_comp[*]} )) && zstd -d --rm -q "${zst_comp[@]}" 63 | diff --git a/man/mkinitcpio.conf.5.txt b/man/mkinitcpio.conf.5.txt 64 | index 0383360..fdb8d91 100644 65 | --- a/man/mkinitcpio.conf.5.txt 66 | +++ b/man/mkinitcpio.conf.5.txt 67 | @@ -69,6 +69,12 @@ despite being "valid". 68 | program. This option is generally not used. It can be potentially dangerous 69 | and may cause invalid images to be generated without any sign of an error. 70 | 71 | +*DECOMPRESS_MODULES*:: 72 | + 73 | + Switch (yes/no) to decide wether kernel modules should be compressed or 74 | + uncompressed during initramfs creation. Enabled by default for faster bootup 75 | + and smaller initramfs size. Disable it to reduce RAM usage in early userspace. 76 | + 77 | See Also 78 | -------- 79 | *mkinitcpio*(8) 80 | @@ -79,4 +85,4 @@ mkinitcpio is created and maintained by the Arch Linux Developer community. 81 | 82 | Copyright 83 | --------- 84 | -Copyright (c) Arch Linux 2006-2021 85 | +Copyright (c) Arch Linux 2006-2022 86 | diff --git a/mkinitcpio b/mkinitcpio 87 | index e0535b0..834eb96 100755 88 | --- a/mkinitcpio 89 | +++ b/mkinitcpio 90 | @@ -675,6 +675,8 @@ if [[ $KERNELVERSION != 'none' ]]; then 91 | [[ -d $_d_kmoduledir ]] || die "'$_d_kmoduledir' is not a valid kernel module directory" 92 | fi 93 | 94 | +[[ -z $MODULES_DECOMPRESS ]] && MODULES_DECOMPRESS=yes 95 | + 96 | _d_workdir=$(initialize_buildroot "$KERNELVERSION" "$_opttargetdir") || cleanup 1 97 | BUILDROOT=${_opttargetdir:-$_d_workdir/root} 98 | 99 | diff --git a/mkinitcpio.conf b/mkinitcpio.conf 100 | index 3494fab..19ec038 100644 101 | --- a/mkinitcpio.conf 102 | +++ b/mkinitcpio.conf 103 | @@ -65,3 +65,9 @@ HOOKS=(base udev autodetect modconf block filesystems keyboard fsck) 104 | # COMPRESSION_OPTIONS 105 | # Additional options for the compressor 106 | #COMPRESSION_OPTIONS=() 107 | + 108 | +# MODULES_DECOMPRESS 109 | +# Decompress kernel modules during initramfs creation. 110 | +# Enable to speedup boot process, disable to save RAM 111 | +# during early userspace. Switch (yes/no) default=yes 112 | +#MODULES_DECOMPRESS="" 113 | -- 114 | 2.37.0.rc0.15.g3b9a5a33c2 115 | 116 | -------------------------------------------------------------------------------- /depends/mkinitcpio-lucjan/0015-fix-reproducibility-in-case-of-var-cache-is-included.patch: -------------------------------------------------------------------------------- 1 | From af0c8e0358a2369e7ba9bf71887213d9d95919da Mon Sep 17 00:00:00 2001 2 | From: Tobias Powalowski 3 | Date: Fri, 11 Mar 2022 16:04:51 +0100 4 | Subject: [PATCH 15/27] fix reproducibility, in case of /var/cache is included 5 | in initramfs 6 | 7 | --- 8 | mkinitcpio | 2 ++ 9 | 1 file changed, 2 insertions(+) 10 | 11 | diff --git a/mkinitcpio b/mkinitcpio 12 | index 834eb96..ba9a911 100755 13 | --- a/mkinitcpio 14 | +++ b/mkinitcpio 15 | @@ -747,6 +747,8 @@ trap -- ERR 16 | 17 | # this is simply a nice-to-have -- it doesn't matter if it fails. 18 | ldconfig -r "$BUILDROOT" &>/dev/null 19 | +# remove /var/cache/ldconfig/aux-cache for reproducability 20 | +[[ -e $BUILDROOT/var/cache/ldconfig/aux-cache ]] && rm $BUILDROOT/var/cache/ldconfig/aux-cache 21 | 22 | # Set umask to create initramfs images and EFI images as 600 23 | umask 077 24 | -- 25 | 2.37.0.rc0.15.g3b9a5a33c2 26 | 27 | -------------------------------------------------------------------------------- /depends/mkinitcpio-lucjan/0016-Good-idea-add-the-default-value.patch: -------------------------------------------------------------------------------- 1 | From 8d3b83888c35bc42b32d1b4830f2f3c113c7e2a2 Mon Sep 17 00:00:00 2001 2 | From: Tobias Powalowski 3 | Date: Sun, 13 Mar 2022 20:49:15 +0100 4 | Subject: [PATCH 16/27] Good idea, add the default value 5 | 6 | Co-authored-by: nl6720 7 | --- 8 | mkinitcpio.conf | 4 ++-- 9 | 1 file changed, 2 insertions(+), 2 deletions(-) 10 | 11 | diff --git a/mkinitcpio.conf b/mkinitcpio.conf 12 | index 19ec038..8acf414 100644 13 | --- a/mkinitcpio.conf 14 | +++ b/mkinitcpio.conf 15 | @@ -69,5 +69,5 @@ HOOKS=(base udev autodetect modconf block filesystems keyboard fsck) 16 | # MODULES_DECOMPRESS 17 | # Decompress kernel modules during initramfs creation. 18 | # Enable to speedup boot process, disable to save RAM 19 | -# during early userspace. Switch (yes/no) default=yes 20 | -#MODULES_DECOMPRESS="" 21 | +# during early userspace. Switch (yes/no). 22 | +#MODULES_DECOMPRESS="yes" 23 | -- 24 | 2.37.0.rc0.15.g3b9a5a33c2 25 | 26 | -------------------------------------------------------------------------------- /depends/mkinitcpio-lucjan/0017-mkinitcpio-improve-MODULES_DECOMPRESS.patch: -------------------------------------------------------------------------------- 1 | From b6829b43e47cbd528358dbcb63509712e0840b91 Mon Sep 17 00:00:00 2001 2 | From: Piotr Gorski 3 | Date: Mon, 14 Mar 2022 12:11:36 +0100 4 | Subject: [PATCH 17/27] mkinitcpio: improve MODULES_DECOMPRESS 5 | 6 | Signed-off-by: Piotr Gorski 7 | --- 8 | mkinitcpio | 2 +- 9 | 1 file changed, 1 insertion(+), 1 deletion(-) 10 | 11 | diff --git a/mkinitcpio b/mkinitcpio 12 | index ba9a911..15b30fc 100755 13 | --- a/mkinitcpio 14 | +++ b/mkinitcpio 15 | @@ -675,7 +675,7 @@ if [[ $KERNELVERSION != 'none' ]]; then 16 | [[ -d $_d_kmoduledir ]] || die "'$_d_kmoduledir' is not a valid kernel module directory" 17 | fi 18 | 19 | -[[ -z $MODULES_DECOMPRESS ]] && MODULES_DECOMPRESS=yes 20 | +MODULES_DECOMPRESS=${MODULES_DECOMPRESS:-"yes"} 21 | 22 | _d_workdir=$(initialize_buildroot "$KERNELVERSION" "$_opttargetdir") || cleanup 1 23 | BUILDROOT=${_opttargetdir:-$_d_workdir/root} 24 | -- 25 | 2.37.0.rc0.15.g3b9a5a33c2 26 | 27 | -------------------------------------------------------------------------------- /depends/mkinitcpio-lucjan/0018-Replace-check-with-rm-f.patch: -------------------------------------------------------------------------------- 1 | From 8842d8a055682eef8e710ba8fb792cc86127c863 Mon Sep 17 00:00:00 2001 2 | From: Tobias Powalowski 3 | Date: Sun, 13 Mar 2022 20:37:55 +0100 4 | Subject: [PATCH 18/27] Replace check with rm -f 5 | 6 | Co-authored-by: nl6720 7 | --- 8 | mkinitcpio | 2 +- 9 | 1 file changed, 1 insertion(+), 1 deletion(-) 10 | 11 | diff --git a/mkinitcpio b/mkinitcpio 12 | index 15b30fc..ee01f0b 100755 13 | --- a/mkinitcpio 14 | +++ b/mkinitcpio 15 | @@ -748,7 +748,7 @@ trap -- ERR 16 | # this is simply a nice-to-have -- it doesn't matter if it fails. 17 | ldconfig -r "$BUILDROOT" &>/dev/null 18 | # remove /var/cache/ldconfig/aux-cache for reproducability 19 | -[[ -e $BUILDROOT/var/cache/ldconfig/aux-cache ]] && rm $BUILDROOT/var/cache/ldconfig/aux-cache 20 | +rm -f $BUILDROOT/var/cache/ldconfig/aux-cache 21 | 22 | # Set umask to create initramfs images and EFI images as 600 23 | umask 077 24 | -- 25 | 2.37.0.rc0.15.g3b9a5a33c2 26 | 27 | -------------------------------------------------------------------------------- /depends/mkinitcpio-lucjan/0019-Fix-typo-in-commit-reproducibility.patch: -------------------------------------------------------------------------------- 1 | From b589c2d6a8a3acabb12297504f3f0b76cf50a38f Mon Sep 17 00:00:00 2001 2 | From: Tobias Powalowski 3 | Date: Sun, 13 Mar 2022 20:46:26 +0100 4 | Subject: [PATCH 19/27] Fix typo in commit reproducibility 5 | 6 | --- 7 | mkinitcpio | 2 +- 8 | 1 file changed, 1 insertion(+), 1 deletion(-) 9 | 10 | diff --git a/mkinitcpio b/mkinitcpio 11 | index ee01f0b..8a512ec 100755 12 | --- a/mkinitcpio 13 | +++ b/mkinitcpio 14 | @@ -747,7 +747,7 @@ trap -- ERR 15 | 16 | # this is simply a nice-to-have -- it doesn't matter if it fails. 17 | ldconfig -r "$BUILDROOT" &>/dev/null 18 | -# remove /var/cache/ldconfig/aux-cache for reproducability 19 | +# remove /var/cache/ldconfig/aux-cache for reproducibility 20 | rm -f $BUILDROOT/var/cache/ldconfig/aux-cache 21 | 22 | # Set umask to create initramfs images and EFI images as 600 23 | -- 24 | 2.37.0.rc0.15.g3b9a5a33c2 25 | 26 | -------------------------------------------------------------------------------- /depends/mkinitcpio-lucjan/0020-mkinitcpio-preserve-module-dir-by-the-kernel-remove-.patch: -------------------------------------------------------------------------------- 1 | From 70478317be63297aefb02d35687bd82a048225b3 Mon Sep 17 00:00:00 2001 2 | From: Piotr Gorski 3 | Date: Thu, 17 Mar 2022 20:29:57 +0100 4 | Subject: [PATCH 20/27] mkinitcpio: preserve module dir by the kernel, remove 5 | modules.order hack 6 | 7 | Signed-off-by: Piotr Gorski 8 | --- 9 | functions | 21 +++++++-------------- 10 | 1 file changed, 7 insertions(+), 14 deletions(-) 11 | 12 | diff --git a/functions b/functions 13 | index f523b53..f6f67ee 100644 14 | --- a/functions 15 | +++ b/functions 16 | @@ -874,20 +874,20 @@ install_modules() { 17 | return 0 18 | fi 19 | 20 | - cp "$@" "$moduledest/kernel" 21 | - 22 | if [[ $MODULES_DECOMPRESS == yes ]]; then 23 | - # unzip modules prior to recompression 24 | + 25 | for m in "$@"; do 26 | + install -D -m644 "$m" "$BUILDROOT/$m" 27 | + # unzip modules prior to recompression 28 | case $m in 29 | *.xz) 30 | - xz_comp+=("$moduledest/kernel/${m##*/}") 31 | + xz_comp+=("$BUILDROOT/$m") 32 | ;; 33 | *.gz) 34 | - gz_comp+=("$moduledest/kernel/${m##*/}") 35 | + gz_comp+=("$BUILDROOT/$m") 36 | ;; 37 | *.zst) 38 | - zst_comp+=("$moduledest/kernel/${m##*/}") 39 | + zst_comp+=("$BUILDROOT/$m") 40 | ;; 41 | esac 42 | done 43 | @@ -898,14 +898,7 @@ install_modules() { 44 | 45 | msg "Generating module dependencies" 46 | install -m644 -t "$moduledest" "$_d_kmoduledir"/modules.builtin 47 | - 48 | - # we install all modules into kernel/, making the .order file incorrect for 49 | - # the module tree. munge it, so that we have an accurate index. This avoids 50 | - # some rare and subtle issues with module loading choices when an alias 51 | - # resolves to multiple modules, only one of which can claim a device. 52 | - awk -F'/' '{ print "kernel/" $NF }' \ 53 | - "$_d_kmoduledir"/modules.order >"$moduledest/modules.order" 54 | - 55 | + install -m644 -t "$moduledest" "$_d_kmoduledir"/modules.order 56 | depmod -b "$BUILDROOT" "$KERNELVERSION" 57 | 58 | # remove all non-binary module.* files (except devname for on-demand module loading) 59 | -- 60 | 2.37.0.rc0.15.g3b9a5a33c2 61 | 62 | -------------------------------------------------------------------------------- /depends/mkinitcpio-lucjan/0021-Typo-correction.patch: -------------------------------------------------------------------------------- 1 | From 017b97f070159e257ae8f761d6e1a4480cd95c94 Mon Sep 17 00:00:00 2001 2 | From: Bischnu <8502263+Bischnu@users.noreply.github.com> 3 | Date: Mon, 21 Mar 2022 14:08:47 +0100 4 | Subject: [PATCH 21/27] Typo correction 5 | 6 | Fixed a typo in build_uefi function 7 | --- 8 | mkinitcpio | 2 +- 9 | 1 file changed, 1 insertion(+), 1 deletion(-) 10 | 11 | diff --git a/mkinitcpio b/mkinitcpio 12 | index 8a512ec..f923624 100755 13 | --- a/mkinitcpio 14 | +++ b/mkinitcpio 15 | @@ -294,7 +294,7 @@ build_uefi(){ 16 | done 17 | fi 18 | if [[ ! -f "$kernelimg" ]]; then 19 | - error "Kernel image '%s' not found" "$kernelimage" 20 | + error "Kernel image '%s' not found" "$kernelimg" 21 | return 1 22 | fi 23 | 24 | -- 25 | 2.37.0.rc0.15.g3b9a5a33c2 26 | 27 | -------------------------------------------------------------------------------- /depends/mkinitcpio-lucjan/0022-Revert-presets-when-using-_efi_image-make-_image-opt.patch: -------------------------------------------------------------------------------- 1 | From e27dc45a097458a4daf2bd8878e7529c66fb0a5f Mon Sep 17 00:00:00 2001 2 | From: Piotr Gorski 3 | Date: Tue, 12 Apr 2022 16:31:31 +0200 4 | Subject: [PATCH 22/27] Revert "presets: when using _efi_image, make _image 5 | optional" 6 | 7 | This reverts commit 0a6c5f474279ee76e4baa0fb13b3cad3b0acebcd. 8 | 9 | Signed-off-by: Piotr Gorski 10 | --- 11 | mkinitcpio | 16 +++++++--------- 12 | 1 file changed, 7 insertions(+), 9 deletions(-) 13 | 14 | diff --git a/mkinitcpio b/mkinitcpio 15 | index f923624..87a5f0f 100755 16 | --- a/mkinitcpio 17 | +++ b/mkinitcpio 18 | @@ -403,18 +403,11 @@ process_preset() ( 19 | continue 20 | fi 21 | 22 | - preset_efi_image=${p}_efi_image 23 | - if [[ ${!preset_efi_image:-$ALL_efi_image} ]]; then 24 | - preset_cmd+=(-U "${!preset_efi_image:-$ALL_efi_image}") 25 | - fi 26 | - 27 | preset_image=${p}_image 28 | if [[ ${!preset_image} ]]; then 29 | preset_cmd+=(-g "${!preset_image}") 30 | - fi 31 | - 32 | - if [[ "${!preset_efi_image:-$ALL_efi_image}" == "" && "${!preset_image}" == "" ]]; then 33 | - warning "No UEFI or CPIO image file specified. Skipping image \`%s'" "$p" 34 | + else 35 | + warning "No image file specified. Skipping image \`%s'" "$p" 36 | continue 37 | fi 38 | 39 | @@ -423,6 +416,11 @@ process_preset() ( 40 | preset_cmd+=(${!preset_options}) # intentional word splitting 41 | fi 42 | 43 | + preset_efi_image=${p}_efi_image 44 | + if [[ ${!preset_efi_image:-$ALL_efi_image} ]]; then 45 | + preset_cmd+=(-U "${!preset_efi_image:-$ALL_efi_image}") 46 | + fi 47 | + 48 | preset_microcode=${p}_microcode[@] 49 | if [[ ${!preset_microcode:-$ALL_microcode} ]]; then 50 | for mc in "${!preset_microcode:-${ALL_microcode[@]}}"; do 51 | -- 52 | 2.37.0.rc0.15.g3b9a5a33c2 53 | 54 | -------------------------------------------------------------------------------- /depends/mkinitcpio-lucjan/0023-preset-Change-unified-image-generation-options.patch: -------------------------------------------------------------------------------- 1 | From 3693e05425f6564a01b677d756b347988a268347 Mon Sep 17 00:00:00 2001 2 | From: Robin Ebert 3 | Date: Wed, 6 Apr 2022 23:10:23 +0200 4 | Subject: [PATCH 23/27] preset: Change unified image generation options 5 | 6 | - Setting ALL_efi_image is nonsense (like it is for ALL_image) so don't allow it 7 | - Allow omitting *_image when *_efi_image is set 8 | --- 9 | mkinitcpio | 14 +++++++------- 10 | 1 file changed, 7 insertions(+), 7 deletions(-) 11 | 12 | diff --git a/mkinitcpio b/mkinitcpio 13 | index 87a5f0f..a3de5ce 100755 14 | --- a/mkinitcpio 15 | +++ b/mkinitcpio 16 | @@ -403,11 +403,16 @@ process_preset() ( 17 | continue 18 | fi 19 | 20 | + preset_efi_image=${p}_efi_image 21 | + if [[ ${!preset_efi_image} ]]; then 22 | + preset_cmd+=(-U "${!preset_efi_image}") 23 | + fi 24 | + 25 | preset_image=${p}_image 26 | if [[ ${!preset_image} ]]; then 27 | preset_cmd+=(-g "${!preset_image}") 28 | - else 29 | - warning "No image file specified. Skipping image \`%s'" "$p" 30 | + elif [[ ! ${!preset_efi_image} ]]; then 31 | + warning "No image or efi_image file specified. Skipping image \`%s'" "$p" 32 | continue 33 | fi 34 | 35 | @@ -416,11 +421,6 @@ process_preset() ( 36 | preset_cmd+=(${!preset_options}) # intentional word splitting 37 | fi 38 | 39 | - preset_efi_image=${p}_efi_image 40 | - if [[ ${!preset_efi_image:-$ALL_efi_image} ]]; then 41 | - preset_cmd+=(-U "${!preset_efi_image:-$ALL_efi_image}") 42 | - fi 43 | - 44 | preset_microcode=${p}_microcode[@] 45 | if [[ ${!preset_microcode:-$ALL_microcode} ]]; then 46 | for mc in "${!preset_microcode:-${ALL_microcode[@]}}"; do 47 | -- 48 | 2.37.0.rc0.15.g3b9a5a33c2 49 | 50 | -------------------------------------------------------------------------------- /depends/mkinitcpio-lucjan/0024-fixed-missing-uefistub-detection.patch: -------------------------------------------------------------------------------- 1 | From 0b2e90d49b1434b8dd631d362e83dcdcc8a6e391 Mon Sep 17 00:00:00 2001 2 | From: Richard Kraus 3 | Date: Fri, 15 Apr 2022 10:52:51 +0200 4 | Subject: [PATCH 24/27] fixed missing uefistub detection 5 | 6 | --- 7 | mkinitcpio | 3 ++- 8 | 1 file changed, 2 insertions(+), 1 deletion(-) 9 | 10 | diff --git a/mkinitcpio b/mkinitcpio 11 | index a3de5ce..f7b3014 100755 12 | --- a/mkinitcpio 13 | +++ b/mkinitcpio 14 | @@ -279,7 +279,8 @@ build_uefi(){ 15 | break 16 | fi 17 | done 18 | - elif [[ ! -f "$uefistub" ]]; then 19 | + fi 20 | + if [[ ! -f "$uefistub" ]]; then 21 | error "UEFI stub '%s' not found" "$uefistub" 22 | return 1 23 | fi 24 | -- 25 | 2.37.0.rc0.15.g3b9a5a33c2 26 | 27 | -------------------------------------------------------------------------------- /depends/mkinitcpio-lucjan/0025-Fix-the-warning-about-missing-modules.builtin.modinf.patch: -------------------------------------------------------------------------------- 1 | From 81ad1a5409cfec4f9a28e8f1287750d9718e6186 Mon Sep 17 00:00:00 2001 2 | From: Piotr Gorski 3 | Date: Tue, 5 Jul 2022 08:56:11 +0200 4 | Subject: [PATCH 25/27] Fix the warning about missing modules.builtin.modinfo 5 | 6 | > depmod: WARNING: could not open modules.builtin.modinfo at /tmp/mkinitcpio.EftMSK/root/lib/modules/5.15.52-1-lts: No such file or directory 7 | 8 | kmod wants modules.builtin.modinfo since v30 [1]. 9 | 10 | Also adds modules.order as suggested by heftig. That file is used (if 11 | exists) since the first commit of depmod. 12 | 13 | [1] https://git.kernel.org/pub/scm/utils/kernel/kmod/kmod.git/commit/?id=0246e06340df292b5dda4bc00e24cc9ae894e881 14 | 15 | Signed-off-by: Piotr Gorski 16 | --- 17 | functions | 3 +-- 18 | 1 file changed, 1 insertion(+), 2 deletions(-) 19 | 20 | diff --git a/functions b/functions 21 | index f6f67ee..2d34909 100644 22 | --- a/functions 23 | +++ b/functions 24 | @@ -897,8 +897,7 @@ install_modules() { 25 | (( ${#zst_comp[*]} )) && zstd -d --rm -q "${zst_comp[@]}" 26 | 27 | msg "Generating module dependencies" 28 | - install -m644 -t "$moduledest" "$_d_kmoduledir"/modules.builtin 29 | - install -m644 -t "$moduledest" "$_d_kmoduledir"/modules.order 30 | + install -m644 -t "$moduledest" "$_d_kmoduledir"/modules.{builtin,builtin.modinfo,order} 31 | depmod -b "$BUILDROOT" "$KERNELVERSION" 32 | 33 | # remove all non-binary module.* files (except devname for on-demand module loading) 34 | -- 35 | 2.37.0.rc0.15.g3b9a5a33c2 36 | 37 | -------------------------------------------------------------------------------- /depends/mkinitcpio-lucjan/0026-Expand-as-it-fails-when-extglob-is-not-set.patch: -------------------------------------------------------------------------------- 1 | From 187bce0838c77c65462d1a56a7c11bfafd0a091e Mon Sep 17 00:00:00 2001 2 | From: =?UTF-8?q?=D0=A1=D1=82=D1=80=D0=B0=D1=85=D0=B8=D1=9A=D0=B0=20=D0=A0?= 3 | =?UTF-8?q?=D0=B0=D0=B4=D0=B8=D1=9B?= 4 | Date: Fri, 22 Apr 2022 18:36:33 +0200 5 | Subject: [PATCH 26/27] Expand @() as it fails when extglob is not set 6 | MIME-Version: 1.0 7 | Content-Type: text/plain; charset=UTF-8 8 | Content-Transfer-Encoding: 8bit 9 | 10 | Signed-off-by: Страхиња Радић 11 | --- 12 | functions | 2 +- 13 | 1 file changed, 1 insertion(+), 1 deletion(-) 14 | 15 | diff --git a/functions b/functions 16 | index 2d34909..09f7ca6 100644 17 | --- a/functions 18 | +++ b/functions 19 | @@ -698,7 +698,7 @@ add_udev_rule() { 20 | for pair in "${rule[@]}"; do 21 | IFS=' =' read -r key value <<< "$pair" 22 | case $key in 23 | - RUN@({program}|+)|IMPORT{program}|ENV{REMOVE_CMD}) 24 | + RUN{program}|RUN+|IMPORT{program}|ENV{REMOVE_CMD}) 25 | # strip quotes 26 | binary=${value//[\"\']/} 27 | # just take the first word as the binary name 28 | -- 29 | 2.37.0.rc0.15.g3b9a5a33c2 30 | 31 | -------------------------------------------------------------------------------- /depends/mkinitcpio-lucjan/0027-autodetect-does-not-work-for-overlay-fs-set-autodete.patch: -------------------------------------------------------------------------------- 1 | From 2ea8fe2261a15f680dcdaf4511445264aee11757 Mon Sep 17 00:00:00 2001 2 | From: Simon Brand 3 | Date: Mon, 30 May 2022 12:35:14 +0000 4 | Subject: [PATCH 27/27] autodetect does not work for overlay fs, set autodetect 5 | to failed 6 | 7 | --- 8 | install/autodetect | 7 ++++++- 9 | 1 file changed, 6 insertions(+), 1 deletion(-) 10 | 11 | diff --git a/install/autodetect b/install/autodetect 12 | index 846aa3a..6a576a6 100644 13 | --- a/install/autodetect 14 | +++ b/install/autodetect 15 | @@ -31,7 +31,12 @@ build() { 16 | 17 | # detect filesystem for root 18 | if rootfstype=$(findmnt -uno fstype -T '/'); then 19 | - add_if_avail "$rootfstype" 20 | + if [ "${rootfstype}" = "overlay" ]; then 21 | + warning "cannot detect type of overlayfs root filesystem" 22 | + fs_autodetect_failed=1 23 | + else 24 | + add_if_avail "$rootfstype" 25 | + fi 26 | else 27 | error "failed to detect root filesystem" 28 | fs_autodetect_failed=1 29 | -- 30 | 2.37.0.rc0.15.g3b9a5a33c2 31 | 32 | -------------------------------------------------------------------------------- /depends/mkinitcpio-lucjan/PKGBUILD: -------------------------------------------------------------------------------- 1 | # Maintainer: Piotr Gorski 2 | # Maintainer: Giancarlo Razzolini 3 | # Maintainer: Dave Reisner 4 | # Maintainer: Thomas Bächler 5 | 6 | pkgname=mkinitcpio-lucjan 7 | _pkgname=mkinitcpio 8 | pkgver=31 9 | pkgrel=13 10 | pkgdesc="Modular initramfs image creation utility" 11 | arch=('any') 12 | url='https://github.com/archlinux/mkinitcpio' 13 | license=('GPL') 14 | depends=('awk' 'mkinitcpio-busybox>=1.19.4-2' 'kmod' 'util-linux>=2.23' 'libarchive' 'coreutils' 15 | 'bash' 'binutils' 'diffutils' 'findutils' 'grep' 'filesystem>=2011.10-1' 'zstd' 'systemd') 16 | makedepends=('asciidoc') 17 | optdepends=('gzip: Use gzip compression for the initramfs image' 18 | 'xz: Use lzma or xz compression for the initramfs image' 19 | 'bzip2: Use bzip2 compression for the initramfs image' 20 | 'lzop: Use lzo compression for the initramfs image' 21 | 'lz4: Use lz4 compression for the initramfs image' 22 | 'mkinitcpio-nfs-utils: Support for root filesystem on NFS') 23 | replaces=('mkinitcpio-zstd') 24 | provides=('initramfs' 'initramfs-lucjan' 'initramfs-zstd' "mkinitcpio=$pkgver") 25 | conflicts=('mkinitcpio') 26 | backup=('etc/mkinitcpio.conf') 27 | source=("https://sources.archlinux.org/other/$_pkgname/$_pkgname-$pkgver.tar.gz"{,.sig} 28 | '0001-Merge-mkinitcpio-libalpm-scripts-into-one.patch' 29 | '0002-functions-allow-tailing-for-custom-kernel-build-upon.patch' 30 | '0003-Fix-ability-to-manually-specify-uefistub.patch' 31 | '0004-Add-support-for-post-generation-hooks.patch' 32 | '0005-Allow-overriding-hooks.patch' 33 | '0006-mkinitcpio-add-VERSION_ID-to-EFISTUB.patch' 34 | '0007-functions-no-progress-for-zstd-decompression.patch' 35 | '0008-mkinitcpio-Support-etc-kernel-cmdline.d.patch' 36 | '0009-presets-when-using-_efi_image-make-_image-optional.patch' 37 | '0010-Revert-functions-no-progress-for-zstd-decompression.patch' 38 | '0011-add-zst-compressed-firmware-support-fpr-future-kerne.patch' 39 | '0012-add-real-symlink-support.patch' 40 | '0013-add-real-symlink-support.patch' 41 | '0014-add-MODULES_DECOMPRESS-switch.patch' 42 | '0015-fix-reproducibility-in-case-of-var-cache-is-included.patch' 43 | '0016-Good-idea-add-the-default-value.patch' 44 | '0017-mkinitcpio-improve-MODULES_DECOMPRESS.patch' 45 | '0018-Replace-check-with-rm-f.patch' 46 | '0019-Fix-typo-in-commit-reproducibility.patch' 47 | '0020-mkinitcpio-preserve-module-dir-by-the-kernel-remove-.patch' 48 | '0021-Typo-correction.patch' 49 | '0022-Revert-presets-when-using-_efi_image-make-_image-opt.patch' 50 | '0023-preset-Change-unified-image-generation-options.patch' 51 | '0024-fixed-missing-uefistub-detection.patch' 52 | '0025-Fix-the-warning-about-missing-modules.builtin.modinf.patch' 53 | '0026-Expand-as-it-fails-when-extglob-is-not-set.patch' 54 | '0027-autodetect-does-not-work-for-overlay-fs-set-autodete.patch') 55 | install=mkinitcpio.install 56 | sha512sums=('4ef87c2e4f579b292c38f9c487e78b3b99f6db77909cab322e860e5ca70aca3747fcfc272e2e15c9a3605c924ab178057b8b23151f98debc5d96e65f3c0c49d5' 57 | 'SKIP' 58 | '6b4a903726a45a4a8a1e5106c62e5b5d69b077b3260eb413735b5f8be0c56d777a6e9e4b24770617720c73aa3c6420c080700fbc8fb44ec60705dcd7dd1218cb' 59 | 'ab9702c2beabdc6a4e20e516f68b5c18e67470d8ed9d17baa4272db72e4d7dcb7b7de8e632e4c266fc2b12bdecfdc9ad811340da96aa9f25c337984859f84743' 60 | 'a37e792661a47c175f82f42fbb1bacb4b3d0408aec64589131d08985a97f1f5f4ecb73f6186cfcb36cdc716c1ca8189114e4939bc6904adb6ac678a5f7721735' 61 | '03f351072ffd62181734f3ed9851fb773f0db91cdb9f04fbbcdcf7f7293794752609fe978f0a306f8f58e055823ec87a907ec972459d5359d9475b7158846f21' 62 | 'a88d3076585be5b5e0ca1f8958ffe710d4d0e8c7571c703eeaf3b445c88dcdd9cbac6016956f8946b851c0a6faa2a7bbacc642f77e75f60af64032ce818a0039' 63 | 'b1617310a9ce4d185be70d222c19b9bcb55e90692988ea6821e83a9db7567151b1bb60dc18a76a6e9cb817b0f50b9a45132a11a0f214a50e9e81ef8eb32fc0bc' 64 | '881a4e608b94ff348e0e6b3de4712fc769215751c8a8018b9ea9f1f197676f5f2e2608b248f10ca71d0fbd45f21892a2773745af40344fc1791bf535b554c0f1' 65 | '58d4ade0998e7266be136e9dd9b2bad720619bf1576353044f3efefd6cd69389a2829cc2d46747974deaeaf98317fccc32927d34de8ef42873e9f7e528e5c8de' 66 | 'ba7a4e463dfb7ea950418b4f6173aec1885cb56567dfd26bd27a675041666d93a223d1ca2ebeaad5460f6b74318c184ee72065733ce6e4727caf3b23a9f5b966' 67 | 'e1b747d074aac449d0e6164a8f47b823da7e8e987194ea8696fb82e51d2559ec043d1a25aa0b5423bf3e5e4c42e2c95e0bbc3bc9ba295891621ef7158086ce77' 68 | '491fcc33a1d2cabf77f4fd475633efc8bccf86f7b294330086c3436575e19163b30525bdf7e1251581ade6548b8380f91b89be30c0fe57a68e3b7f696c7a4a34' 69 | '865cee91aeeb0fd4da02d706f1371968701e703837901d4ef85ce76bb1242c84d3ae4c3fc32e6516798de87f70c97427dfac8896f7cfbccaa852366f215f89eb' 70 | 'e00d6a169643f7dd1a5365069dfba7186890d65ddcf408fa2f1a4e8a7d8c964b08f608d1f0730d4bd4bf4f0b0fd29e3a14c563d4202ee324a139e61d54fb2722' 71 | '470492afe84efece7e1779bebd6e999f667c3663ccdb6141ce2d136cda048b34cdc0a48dae84e69befc527035221ff3a0afd7db1a6b8c7a4ee9fa79d6e239356' 72 | 'ad909a0d2d0d579a79481acb9685b2736da0858859e17318966e230f74090bc0c61b75e266070c13a0c4bf5ed480e718f8374298f73995baf181b9309227261b' 73 | '569f9174830b379deae16fac49a2cc8db11cea6a5cb763bf9b6cb803247fabd7e2ee6b767fd886a0b19718dbc0c828e9385de76a213e50945de1e13d2ab3cd99' 74 | '14237ce6b8346d3b404431b6e34ead973274e7b738ac227da10f8a2d101faa2c1c3be066eb3fd5f496971e503f1ab77115770d60a21d71b97ae0092993784784' 75 | 'bd8c32e32dc03f3c7246c932979a99c6ea6084494cf902835178086505430449dc382a872a2a13994e7efc8e7c220b0fed2e9a7a369b1e513da0da0385294828' 76 | '63e6d131c563349ff466723259d9b0ca7af3e24abc2310f4924ac67356c903e63dfb2ef424ac111c751da1e922a42349672271d195e03ec82a72a31a344b28e2' 77 | '4d8c0bc3949b05a520c86d4ab5b6dd59de9ba9c9f3030064983b23cc1f6a833ee25e40235537133c3086cc38a82f195461a356f5a25f297d15fa1d8deb660cba' 78 | '9af4a956313aa4dd907454c916a8f718691b591dbd63bec3bcbb42e05d877c281464bc2cc86daac196c0333c1d548360cac09347cb9317dcca2a1098a769c8a7' 79 | '89a41b9ff1593e9c428c03dfa0b52f8f9ccc7e2f49f953c95c8c8d865f58d03596cf1ed4a84898b0f68e24d36dde6f39075036f947c69d36ef0750eede4d1d59' 80 | '053bb8430208895707f95d763351cfe1a02edb888204478e28f3635b9ecabb2c1a04de4f53e99928c52de4f718459e784029e6301692c7c7a732325a290f9558' 81 | 'e16ada4cfdd4b39d09450e239a84e7fc322c930246b4ba5979db12824ce0c4ae5c8da19b25596b893570e47be5c7cd3173de8a8230db774365b76d7c9aed453f' 82 | '18f4e1735734b75b37b0220e15073fd29ab35edd5ed9640e07aa4d4bb84402b641126bbc992bf9b6eb5b8010102939ce7bb06ef5df343665080cdac799677ffc' 83 | '871b08ed18d099ccababebdb9b127eb4f8e03d55aea284e87dcf35a9eb7a9f90a1b40abfb1e54e51264be9172c323d8a92efb41b23c935862a85dbbc209bfc76' 84 | 'f267b10f5c2d08e02d8d4dcd75f50f5ce46b8aed3eed898b97eb3c3b12db63656ea03eb9993b28c125bb1e200f1b8c7e77f93ef0813b0b35b60cfcba5482cbc0') 85 | b2sums=('0113e288906e3b5fa485c29c00e7df60d85addd96718c45531031a686f18c739fa18303b6cac374d35b85edb7b663e221c8dc9158dff08c75858a4ed4dd154bf' 86 | 'SKIP' 87 | '872d043d963dfe69abb71f14cdd8d3adff222d53606ea07bedaf87e104fa23ee636daa914ae64e140b8fbc216d06d56c50b32afe22a36ca71d02e32c01f659b3' 88 | '425e64a8810d57d2d82efdef54e964828a2ab3f1142c73db37e21e0365b0a9d4a520d9f4a54baf1f9870c6b62afa20070125da90d0e91bbcaf6b55331538ab88' 89 | '8e4a79c0bc242b3145c90dadc03ff65a041b264f8c47495f36735df6bceb53239c08906f6e5d9b779b65c75d0bb9dca5e90c9ac4d5dab32c41a9208218936e92' 90 | '91af56014ae8b57a9bfd5c7fee09a49682449a47bda64b98ae33d64cb166a15bbbea351e35e1407fdd71351c9d26d504d57f5519f7b0f1c0488ada142d5d784b' 91 | '55cf714d122b11ce57c8a0a7fc5977199bb9b88cb465e6482b590929a29a709354b015dff15422bf3d37d0931a75d88578543613a6e5bb9fc76ccdb29d313de0' 92 | '2b6367d8b16ba499fefeb791fa9cf732877e029433933930977bdf69afe6696a187bc8ddbcc4627e793e7f66cc2f38c7b68ee1954a7e004380df1c78b7a1c25f' 93 | 'a823fbba187281e348928a98e932848119382a5081e810d9c4350ab5d7cd68cc8cf3e52259e9ee5a8445aa0e47285de894fd23d88f4448c64e370681011d5063' 94 | 'b29894f394ed9c70028581aa1e5469bbd131af646ed33ab8ce2a80859e83a13cb06d0dad4018a2e75914ec5b2c552dadbed3a43f28f18caf5e562686939a8cbb' 95 | '164c969693fba5f97e4a4a3e5da20048a2121a663d0b9a7fb889e3d1c924bbb83aef858f6395f91e724c8c0df6428ceb96cf69c1e051f87acb101beaf98f07e3' 96 | '6440220ce74f34bcc98c01d3586cfab997002b672302b0d48192d3b102c757418cedf086da3535a0062de18e727bbcf6050470f9a9350d7e9c84eaaa00a39690' 97 | 'b9f88fcd32f84f559c462d12215b7d00f09a1d067adf07336df2db8b8e89c0c837a768a63a9b20923b279f4d3292f88b11a117a26cbc45019b48167e313f1b5d' 98 | '5b597fc0ea63cb5285abea9c4bc7637e711efb5655cc5a77122f9c18d536b5bc34bc78876c73087dd0de16d9ac8b3ddcc47a8083b245bbcc4a6bc40d7d9c0aa3' 99 | '51acc62f00abc4500e32d0591d5e934445f8e89ce6c3816aff880b94bc1d3be1c431ae90c477e375307be9811c38f1bfda86296e96859251ab07acf446648858' 100 | '03dfb78b6e05c43355b45e733ed084bf3f1ceb34032c0337c6c2f313319197f44245e7e12ff223094d959024b7ce2e3a52e96b6f879e426a90c94836cd661367' 101 | '4bf38bb576a4e5719df2c72ef300acd9ab68a59c1da0602d502292c6275a5da4b23343c00906bdd0124d785bed3777a5b482e21b4249f737a33e5d909fa18e0b' 102 | '1f419c9d7f3974b3900c4c281db123c037349fc1b79c63f9666b734c4ca781b7d0851ba367d1557fecc499bfcaf6e15b484cb503c5f7253973b9d849c8d55575' 103 | 'a0c0ffaf04fa4ccb8611144bdb3daa866ec5355b91095e2b5a4f0d84a67f1d0fd57861385fc8e11f1b61287ba80317b8850510bf7ff416608ef2446560ea3dd1' 104 | '29d688568c476ea3844bb195b5d0b0f06d0907a0a5a3be25387f45b1148ad378e34dc71cca1ba39a8bf91ec2b2ac8b60eccfc0f56e07948201d2db65a503d42b' 105 | '45d539b5f11306b2068337ff25994d85cbcaa7b4ef6eec9c6f034197ebe230c5efc0bcfbf27a5938eec80d45f2dad9f6c41614f4194b7a81e1d321c9555c807f' 106 | 'bed2649b3a76f8dfa40a65675a1752b8cea178abb87506909e42f9ed2042e211b935f3efdb955fa119d6c73d4dc7704f38cc2a86d7646bcb36253636bf54d210' 107 | '425b32afbe91162acf9ed0cbe50578827d4ec2de7e34e61c3a2fed2cb48e459faad1d6d973d477166104e63b4a3deaa9cbda838d59ec43b84ad57a17792a28e9' 108 | 'a57b823600f178dbaff39ca956dbcff26ca207029a0c33e09c3ed672d0cba5d9b8ee6b108de5cda453ef3221beaab21408df5d12aeb301be204aede539126622' 109 | 'd9b4dfa8533a39e9a0c588d23dbca436af6211a0c0956c508b6c06a53e4dd666be3299f261ed2907a479cd5802e12b17a51fd14978951a6162e322927f3595f6' 110 | 'd5c44cd70537db3decbae2fe8710ec928847c88534da602938caf65d71c223f0687b4d427a6da94d5b32f029cf5fb3705c48c97b7d69cf51ba3e5b0a406761ba' 111 | '671a2ab5a0b7a239819ab21c434d5f345f0a5a26457088d3bbedecbb11ddb61b37e66030b8f2d80a6886d10ce5df4e8270800242f7070cd46009ae7bf8294792' 112 | 'fb1d0825f18f485d16f9c83e7f1b38cbbcfce29e81bedffbebf7c9262d614be59b51514541585ae7479161fb2bf9f7b49d07f26448cc2bf650ef4eb7fe95db26' 113 | '8e2e6d3c90375b131c3b117ae440dcad575286d8e11c9b421fe5fff5f2a66677bdebd5604119ebabc675c1f6134e2ab10521e349ac53e8b40de86bff4e6c7a8f') 114 | validpgpkeys=('ECCAC84C1BA08A6CC8E63FBBF22FB1D78A77AEAB') # Giancarlo Razzolini 115 | 116 | prepare() { 117 | cd $_pkgname-$pkgver 118 | 119 | local src 120 | for src in "${source[@]}"; do 121 | src="${src%%::*}" 122 | src="${src##*/}" 123 | [[ $src = *.patch ]] || continue 124 | echo "Applying patch $src..." 125 | patch -Np1 < "../$src" 126 | done 127 | } 128 | 129 | check() { 130 | make -C "$_pkgname-$pkgver" check 131 | } 132 | 133 | package() { 134 | make -C "$_pkgname-$pkgver" DESTDIR="$pkgdir" install 135 | } 136 | -------------------------------------------------------------------------------- /depends/mkinitcpio-lucjan/mkinitcpio.install: -------------------------------------------------------------------------------- 1 | #!/bin/sh 2 | 3 | post_upgrade() { 4 | if [ "$(vercmp 0.9.0 "$2")" -eq 1 ]; then 5 | printf '==> If your /usr is on a separate partition, you must add the "usr" hook\n' 6 | printf ' to /etc/mkinitcpio.conf and regenerate your images before rebooting\n' 7 | fi 8 | 9 | if [ "$(vercmp 0.12.0 "$2")" -eq 1 ]; then 10 | printf '==> The "block" hook has replaced several hooks:\n' 11 | printf ' fw, sata, pata, scsi, virtio, mmc, usb\n' 12 | printf ' Replace any and all of these in /etc/mkinitcpio.conf with a single\n' 13 | printf ' instance of the "block" hook\n' 14 | fi 15 | } 16 | -------------------------------------------------------------------------------- /depends/uksmd-git/.SRCINFO: -------------------------------------------------------------------------------- 1 | # Generated by makepkg 6.0.1 2 | # Mon Jul 18 20:19:19 UTC 2022 3 | pkgbase = uksmd-git 4 | pkgdesc = Userspace KSM helper daemon 5 | pkgver = 0.0.0.r37.gf10f38e 6 | pkgrel = 3 7 | epoch = 1 8 | url = https://codeberg.org/pf-kernel/uksmd 9 | arch = x86_64 10 | license = GPL3 11 | makedepends = meson 12 | makedepends = git 13 | depends = UKSMD-BUILTIN 14 | depends = procps-ng 15 | depends = libcap-ng 16 | provides = uksmd=0.0.0.r37.gf10f38e 17 | conflicts = uksmd 18 | source = git+https://codeberg.org/pf-kernel/uksmd 19 | source = uksmdstats 20 | sha256sums = SKIP 21 | sha256sums = 0b09cbca4e1a4ceb68f678991f42290ed6fe4efe4f06a331a71d868df8b9f8a7 22 | 23 | pkgname = uksmd-git 24 | -------------------------------------------------------------------------------- /depends/uksmd-git/PKGBUILD: -------------------------------------------------------------------------------- 1 | # Maintainer: Piotr Górski 2 | # Contributor: Oleksandr Natalenko 3 | # Contributor: Damian N. 4 | 5 | pkgname=uksmd-git 6 | _pkgname=uksmd 7 | pkgver=0.0.0.r37.gf10f38e 8 | pkgrel=3 9 | epoch=1 10 | pkgdesc="Userspace KSM helper daemon" 11 | url="https://codeberg.org/pf-kernel/uksmd" 12 | license=(GPL3) 13 | arch=(x86_64) 14 | depends=('UKSMD-BUILTIN' 'procps-ng' 'libcap-ng') 15 | makedepends=('meson' 'git') 16 | conflicts=('uksmd') 17 | provides=("uksmd=${pkgver}") 18 | source=('git+https://codeberg.org/pf-kernel/uksmd' 19 | 'uksmdstats') 20 | sha256sums=('SKIP' 21 | '0b09cbca4e1a4ceb68f678991f42290ed6fe4efe4f06a331a71d868df8b9f8a7') 22 | 23 | pkgver() { 24 | cd $_pkgname 25 | _ver="$(cat meson.build | grep -o "[[:digit:]]*" | paste -sd'.')" 26 | printf "${_ver}.r$(git rev-list --count HEAD).g$(git rev-parse --short HEAD)" 27 | } 28 | 29 | prepare() { 30 | cd $_pkgname 31 | 32 | local src 33 | for src in "${source[@]}"; do 34 | src="${src%%::*}" 35 | src="${src##*/}" 36 | [[ $src = *.patch ]] || continue 37 | echo "Applying patch $src..." 38 | patch -Np1 < "../$src" 39 | done 40 | } 41 | 42 | build() { 43 | cd $_pkgname 44 | arch-meson . build 45 | meson compile -C build 46 | } 47 | 48 | package() { 49 | cd $_pkgname 50 | meson install -C build --destdir "${pkgdir}" 51 | install -Dm 755 ${srcdir}/uksmdstats "${pkgdir}"/usr/bin/uksmdstats 52 | install -Dm 644 "COPYING" "${pkgdir}/usr/share/licenses/${_pkgname}/LICENSE" 53 | } 54 | -------------------------------------------------------------------------------- /depends/uksmd-git/uksmdstats: -------------------------------------------------------------------------------- 1 | #!/bin/sh 2 | if [ -f /sys/kernel/pmadv/ksm ]; then 3 | echo -e "======================================================" 4 | echo -e "uksmd with uksmdstats support. Powered by CachyOS Team" 5 | echo -e "======================================================" 6 | echo -e "Full scans:\t\t$(cat /sys/kernel/mm/ksm/full_scans)" 7 | echo -e "Max page sharing:\t$(cat /sys/kernel/mm/ksm/max_page_sharing)" 8 | echo -e "Pages to scan:\t\t$(cat /sys/kernel/mm/ksm/pages_to_scan)\n" 9 | echo -e "Pages shared:\t\t$(awk '{ print($0 / 256) }' /sys/kernel/mm/ksm/pages_shared)" 10 | echo -e "Pages unshared:\t\t$(awk '{ print($0 / 256) }' /sys/kernel/mm/ksm/pages_unshared)" 11 | echo -e "Pages sharing:\t\t$(awk '{ print($0 / 256) }' /sys/kernel/mm/ksm/pages_sharing)" 12 | else 13 | echo -e "The kernel you are using does not support UKSMD." 14 | fi 15 | -------------------------------------------------------------------------------- /lucjan-kernels-rolling/linux-lucjan-git/.SRCINFO: -------------------------------------------------------------------------------- 1 | # Generated by makepkg 6.0.1 2 | # Tue Jul 19 16:35:25 UTC 2022 3 | pkgbase = linux-lucjan-git 4 | pkgdesc = Linux LL 5 | pkgver = 5.18.11.r35442.gf5026b3735c9.ll131 6 | pkgrel = 1 7 | url = https://gitlab.com/sirlucjan/lucjan-kernels/wikis/README 8 | arch = x86_64 9 | license = GPL2 10 | makedepends = bc 11 | makedepends = libelf 12 | makedepends = cpio 13 | makedepends = perl 14 | makedepends = tar 15 | makedepends = xz 16 | makedepends = git 17 | options = !strip 18 | source = git://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git#branch=linux-rolling-stable 19 | source = https://gitlab.com/sirlucjan/linux-lucjan/raw/master/current/5.18-lucjan-ll131.patch 20 | source = https://gitlab.com/sirlucjan/linux-lucjan/raw/master/current/5.18-lucjan-ll131.patch.sig 21 | source = config 22 | validpgpkeys = 399521CE9D6D65B35EEF0F8C79AFA05ABDB26C5A 23 | sha512sums = SKIP 24 | sha512sums = d2281a7537c9568675e9291d879dfba678c742bad5555f31e858af7852ecbd9c745c6b3f1da137307914b3b98147d81c65846079557f6b817bc4e144ddc83b9c 25 | sha512sums = SKIP 26 | sha512sums = 4b02e9770860e61bf16ebb18b486672b1db8c0b433e398eb471a2fd4b03351547e58987c15e124f08ddf31986bc6392925ba3ebbad9d2d7c174b109fd1e47843 27 | 28 | pkgname = linux-lucjan-git-kernel 29 | pkgdesc = The Linux LL kernel and modules with the lucjan-ll131 patchset. Sixth Gen Intel Core i3/i5/i7 optimized. 30 | groups = linux-lucjan-git 31 | depends = coreutils 32 | depends = kmod 33 | depends = initramfs-lucjan 34 | optdepends = wireless-regdb: to set the correct wireless channels of your country 35 | optdepends = linux-firmware: firmware images needed for some devices 36 | optdepends = modprobed-db: Keeps track of EVERY kernel module that has ever been probed - useful for those of us who make localmodconfig 37 | optdepends = uksmd: Userspace KSM helper daemon 38 | provides = VIRTUALBOX-GUEST-MODULES 39 | provides = WIREGUARD-MODULE 40 | provides = UKSMD-BUILTIN 41 | 42 | pkgname = linux-lucjan-git-headers 43 | pkgdesc = Headers and scripts for building modules for the Linux LL kernel. Sixth Gen Intel Core i3/i5/i7 optimized. 44 | groups = linux-lucjan-git 45 | depends = linux-lucjan-git-kernel 46 | depends = pahole 47 | -------------------------------------------------------------------------------- /lucjan-kernels-rolling/linux-lucjan-git/PKGBUILD: -------------------------------------------------------------------------------- 1 | # Maintainer: Piotr Gorski 2 | # Contributor: Jan Alexander Steffens (heftig) 3 | # Contributor: Tobias Powalowski 4 | # Contributor: Thomas Baechler 5 | 6 | ### BUILD OPTIONS 7 | # Set these variables to ANYTHING that is not null to enable them 8 | 9 | ### Tweak kernel options prior to a build via nconfig 10 | _makenconfig= 11 | 12 | ### Tweak kernel options prior to a build via menuconfig 13 | _makemenuconfig= 14 | 15 | ### Tweak kernel options prior to a build via xconfig 16 | _makexconfig= 17 | 18 | ### Tweak kernel options prior to a build via gconfig 19 | _makegconfig= 20 | 21 | # NUMA is optimized for multi-socket motherboards. 22 | # A single multi-core CPU actually runs slower with NUMA enabled. 23 | # See, https://bugs.archlinux.org/task/31187 24 | _NUMAdisable=y 25 | 26 | # Compile ONLY used modules to VASTLYreduce the number of modules built 27 | # and the build time. 28 | # 29 | # To keep track of which modules are needed for your specific system/hardware, 30 | # give module_db script a try: https://aur.archlinux.org/packages/modprobed-db 31 | # This PKGBUILD read the database kept if it exists 32 | # 33 | # More at this wiki page ---> https://wiki.archlinux.org/index.php/Modprobed-db 34 | _localmodcfg= 35 | 36 | # Use the current kernel's .config file 37 | # Enabling this option will use the .config of the RUNNING kernel rather than 38 | # the ARCH defaults. Useful when the package gets updated and you already went 39 | # through the trouble of customizing your config options. NOT recommended when 40 | # a new kernel is released, but again, convenient for package bumps. 41 | _use_current= 42 | 43 | ### Selecting linux-lucjan branding 44 | # ATTENTION - one of two predefined values should be selected! 45 | # 'yes' - enable linux-lucjan branding 46 | # 'no' - disable linux-lucjan branding 47 | _ll_branding='yes' 48 | 49 | ### Setting GCC/Clang flags for your processor 50 | # To see which option to select, run the command: 51 | # gcc -c -Q -march=native --help=target | grep march 52 | # You can find the full list below: 53 | # https://github.com/graysky2/kernel_compiler_patch#expanded-cpus-include 54 | _compiler_tune=y 55 | 56 | ### Set performance governor as default 57 | _per_gov=y 58 | 59 | ### Disable MQ-Deadline I/O scheduler 60 | _mq_deadline_disable=y 61 | 62 | ### Disable Kyber I/O scheduler 63 | _kyber_disable=y 64 | 65 | ### Selecting the CPU scheduler 66 | # ATTENTION - one of three predefined values should be selected! 67 | # 'bmq' - select 'BitMap Queue CPU scheduler' 68 | # 'pds' - select 'Priority and Deadline based Skip list multiple queue CPU scheduler' 69 | # 'none' - select 'Completely Fair Scheduler' 70 | _cpusched='pds' 71 | 72 | ### Enable KBUILD_CFLAGS -O3 73 | _cc_harder=y 74 | 75 | ### Running with a 1000 HZ tick rate 76 | _1k_HZ_ticks=y 77 | 78 | ### Enable protect mappings under memory pressure 79 | _mm_protect=y 80 | 81 | ### Enable multigenerational LRU 82 | # ATTENTION - one of three predefined values should be selected! 83 | # 'standard' - enable multigenerational LRU 84 | # 'stats' - enable multigenerational LRU with stats 85 | # 'none' - disable multigenerational LRU 86 | _lru_config='standard' 87 | 88 | ### Enable Linux Random Number Generator 89 | _lrng_enable=y 90 | 91 | ### Enable TCP_CONG_BBR2 92 | _tcp_bbr2=y 93 | 94 | ### Enable FULLCONENAT 95 | _nf_cone=y 96 | 97 | ### Enable RTW88 98 | _rtw88= 99 | 100 | ### Enable SPECULATIVE_PAGE_FAULT 101 | # ATTENTION - one of two predefined values should be selected! 102 | # 'standard' - enable SPECULATIVE_PAGE_FAULT 103 | # 'stats' - enable support SPECULATIVE_PAGE_FAULT with stats 104 | _spf_config='standard' 105 | 106 | ### Selecting the ZSTD kernel and modules compression level 107 | # ATTENTION - one of two predefined values should be selected! 108 | # 'ultra' - highest compression ratio 109 | # 'normal' - standard compression ratio 110 | # WARNING: the ultra settings can sometimes 111 | # be counterproductive in both size and speed. 112 | _zstd_level_value='ultra' 113 | 114 | # Enable zram/zswap ZSTD compression 115 | _zstd_swap_compression=y 116 | 117 | # Disable DEBUG to lower the size of the kernel 118 | _disable_debug=y 119 | 120 | ### Download ll-reverts patchset 121 | # ATTENTION - one of two predefined values should be selected! 122 | # 'stable' - stable releases (recommended) 123 | # 'unstable' - rc releases (active only temporarily) 124 | _ll_rev='stable' 125 | 126 | ### Download linux-lucjan patchset 127 | # ATTENTION - one of four predefined values should be selected! 128 | # 'current' - stable releases (recommended) 129 | # 'pending' - resync stable releases (active only temporarily) 130 | # 'testing' - rc releases (active only temporarily) 131 | # 'trunk' - pre-rc releases (active only temporarily) 132 | _linux_lucjan='current' 133 | 134 | ### Do not edit below this line unless you know what you're doing 135 | 136 | pkgbase=linux-lucjan-git 137 | _pkgbase=linux-lucjan 138 | # pkgname=('linux-lucjan-git-kernel' 'linux-lucjan-git-headers') 139 | _major=5.18 140 | _patches=${_major}-dev 141 | _srcname=linux 142 | pkgver=5.18.11.r35442.gf5026b3735c9.ll131 143 | pkgrel=1 144 | pkgdesc='Linux LL' 145 | arch=('x86_64') 146 | url="https://gitlab.com/sirlucjan/lucjan-kernels/wikis/README" 147 | license=('GPL2') 148 | options=('!strip') 149 | makedepends=('bc' 'libelf' 'cpio' 'perl' 'tar' 'xz' 'git') 150 | if [ -z "$_disable_debug" ]; then 151 | makedepends+=('pahole') 152 | fi 153 | 154 | ### LL reverts 155 | # Some patches for BFQ/block-stable conflict with 156 | # patches for BFQ-dev/block-mainline. 157 | # To use linux-lucjan smoothly do not change 158 | # the settings below. Otherwise kernel 159 | # will not compile. 160 | 161 | if [ "$_ll_rev" = "stable" ]; then 162 | 163 | # _llrevpath="https://raw.githubusercontent.com/sirlucjan/kernel-patches/master/${_patches}/ll-reverts/stable" 164 | _llrevpath="https://gitlab.com/sirlucjan/kernel-patches/raw/master/${_patches}/ll-reverts/stable" 165 | _llrevname='ll-reverts' 166 | _llrevver='ver1' 167 | _llrevpatch="${_major}-${_llrevname}-${_llrevver}.patch" 168 | 169 | elif [ "$_ll_rev" = "unstable" ]; then 170 | 171 | # _llrevpath="https://raw.githubusercontent.com/sirlucjan/kernel-patches/master/${_patches}/ll-reverts/unstable" 172 | _llrevpath="https://gitlab.com/sirlucjan/kernel-patches/raw/master/${_patches}/ll-reverts/unstable" 173 | _llrevname='ll-reverts' 174 | _llrevver='ver1' 175 | _llrevrc='rc1' 176 | _llrevpatch="${_major}-${_llrevname}-${_llrevver}-${_llrevrc}.patch" 177 | 178 | fi 179 | 180 | ### linux-lucjan 181 | # If you do not use the kernel development version (stable-rc) 182 | # only the current branch will be used. Pending and testing branches 183 | # are used only in development versions (stable-rc) 184 | # and the trunk branch is used only in the first releases 185 | # of the new kernel line or contains only temporary solutions. 186 | 187 | if [ "$_linux_lucjan" = "current" ]; then 188 | 189 | # _lucjanpath="https://raw.githubusercontent.com/sirlucjan/${_pkgbase}/master/current" 190 | _lucjanpath="https://gitlab.com/sirlucjan/${_pkgbase}/raw/master/current" 191 | _lucjanname='lucjan' 192 | _lucjanrev='ll131' 193 | _lucjanpatch="${_major}-${_lucjanname}-${_lucjanrev}.patch" 194 | 195 | elif [ "$_linux_lucjan" = "pending" ]; then 196 | 197 | # _lucjanpath="https://raw.githubusercontent.com/sirlucjan/${_pkgbase}/master/pending" 198 | _lucjanpath="https://gitlab.com/sirlucjan/${_pkgbase}/raw/master/pending" 199 | _lucjanname='lucjan' 200 | _lucjanrev='ll59' 201 | _lucjanpatch="${_major}-${_lucjanname}-${_lucjanrev}.patch" 202 | 203 | elif [ "$_linux_lucjan" = "testing" ]; then 204 | 205 | # _lucjanpath="https://raw.githubusercontent.com/sirlucjan/${_pkgbase}/master/testing" 206 | _lucjanpath="https://gitlab.com/sirlucjan/${_pkgbase}/raw/master/testing" 207 | _lucjanname='lucjan' 208 | _lucjanrev='ll132' 209 | _lucjanrc='rc1' 210 | _lucjanpatch="${_major}-${_lucjanname}-${_lucjanrev}-${_lucjanrc}.patch" 211 | 212 | elif [ "$_linux_lucjan" = "trunk" ]; then 213 | 214 | # _lucjanpath="https://raw.githubusercontent.com/sirlucjan/${_pkgbase}/master/trunk" 215 | _lucjanpath="https://gitlab.com/sirlucjan/${_pkgbase}/raw/master/trunk" 216 | _lucjanname='lucjan' 217 | _lucjanrev='ll22' 218 | _lucjanrc='rc1' 219 | _lucjanpatch="${_major}-${_lucjanname}-${_lucjanrev}-${_lucjanrc}.patch" 220 | 221 | fi 222 | 223 | source=("git://git.kernel.org/pub/scm/linux/kernel/git/stable/${_srcname}.git#branch=linux-rolling-stable" 224 | # ll-reverts 225 | # "${_llrevpath}/${_llrevpatch}"{,.sig} 226 | # linux-lucjan 227 | "${_lucjanpath}/${_lucjanpatch}"{,.sig} 228 | # the main kernel config files 229 | 'config') 230 | 231 | export KBUILD_BUILD_HOST=archlinux 232 | export KBUILD_BUILD_USER=$pkgbase 233 | export KBUILD_BUILD_TIMESTAMP="$(date -Ru${SOURCE_DATE_EPOCH:+d @$SOURCE_DATE_EPOCH})" 234 | 235 | pkgver() { 236 | cd $_srcname 237 | 238 | _ver="$(git describe --long --tags | sed 's/^v//;s/\([^-]*-g\)/r\1/;s/-/./g')" 239 | printf ${_ver}.${_lucjanrev} 240 | } 241 | 242 | prepare() { 243 | cd $_srcname 244 | 245 | ### Setting version 246 | echo "Setting version..." 247 | sed -e "/^EXTRAVERSION =/s/=.*/=/" -i Makefile 248 | touch .scmversion 249 | scripts/setlocalversion --save-scmversion 250 | echo "-$pkgrel" > localversion.10-pkgrel 251 | echo "${pkgbase#linux}" > localversion.20-pkgname 252 | 253 | ### Patching sources 254 | local src 255 | for src in "${source[@]}"; do 256 | src="${src%%::*}" 257 | src="${src##*/}" 258 | [[ $src = *.patch ]] || continue 259 | echo "Applying patch $src..." 260 | patch -Np1 < "../$src" 261 | done 262 | 263 | ### Setting config 264 | echo "Setting config..." 265 | cp ../config .config 266 | 267 | ### Optionally use running kernel's config 268 | # code originally by nous; http://aur.archlinux.org/packages.php?ID=40191 269 | if [ -n "$_use_current" ]; then 270 | if [[ -s /proc/config.gz ]]; then 271 | echo "Extracting config from /proc/config.gz..." 272 | # modprobe configs 273 | zcat /proc/config.gz > ./.config 274 | else 275 | warning "Your kernel was not compiled with IKCONFIG_PROC!" 276 | warning "You cannot read the current config!" 277 | warning "Aborting!" 278 | exit 279 | fi 280 | fi 281 | 282 | ### Selecting linux-lucjan branding 283 | if [ "$_ll_branding" = "yes" ]; then 284 | echo "Enabling linux-lucjan branding..." 285 | scripts/config --enable CONFIG_LL_BRANDING 286 | elif [ "$_ll_branding" = "no" ]; then 287 | echo "Disabling linux-lucjan branding..." 288 | scripts/config --disable CONFIG_LL_BRANDING 289 | else 290 | if [ -n "$_ll_branding" ]; then 291 | error "The value $_ll_branding is invalid. Choose the correct one again." 292 | else 293 | error "The value is empty. Choose the correct one again." 294 | fi 295 | error "Selecting linux-lucjan branding failed!" 296 | exit 297 | fi 298 | 299 | ### Set GCC/Clang flags 300 | if [ -n "$_compiler_tune" ]; then 301 | echo "Setting GCC/Clang flags for Intel Skylake CPU..." 302 | scripts/config --disable CONFIG_GENERIC_CPU 303 | scripts/config --enable CONFIG_MSKYLAKE 304 | fi 305 | 306 | ### Set performance governor 307 | if [ -n "$_per_gov" ]; then 308 | echo "Setting performance governor..." 309 | scripts/config --disable CONFIG_CPU_FREQ_DEFAULT_GOV_SCHEDUTIL 310 | scripts/config --enable CONFIG_CPU_FREQ_DEFAULT_GOV_PERFORMANCE 311 | echo "Disabling uneeded governors..." 312 | scripts/config --disable CONFIG_CPU_FREQ_GOV_ONDEMAND 313 | scripts/config --disable CONFIG_CPU_FREQ_GOV_CONSERVATIVE 314 | scripts/config --disable CONFIG_CPU_FREQ_GOV_USERSPACE 315 | scripts/config --disable CONFIG_CPU_FREQ_GOV_SCHEDUTIL 316 | fi 317 | 318 | ### Disable MQ-Deadline I/O scheduler 319 | if [ -n "$_mq_deadline_disable" ]; then 320 | echo "Disabling MQ-Deadline I/O scheduler..." 321 | scripts/config --disable CONFIG_MQ_IOSCHED_DEADLINE 322 | fi 323 | 324 | ### Disable Kyber I/O scheduler 325 | if [ -n "$_kyber_disable" ]; then 326 | echo "Disabling Kyber I/O scheduler..." 327 | scripts/config --disable CONFIG_MQ_IOSCHED_KYBER 328 | fi 329 | 330 | ### Selecting the CPU scheduler 331 | if [ "$_cpusched" = "bmq" ]; then 332 | echo "Selecting BMQ CPU scheduler..." 333 | scripts/config --enable CONFIG_SCHED_BMQ 334 | scripts/config --disable CONFIG_SCHED_PDS 335 | elif [ "$_cpusched" = "pds" ]; then 336 | echo "Selecting PDS CPU scheduler..." 337 | scripts/config --disable CONFIG_SCHED_BMQ 338 | scripts/config --enable CONFIG_SCHED_PDS 339 | elif [ "$_cpusched" = "none" ]; then 340 | echo "Selecting Completely Fair Scheduler..." 341 | scripts/config --disable CONFIG_SCHED_ALT 342 | else 343 | if [ -n "$_cpusched" ]; then 344 | error "The value $_cpusched is invalid. Choose the correct one again." 345 | else 346 | error "The value is empty. Choose the correct one again." 347 | fi 348 | error "Selecting the CPU scheduler failed!" 349 | exit 350 | fi 351 | 352 | ### Enable KBUILD_CFLAGS -O3 353 | if [ -n "$_cc_harder" ]; then 354 | echo "Enabling KBUILD_CFLAGS -O3..." 355 | scripts/config --disable CONFIG_CC_OPTIMIZE_FOR_PERFORMANCE 356 | scripts/config --enable CONFIG_CC_OPTIMIZE_FOR_PERFORMANCE_O3 357 | fi 358 | 359 | ### Optionally set tickrate to 1000 360 | if [ -n "$_1k_HZ_ticks" ]; then 361 | echo "Setting tick rate to 1k..." 362 | scripts/config --disable CONFIG_HZ_300 363 | scripts/config --enable CONFIG_HZ_1000 364 | scripts/config --set-val CONFIG_HZ 1000 365 | fi 366 | 367 | ### Enable TCP_CONG_BBR2 368 | if [ -n "$_tcp_bbr2" ]; then 369 | echo "Disabling TCP_CONG_CUBIC..." 370 | scripts/config --module CONFIG_TCP_CONG_CUBIC 371 | scripts/config --disable CONFIG_DEFAULT_CUBIC 372 | echo "Enabling TCP_CONG_BBR2..." 373 | scripts/config --enable CONFIG_TCP_CONG_BBR2 374 | scripts/config --enable CONFIG_DEFAULT_BBR2 375 | scripts/config --set-str CONFIG_DEFAULT_TCP_CONG bbr2 376 | fi 377 | 378 | ### Enable FULLCONENAT 379 | if [ -n "$_nf_cone" ]; then 380 | echo "Enabling FULLCONENAT..." 381 | scripts/config --module CONFIG_IP_NF_TARGET_FULLCONENAT 382 | scripts/config --module CONFIG_NETFILTER_XT_TARGET_FULLCONENAT 383 | fi 384 | 385 | ### Enable RTW88 386 | if [ -n "$_rtw88" ]; then 387 | echo "Enabling RTW88..." 388 | scripts/config --module CONFIG_RTW88_USB 389 | scripts/config --module CONFIG_RTW88_8822BU 390 | scripts/config --module CONFIG_RTW88_8822CU 391 | scripts/config --module CONFIG_RTW88_8723DU 392 | scripts/config --module CONFIG_RTW88_8821CU 393 | fi 394 | 395 | ### Enable SPECULATIVE_PAGE_FAULT 396 | if [ "$_spf_config" = "standard" ]; then 397 | echo "Enabling SPECULATIVE_PAGE_FAULT..." 398 | scripts/config --enable CONFIG_SPECULATIVE_PAGE_FAULT 399 | scripts/config --disable CONFIG_SPECULATIVE_PAGE_FAULT_STATS 400 | elif [ "$_spf_config" = "stats" ]; then 401 | echo "Enabling SPECULATIVE_PAGE_FAULT with stats..." 402 | scripts/config --enable CONFIG_SPECULATIVE_PAGE_FAULT 403 | scripts/config --enable CONFIG_SPECULATIVE_PAGE_FAULT_STATS 404 | else 405 | if [ -n "$_spf_config" ]; then 406 | error "The value $_spf_config is invalid. Choose the correct one again." 407 | else 408 | error "The value is empty. Choose the correct one again." 409 | fi 410 | error "Enabling SPECULATIVE_PAGE_FAULT failed!" 411 | exit 412 | fi 413 | 414 | ### Enable protect mappings under memory pressure 415 | if [ -n "$_mm_protect" ]; then 416 | echo "Enabling protect file mappings under memory pressure..." 417 | scripts/config --enable CONFIG_UNEVICTABLE_FILE 418 | scripts/config --set-val CONFIG_UNEVICTABLE_FILE_KBYTES_LOW 0 419 | scripts/config --set-val CONFIG_UNEVICTABLE_FILE_KBYTES_MIN 0 420 | echo "Enabling protect anonymous mappings under memory pressure..." 421 | scripts/config --enable CONFIG_UNEVICTABLE_ANON 422 | scripts/config --set-val CONFIG_UNEVICTABLE_ANON_KBYTES_LOW 0 423 | scripts/config --set-val CONFIG_UNEVICTABLE_ANON_KBYTES_MIN 0 424 | fi 425 | 426 | ### Enable multigenerational LRU 427 | if [ "$_lru_config" = "standard" ]; then 428 | echo "Enabling multigenerational LRU..." 429 | scripts/config --enable CONFIG_LRU_GEN 430 | scripts/config --enable CONFIG_LRU_GEN_ENABLED 431 | scripts/config --disable CONFIG_LRU_GEN_STATS 432 | elif [ "$_lru_config" = "stats" ]; then 433 | echo "Enabling multigenerational LRU with stats..." 434 | scripts/config --enable CONFIG_LRU_GEN 435 | scripts/config --enable CONFIG_LRU_GEN_ENABLED 436 | scripts/config --enable CONFIG_LRU_GEN_STATS 437 | elif [ "$_lru_config" = "none" ]; then 438 | echo "Disabling multigenerational LRU..." 439 | scripts/config --disable CONFIG_LRU_GEN 440 | else 441 | if [ -n "$_lru_config" ]; then 442 | error "The value $_lru_config is invalid. Choose the correct one again." 443 | else 444 | error "The value is empty. Choose the correct one again." 445 | fi 446 | error "Enabling multigenerational LRU failed!" 447 | exit 448 | fi 449 | 450 | ### Enable Linux Random Number Generator 451 | if [ -n "$_lrng_enable" ]; then 452 | echo "Enabling Linux Random Number Generator..." 453 | scripts/config --disable CONFIG_RANDOM_DEFAULT_IMPL 454 | scripts/config --enable CONFIG_LRNG 455 | scripts/config --enable CONFIG_LRNG_SHA256 456 | scripts/config --enable CONFIG_LRNG_COMMON_DEV_IF 457 | scripts/config --enable CONFIG_LRNG_DRNG_ATOMIC 458 | scripts/config --enable CONFIG_LRNG_SYSCTL 459 | scripts/config --enable CONFIG_LRNG_RANDOM_IF 460 | scripts/config --module CONFIG_LRNG_KCAPI_IF 461 | scripts/config --module CONFIG_LRNG_HWRAND_IF 462 | scripts/config --enable CONFIG_LRNG_DEV_IF 463 | scripts/config --enable CONFIG_LRNG_RUNTIME_ES_CONFIG 464 | scripts/config --enable CONFIG_LRNG_IRQ_DFLT_TIMER_ES 465 | scripts/config --disable CONFIG_LRNG_SCHED_DFLT_TIMER_ES 466 | scripts/config --enable CONFIG_LRNG_TIMER_COMMON 467 | scripts/config --disable CONFIG_LRNG_COLLECTION_SIZE_256 468 | scripts/config --disable CONFIG_LRNG_COLLECTION_SIZE_512 469 | scripts/config --enable CONFIG_LRNG_COLLECTION_SIZE_1024 470 | scripts/config --disable CONFIG_LRNG_COLLECTION_SIZE_2048 471 | scripts/config --disable CONFIG_LRNG_COLLECTION_SIZE_4096 472 | scripts/config --disable CONFIG_LRNG_COLLECTION_SIZE_8192 473 | scripts/config --set-val CONFIG_LRNG_COLLECTION_SIZE 1024 474 | scripts/config --enable CONFIG_LRNG_HEALTH_TESTS 475 | scripts/config --set-val CONFIG_LRNG_RCT_CUTOFF 31 476 | scripts/config --set-val CONFIG_LRNG_APT_CUTOFF 325 477 | scripts/config --enable CONFIG_LRNG_IRQ 478 | scripts/config --enable CONFIG_LRNG_CONTINUOUS_COMPRESSION_ENABLED 479 | scripts/config --disable CONFIG_LRNG_CONTINUOUS_COMPRESSION_DISABLED 480 | scripts/config --enable CONFIG_LRNG_ENABLE_CONTINUOUS_COMPRESSION 481 | scripts/config --enable CONFIG_LRNG_SWITCHABLE_CONTINUOUS_COMPRESSION 482 | scripts/config --set-val CONFIG_LRNG_IRQ_ENTROPY_RATE 256 483 | scripts/config --enable CONFIG_LRNG_JENT 484 | scripts/config --set-val CONFIG_LRNG_JENT_ENTROPY_RATE 16 485 | scripts/config --enable CONFIG_LRNG_CPU 486 | scripts/config --set-val CONFIG_LRNG_CPU_FULL_ENT_MULTIPLIER 1 487 | scripts/config --set-val CONFIG_LRNG_CPU_ENTROPY_RATE 8 488 | scripts/config --enable CONFIG_LRNG_SCHED 489 | scripts/config --set-val CONFIG_LRNG_SCHED_ENTROPY_RATE 4294967295 490 | scripts/config --enable CONFIG_LRNG_DRNG_CHACHA20 491 | scripts/config --module CONFIG_LRNG_DRBG 492 | scripts/config --module CONFIG_LRNG_DRNG_KCAPI 493 | scripts/config --enable CONFIG_LRNG_SWITCH 494 | scripts/config --enable CONFIG_LRNG_SWITCH_HASH 495 | scripts/config --module CONFIG_LRNG_HASH_KCAPI 496 | scripts/config --enable CONFIG_LRNG_SWITCH_DRNG 497 | scripts/config --module CONFIG_LRNG_SWITCH_DRBG 498 | scripts/config --module CONFIG_LRNG_SWITCH_DRNG_KCAPI 499 | scripts/config --enable CONFIG_LRNG_DFLT_DRNG_CHACHA20 500 | scripts/config --disable CONFIG_LRNG_DFLT_DRNG_DRBG 501 | scripts/config --disable CONFIG_LRNG_DFLT_DRNG_KCAPI 502 | scripts/config --enable CONFIG_LRNG_TESTING_MENU 503 | scripts/config --disable CONFIG_LRNG_RAW_HIRES_ENTROPY 504 | scripts/config --disable CONFIG_LRNG_RAW_JIFFIES_ENTROPY 505 | scripts/config --disable CONFIG_LRNG_RAW_IRQ_ENTROPY 506 | scripts/config --disable CONFIG_LRNG_RAW_RETIP_ENTROPY 507 | scripts/config --disable CONFIG_LRNG_RAW_REGS_ENTROPY 508 | scripts/config --disable CONFIG_LRNG_RAW_ARRAY 509 | scripts/config --disable CONFIG_LRNG_IRQ_PERF 510 | scripts/config --disable CONFIG_LRNG_RAW_SCHED_HIRES_ENTROPY 511 | scripts/config --disable CONFIG_LRNG_RAW_SCHED_PID_ENTROPY 512 | scripts/config --disable CONFIG_LRNG_RAW_SCHED_START_TIME_ENTROPY 513 | scripts/config --disable CONFIG_LRNG_RAW_SCHED_NVCSW_ENTROPY 514 | scripts/config --disable CONFIG_LRNG_SCHED_PERF 515 | scripts/config --disable CONFIG_LRNG_ACVT_HASH 516 | scripts/config --disable CONFIG_LRNG_RUNTIME_MAX_WO_RESEED_CONFIG 517 | scripts/config --disable CONFIG_LRNG_TEST_CPU_ES_COMPRESSION 518 | scripts/config --enable CONFIG_LRNG_SELFTEST 519 | scripts/config --disable CONFIG_LRNG_SELFTEST_PANIC 520 | fi 521 | 522 | ### Optionally disable NUMA for 64-bit kernels only 523 | # (x86 kernels do not support NUMA) 524 | if [ -n "$_NUMAdisable" ]; then 525 | echo "Disabling NUMA from kernel config..." 526 | scripts/config --disable CONFIG_NUMA 527 | fi 528 | 529 | ### Selecting the ZSTD modules and kernel compression level 530 | if [ "$_zstd_level_value" = "ultra" ]; then 531 | echo "Enabling highest ZSTD modules compression ratio..." 532 | scripts/config --set-val CONFIG_MODULE_COMPRESS_ZSTD_LEVEL 19 533 | scripts/config --enable CONFIG_MODULE_COMPRESS_ZSTD_ULTRA 534 | scripts/config --set-val CONFIG_MODULE_COMPRESS_ZSTD_LEVEL_ULTRA 22 535 | echo "Enabling highest ZSTD kernel compression ratio..." 536 | scripts/config --set-val CONFIG_ZSTD_COMP_VAL 22 537 | elif [ "$_zstd_level_value" = "normal" ]; then 538 | echo "Enabling standard ZSTD modules compression ratio..." 539 | scripts/config --set-val CONFIG_MODULE_COMPRESS_ZSTD_LEVEL 19 540 | scripts/config --disable CONFIG_MODULE_COMPRESS_ZSTD_ULTRA 541 | echo "Enabling standard ZSTD kernel compression ratio..." 542 | scripts/config --set-val CONFIG_ZSTD_COMP_VAL 19 543 | else 544 | if [ -n "$_zstd_level_value" ]; then 545 | error "The value $_zstd_level_value is invalid. Choose the correct one again." 546 | else 547 | error "The value is empty. Choose the correct one again." 548 | fi 549 | error "Selecting the ZSTD modules and kernel compression level failed!" 550 | exit 551 | fi 552 | 553 | ### Enable zram/zswap ZSTD compression 554 | if [ -n "$_zstd_swap_compression" ]; then 555 | echo "Enabling zram ZSTD compression..." 556 | scripts/config --disable CONFIG_ZRAM_DEF_COMP_LZORLE 557 | scripts/config --enable CONFIG_ZRAM_DEF_COMP_ZSTD 558 | scripts/config --set-str CONFIG_ZRAM_DEF_COMP zstd 559 | echo "Enabling zswap ZSTD compression..." 560 | scripts/config --disable CONFIG_ZSWAP_COMPRESSOR_DEFAULT_LZ4 561 | scripts/config --enable CONFIG_ZSWAP_COMPRESSOR_DEFAULT_ZSTD 562 | scripts/config --set-str CONFIG_ZSWAP_COMPRESSOR_DEFAULT zstd 563 | echo "Enabling zram entropy calculation..." 564 | scripts/config --enable CONFIG_ZRAM_ENTROPY 565 | scripts/config --set-val CONFIG_ZRAM_ENTROPY_THRESHOLD 100000 566 | fi 567 | 568 | ### Disable DEBUG 569 | if [ -n "$_disable_debug" ]; then 570 | echo "Disabling DEBUG..." 571 | scripts/config --disable CONFIG_DEBUG_INFO 572 | scripts/config --disable CONFIG_DEBUG_INFO_BTF 573 | scripts/config --disable CONFIG_DEBUG_INFO_DWARF5 574 | scripts/config --disable CONFIG_CGROUP_BPF 575 | scripts/config --disable CONFIG_BPF_LSM 576 | scripts/config --disable CONFIG_BPF_PRELOAD 577 | scripts/config --disable CONFIG_BPF_LIRC_MODE2 578 | scripts/config --disable CONFIG_BPF_KPROBE_OVERRIDE 579 | scripts/config --disable CONFIG_PM_DEBUG 580 | scripts/config --disable CONFIG_PM_SLEEP_DEBUG 581 | scripts/config --disable CONFIG_ACPI_DEBUG 582 | scripts/config --disable CONFIG_SCHED_DEBUG 583 | scripts/config --disable CONFIG_LATENCYTOP 584 | scripts/config --disable CONFIG_DEBUG_PREEMPT 585 | fi 586 | 587 | ### Optionally load needed modules for the make localmodconfig 588 | # See https://aur.archlinux.org/packages/modprobed-db 589 | if [ -n "$_localmodcfg" ]; then 590 | if [ -f $HOME/.config/modprobed.db ]; then 591 | echo "Running Steven Rostedt's make localmodconfig now" 592 | make LSMOD=$HOME/.config/modprobed.db localmodconfig 593 | else 594 | echo "No modprobed.db data found" 595 | exit 596 | fi 597 | fi 598 | 599 | ### Rewrite configuration 600 | echo "Rewrite configuration..." 601 | make prepare 602 | yes "" | make config >/dev/null 603 | diff -u ../config .config || : 604 | 605 | ### Prepared version 606 | make -s kernelrelease > version 607 | echo "Prepared $pkgbase version $( "${startdir}/config.last" 624 | } 625 | 626 | build() { 627 | cd $_srcname 628 | 629 | make all 630 | } 631 | 632 | _package-kernel() { 633 | pkgdesc="The $pkgdesc kernel and modules with the ${_lucjanname}-${_lucjanrev} patchset. Sixth Gen Intel Core i3/i5/i7 optimized." 634 | depends=('coreutils' 'kmod' 'initramfs-lucjan') 635 | optdepends=('wireless-regdb: to set the correct wireless channels of your country' 636 | 'linux-firmware: firmware images needed for some devices' 637 | 'modprobed-db: Keeps track of EVERY kernel module that has ever been probed - useful for those of us who make localmodconfig' 638 | 'uksmd: Userspace KSM helper daemon') 639 | provides=(VIRTUALBOX-GUEST-MODULES WIREGUARD-MODULE UKSMD-BUILTIN) 640 | groups=('linux-lucjan-git') 641 | 642 | cd $_srcname 643 | local kernver="$( 2 | # Contributor: Jan Alexander Steffens (heftig) 3 | # Contributor: Tobias Powalowski 4 | # Contributor: Thomas Baechler 5 | 6 | ### BUILD OPTIONS 7 | # Set these variables to ANYTHING that is not null to enable them 8 | 9 | ### Tweak kernel options prior to a build via nconfig 10 | _makenconfig= 11 | 12 | ### Tweak kernel options prior to a build via menuconfig 13 | _makemenuconfig= 14 | 15 | ### Tweak kernel options prior to a build via xconfig 16 | _makexconfig= 17 | 18 | ### Tweak kernel options prior to a build via gconfig 19 | _makegconfig= 20 | 21 | # NUMA is optimized for multi-socket motherboards. 22 | # A single multi-core CPU actually runs slower with NUMA enabled. 23 | # See, https://bugs.archlinux.org/task/31187 24 | _NUMAdisable=y 25 | 26 | # Compile ONLY used modules to VASTLYreduce the number of modules built 27 | # and the build time. 28 | # 29 | # To keep track of which modules are needed for your specific system/hardware, 30 | # give module_db script a try: https://aur.archlinux.org/packages/modprobed-db 31 | # This PKGBUILD read the database kept if it exists 32 | # 33 | # More at this wiki page ---> https://wiki.archlinux.org/index.php/Modprobed-db 34 | _localmodcfg= 35 | 36 | # Use the current kernel's .config file 37 | # Enabling this option will use the .config of the RUNNING kernel rather than 38 | # the ARCH defaults. Useful when the package gets updated and you already went 39 | # through the trouble of customizing your config options. NOT recommended when 40 | # a new kernel is released, but again, convenient for package bumps. 41 | _use_current= 42 | 43 | ### Selecting linux-lucjan branding 44 | # ATTENTION - one of two predefined values should be selected! 45 | # 'yes' - enable linux-lucjan branding 46 | # 'no' - disable linux-lucjan branding 47 | _ll_branding='yes' 48 | 49 | ### Setting GCC/Clang flags for your processor 50 | # To see which option to select, run the command: 51 | # gcc -c -Q -march=native --help=target | grep march 52 | # You can find the full list below: 53 | # https://github.com/graysky2/kernel_compiler_patch#expanded-cpus-include 54 | _compiler_tune=y 55 | 56 | ### Set performance governor as default 57 | _per_gov=y 58 | 59 | ### Disable MQ-Deadline I/O scheduler 60 | _mq_deadline_disable=y 61 | 62 | ### Disable Kyber I/O scheduler 63 | _kyber_disable=y 64 | 65 | ### Selecting the CPU scheduler 66 | # ATTENTION - one of three predefined values should be selected! 67 | # 'bmq' - select 'BitMap Queue CPU scheduler' 68 | # 'pds' - select 'Priority and Deadline based Skip list multiple queue CPU scheduler' 69 | # 'none' - select 'Completely Fair Scheduler' 70 | _cpusched='pds' 71 | 72 | ### Enable KBUILD_CFLAGS -O3 73 | _cc_harder=y 74 | 75 | ### Running with a 1000 HZ tick rate 76 | _1k_HZ_ticks=y 77 | 78 | ### Enable protect mappings under memory pressure 79 | _mm_protect=y 80 | 81 | ### Enable multigenerational LRU 82 | # ATTENTION - one of three predefined values should be selected! 83 | # 'standard' - enable multigenerational LRU 84 | # 'stats' - enable multigenerational LRU with stats 85 | # 'none' - disable multigenerational LRU 86 | _lru_config='standard' 87 | 88 | ### Enable Linux Random Number Generator 89 | _lrng_enable=y 90 | 91 | ### Enable TCP_CONG_BBR2 92 | _tcp_bbr2=y 93 | 94 | ### Enable FULLCONENAT 95 | _nf_cone=y 96 | 97 | ### Enable RTW88 98 | _rtw88= 99 | 100 | ### Enable SPECULATIVE_PAGE_FAULT 101 | # ATTENTION - one of two predefined values should be selected! 102 | # 'standard' - enable SPECULATIVE_PAGE_FAULT 103 | # 'stats' - enable support SPECULATIVE_PAGE_FAULT with stats 104 | _spf_config='standard' 105 | 106 | ### Selecting the ZSTD kernel and modules compression level 107 | # ATTENTION - one of two predefined values should be selected! 108 | # 'ultra' - highest compression ratio 109 | # 'normal' - standard compression ratio 110 | # WARNING: the ultra settings can sometimes 111 | # be counterproductive in both size and speed. 112 | _zstd_level_value='ultra' 113 | 114 | # Enable zram/zswap ZSTD compression 115 | _zstd_swap_compression=y 116 | 117 | # Disable DEBUG to lower the size of the kernel 118 | _disable_debug=y 119 | 120 | ### Download ll-reverts patchset 121 | # ATTENTION - one of two predefined values should be selected! 122 | # 'stable' - stable releases (recommended) 123 | # 'unstable' - rc releases (active only temporarily) 124 | _ll_rev='stable' 125 | 126 | ### Download linux-lucjan patchset 127 | # ATTENTION - one of four predefined values should be selected! 128 | # 'current' - stable releases (recommended) 129 | # 'pending' - resync stable releases (active only temporarily) 130 | # 'testing' - rc releases (active only temporarily) 131 | # 'trunk' - pre-rc releases (active only temporarily) 132 | _linux_lucjan='current' 133 | 134 | ### Do not edit below this line unless you know what you're doing 135 | 136 | pkgbase=linux-lucjan-git 137 | _pkgbase=linux-lucjan 138 | # pkgname=('linux-lucjan-git-kernel' 'linux-lucjan-git-headers') 139 | _major=5.18 140 | _patches=${_major}-dev 141 | _srcname=linux 142 | pkgver=5.18.12.r0.gc2e9702659df.ll131 143 | pkgrel=1 144 | pkgdesc='Linux LL' 145 | arch=('x86_64') 146 | url="https://gitlab.com/sirlucjan/lucjan-kernels/wikis/README" 147 | license=('GPL2') 148 | options=('!strip') 149 | makedepends=('bc' 'libelf' 'cpio' 'perl' 'tar' 'xz' 'git') 150 | if [ -z "$_disable_debug" ]; then 151 | makedepends+=('pahole') 152 | fi 153 | 154 | ### LL reverts 155 | # Some patches for BFQ/block-stable conflict with 156 | # patches for BFQ-dev/block-mainline. 157 | # To use linux-lucjan smoothly do not change 158 | # the settings below. Otherwise kernel 159 | # will not compile. 160 | 161 | if [ "$_ll_rev" = "stable" ]; then 162 | 163 | # _llrevpath="https://raw.githubusercontent.com/sirlucjan/kernel-patches/master/${_patches}/ll-reverts/stable" 164 | _llrevpath="https://gitlab.com/sirlucjan/kernel-patches/raw/master/${_patches}/ll-reverts/stable" 165 | _llrevname='ll-reverts' 166 | _llrevver='ver1' 167 | _llrevpatch="${_major}-${_llrevname}-${_llrevver}.patch" 168 | 169 | elif [ "$_ll_rev" = "unstable" ]; then 170 | 171 | # _llrevpath="https://raw.githubusercontent.com/sirlucjan/kernel-patches/master/${_patches}/ll-reverts/unstable" 172 | _llrevpath="https://gitlab.com/sirlucjan/kernel-patches/raw/master/${_patches}/ll-reverts/unstable" 173 | _llrevname='ll-reverts' 174 | _llrevver='ver1' 175 | _llrevrc='rc1' 176 | _llrevpatch="${_major}-${_llrevname}-${_llrevver}-${_llrevrc}.patch" 177 | 178 | fi 179 | 180 | ### linux-lucjan 181 | # If you do not use the kernel development version (stable-rc) 182 | # only the current branch will be used. Pending and testing branches 183 | # are used only in development versions (stable-rc) 184 | # and the trunk branch is used only in the first releases 185 | # of the new kernel line or contains only temporary solutions. 186 | 187 | if [ "$_linux_lucjan" = "current" ]; then 188 | 189 | # _lucjanpath="https://raw.githubusercontent.com/sirlucjan/${_pkgbase}/master/current" 190 | _lucjanpath="https://gitlab.com/sirlucjan/${_pkgbase}/raw/master/current" 191 | _lucjanname='lucjan' 192 | _lucjanrev='ll131' 193 | _lucjanpatch="${_major}-${_lucjanname}-${_lucjanrev}.patch" 194 | 195 | elif [ "$_linux_lucjan" = "pending" ]; then 196 | 197 | # _lucjanpath="https://raw.githubusercontent.com/sirlucjan/${_pkgbase}/master/pending" 198 | _lucjanpath="https://gitlab.com/sirlucjan/${_pkgbase}/raw/master/pending" 199 | _lucjanname='lucjan' 200 | _lucjanrev='ll59' 201 | _lucjanpatch="${_major}-${_lucjanname}-${_lucjanrev}.patch" 202 | 203 | elif [ "$_linux_lucjan" = "testing" ]; then 204 | 205 | # _lucjanpath="https://raw.githubusercontent.com/sirlucjan/${_pkgbase}/master/testing" 206 | _lucjanpath="https://gitlab.com/sirlucjan/${_pkgbase}/raw/master/testing" 207 | _lucjanname='lucjan' 208 | _lucjanrev='ll132' 209 | _lucjanrc='rc1' 210 | _lucjanpatch="${_major}-${_lucjanname}-${_lucjanrev}-${_lucjanrc}.patch" 211 | 212 | elif [ "$_linux_lucjan" = "trunk" ]; then 213 | 214 | # _lucjanpath="https://raw.githubusercontent.com/sirlucjan/${_pkgbase}/master/trunk" 215 | _lucjanpath="https://gitlab.com/sirlucjan/${_pkgbase}/raw/master/trunk" 216 | _lucjanname='lucjan' 217 | _lucjanrev='ll22' 218 | _lucjanrc='rc1' 219 | _lucjanpatch="${_major}-${_lucjanname}-${_lucjanrev}-${_lucjanrc}.patch" 220 | 221 | fi 222 | 223 | source=("git://git.kernel.org/pub/scm/linux/kernel/git/stable/${_srcname}.git#branch=linux-${_major}.y" 224 | # ll-reverts 225 | # "${_llrevpath}/${_llrevpatch}"{,.sig} 226 | # linux-lucjan 227 | "${_lucjanpath}/${_lucjanpatch}"{,.sig} 228 | # the main kernel config files 229 | 'config') 230 | 231 | export KBUILD_BUILD_HOST=archlinux 232 | export KBUILD_BUILD_USER=$pkgbase 233 | export KBUILD_BUILD_TIMESTAMP="$(date -Ru${SOURCE_DATE_EPOCH:+d @$SOURCE_DATE_EPOCH})" 234 | 235 | pkgver() { 236 | cd $_srcname 237 | 238 | _ver="$(git describe --long --tags | sed 's/^v//;s/\([^-]*-g\)/r\1/;s/-/./g')" 239 | printf ${_ver}.${_lucjanrev} 240 | } 241 | 242 | prepare() { 243 | cd $_srcname 244 | 245 | ### Setting version 246 | echo "Setting version..." 247 | sed -e "/^EXTRAVERSION =/s/=.*/=/" -i Makefile 248 | touch .scmversion 249 | scripts/setlocalversion --save-scmversion 250 | echo "-$pkgrel" > localversion.10-pkgrel 251 | echo "${pkgbase#linux}" > localversion.20-pkgname 252 | 253 | ### Patching sources 254 | local src 255 | for src in "${source[@]}"; do 256 | src="${src%%::*}" 257 | src="${src##*/}" 258 | [[ $src = *.patch ]] || continue 259 | echo "Applying patch $src..." 260 | patch -Np1 < "../$src" 261 | done 262 | 263 | ### Setting config 264 | echo "Setting config..." 265 | cp ../config .config 266 | 267 | ### Optionally use running kernel's config 268 | # code originally by nous; http://aur.archlinux.org/packages.php?ID=40191 269 | if [ -n "$_use_current" ]; then 270 | if [[ -s /proc/config.gz ]]; then 271 | echo "Extracting config from /proc/config.gz..." 272 | # modprobe configs 273 | zcat /proc/config.gz > ./.config 274 | else 275 | warning "Your kernel was not compiled with IKCONFIG_PROC!" 276 | warning "You cannot read the current config!" 277 | warning "Aborting!" 278 | exit 279 | fi 280 | fi 281 | 282 | ### Selecting linux-lucjan branding 283 | if [ "$_ll_branding" = "yes" ]; then 284 | echo "Enabling linux-lucjan branding..." 285 | scripts/config --enable CONFIG_LL_BRANDING 286 | elif [ "$_ll_branding" = "no" ]; then 287 | echo "Disabling linux-lucjan branding..." 288 | scripts/config --disable CONFIG_LL_BRANDING 289 | else 290 | if [ -n "$_ll_branding" ]; then 291 | error "The value $_ll_branding is invalid. Choose the correct one again." 292 | else 293 | error "The value is empty. Choose the correct one again." 294 | fi 295 | error "Selecting linux-lucjan branding failed!" 296 | exit 297 | fi 298 | 299 | ### Set GCC/Clang flags 300 | if [ -n "$_compiler_tune" ]; then 301 | echo "Setting GCC/Clang flags for Intel Skylake CPU..." 302 | scripts/config --disable CONFIG_GENERIC_CPU 303 | scripts/config --enable CONFIG_MSKYLAKE 304 | fi 305 | 306 | ### Set performance governor 307 | if [ -n "$_per_gov" ]; then 308 | echo "Setting performance governor..." 309 | scripts/config --disable CONFIG_CPU_FREQ_DEFAULT_GOV_SCHEDUTIL 310 | scripts/config --enable CONFIG_CPU_FREQ_DEFAULT_GOV_PERFORMANCE 311 | echo "Disabling uneeded governors..." 312 | scripts/config --disable CONFIG_CPU_FREQ_GOV_ONDEMAND 313 | scripts/config --disable CONFIG_CPU_FREQ_GOV_CONSERVATIVE 314 | scripts/config --disable CONFIG_CPU_FREQ_GOV_USERSPACE 315 | scripts/config --disable CONFIG_CPU_FREQ_GOV_SCHEDUTIL 316 | fi 317 | 318 | ### Disable MQ-Deadline I/O scheduler 319 | if [ -n "$_mq_deadline_disable" ]; then 320 | echo "Disabling MQ-Deadline I/O scheduler..." 321 | scripts/config --disable CONFIG_MQ_IOSCHED_DEADLINE 322 | fi 323 | 324 | ### Disable Kyber I/O scheduler 325 | if [ -n "$_kyber_disable" ]; then 326 | echo "Disabling Kyber I/O scheduler..." 327 | scripts/config --disable CONFIG_MQ_IOSCHED_KYBER 328 | fi 329 | 330 | ### Selecting the CPU scheduler 331 | if [ "$_cpusched" = "bmq" ]; then 332 | echo "Selecting BMQ CPU scheduler..." 333 | scripts/config --enable CONFIG_SCHED_BMQ 334 | scripts/config --disable CONFIG_SCHED_PDS 335 | elif [ "$_cpusched" = "pds" ]; then 336 | echo "Selecting PDS CPU scheduler..." 337 | scripts/config --disable CONFIG_SCHED_BMQ 338 | scripts/config --enable CONFIG_SCHED_PDS 339 | elif [ "$_cpusched" = "none" ]; then 340 | echo "Selecting Completely Fair Scheduler..." 341 | scripts/config --disable CONFIG_SCHED_ALT 342 | else 343 | if [ -n "$_cpusched" ]; then 344 | error "The value $_cpusched is invalid. Choose the correct one again." 345 | else 346 | error "The value is empty. Choose the correct one again." 347 | fi 348 | error "Selecting the CPU scheduler failed!" 349 | exit 350 | fi 351 | 352 | ### Enable KBUILD_CFLAGS -O3 353 | if [ -n "$_cc_harder" ]; then 354 | echo "Enabling KBUILD_CFLAGS -O3..." 355 | scripts/config --disable CONFIG_CC_OPTIMIZE_FOR_PERFORMANCE 356 | scripts/config --enable CONFIG_CC_OPTIMIZE_FOR_PERFORMANCE_O3 357 | fi 358 | 359 | ### Optionally set tickrate to 1000 360 | if [ -n "$_1k_HZ_ticks" ]; then 361 | echo "Setting tick rate to 1k..." 362 | scripts/config --disable CONFIG_HZ_300 363 | scripts/config --enable CONFIG_HZ_1000 364 | scripts/config --set-val CONFIG_HZ 1000 365 | fi 366 | 367 | ### Enable TCP_CONG_BBR2 368 | if [ -n "$_tcp_bbr2" ]; then 369 | echo "Disabling TCP_CONG_CUBIC..." 370 | scripts/config --module CONFIG_TCP_CONG_CUBIC 371 | scripts/config --disable CONFIG_DEFAULT_CUBIC 372 | echo "Enabling TCP_CONG_BBR2..." 373 | scripts/config --enable CONFIG_TCP_CONG_BBR2 374 | scripts/config --enable CONFIG_DEFAULT_BBR2 375 | scripts/config --set-str CONFIG_DEFAULT_TCP_CONG bbr2 376 | fi 377 | 378 | ### Enable FULLCONENAT 379 | if [ -n "$_nf_cone" ]; then 380 | echo "Enabling FULLCONENAT..." 381 | scripts/config --module CONFIG_IP_NF_TARGET_FULLCONENAT 382 | scripts/config --module CONFIG_NETFILTER_XT_TARGET_FULLCONENAT 383 | fi 384 | 385 | ### Enable RTW88 386 | if [ -n "$_rtw88" ]; then 387 | echo "Enabling RTW88..." 388 | scripts/config --module CONFIG_RTW88_USB 389 | scripts/config --module CONFIG_RTW88_8822BU 390 | scripts/config --module CONFIG_RTW88_8822CU 391 | scripts/config --module CONFIG_RTW88_8723DU 392 | scripts/config --module CONFIG_RTW88_8821CU 393 | fi 394 | 395 | ### Enable SPECULATIVE_PAGE_FAULT 396 | if [ "$_spf_config" = "standard" ]; then 397 | echo "Enabling SPECULATIVE_PAGE_FAULT..." 398 | scripts/config --enable CONFIG_SPECULATIVE_PAGE_FAULT 399 | scripts/config --disable CONFIG_SPECULATIVE_PAGE_FAULT_STATS 400 | elif [ "$_spf_config" = "stats" ]; then 401 | echo "Enabling SPECULATIVE_PAGE_FAULT with stats..." 402 | scripts/config --enable CONFIG_SPECULATIVE_PAGE_FAULT 403 | scripts/config --enable CONFIG_SPECULATIVE_PAGE_FAULT_STATS 404 | else 405 | if [ -n "$_spf_config" ]; then 406 | error "The value $_spf_config is invalid. Choose the correct one again." 407 | else 408 | error "The value is empty. Choose the correct one again." 409 | fi 410 | error "Enabling SPECULATIVE_PAGE_FAULT failed!" 411 | exit 412 | fi 413 | 414 | ### Enable protect mappings under memory pressure 415 | if [ -n "$_mm_protect" ]; then 416 | echo "Enabling protect file mappings under memory pressure..." 417 | scripts/config --enable CONFIG_UNEVICTABLE_FILE 418 | scripts/config --set-val CONFIG_UNEVICTABLE_FILE_KBYTES_LOW 0 419 | scripts/config --set-val CONFIG_UNEVICTABLE_FILE_KBYTES_MIN 0 420 | echo "Enabling protect anonymous mappings under memory pressure..." 421 | scripts/config --enable CONFIG_UNEVICTABLE_ANON 422 | scripts/config --set-val CONFIG_UNEVICTABLE_ANON_KBYTES_LOW 0 423 | scripts/config --set-val CONFIG_UNEVICTABLE_ANON_KBYTES_MIN 0 424 | fi 425 | 426 | ### Enable multigenerational LRU 427 | if [ "$_lru_config" = "standard" ]; then 428 | echo "Enabling multigenerational LRU..." 429 | scripts/config --enable CONFIG_LRU_GEN 430 | scripts/config --enable CONFIG_LRU_GEN_ENABLED 431 | scripts/config --disable CONFIG_LRU_GEN_STATS 432 | elif [ "$_lru_config" = "stats" ]; then 433 | echo "Enabling multigenerational LRU with stats..." 434 | scripts/config --enable CONFIG_LRU_GEN 435 | scripts/config --enable CONFIG_LRU_GEN_ENABLED 436 | scripts/config --enable CONFIG_LRU_GEN_STATS 437 | elif [ "$_lru_config" = "none" ]; then 438 | echo "Disabling multigenerational LRU..." 439 | scripts/config --disable CONFIG_LRU_GEN 440 | else 441 | if [ -n "$_lru_config" ]; then 442 | error "The value $_lru_config is invalid. Choose the correct one again." 443 | else 444 | error "The value is empty. Choose the correct one again." 445 | fi 446 | error "Enabling multigenerational LRU failed!" 447 | exit 448 | fi 449 | 450 | ### Enable Linux Random Number Generator 451 | if [ -n "$_lrng_enable" ]; then 452 | echo "Enabling Linux Random Number Generator..." 453 | scripts/config --disable CONFIG_RANDOM_DEFAULT_IMPL 454 | scripts/config --enable CONFIG_LRNG 455 | scripts/config --enable CONFIG_LRNG_SHA256 456 | scripts/config --enable CONFIG_LRNG_COMMON_DEV_IF 457 | scripts/config --enable CONFIG_LRNG_DRNG_ATOMIC 458 | scripts/config --enable CONFIG_LRNG_SYSCTL 459 | scripts/config --enable CONFIG_LRNG_RANDOM_IF 460 | scripts/config --module CONFIG_LRNG_KCAPI_IF 461 | scripts/config --module CONFIG_LRNG_HWRAND_IF 462 | scripts/config --enable CONFIG_LRNG_DEV_IF 463 | scripts/config --enable CONFIG_LRNG_RUNTIME_ES_CONFIG 464 | scripts/config --enable CONFIG_LRNG_IRQ_DFLT_TIMER_ES 465 | scripts/config --disable CONFIG_LRNG_SCHED_DFLT_TIMER_ES 466 | scripts/config --enable CONFIG_LRNG_TIMER_COMMON 467 | scripts/config --disable CONFIG_LRNG_COLLECTION_SIZE_256 468 | scripts/config --disable CONFIG_LRNG_COLLECTION_SIZE_512 469 | scripts/config --enable CONFIG_LRNG_COLLECTION_SIZE_1024 470 | scripts/config --disable CONFIG_LRNG_COLLECTION_SIZE_2048 471 | scripts/config --disable CONFIG_LRNG_COLLECTION_SIZE_4096 472 | scripts/config --disable CONFIG_LRNG_COLLECTION_SIZE_8192 473 | scripts/config --set-val CONFIG_LRNG_COLLECTION_SIZE 1024 474 | scripts/config --enable CONFIG_LRNG_HEALTH_TESTS 475 | scripts/config --set-val CONFIG_LRNG_RCT_CUTOFF 31 476 | scripts/config --set-val CONFIG_LRNG_APT_CUTOFF 325 477 | scripts/config --enable CONFIG_LRNG_IRQ 478 | scripts/config --enable CONFIG_LRNG_CONTINUOUS_COMPRESSION_ENABLED 479 | scripts/config --disable CONFIG_LRNG_CONTINUOUS_COMPRESSION_DISABLED 480 | scripts/config --enable CONFIG_LRNG_ENABLE_CONTINUOUS_COMPRESSION 481 | scripts/config --enable CONFIG_LRNG_SWITCHABLE_CONTINUOUS_COMPRESSION 482 | scripts/config --set-val CONFIG_LRNG_IRQ_ENTROPY_RATE 256 483 | scripts/config --enable CONFIG_LRNG_JENT 484 | scripts/config --set-val CONFIG_LRNG_JENT_ENTROPY_RATE 16 485 | scripts/config --enable CONFIG_LRNG_CPU 486 | scripts/config --set-val CONFIG_LRNG_CPU_FULL_ENT_MULTIPLIER 1 487 | scripts/config --set-val CONFIG_LRNG_CPU_ENTROPY_RATE 8 488 | scripts/config --enable CONFIG_LRNG_SCHED 489 | scripts/config --set-val CONFIG_LRNG_SCHED_ENTROPY_RATE 4294967295 490 | scripts/config --enable CONFIG_LRNG_DRNG_CHACHA20 491 | scripts/config --module CONFIG_LRNG_DRBG 492 | scripts/config --module CONFIG_LRNG_DRNG_KCAPI 493 | scripts/config --enable CONFIG_LRNG_SWITCH 494 | scripts/config --enable CONFIG_LRNG_SWITCH_HASH 495 | scripts/config --module CONFIG_LRNG_HASH_KCAPI 496 | scripts/config --enable CONFIG_LRNG_SWITCH_DRNG 497 | scripts/config --module CONFIG_LRNG_SWITCH_DRBG 498 | scripts/config --module CONFIG_LRNG_SWITCH_DRNG_KCAPI 499 | scripts/config --enable CONFIG_LRNG_DFLT_DRNG_CHACHA20 500 | scripts/config --disable CONFIG_LRNG_DFLT_DRNG_DRBG 501 | scripts/config --disable CONFIG_LRNG_DFLT_DRNG_KCAPI 502 | scripts/config --enable CONFIG_LRNG_TESTING_MENU 503 | scripts/config --disable CONFIG_LRNG_RAW_HIRES_ENTROPY 504 | scripts/config --disable CONFIG_LRNG_RAW_JIFFIES_ENTROPY 505 | scripts/config --disable CONFIG_LRNG_RAW_IRQ_ENTROPY 506 | scripts/config --disable CONFIG_LRNG_RAW_RETIP_ENTROPY 507 | scripts/config --disable CONFIG_LRNG_RAW_REGS_ENTROPY 508 | scripts/config --disable CONFIG_LRNG_RAW_ARRAY 509 | scripts/config --disable CONFIG_LRNG_IRQ_PERF 510 | scripts/config --disable CONFIG_LRNG_RAW_SCHED_HIRES_ENTROPY 511 | scripts/config --disable CONFIG_LRNG_RAW_SCHED_PID_ENTROPY 512 | scripts/config --disable CONFIG_LRNG_RAW_SCHED_START_TIME_ENTROPY 513 | scripts/config --disable CONFIG_LRNG_RAW_SCHED_NVCSW_ENTROPY 514 | scripts/config --disable CONFIG_LRNG_SCHED_PERF 515 | scripts/config --disable CONFIG_LRNG_ACVT_HASH 516 | scripts/config --disable CONFIG_LRNG_RUNTIME_MAX_WO_RESEED_CONFIG 517 | scripts/config --disable CONFIG_LRNG_TEST_CPU_ES_COMPRESSION 518 | scripts/config --enable CONFIG_LRNG_SELFTEST 519 | scripts/config --disable CONFIG_LRNG_SELFTEST_PANIC 520 | fi 521 | 522 | ### Optionally disable NUMA for 64-bit kernels only 523 | # (x86 kernels do not support NUMA) 524 | if [ -n "$_NUMAdisable" ]; then 525 | echo "Disabling NUMA from kernel config..." 526 | scripts/config --disable CONFIG_NUMA 527 | fi 528 | 529 | ### Selecting the ZSTD modules and kernel compression level 530 | if [ "$_zstd_level_value" = "ultra" ]; then 531 | echo "Enabling highest ZSTD modules compression ratio..." 532 | scripts/config --set-val CONFIG_MODULE_COMPRESS_ZSTD_LEVEL 19 533 | scripts/config --enable CONFIG_MODULE_COMPRESS_ZSTD_ULTRA 534 | scripts/config --set-val CONFIG_MODULE_COMPRESS_ZSTD_LEVEL_ULTRA 22 535 | echo "Enabling highest ZSTD kernel compression ratio..." 536 | scripts/config --set-val CONFIG_ZSTD_COMP_VAL 22 537 | elif [ "$_zstd_level_value" = "normal" ]; then 538 | echo "Enabling standard ZSTD modules compression ratio..." 539 | scripts/config --set-val CONFIG_MODULE_COMPRESS_ZSTD_LEVEL 19 540 | scripts/config --disable CONFIG_MODULE_COMPRESS_ZSTD_ULTRA 541 | echo "Enabling standard ZSTD kernel compression ratio..." 542 | scripts/config --set-val CONFIG_ZSTD_COMP_VAL 19 543 | else 544 | if [ -n "$_zstd_level_value" ]; then 545 | error "The value $_zstd_level_value is invalid. Choose the correct one again." 546 | else 547 | error "The value is empty. Choose the correct one again." 548 | fi 549 | error "Selecting the ZSTD modules and kernel compression level failed!" 550 | exit 551 | fi 552 | 553 | ### Enable zram/zswap ZSTD compression 554 | if [ -n "$_zstd_swap_compression" ]; then 555 | echo "Enabling zram ZSTD compression..." 556 | scripts/config --disable CONFIG_ZRAM_DEF_COMP_LZORLE 557 | scripts/config --enable CONFIG_ZRAM_DEF_COMP_ZSTD 558 | scripts/config --set-str CONFIG_ZRAM_DEF_COMP zstd 559 | echo "Enabling zswap ZSTD compression..." 560 | scripts/config --disable CONFIG_ZSWAP_COMPRESSOR_DEFAULT_LZ4 561 | scripts/config --enable CONFIG_ZSWAP_COMPRESSOR_DEFAULT_ZSTD 562 | scripts/config --set-str CONFIG_ZSWAP_COMPRESSOR_DEFAULT zstd 563 | echo "Enabling zram entropy calculation..." 564 | scripts/config --enable CONFIG_ZRAM_ENTROPY 565 | scripts/config --set-val CONFIG_ZRAM_ENTROPY_THRESHOLD 100000 566 | fi 567 | 568 | ### Disable DEBUG 569 | if [ -n "$_disable_debug" ]; then 570 | echo "Disabling DEBUG..." 571 | scripts/config --disable CONFIG_DEBUG_INFO 572 | scripts/config --disable CONFIG_DEBUG_INFO_BTF 573 | scripts/config --disable CONFIG_DEBUG_INFO_DWARF5 574 | scripts/config --disable CONFIG_CGROUP_BPF 575 | scripts/config --disable CONFIG_BPF_LSM 576 | scripts/config --disable CONFIG_BPF_PRELOAD 577 | scripts/config --disable CONFIG_BPF_LIRC_MODE2 578 | scripts/config --disable CONFIG_BPF_KPROBE_OVERRIDE 579 | scripts/config --disable CONFIG_PM_DEBUG 580 | scripts/config --disable CONFIG_PM_SLEEP_DEBUG 581 | scripts/config --disable CONFIG_ACPI_DEBUG 582 | scripts/config --disable CONFIG_SCHED_DEBUG 583 | scripts/config --disable CONFIG_LATENCYTOP 584 | scripts/config --disable CONFIG_DEBUG_PREEMPT 585 | fi 586 | 587 | ### Optionally load needed modules for the make localmodconfig 588 | # See https://aur.archlinux.org/packages/modprobed-db 589 | if [ -n "$_localmodcfg" ]; then 590 | if [ -f $HOME/.config/modprobed.db ]; then 591 | echo "Running Steven Rostedt's make localmodconfig now" 592 | make LSMOD=$HOME/.config/modprobed.db localmodconfig 593 | else 594 | echo "No modprobed.db data found" 595 | exit 596 | fi 597 | fi 598 | 599 | ### Rewrite configuration 600 | echo "Rewrite configuration..." 601 | make prepare 602 | yes "" | make config >/dev/null 603 | diff -u ../config .config || : 604 | 605 | ### Prepared version 606 | make -s kernelrelease > version 607 | echo "Prepared $pkgbase version $( "${startdir}/config.last" 624 | } 625 | 626 | build() { 627 | cd $_srcname 628 | 629 | make all 630 | } 631 | 632 | _package-kernel() { 633 | pkgdesc="The $pkgdesc kernel and modules with the ${_lucjanname}-${_lucjanrev} patchset. Sixth Gen Intel Core i3/i5/i7 optimized." 634 | depends=('coreutils' 'kmod' 'initramfs-lucjan') 635 | optdepends=('wireless-regdb: to set the correct wireless channels of your country' 636 | 'linux-firmware: firmware images needed for some devices' 637 | 'modprobed-db: Keeps track of EVERY kernel module that has ever been probed - useful for those of us who make localmodconfig' 638 | 'uksmd: Userspace KSM helper daemon') 639 | provides=(VIRTUALBOX-GUEST-MODULES WIREGUARD-MODULE UKSMD-BUILTIN) 640 | groups=('linux-lucjan-git') 641 | 642 | cd $_srcname 643 | local kernver="$( 2 | # Contributor: Jan Alexander Steffens (heftig) 3 | # Contributor: Tobias Powalowski 4 | # Contributor: Thomas Baechler 5 | 6 | ### BUILD OPTIONS 7 | # Set these variables to ANYTHING that is not null to enable them 8 | 9 | ### Tweak kernel options prior to a build via nconfig 10 | _makenconfig= 11 | 12 | ### Tweak kernel options prior to a build via menuconfig 13 | _makemenuconfig= 14 | 15 | ### Tweak kernel options prior to a build via xconfig 16 | _makexconfig= 17 | 18 | ### Tweak kernel options prior to a build via gconfig 19 | _makegconfig= 20 | 21 | # NUMA is optimized for multi-socket motherboards. 22 | # A single multi-core CPU actually runs slower with NUMA enabled. 23 | # See, https://bugs.archlinux.org/task/31187 24 | _NUMAdisable=y 25 | 26 | # Compile ONLY used modules to VASTLYreduce the number of modules built 27 | # and the build time. 28 | # 29 | # To keep track of which modules are needed for your specific system/hardware, 30 | # give module_db script a try: https://aur.archlinux.org/packages/modprobed-db 31 | # This PKGBUILD read the database kept if it exists 32 | # 33 | # More at this wiki page ---> https://wiki.archlinux.org/index.php/Modprobed-db 34 | _localmodcfg= 35 | 36 | # Use the current kernel's .config file 37 | # Enabling this option will use the .config of the RUNNING kernel rather than 38 | # the ARCH defaults. Useful when the package gets updated and you already went 39 | # through the trouble of customizing your config options. NOT recommended when 40 | # a new kernel is released, but again, convenient for package bumps. 41 | _use_current= 42 | 43 | ### Selecting linux-lucjan branding 44 | # ATTENTION - one of two predefined values should be selected! 45 | # 'yes' - enable linux-lucjan branding 46 | # 'no' - disable linux-lucjan branding 47 | _ll_branding='yes' 48 | 49 | ### Setting GCC/Clang flags for your processor 50 | # To see which option to select, run the command: 51 | # gcc -c -Q -march=native --help=target | grep march 52 | # You can find the full list below: 53 | # https://github.com/graysky2/kernel_compiler_patch#expanded-cpus-include 54 | _compiler_tune=y 55 | 56 | ### Set performance governor as default 57 | _per_gov=y 58 | 59 | ### Disable MQ-Deadline I/O scheduler 60 | _mq_deadline_disable=y 61 | 62 | ### Disable Kyber I/O scheduler 63 | _kyber_disable=y 64 | 65 | ### Selecting the CPU scheduler 66 | # ATTENTION - one of three predefined values should be selected! 67 | # 'bmq' - select 'BitMap Queue CPU scheduler' 68 | # 'pds' - select 'Priority and Deadline based Skip list multiple queue CPU scheduler' 69 | # 'none' - select 'Completely Fair Scheduler' 70 | _cpusched='pds' 71 | 72 | ### Enable KBUILD_CFLAGS -O3 73 | _cc_harder=y 74 | 75 | ### Running with a 1000 HZ tick rate 76 | _1k_HZ_ticks=y 77 | 78 | ### Enable protect mappings under memory pressure 79 | _mm_protect=y 80 | 81 | ### Enable multigenerational LRU 82 | # ATTENTION - one of three predefined values should be selected! 83 | # 'standard' - enable multigenerational LRU 84 | # 'stats' - enable multigenerational LRU with stats 85 | # 'none' - disable multigenerational LRU 86 | _lru_config='standard' 87 | 88 | ### Enable Linux Random Number Generator 89 | _lrng_enable=y 90 | 91 | ### Enable TCP_CONG_BBR2 92 | _tcp_bbr2=y 93 | 94 | ### Enable FULLCONENAT 95 | _nf_cone=y 96 | 97 | ### Enable RTW88 98 | _rtw88= 99 | 100 | ### Enable SPECULATIVE_PAGE_FAULT 101 | # ATTENTION - one of two predefined values should be selected! 102 | # 'standard' - enable SPECULATIVE_PAGE_FAULT 103 | # 'stats' - enable support SPECULATIVE_PAGE_FAULT with stats 104 | _spf_config='standard' 105 | 106 | ### Selecting the ZSTD kernel and modules compression level 107 | # ATTENTION - one of two predefined values should be selected! 108 | # 'ultra' - highest compression ratio 109 | # 'normal' - standard compression ratio 110 | # WARNING: the ultra settings can sometimes 111 | # be counterproductive in both size and speed. 112 | _zstd_level_value='ultra' 113 | 114 | # Enable zram/zswap ZSTD compression 115 | _zstd_swap_compression=y 116 | 117 | # Disable DEBUG to lower the size of the kernel 118 | _disable_debug=y 119 | 120 | ### Download ll-reverts patchset 121 | # ATTENTION - one of two predefined values should be selected! 122 | # 'stable' - stable releases (recommended) 123 | # 'unstable' - rc releases (active only temporarily) 124 | _ll_rev='stable' 125 | 126 | ### Download linux-lucjan patchset 127 | # ATTENTION - one of four predefined values should be selected! 128 | # 'current' - stable releases (recommended) 129 | # 'pending' - resync stable releases (active only temporarily) 130 | # 'testing' - rc releases (active only temporarily) 131 | # 'trunk' - pre-rc releases (active only temporarily) 132 | _linux_lucjan='current' 133 | 134 | ### Do not edit below this line unless you know what you're doing 135 | 136 | pkgbase=linux-lucjan 137 | # pkgname=('linux-lucjan-kernel' 'linux-lucjan-headers') 138 | _major=5.18 139 | _minor=12 140 | _patches=${_major}-dev 141 | pkgver=5.18.12.ll131 142 | _pkgver=${_major}.${_minor} 143 | _srcname=linux-${_pkgver} 144 | pkgrel=1 145 | pkgdesc='Linux LL' 146 | arch=('x86_64') 147 | url="https://gitlab.com/sirlucjan/lucjan-kernels/wikis/README" 148 | license=('GPL2') 149 | options=('!strip') 150 | makedepends=('bc' 'libelf' 'cpio' 'perl' 'tar' 'xz') 151 | if [ -z "$_disable_debug" ]; then 152 | makedepends+=('pahole') 153 | fi 154 | 155 | ### LL reverts 156 | # Some patches for BFQ/block-stable conflict with 157 | # patches for BFQ-dev/block-mainline. 158 | # To use linux-lucjan smoothly do not change 159 | # the settings below. Otherwise kernel 160 | # will not compile. 161 | 162 | if [ "$_ll_rev" = "stable" ]; then 163 | 164 | # _llrevpath="https://raw.githubusercontent.com/sirlucjan/kernel-patches/master/${_patches}/ll-reverts/stable" 165 | _llrevpath="https://gitlab.com/sirlucjan/kernel-patches/raw/master/${_patches}/ll-reverts/stable" 166 | _llrevname='ll-reverts' 167 | _llrevver='ver1' 168 | _llrevpatch="${_major}-${_llrevname}-${_llrevver}.patch" 169 | 170 | elif [ "$_ll_rev" = "unstable" ]; then 171 | 172 | # _llrevpath="https://raw.githubusercontent.com/sirlucjan/kernel-patches/master/${_patches}/ll-reverts/unstable" 173 | _llrevpath="https://gitlab.com/sirlucjan/kernel-patches/raw/master/${_patches}/ll-reverts/unstable" 174 | _llrevname='ll-reverts' 175 | _llrevver='ver1' 176 | _llrevrc='rc1' 177 | _llrevpatch="${_major}-${_llrevname}-${_llrevver}-${_llrevrc}.patch" 178 | 179 | fi 180 | 181 | ### linux-lucjan 182 | # If you do not use the kernel development version (stable-rc) 183 | # only the current branch will be used. Pending and testing branches 184 | # are used only in development versions (stable-rc) 185 | # and the trunk branch is used only in the first releases 186 | # of the new kernel line or contains only temporary solutions. 187 | 188 | if [ "$_linux_lucjan" = "current" ]; then 189 | 190 | # _lucjanpath="https://raw.githubusercontent.com/sirlucjan/${pkgbase}/master/current" 191 | _lucjanpath="https://gitlab.com/sirlucjan/${pkgbase}/raw/master/current" 192 | _lucjanname='lucjan' 193 | _lucjanrev='ll131' 194 | _lucjanpatch="${_major}-${_lucjanname}-${_lucjanrev}.patch" 195 | 196 | elif [ "$_linux_lucjan" = "pending" ]; then 197 | 198 | # _lucjanpath="https://raw.githubusercontent.com/sirlucjan/${pkgbase}/master/pending" 199 | _lucjanpath="https://gitlab.com/sirlucjan/${pkgbase}/raw/master/pending" 200 | _lucjanname='lucjan' 201 | _lucjanrev='ll59' 202 | _lucjanpatch="${_major}-${_lucjanname}-${_lucjanrev}.patch" 203 | 204 | elif [ "$_linux_lucjan" = "testing" ]; then 205 | 206 | # _lucjanpath="https://raw.githubusercontent.com/sirlucjan/${pkgbase}/master/testing" 207 | _lucjanpath="https://gitlab.com/sirlucjan/${pkgbase}/raw/master/testing" 208 | _lucjanname='lucjan' 209 | _lucjanrev='ll132' 210 | _lucjanrc='rc1' 211 | _lucjanpatch="${_major}-${_lucjanname}-${_lucjanrev}-${_lucjanrc}.patch" 212 | 213 | elif [ "$_linux_lucjan" = "trunk" ]; then 214 | 215 | # _lucjanpath="https://raw.githubusercontent.com/sirlucjan/${pkgbase}/master/trunk" 216 | _lucjanpath="https://gitlab.com/sirlucjan/${pkgbase}/raw/master/trunk" 217 | _lucjanname='lucjan' 218 | _lucjanrev='ll22' 219 | _lucjanrc='rc1' 220 | _lucjanpatch="${_major}-${_lucjanname}-${_lucjanrev}-${_lucjanrc}.patch" 221 | 222 | fi 223 | 224 | source=("https://www.kernel.org/pub/linux/kernel/v5.x/${_srcname}.tar"{.xz,.sign} 225 | # ll-reverts 226 | # "${_llrevpath}/${_llrevpatch}"{,.sig} 227 | # linux-lucjan 228 | "${_lucjanpath}/${_lucjanpatch}"{,.sig} 229 | # the main kernel config files 230 | 'config') 231 | 232 | export KBUILD_BUILD_HOST=archlinux 233 | export KBUILD_BUILD_USER=$pkgbase 234 | export KBUILD_BUILD_TIMESTAMP="$(date -Ru${SOURCE_DATE_EPOCH:+d @$SOURCE_DATE_EPOCH})" 235 | 236 | pkgver() { 237 | 238 | printf ${_pkgver}.${_lucjanrev} 239 | 240 | } 241 | 242 | prepare() { 243 | cd $_srcname 244 | 245 | ### Setting version 246 | echo "Setting version..." 247 | sed -e "/^EXTRAVERSION =/s/=.*/=/" -i Makefile 248 | touch .scmversion 249 | scripts/setlocalversion --save-scmversion 250 | echo "-$pkgrel" > localversion.10-pkgrel 251 | echo "${pkgbase#linux}" > localversion.20-pkgname 252 | 253 | ### Patching sources 254 | local src 255 | for src in "${source[@]}"; do 256 | src="${src%%::*}" 257 | src="${src##*/}" 258 | [[ $src = *.patch ]] || continue 259 | echo "Applying patch $src..." 260 | patch -Np1 < "../$src" 261 | done 262 | 263 | ### Setting config 264 | echo "Setting config..." 265 | cp ../config .config 266 | 267 | ### Optionally use running kernel's config 268 | # code originally by nous; http://aur.archlinux.org/packages.php?ID=40191 269 | if [ -n "$_use_current" ]; then 270 | if [[ -s /proc/config.gz ]]; then 271 | echo "Extracting config from /proc/config.gz..." 272 | # modprobe configs 273 | zcat /proc/config.gz > ./.config 274 | else 275 | warning "Your kernel was not compiled with IKCONFIG_PROC!" 276 | warning "You cannot read the current config!" 277 | warning "Aborting!" 278 | exit 279 | fi 280 | fi 281 | 282 | ### Selecting linux-lucjan branding 283 | if [ "$_ll_branding" = "yes" ]; then 284 | echo "Enabling linux-lucjan branding..." 285 | scripts/config --enable CONFIG_LL_BRANDING 286 | elif [ "$_ll_branding" = "no" ]; then 287 | echo "Disabling linux-lucjan branding..." 288 | scripts/config --disable CONFIG_LL_BRANDING 289 | else 290 | if [ -n "$_ll_branding" ]; then 291 | error "The value $_ll_branding is invalid. Choose the correct one again." 292 | else 293 | error "The value is empty. Choose the correct one again." 294 | fi 295 | error "Selecting linux-lucjan branding failed!" 296 | exit 297 | fi 298 | 299 | ### Set GCC/Clang flags 300 | if [ -n "$_compiler_tune" ]; then 301 | echo "Setting GCC/Clang flags for Intel Skylake CPU..." 302 | scripts/config --disable CONFIG_GENERIC_CPU 303 | scripts/config --enable CONFIG_MSKYLAKE 304 | fi 305 | 306 | ### Set performance governor 307 | if [ -n "$_per_gov" ]; then 308 | echo "Setting performance governor..." 309 | scripts/config --disable CONFIG_CPU_FREQ_DEFAULT_GOV_SCHEDUTIL 310 | scripts/config --enable CONFIG_CPU_FREQ_DEFAULT_GOV_PERFORMANCE 311 | echo "Disabling uneeded governors..." 312 | scripts/config --disable CONFIG_CPU_FREQ_GOV_ONDEMAND 313 | scripts/config --disable CONFIG_CPU_FREQ_GOV_CONSERVATIVE 314 | scripts/config --disable CONFIG_CPU_FREQ_GOV_USERSPACE 315 | scripts/config --disable CONFIG_CPU_FREQ_GOV_SCHEDUTIL 316 | fi 317 | 318 | ### Disable MQ-Deadline I/O scheduler 319 | if [ -n "$_mq_deadline_disable" ]; then 320 | echo "Disabling MQ-Deadline I/O scheduler..." 321 | scripts/config --disable CONFIG_MQ_IOSCHED_DEADLINE 322 | fi 323 | 324 | ### Disable Kyber I/O scheduler 325 | if [ -n "$_kyber_disable" ]; then 326 | echo "Disabling Kyber I/O scheduler..." 327 | scripts/config --disable CONFIG_MQ_IOSCHED_KYBER 328 | fi 329 | 330 | ### Selecting the CPU scheduler 331 | if [ "$_cpusched" = "bmq" ]; then 332 | echo "Selecting BMQ CPU scheduler..." 333 | scripts/config --enable CONFIG_SCHED_BMQ 334 | scripts/config --disable CONFIG_SCHED_PDS 335 | elif [ "$_cpusched" = "pds" ]; then 336 | echo "Selecting PDS CPU scheduler..." 337 | scripts/config --disable CONFIG_SCHED_BMQ 338 | scripts/config --enable CONFIG_SCHED_PDS 339 | elif [ "$_cpusched" = "none" ]; then 340 | echo "Selecting Completely Fair Scheduler..." 341 | scripts/config --disable CONFIG_SCHED_ALT 342 | else 343 | if [ -n "$_cpusched" ]; then 344 | error "The value $_cpusched is invalid. Choose the correct one again." 345 | else 346 | error "The value is empty. Choose the correct one again." 347 | fi 348 | error "Selecting the CPU scheduler failed!" 349 | exit 350 | fi 351 | 352 | ### Enable KBUILD_CFLAGS -O3 353 | if [ -n "$_cc_harder" ]; then 354 | echo "Enabling KBUILD_CFLAGS -O3..." 355 | scripts/config --disable CONFIG_CC_OPTIMIZE_FOR_PERFORMANCE 356 | scripts/config --enable CONFIG_CC_OPTIMIZE_FOR_PERFORMANCE_O3 357 | fi 358 | 359 | ### Optionally set tickrate to 1000 360 | if [ -n "$_1k_HZ_ticks" ]; then 361 | echo "Setting tick rate to 1k..." 362 | scripts/config --disable CONFIG_HZ_300 363 | scripts/config --enable CONFIG_HZ_1000 364 | scripts/config --set-val CONFIG_HZ 1000 365 | fi 366 | 367 | ### Enable TCP_CONG_BBR2 368 | if [ -n "$_tcp_bbr2" ]; then 369 | echo "Disabling TCP_CONG_CUBIC..." 370 | scripts/config --module CONFIG_TCP_CONG_CUBIC 371 | scripts/config --disable CONFIG_DEFAULT_CUBIC 372 | echo "Enabling TCP_CONG_BBR2..." 373 | scripts/config --enable CONFIG_TCP_CONG_BBR2 374 | scripts/config --enable CONFIG_DEFAULT_BBR2 375 | scripts/config --set-str CONFIG_DEFAULT_TCP_CONG bbr2 376 | fi 377 | 378 | ### Enable FULLCONENAT 379 | if [ -n "$_nf_cone" ]; then 380 | echo "Enabling FULLCONENAT..." 381 | scripts/config --module CONFIG_IP_NF_TARGET_FULLCONENAT 382 | scripts/config --module CONFIG_NETFILTER_XT_TARGET_FULLCONENAT 383 | fi 384 | 385 | ### Enable RTW88 386 | if [ -n "$_rtw88" ]; then 387 | echo "Enabling RTW88..." 388 | scripts/config --module CONFIG_RTW88_USB 389 | scripts/config --module CONFIG_RTW88_8822BU 390 | scripts/config --module CONFIG_RTW88_8822CU 391 | scripts/config --module CONFIG_RTW88_8723DU 392 | scripts/config --module CONFIG_RTW88_8821CU 393 | fi 394 | 395 | ### Enable SPECULATIVE_PAGE_FAULT 396 | if [ "$_spf_config" = "standard" ]; then 397 | echo "Enabling SPECULATIVE_PAGE_FAULT..." 398 | scripts/config --enable CONFIG_SPECULATIVE_PAGE_FAULT 399 | scripts/config --disable CONFIG_SPECULATIVE_PAGE_FAULT_STATS 400 | elif [ "$_spf_config" = "stats" ]; then 401 | echo "Enabling SPECULATIVE_PAGE_FAULT with stats..." 402 | scripts/config --enable CONFIG_SPECULATIVE_PAGE_FAULT 403 | scripts/config --enable CONFIG_SPECULATIVE_PAGE_FAULT_STATS 404 | else 405 | if [ -n "$_spf_config" ]; then 406 | error "The value $_spf_config is invalid. Choose the correct one again." 407 | else 408 | error "The value is empty. Choose the correct one again." 409 | fi 410 | error "Enabling SPECULATIVE_PAGE_FAULT failed!" 411 | exit 412 | fi 413 | 414 | ### Enable protect mappings under memory pressure 415 | if [ -n "$_mm_protect" ]; then 416 | echo "Enabling protect file mappings under memory pressure..." 417 | scripts/config --enable CONFIG_UNEVICTABLE_FILE 418 | scripts/config --set-val CONFIG_UNEVICTABLE_FILE_KBYTES_LOW 0 419 | scripts/config --set-val CONFIG_UNEVICTABLE_FILE_KBYTES_MIN 0 420 | echo "Enabling protect anonymous mappings under memory pressure..." 421 | scripts/config --enable CONFIG_UNEVICTABLE_ANON 422 | scripts/config --set-val CONFIG_UNEVICTABLE_ANON_KBYTES_LOW 0 423 | scripts/config --set-val CONFIG_UNEVICTABLE_ANON_KBYTES_MIN 0 424 | fi 425 | 426 | ### Enable multigenerational LRU 427 | if [ "$_lru_config" = "standard" ]; then 428 | echo "Enabling multigenerational LRU..." 429 | scripts/config --enable CONFIG_LRU_GEN 430 | scripts/config --enable CONFIG_LRU_GEN_ENABLED 431 | scripts/config --disable CONFIG_LRU_GEN_STATS 432 | elif [ "$_lru_config" = "stats" ]; then 433 | echo "Enabling multigenerational LRU with stats..." 434 | scripts/config --enable CONFIG_LRU_GEN 435 | scripts/config --enable CONFIG_LRU_GEN_ENABLED 436 | scripts/config --enable CONFIG_LRU_GEN_STATS 437 | elif [ "$_lru_config" = "none" ]; then 438 | echo "Disabling multigenerational LRU..." 439 | scripts/config --disable CONFIG_LRU_GEN 440 | else 441 | if [ -n "$_lru_config" ]; then 442 | error "The value $_lru_config is invalid. Choose the correct one again." 443 | else 444 | error "The value is empty. Choose the correct one again." 445 | fi 446 | error "Enabling multigenerational LRU failed!" 447 | exit 448 | fi 449 | 450 | ### Enable Linux Random Number Generator 451 | if [ -n "$_lrng_enable" ]; then 452 | echo "Enabling Linux Random Number Generator..." 453 | scripts/config --disable CONFIG_RANDOM_DEFAULT_IMPL 454 | scripts/config --enable CONFIG_LRNG 455 | scripts/config --enable CONFIG_LRNG_SHA256 456 | scripts/config --enable CONFIG_LRNG_COMMON_DEV_IF 457 | scripts/config --enable CONFIG_LRNG_DRNG_ATOMIC 458 | scripts/config --enable CONFIG_LRNG_SYSCTL 459 | scripts/config --enable CONFIG_LRNG_RANDOM_IF 460 | scripts/config --module CONFIG_LRNG_KCAPI_IF 461 | scripts/config --module CONFIG_LRNG_HWRAND_IF 462 | scripts/config --enable CONFIG_LRNG_DEV_IF 463 | scripts/config --enable CONFIG_LRNG_RUNTIME_ES_CONFIG 464 | scripts/config --enable CONFIG_LRNG_IRQ_DFLT_TIMER_ES 465 | scripts/config --disable CONFIG_LRNG_SCHED_DFLT_TIMER_ES 466 | scripts/config --enable CONFIG_LRNG_TIMER_COMMON 467 | scripts/config --disable CONFIG_LRNG_COLLECTION_SIZE_256 468 | scripts/config --disable CONFIG_LRNG_COLLECTION_SIZE_512 469 | scripts/config --enable CONFIG_LRNG_COLLECTION_SIZE_1024 470 | scripts/config --disable CONFIG_LRNG_COLLECTION_SIZE_2048 471 | scripts/config --disable CONFIG_LRNG_COLLECTION_SIZE_4096 472 | scripts/config --disable CONFIG_LRNG_COLLECTION_SIZE_8192 473 | scripts/config --set-val CONFIG_LRNG_COLLECTION_SIZE 1024 474 | scripts/config --enable CONFIG_LRNG_HEALTH_TESTS 475 | scripts/config --set-val CONFIG_LRNG_RCT_CUTOFF 31 476 | scripts/config --set-val CONFIG_LRNG_APT_CUTOFF 325 477 | scripts/config --enable CONFIG_LRNG_IRQ 478 | scripts/config --enable CONFIG_LRNG_CONTINUOUS_COMPRESSION_ENABLED 479 | scripts/config --disable CONFIG_LRNG_CONTINUOUS_COMPRESSION_DISABLED 480 | scripts/config --enable CONFIG_LRNG_ENABLE_CONTINUOUS_COMPRESSION 481 | scripts/config --enable CONFIG_LRNG_SWITCHABLE_CONTINUOUS_COMPRESSION 482 | scripts/config --set-val CONFIG_LRNG_IRQ_ENTROPY_RATE 256 483 | scripts/config --enable CONFIG_LRNG_JENT 484 | scripts/config --set-val CONFIG_LRNG_JENT_ENTROPY_RATE 16 485 | scripts/config --enable CONFIG_LRNG_CPU 486 | scripts/config --set-val CONFIG_LRNG_CPU_FULL_ENT_MULTIPLIER 1 487 | scripts/config --set-val CONFIG_LRNG_CPU_ENTROPY_RATE 8 488 | scripts/config --enable CONFIG_LRNG_SCHED 489 | scripts/config --set-val CONFIG_LRNG_SCHED_ENTROPY_RATE 4294967295 490 | scripts/config --enable CONFIG_LRNG_DRNG_CHACHA20 491 | scripts/config --module CONFIG_LRNG_DRBG 492 | scripts/config --module CONFIG_LRNG_DRNG_KCAPI 493 | scripts/config --enable CONFIG_LRNG_SWITCH 494 | scripts/config --enable CONFIG_LRNG_SWITCH_HASH 495 | scripts/config --module CONFIG_LRNG_HASH_KCAPI 496 | scripts/config --enable CONFIG_LRNG_SWITCH_DRNG 497 | scripts/config --module CONFIG_LRNG_SWITCH_DRBG 498 | scripts/config --module CONFIG_LRNG_SWITCH_DRNG_KCAPI 499 | scripts/config --enable CONFIG_LRNG_DFLT_DRNG_CHACHA20 500 | scripts/config --disable CONFIG_LRNG_DFLT_DRNG_DRBG 501 | scripts/config --disable CONFIG_LRNG_DFLT_DRNG_KCAPI 502 | scripts/config --enable CONFIG_LRNG_TESTING_MENU 503 | scripts/config --disable CONFIG_LRNG_RAW_HIRES_ENTROPY 504 | scripts/config --disable CONFIG_LRNG_RAW_JIFFIES_ENTROPY 505 | scripts/config --disable CONFIG_LRNG_RAW_IRQ_ENTROPY 506 | scripts/config --disable CONFIG_LRNG_RAW_RETIP_ENTROPY 507 | scripts/config --disable CONFIG_LRNG_RAW_REGS_ENTROPY 508 | scripts/config --disable CONFIG_LRNG_RAW_ARRAY 509 | scripts/config --disable CONFIG_LRNG_IRQ_PERF 510 | scripts/config --disable CONFIG_LRNG_RAW_SCHED_HIRES_ENTROPY 511 | scripts/config --disable CONFIG_LRNG_RAW_SCHED_PID_ENTROPY 512 | scripts/config --disable CONFIG_LRNG_RAW_SCHED_START_TIME_ENTROPY 513 | scripts/config --disable CONFIG_LRNG_RAW_SCHED_NVCSW_ENTROPY 514 | scripts/config --disable CONFIG_LRNG_SCHED_PERF 515 | scripts/config --disable CONFIG_LRNG_ACVT_HASH 516 | scripts/config --disable CONFIG_LRNG_RUNTIME_MAX_WO_RESEED_CONFIG 517 | scripts/config --disable CONFIG_LRNG_TEST_CPU_ES_COMPRESSION 518 | scripts/config --enable CONFIG_LRNG_SELFTEST 519 | scripts/config --disable CONFIG_LRNG_SELFTEST_PANIC 520 | fi 521 | 522 | ### Optionally disable NUMA for 64-bit kernels only 523 | # (x86 kernels do not support NUMA) 524 | if [ -n "$_NUMAdisable" ]; then 525 | echo "Disabling NUMA from kernel config..." 526 | scripts/config --disable CONFIG_NUMA 527 | fi 528 | 529 | ### Selecting the ZSTD modules and kernel compression level 530 | if [ "$_zstd_level_value" = "ultra" ]; then 531 | echo "Enabling highest ZSTD modules compression ratio..." 532 | scripts/config --set-val CONFIG_MODULE_COMPRESS_ZSTD_LEVEL 19 533 | scripts/config --enable CONFIG_MODULE_COMPRESS_ZSTD_ULTRA 534 | scripts/config --set-val CONFIG_MODULE_COMPRESS_ZSTD_LEVEL_ULTRA 22 535 | echo "Enabling highest ZSTD kernel compression ratio..." 536 | scripts/config --set-val CONFIG_ZSTD_COMP_VAL 22 537 | elif [ "$_zstd_level_value" = "normal" ]; then 538 | echo "Enabling standard ZSTD modules compression ratio..." 539 | scripts/config --set-val CONFIG_MODULE_COMPRESS_ZSTD_LEVEL 19 540 | scripts/config --disable CONFIG_MODULE_COMPRESS_ZSTD_ULTRA 541 | echo "Enabling standard ZSTD kernel compression ratio..." 542 | scripts/config --set-val CONFIG_ZSTD_COMP_VAL 19 543 | else 544 | if [ -n "$_zstd_level_value" ]; then 545 | error "The value $_zstd_level_value is invalid. Choose the correct one again." 546 | else 547 | error "The value is empty. Choose the correct one again." 548 | fi 549 | error "Selecting the ZSTD modules and kernel compression level failed!" 550 | exit 551 | fi 552 | 553 | ### Enable zram/zswap ZSTD compression 554 | if [ -n "$_zstd_swap_compression" ]; then 555 | echo "Enabling zram ZSTD compression..." 556 | scripts/config --disable CONFIG_ZRAM_DEF_COMP_LZORLE 557 | scripts/config --enable CONFIG_ZRAM_DEF_COMP_ZSTD 558 | scripts/config --set-str CONFIG_ZRAM_DEF_COMP zstd 559 | echo "Enabling zswap ZSTD compression..." 560 | scripts/config --disable CONFIG_ZSWAP_COMPRESSOR_DEFAULT_LZ4 561 | scripts/config --enable CONFIG_ZSWAP_COMPRESSOR_DEFAULT_ZSTD 562 | scripts/config --set-str CONFIG_ZSWAP_COMPRESSOR_DEFAULT zstd 563 | echo "Enabling zram entropy calculation..." 564 | scripts/config --enable CONFIG_ZRAM_ENTROPY 565 | scripts/config --set-val CONFIG_ZRAM_ENTROPY_THRESHOLD 100000 566 | fi 567 | 568 | ### Disable DEBUG 569 | if [ -n "$_disable_debug" ]; then 570 | echo "Disabling DEBUG..." 571 | scripts/config --disable CONFIG_DEBUG_INFO 572 | scripts/config --disable CONFIG_DEBUG_INFO_BTF 573 | scripts/config --disable CONFIG_DEBUG_INFO_DWARF5 574 | scripts/config --disable CONFIG_CGROUP_BPF 575 | scripts/config --disable CONFIG_BPF_LSM 576 | scripts/config --disable CONFIG_BPF_PRELOAD 577 | scripts/config --disable CONFIG_BPF_LIRC_MODE2 578 | scripts/config --disable CONFIG_BPF_KPROBE_OVERRIDE 579 | scripts/config --disable CONFIG_PM_DEBUG 580 | scripts/config --disable CONFIG_PM_SLEEP_DEBUG 581 | scripts/config --disable CONFIG_ACPI_DEBUG 582 | scripts/config --disable CONFIG_SCHED_DEBUG 583 | scripts/config --disable CONFIG_LATENCYTOP 584 | scripts/config --disable CONFIG_DEBUG_PREEMPT 585 | fi 586 | 587 | ### Optionally load needed modules for the make localmodconfig 588 | # See https://aur.archlinux.org/packages/modprobed-db 589 | if [ -n "$_localmodcfg" ]; then 590 | if [ -f $HOME/.config/modprobed.db ]; then 591 | echo "Running Steven Rostedt's make localmodconfig now" 592 | make LSMOD=$HOME/.config/modprobed.db localmodconfig 593 | else 594 | echo "No modprobed.db data found" 595 | exit 596 | fi 597 | fi 598 | 599 | ### Rewrite configuration 600 | echo "Rewrite configuration..." 601 | make prepare 602 | yes "" | make config >/dev/null 603 | diff -u ../config .config || : 604 | 605 | ### Prepared version 606 | make -s kernelrelease > version 607 | echo "Prepared $pkgbase version $( "${startdir}/config.last" 624 | } 625 | 626 | build() { 627 | cd $_srcname 628 | 629 | make all 630 | } 631 | 632 | _package-kernel() { 633 | pkgdesc="The $pkgdesc kernel and modules with the ${_lucjanname}-${_lucjanrev} patchset. Sixth Gen Intel Core i3/i5/i7 optimized." 634 | depends=('coreutils' 'kmod' 'initramfs-lucjan') 635 | optdepends=('wireless-regdb: to set the correct wireless channels of your country' 636 | 'linux-firmware: firmware images needed for some devices' 637 | 'modprobed-db: Keeps track of EVERY kernel module that has ever been probed - useful for those of us who make localmodconfig' 638 | 'uksmd: Userspace KSM helper daemon') 639 | provides=(VIRTUALBOX-GUEST-MODULES WIREGUARD-MODULE UKSMD-BUILTIN) 640 | groups=('linux-lucjan') 641 | 642 | cd $_srcname 643 | local kernver="$( 2 | # Contributor: Jan Alexander Steffens (heftig) 3 | # Contributor: Tobias Powalowski 4 | # Contributor: Thomas Baechler 5 | 6 | ### BUILD OPTIONS 7 | # Set these variables to ANYTHING that is not null to enable them 8 | 9 | ### Tweak kernel options prior to a build via nconfig 10 | _makenconfig= 11 | 12 | ### Tweak kernel options prior to a build via menuconfig 13 | _makemenuconfig= 14 | 15 | ### Tweak kernel options prior to a build via xconfig 16 | _makexconfig= 17 | 18 | ### Tweak kernel options prior to a build via gconfig 19 | _makegconfig= 20 | 21 | # NUMA is optimized for multi-socket motherboards. 22 | # A single multi-core CPU actually runs slower with NUMA enabled. 23 | # See, https://bugs.archlinux.org/task/31187 24 | _NUMAdisable=y 25 | 26 | # Compile ONLY used modules to VASTLYreduce the number of modules built 27 | # and the build time. 28 | # 29 | # To keep track of which modules are needed for your specific system/hardware, 30 | # give module_db script a try: https://aur.archlinux.org/packages/modprobed-db 31 | # This PKGBUILD read the database kept if it exists 32 | # 33 | # More at this wiki page ---> https://wiki.archlinux.org/index.php/Modprobed-db 34 | _localmodcfg= 35 | 36 | # Use the current kernel's .config file 37 | # Enabling this option will use the .config of the RUNNING kernel rather than 38 | # the ARCH defaults. Useful when the package gets updated and you already went 39 | # through the trouble of customizing your config options. NOT recommended when 40 | # a new kernel is released, but again, convenient for package bumps. 41 | _use_current= 42 | 43 | ### Selecting linux-lucjan branding 44 | # ATTENTION - one of two predefined values should be selected! 45 | # 'yes' - enable linux-lucjan branding 46 | # 'no' - disable linux-lucjan branding 47 | _ll_branding='yes' 48 | 49 | ### Setting GCC/Clang flags for your processor 50 | # To see which option to select, run the command: 51 | # gcc -c -Q -march=native --help=target | grep march 52 | # You can find the full list below: 53 | # https://github.com/graysky2/kernel_compiler_patch#expanded-cpus-include 54 | _compiler_tune=y 55 | 56 | ### Set performance governor as default 57 | _per_gov=y 58 | 59 | ### Disable MQ-Deadline I/O scheduler 60 | _mq_deadline_disable=y 61 | 62 | ### Disable Kyber I/O scheduler 63 | _kyber_disable=y 64 | 65 | ### Selecting the CPU scheduler 66 | # ATTENTION - one of three predefined values should be selected! 67 | # 'bmq' - select 'BitMap Queue CPU scheduler' 68 | # 'pds' - select 'Priority and Deadline based Skip list multiple queue CPU scheduler' 69 | # 'none' - select 'Completely Fair Scheduler' 70 | _cpusched='pds' 71 | 72 | ### Enable KBUILD_CFLAGS -O3 73 | _cc_harder=y 74 | 75 | ### Running with a 1000 HZ tick rate 76 | _1k_HZ_ticks=y 77 | 78 | ### Enable protect mappings under memory pressure 79 | _mm_protect=y 80 | 81 | ### Enable multigenerational LRU 82 | # ATTENTION - one of three predefined values should be selected! 83 | # 'standard' - enable multigenerational LRU 84 | # 'stats' - enable multigenerational LRU with stats 85 | # 'none' - disable multigenerational LRU 86 | _lru_config='standard' 87 | 88 | ### Enable Linux Random Number Generator 89 | _lrng_enable=y 90 | 91 | ### Enable TCP_CONG_BBR2 92 | _tcp_bbr2=y 93 | 94 | ### Enable FULLCONENAT 95 | _nf_cone=y 96 | 97 | ### Enable RTW88 98 | _rtw88= 99 | 100 | ### Enable SPECULATIVE_PAGE_FAULT 101 | # ATTENTION - one of two predefined values should be selected! 102 | # 'standard' - enable SPECULATIVE_PAGE_FAULT 103 | # 'stats' - enable support SPECULATIVE_PAGE_FAULT with stats 104 | _spf_config='standard' 105 | 106 | ### Selecting the ZSTD kernel and modules compression level 107 | # ATTENTION - one of two predefined values should be selected! 108 | # 'ultra' - highest compression ratio 109 | # 'normal' - standard compression ratio 110 | # WARNING: the ultra settings can sometimes 111 | # be counterproductive in both size and speed. 112 | _zstd_level_value='ultra' 113 | 114 | # Enable zram/zswap ZSTD compression 115 | _zstd_swap_compression=y 116 | 117 | # Disable DEBUG to lower the size of the kernel 118 | _disable_debug=y 119 | 120 | ### Download ll-reverts patchset 121 | # ATTENTION - one of two predefined values should be selected! 122 | # 'stable' - stable releases (recommended) 123 | # 'unstable' - rc releases (active only temporarily) 124 | _ll_rev='stable' 125 | 126 | ### Download linux-lucjan patchset 127 | # ATTENTION - one of four predefined values should be selected! 128 | # 'current' - stable releases (recommended) 129 | # 'pending' - resync stable releases (active only temporarily) 130 | # 'testing' - rc releases (active only temporarily) 131 | # 'trunk' - pre-rc releases (active only temporarily) 132 | _linux_lucjan='testing' 133 | 134 | ### Do not edit below this line unless you know what you're doing 135 | 136 | pkgbase=linux-lucjan-git 137 | _pkgbase=linux-lucjan 138 | # pkgname=('linux-lucjan-git-kernel' 'linux-lucjan-git-headers') 139 | _major=5.18 140 | _patches=${_major}-dev 141 | _srcname=linux-stable-rc 142 | pkgver=5.18.12.r232.ga04b1a5cb7d2.ll132 143 | pkgrel=0 144 | pkgdesc='Linux LL' 145 | arch=('x86_64') 146 | url="https://gitlab.com/sirlucjan/lucjan-kernels/wikis/README" 147 | license=('GPL2') 148 | options=('!strip') 149 | makedepends=('bc' 'libelf' 'cpio' 'perl' 'tar' 'xz' 'git') 150 | if [ -z "$_disable_debug" ]; then 151 | makedepends+=('pahole') 152 | fi 153 | 154 | ### LL reverts 155 | # Some patches for BFQ/block-stable conflict with 156 | # patches for BFQ-dev/block-mainline. 157 | # To use linux-lucjan smoothly do not change 158 | # the settings below. Otherwise kernel 159 | # will not compile. 160 | 161 | if [ "$_ll_rev" = "stable" ]; then 162 | 163 | # _llrevpath="https://raw.githubusercontent.com/sirlucjan/kernel-patches/master/${_patches}/ll-reverts/stable" 164 | _llrevpath="https://gitlab.com/sirlucjan/kernel-patches/raw/master/${_patches}/ll-reverts/stable" 165 | _llrevname='ll-reverts' 166 | _llrevver='ver1' 167 | _llrevpatch="${_major}-${_llrevname}-${_llrevver}.patch" 168 | 169 | elif [ "$_ll_rev" = "unstable" ]; then 170 | 171 | # _llrevpath="https://raw.githubusercontent.com/sirlucjan/kernel-patches/master/${_patches}/ll-reverts/unstable" 172 | _llrevpath="https://gitlab.com/sirlucjan/kernel-patches/raw/master/${_patches}/ll-reverts/unstable" 173 | _llrevname='ll-reverts' 174 | _llrevver='ver1' 175 | _llrevrc='rc1' 176 | _llrevpatch="${_major}-${_llrevname}-${_llrevver}-${_llrevrc}.patch" 177 | 178 | fi 179 | 180 | ### linux-lucjan 181 | # If you do not use the kernel development version (stable-rc) 182 | # only the current branch will be used. Pending and testing branches 183 | # are used only in development versions (stable-rc) 184 | # and the trunk branch is used only in the first releases 185 | # of the new kernel line or contains only temporary solutions. 186 | 187 | if [ "$_linux_lucjan" = "current" ]; then 188 | 189 | # _lucjanpath="https://raw.githubusercontent.com/sirlucjan/${_pkgbase}/master/current" 190 | _lucjanpath="https://gitlab.com/sirlucjan/${_pkgbase}/raw/master/current" 191 | _lucjanname='lucjan' 192 | _lucjanrev='ll131' 193 | _lucjanpatch="${_major}-${_lucjanname}-${_lucjanrev}.patch" 194 | 195 | elif [ "$_linux_lucjan" = "pending" ]; then 196 | 197 | # _lucjanpath="https://raw.githubusercontent.com/sirlucjan/${_pkgbase}/master/pending" 198 | _lucjanpath="https://gitlab.com/sirlucjan/${_pkgbase}/raw/master/pending" 199 | _lucjanname='lucjan' 200 | _lucjanrev='ll59' 201 | _lucjanpatch="${_major}-${_lucjanname}-${_lucjanrev}.patch" 202 | 203 | elif [ "$_linux_lucjan" = "testing" ]; then 204 | 205 | # _lucjanpath="https://raw.githubusercontent.com/sirlucjan/${_pkgbase}/master/testing" 206 | _lucjanpath="https://gitlab.com/sirlucjan/${_pkgbase}/raw/master/testing" 207 | _lucjanname='lucjan' 208 | _lucjanrev='ll132' 209 | _lucjanrc='rc1' 210 | _lucjanpatch="${_major}-${_lucjanname}-${_lucjanrev}-${_lucjanrc}.patch" 211 | 212 | elif [ "$_linux_lucjan" = "trunk" ]; then 213 | 214 | # _lucjanpath="https://raw.githubusercontent.com/sirlucjan/${_pkgbase}/master/trunk" 215 | _lucjanpath="https://gitlab.com/sirlucjan/${_pkgbase}/raw/master/trunk" 216 | _lucjanname='lucjan' 217 | _lucjanrev='ll22' 218 | _lucjanrc='rc1' 219 | _lucjanpatch="${_major}-${_lucjanname}-${_lucjanrev}-${_lucjanrc}.patch" 220 | 221 | fi 222 | 223 | source=("git://git.kernel.org/pub/scm/linux/kernel/git/stable/${_srcname}.git#branch=linux-${_major}.y" 224 | # ll-reverts 225 | # "${_llrevpath}/${_llrevpatch}"{,.sig} 226 | # linux-lucjan 227 | "${_lucjanpath}/${_lucjanpatch}"{,.sig} 228 | # the main kernel config files 229 | 'config') 230 | 231 | export KBUILD_BUILD_HOST=archlinux 232 | export KBUILD_BUILD_USER=$pkgbase 233 | export KBUILD_BUILD_TIMESTAMP="$(date -Ru${SOURCE_DATE_EPOCH:+d @$SOURCE_DATE_EPOCH})" 234 | 235 | pkgver() { 236 | cd $_srcname 237 | 238 | _ver="$(git describe --long --tags | sed 's/^v//;s/\([^-]*-g\)/r\1/;s/-/./g')" 239 | printf ${_ver}.${_lucjanrev} 240 | } 241 | 242 | prepare() { 243 | cd $_srcname 244 | 245 | ### Setting version 246 | echo "Setting version..." 247 | sed -e "/^EXTRAVERSION =/s/=.*/=/" -i Makefile 248 | touch .scmversion 249 | scripts/setlocalversion --save-scmversion 250 | echo "-$pkgrel" > localversion.10-pkgrel 251 | echo "${pkgbase#linux}" > localversion.20-pkgname 252 | 253 | ### Patching sources 254 | local src 255 | for src in "${source[@]}"; do 256 | src="${src%%::*}" 257 | src="${src##*/}" 258 | [[ $src = *.patch ]] || continue 259 | echo "Applying patch $src..." 260 | patch -Np1 < "../$src" 261 | done 262 | 263 | ### Setting config 264 | echo "Setting config..." 265 | cp ../config .config 266 | 267 | ### Optionally use running kernel's config 268 | # code originally by nous; http://aur.archlinux.org/packages.php?ID=40191 269 | if [ -n "$_use_current" ]; then 270 | if [[ -s /proc/config.gz ]]; then 271 | echo "Extracting config from /proc/config.gz..." 272 | # modprobe configs 273 | zcat /proc/config.gz > ./.config 274 | else 275 | warning "Your kernel was not compiled with IKCONFIG_PROC!" 276 | warning "You cannot read the current config!" 277 | warning "Aborting!" 278 | exit 279 | fi 280 | fi 281 | 282 | ### Selecting linux-lucjan branding 283 | if [ "$_ll_branding" = "yes" ]; then 284 | echo "Enabling linux-lucjan branding..." 285 | scripts/config --enable CONFIG_LL_BRANDING 286 | elif [ "$_ll_branding" = "no" ]; then 287 | echo "Disabling linux-lucjan branding..." 288 | scripts/config --disable CONFIG_LL_BRANDING 289 | else 290 | if [ -n "$_ll_branding" ]; then 291 | error "The value $_ll_branding is invalid. Choose the correct one again." 292 | else 293 | error "The value is empty. Choose the correct one again." 294 | fi 295 | error "Selecting linux-lucjan branding failed!" 296 | exit 297 | fi 298 | 299 | ### Set GCC/Clang flags 300 | if [ -n "$_compiler_tune" ]; then 301 | echo "Setting GCC/Clang flags for Intel Skylake CPU..." 302 | scripts/config --disable CONFIG_GENERIC_CPU 303 | scripts/config --enable CONFIG_MSKYLAKE 304 | fi 305 | 306 | ### Set performance governor 307 | if [ -n "$_per_gov" ]; then 308 | echo "Setting performance governor..." 309 | scripts/config --disable CONFIG_CPU_FREQ_DEFAULT_GOV_SCHEDUTIL 310 | scripts/config --enable CONFIG_CPU_FREQ_DEFAULT_GOV_PERFORMANCE 311 | echo "Disabling uneeded governors..." 312 | scripts/config --disable CONFIG_CPU_FREQ_GOV_ONDEMAND 313 | scripts/config --disable CONFIG_CPU_FREQ_GOV_CONSERVATIVE 314 | scripts/config --disable CONFIG_CPU_FREQ_GOV_USERSPACE 315 | scripts/config --disable CONFIG_CPU_FREQ_GOV_SCHEDUTIL 316 | fi 317 | 318 | ### Disable MQ-Deadline I/O scheduler 319 | if [ -n "$_mq_deadline_disable" ]; then 320 | echo "Disabling MQ-Deadline I/O scheduler..." 321 | scripts/config --disable CONFIG_MQ_IOSCHED_DEADLINE 322 | fi 323 | 324 | ### Disable Kyber I/O scheduler 325 | if [ -n "$_kyber_disable" ]; then 326 | echo "Disabling Kyber I/O scheduler..." 327 | scripts/config --disable CONFIG_MQ_IOSCHED_KYBER 328 | fi 329 | 330 | ### Selecting the CPU scheduler 331 | if [ "$_cpusched" = "bmq" ]; then 332 | echo "Selecting BMQ CPU scheduler..." 333 | scripts/config --enable CONFIG_SCHED_BMQ 334 | scripts/config --disable CONFIG_SCHED_PDS 335 | elif [ "$_cpusched" = "pds" ]; then 336 | echo "Selecting PDS CPU scheduler..." 337 | scripts/config --disable CONFIG_SCHED_BMQ 338 | scripts/config --enable CONFIG_SCHED_PDS 339 | elif [ "$_cpusched" = "none" ]; then 340 | echo "Selecting Completely Fair Scheduler..." 341 | scripts/config --disable CONFIG_SCHED_ALT 342 | else 343 | if [ -n "$_cpusched" ]; then 344 | error "The value $_cpusched is invalid. Choose the correct one again." 345 | else 346 | error "The value is empty. Choose the correct one again." 347 | fi 348 | error "Selecting the CPU scheduler failed!" 349 | exit 350 | fi 351 | 352 | ### Enable KBUILD_CFLAGS -O3 353 | if [ -n "$_cc_harder" ]; then 354 | echo "Enabling KBUILD_CFLAGS -O3..." 355 | scripts/config --disable CONFIG_CC_OPTIMIZE_FOR_PERFORMANCE 356 | scripts/config --enable CONFIG_CC_OPTIMIZE_FOR_PERFORMANCE_O3 357 | fi 358 | 359 | ### Optionally set tickrate to 1000 360 | if [ -n "$_1k_HZ_ticks" ]; then 361 | echo "Setting tick rate to 1k..." 362 | scripts/config --disable CONFIG_HZ_300 363 | scripts/config --enable CONFIG_HZ_1000 364 | scripts/config --set-val CONFIG_HZ 1000 365 | fi 366 | 367 | ### Enable TCP_CONG_BBR2 368 | if [ -n "$_tcp_bbr2" ]; then 369 | echo "Disabling TCP_CONG_CUBIC..." 370 | scripts/config --module CONFIG_TCP_CONG_CUBIC 371 | scripts/config --disable CONFIG_DEFAULT_CUBIC 372 | echo "Enabling TCP_CONG_BBR2..." 373 | scripts/config --enable CONFIG_TCP_CONG_BBR2 374 | scripts/config --enable CONFIG_DEFAULT_BBR2 375 | scripts/config --set-str CONFIG_DEFAULT_TCP_CONG bbr2 376 | fi 377 | 378 | ### Enable FULLCONENAT 379 | if [ -n "$_nf_cone" ]; then 380 | echo "Enabling FULLCONENAT..." 381 | scripts/config --module CONFIG_IP_NF_TARGET_FULLCONENAT 382 | scripts/config --module CONFIG_NETFILTER_XT_TARGET_FULLCONENAT 383 | fi 384 | 385 | ### Enable RTW88 386 | if [ -n "$_rtw88" ]; then 387 | echo "Enabling RTW88..." 388 | scripts/config --module CONFIG_RTW88_USB 389 | scripts/config --module CONFIG_RTW88_8822BU 390 | scripts/config --module CONFIG_RTW88_8822CU 391 | scripts/config --module CONFIG_RTW88_8723DU 392 | scripts/config --module CONFIG_RTW88_8821CU 393 | fi 394 | 395 | ### Enable SPECULATIVE_PAGE_FAULT 396 | if [ "$_spf_config" = "standard" ]; then 397 | echo "Enabling SPECULATIVE_PAGE_FAULT..." 398 | scripts/config --enable CONFIG_SPECULATIVE_PAGE_FAULT 399 | scripts/config --disable CONFIG_SPECULATIVE_PAGE_FAULT_STATS 400 | elif [ "$_spf_config" = "stats" ]; then 401 | echo "Enabling SPECULATIVE_PAGE_FAULT with stats..." 402 | scripts/config --enable CONFIG_SPECULATIVE_PAGE_FAULT 403 | scripts/config --enable CONFIG_SPECULATIVE_PAGE_FAULT_STATS 404 | else 405 | if [ -n "$_spf_config" ]; then 406 | error "The value $_spf_config is invalid. Choose the correct one again." 407 | else 408 | error "The value is empty. Choose the correct one again." 409 | fi 410 | error "Enabling SPECULATIVE_PAGE_FAULT failed!" 411 | exit 412 | fi 413 | 414 | ### Enable protect mappings under memory pressure 415 | if [ -n "$_mm_protect" ]; then 416 | echo "Enabling protect file mappings under memory pressure..." 417 | scripts/config --enable CONFIG_UNEVICTABLE_FILE 418 | scripts/config --set-val CONFIG_UNEVICTABLE_FILE_KBYTES_LOW 0 419 | scripts/config --set-val CONFIG_UNEVICTABLE_FILE_KBYTES_MIN 0 420 | echo "Enabling protect anonymous mappings under memory pressure..." 421 | scripts/config --enable CONFIG_UNEVICTABLE_ANON 422 | scripts/config --set-val CONFIG_UNEVICTABLE_ANON_KBYTES_LOW 0 423 | scripts/config --set-val CONFIG_UNEVICTABLE_ANON_KBYTES_MIN 0 424 | fi 425 | 426 | ### Enable multigenerational LRU 427 | if [ "$_lru_config" = "standard" ]; then 428 | echo "Enabling multigenerational LRU..." 429 | scripts/config --enable CONFIG_LRU_GEN 430 | scripts/config --enable CONFIG_LRU_GEN_ENABLED 431 | scripts/config --disable CONFIG_LRU_GEN_STATS 432 | elif [ "$_lru_config" = "stats" ]; then 433 | echo "Enabling multigenerational LRU with stats..." 434 | scripts/config --enable CONFIG_LRU_GEN 435 | scripts/config --enable CONFIG_LRU_GEN_ENABLED 436 | scripts/config --enable CONFIG_LRU_GEN_STATS 437 | elif [ "$_lru_config" = "none" ]; then 438 | echo "Disabling multigenerational LRU..." 439 | scripts/config --disable CONFIG_LRU_GEN 440 | else 441 | if [ -n "$_lru_config" ]; then 442 | error "The value $_lru_config is invalid. Choose the correct one again." 443 | else 444 | error "The value is empty. Choose the correct one again." 445 | fi 446 | error "Enabling multigenerational LRU failed!" 447 | exit 448 | fi 449 | 450 | ### Enable Linux Random Number Generator 451 | if [ -n "$_lrng_enable" ]; then 452 | echo "Enabling Linux Random Number Generator..." 453 | scripts/config --disable CONFIG_RANDOM_DEFAULT_IMPL 454 | scripts/config --enable CONFIG_LRNG 455 | scripts/config --enable CONFIG_LRNG_SHA256 456 | scripts/config --enable CONFIG_LRNG_COMMON_DEV_IF 457 | scripts/config --enable CONFIG_LRNG_DRNG_ATOMIC 458 | scripts/config --enable CONFIG_LRNG_SYSCTL 459 | scripts/config --enable CONFIG_LRNG_RANDOM_IF 460 | scripts/config --module CONFIG_LRNG_KCAPI_IF 461 | scripts/config --module CONFIG_LRNG_HWRAND_IF 462 | scripts/config --enable CONFIG_LRNG_DEV_IF 463 | scripts/config --enable CONFIG_LRNG_RUNTIME_ES_CONFIG 464 | scripts/config --enable CONFIG_LRNG_IRQ_DFLT_TIMER_ES 465 | scripts/config --disable CONFIG_LRNG_SCHED_DFLT_TIMER_ES 466 | scripts/config --enable CONFIG_LRNG_TIMER_COMMON 467 | scripts/config --disable CONFIG_LRNG_COLLECTION_SIZE_256 468 | scripts/config --disable CONFIG_LRNG_COLLECTION_SIZE_512 469 | scripts/config --enable CONFIG_LRNG_COLLECTION_SIZE_1024 470 | scripts/config --disable CONFIG_LRNG_COLLECTION_SIZE_2048 471 | scripts/config --disable CONFIG_LRNG_COLLECTION_SIZE_4096 472 | scripts/config --disable CONFIG_LRNG_COLLECTION_SIZE_8192 473 | scripts/config --set-val CONFIG_LRNG_COLLECTION_SIZE 1024 474 | scripts/config --enable CONFIG_LRNG_HEALTH_TESTS 475 | scripts/config --set-val CONFIG_LRNG_RCT_CUTOFF 31 476 | scripts/config --set-val CONFIG_LRNG_APT_CUTOFF 325 477 | scripts/config --enable CONFIG_LRNG_IRQ 478 | scripts/config --enable CONFIG_LRNG_CONTINUOUS_COMPRESSION_ENABLED 479 | scripts/config --disable CONFIG_LRNG_CONTINUOUS_COMPRESSION_DISABLED 480 | scripts/config --enable CONFIG_LRNG_ENABLE_CONTINUOUS_COMPRESSION 481 | scripts/config --enable CONFIG_LRNG_SWITCHABLE_CONTINUOUS_COMPRESSION 482 | scripts/config --set-val CONFIG_LRNG_IRQ_ENTROPY_RATE 256 483 | scripts/config --enable CONFIG_LRNG_JENT 484 | scripts/config --set-val CONFIG_LRNG_JENT_ENTROPY_RATE 16 485 | scripts/config --enable CONFIG_LRNG_CPU 486 | scripts/config --set-val CONFIG_LRNG_CPU_FULL_ENT_MULTIPLIER 1 487 | scripts/config --set-val CONFIG_LRNG_CPU_ENTROPY_RATE 8 488 | scripts/config --enable CONFIG_LRNG_SCHED 489 | scripts/config --set-val CONFIG_LRNG_SCHED_ENTROPY_RATE 4294967295 490 | scripts/config --enable CONFIG_LRNG_DRNG_CHACHA20 491 | scripts/config --module CONFIG_LRNG_DRBG 492 | scripts/config --module CONFIG_LRNG_DRNG_KCAPI 493 | scripts/config --enable CONFIG_LRNG_SWITCH 494 | scripts/config --enable CONFIG_LRNG_SWITCH_HASH 495 | scripts/config --module CONFIG_LRNG_HASH_KCAPI 496 | scripts/config --enable CONFIG_LRNG_SWITCH_DRNG 497 | scripts/config --module CONFIG_LRNG_SWITCH_DRBG 498 | scripts/config --module CONFIG_LRNG_SWITCH_DRNG_KCAPI 499 | scripts/config --enable CONFIG_LRNG_DFLT_DRNG_CHACHA20 500 | scripts/config --disable CONFIG_LRNG_DFLT_DRNG_DRBG 501 | scripts/config --disable CONFIG_LRNG_DFLT_DRNG_KCAPI 502 | scripts/config --enable CONFIG_LRNG_TESTING_MENU 503 | scripts/config --disable CONFIG_LRNG_RAW_HIRES_ENTROPY 504 | scripts/config --disable CONFIG_LRNG_RAW_JIFFIES_ENTROPY 505 | scripts/config --disable CONFIG_LRNG_RAW_IRQ_ENTROPY 506 | scripts/config --disable CONFIG_LRNG_RAW_RETIP_ENTROPY 507 | scripts/config --disable CONFIG_LRNG_RAW_REGS_ENTROPY 508 | scripts/config --disable CONFIG_LRNG_RAW_ARRAY 509 | scripts/config --disable CONFIG_LRNG_IRQ_PERF 510 | scripts/config --disable CONFIG_LRNG_RAW_SCHED_HIRES_ENTROPY 511 | scripts/config --disable CONFIG_LRNG_RAW_SCHED_PID_ENTROPY 512 | scripts/config --disable CONFIG_LRNG_RAW_SCHED_START_TIME_ENTROPY 513 | scripts/config --disable CONFIG_LRNG_RAW_SCHED_NVCSW_ENTROPY 514 | scripts/config --disable CONFIG_LRNG_SCHED_PERF 515 | scripts/config --disable CONFIG_LRNG_ACVT_HASH 516 | scripts/config --disable CONFIG_LRNG_RUNTIME_MAX_WO_RESEED_CONFIG 517 | scripts/config --disable CONFIG_LRNG_TEST_CPU_ES_COMPRESSION 518 | scripts/config --enable CONFIG_LRNG_SELFTEST 519 | scripts/config --disable CONFIG_LRNG_SELFTEST_PANIC 520 | fi 521 | 522 | ### Optionally disable NUMA for 64-bit kernels only 523 | # (x86 kernels do not support NUMA) 524 | if [ -n "$_NUMAdisable" ]; then 525 | echo "Disabling NUMA from kernel config..." 526 | scripts/config --disable CONFIG_NUMA 527 | fi 528 | 529 | ### Selecting the ZSTD modules and kernel compression level 530 | if [ "$_zstd_level_value" = "ultra" ]; then 531 | echo "Enabling highest ZSTD modules compression ratio..." 532 | scripts/config --set-val CONFIG_MODULE_COMPRESS_ZSTD_LEVEL 19 533 | scripts/config --enable CONFIG_MODULE_COMPRESS_ZSTD_ULTRA 534 | scripts/config --set-val CONFIG_MODULE_COMPRESS_ZSTD_LEVEL_ULTRA 22 535 | echo "Enabling highest ZSTD kernel compression ratio..." 536 | scripts/config --set-val CONFIG_ZSTD_COMP_VAL 22 537 | elif [ "$_zstd_level_value" = "normal" ]; then 538 | echo "Enabling standard ZSTD modules compression ratio..." 539 | scripts/config --set-val CONFIG_MODULE_COMPRESS_ZSTD_LEVEL 19 540 | scripts/config --disable CONFIG_MODULE_COMPRESS_ZSTD_ULTRA 541 | echo "Enabling standard ZSTD kernel compression ratio..." 542 | scripts/config --set-val CONFIG_ZSTD_COMP_VAL 19 543 | else 544 | if [ -n "$_zstd_level_value" ]; then 545 | error "The value $_zstd_level_value is invalid. Choose the correct one again." 546 | else 547 | error "The value is empty. Choose the correct one again." 548 | fi 549 | error "Selecting the ZSTD modules and kernel compression level failed!" 550 | exit 551 | fi 552 | 553 | ### Enable zram/zswap ZSTD compression 554 | if [ -n "$_zstd_swap_compression" ]; then 555 | echo "Enabling zram ZSTD compression..." 556 | scripts/config --disable CONFIG_ZRAM_DEF_COMP_LZORLE 557 | scripts/config --enable CONFIG_ZRAM_DEF_COMP_ZSTD 558 | scripts/config --set-str CONFIG_ZRAM_DEF_COMP zstd 559 | echo "Enabling zswap ZSTD compression..." 560 | scripts/config --disable CONFIG_ZSWAP_COMPRESSOR_DEFAULT_LZ4 561 | scripts/config --enable CONFIG_ZSWAP_COMPRESSOR_DEFAULT_ZSTD 562 | scripts/config --set-str CONFIG_ZSWAP_COMPRESSOR_DEFAULT zstd 563 | echo "Enabling zram entropy calculation..." 564 | scripts/config --enable CONFIG_ZRAM_ENTROPY 565 | scripts/config --set-val CONFIG_ZRAM_ENTROPY_THRESHOLD 100000 566 | fi 567 | 568 | ### Disable DEBUG 569 | if [ -n "$_disable_debug" ]; then 570 | echo "Disabling DEBUG..." 571 | scripts/config --disable CONFIG_DEBUG_INFO 572 | scripts/config --disable CONFIG_DEBUG_INFO_BTF 573 | scripts/config --disable CONFIG_DEBUG_INFO_DWARF5 574 | scripts/config --disable CONFIG_CGROUP_BPF 575 | scripts/config --disable CONFIG_BPF_LSM 576 | scripts/config --disable CONFIG_BPF_PRELOAD 577 | scripts/config --disable CONFIG_BPF_LIRC_MODE2 578 | scripts/config --disable CONFIG_BPF_KPROBE_OVERRIDE 579 | scripts/config --disable CONFIG_PM_DEBUG 580 | scripts/config --disable CONFIG_PM_SLEEP_DEBUG 581 | scripts/config --disable CONFIG_ACPI_DEBUG 582 | scripts/config --disable CONFIG_SCHED_DEBUG 583 | scripts/config --disable CONFIG_LATENCYTOP 584 | scripts/config --disable CONFIG_DEBUG_PREEMPT 585 | fi 586 | 587 | ### Optionally load needed modules for the make localmodconfig 588 | # See https://aur.archlinux.org/packages/modprobed-db 589 | if [ -n "$_localmodcfg" ]; then 590 | if [ -f $HOME/.config/modprobed.db ]; then 591 | echo "Running Steven Rostedt's make localmodconfig now" 592 | make LSMOD=$HOME/.config/modprobed.db localmodconfig 593 | else 594 | echo "No modprobed.db data found" 595 | exit 596 | fi 597 | fi 598 | 599 | ### Rewrite configuration 600 | echo "Rewrite configuration..." 601 | make prepare 602 | yes "" | make config >/dev/null 603 | diff -u ../config .config || : 604 | 605 | ### Prepared version 606 | make -s kernelrelease > version 607 | echo "Prepared $pkgbase version $( "${startdir}/config.last" 624 | } 625 | 626 | build() { 627 | cd $_srcname 628 | 629 | make all 630 | } 631 | 632 | _package-kernel() { 633 | pkgdesc="The $pkgdesc kernel and modules with the ${_lucjanname}-${_lucjanrev} patchset. Sixth Gen Intel Core i3/i5/i7 optimized." 634 | depends=('coreutils' 'kmod' 'initramfs-lucjan') 635 | optdepends=('wireless-regdb: to set the correct wireless channels of your country' 636 | 'linux-firmware: firmware images needed for some devices' 637 | 'modprobed-db: Keeps track of EVERY kernel module that has ever been probed - useful for those of us who make localmodconfig' 638 | 'uksmd: Userspace KSM helper daemon') 639 | provides=(VIRTUALBOX-GUEST-MODULES WIREGUARD-MODULE UKSMD-BUILTIN) 640 | groups=('linux-lucjan-git') 641 | 642 | cd $_srcname 643 | local kernver="$(