├── .SRCINFO ├── .gitignore └── PKGBUILD /.SRCINFO: -------------------------------------------------------------------------------- 1 | pkgbase = linux-lqx 2 | pkgdesc = Linux Liquorix 3 | pkgver = 6.16.11.lqx1 4 | pkgrel = 1 5 | url = https://liquorix.net/ 6 | arch = x86_64 7 | license = GPL-2.0-only 8 | makedepends = bc 9 | makedepends = cpio 10 | makedepends = gettext 11 | makedepends = git 12 | makedepends = libelf 13 | makedepends = pahole 14 | makedepends = perl 15 | makedepends = python 16 | makedepends = rust 17 | makedepends = rust-src 18 | makedepends = rust-bindgen 19 | makedepends = tar 20 | makedepends = xz 21 | makedepends = zstd 22 | options = !debug 23 | options = !strip 24 | source = https://cdn.kernel.org/pub/linux/kernel/v6.x/linux-6.16.tar.xz 25 | source = https://cdn.kernel.org/pub/linux/kernel/v6.x/linux-6.16.tar.sign 26 | source = https://github.com/damentz/liquorix-package/archive/6.16-10.tar.gz 27 | validpgpkeys = ABAF11C65A2970B130ABE3C479BE3E4300411886 28 | validpgpkeys = 647F28654894E3BD457199BE38DBBDC86092693E 29 | sha512sums = 55a00f89ad6db6db2e26ff5dc5cfc96bbf6654e5bd5d17d2a3b944a47640367e54139716d230923187bebc6cb7756edc9511a620fb8abc6f32c50a658a734784 30 | sha512sums = SKIP 31 | sha512sums = 5fbb2fb2eff64df1edff62325cf726345352e54acd611f2502dbd532f0048eaed77fc58657bc92e1db049f7ab22fe24d8143719c6487ff96b697f206a9172e9b 32 | 33 | pkgname = linux-lqx 34 | pkgdesc = The Linux Liquorix kernel and modules 35 | depends = coreutils 36 | depends = kmod 37 | depends = initramfs 38 | optdepends = wireless-regdb: to set the correct wireless channels of your country 39 | optdepends = linux-firmware: firmware images needed for some devices 40 | optdepends = sof-firmware: firmware images needed for Sound Open Firmware capable devices 41 | optdepends = modprobed-db: Keeps track of EVERY kernel module that has ever been probed - useful for those of us who make localmodconfig 42 | optdepends = uksmd: Userspace KSM helper daemon 43 | provides = VIRTUALBOX-GUEST-MODULES 44 | provides = WIREGUARD-MODULE 45 | provides = UKSMD-BUILTIN 46 | provides = VHBA-MODULE 47 | 48 | pkgname = linux-lqx-headers 49 | pkgdesc = Headers and scripts for building modules for the Linux Liquorix kernel 50 | depends = linux-lqx 51 | depends = pahole 52 | 53 | pkgname = linux-lqx-docs 54 | pkgdesc = Documentation for the Linux Liquorix kernel 55 | depends = linux-lqx 56 | -------------------------------------------------------------------------------- /.gitignore: -------------------------------------------------------------------------------- 1 | /*.tar.* 2 | /*.tar 3 | /*.pkg 4 | /config.last 5 | /src 6 | /pkg 7 | -------------------------------------------------------------------------------- /PKGBUILD: -------------------------------------------------------------------------------- 1 | # Maintainer: Piotr Gorski PGP-Key: BDB26C5A 2 | # Contributor: shivik <> PGP-Key: 761E423C 3 | # Contributor: Michael Duell PGP-Key: 6EE23EBE 4 | # A special thanks to Steven Barrett for very important suggestions 5 | # Contributor: Jan Alexander Steffens (heftig) 6 | # Contributor: Tobias Powalowski 7 | # Contributor: Thomas Baechler 8 | 9 | ### BUILD OPTIONS 10 | # Set these variables to ANYTHING that is not null to enable them 11 | 12 | ### Tweak kernel options prior to a build via nconfig 13 | _makenconfig= 14 | 15 | ### Tweak kernel options prior to a build via menuconfig 16 | _makemenuconfig= 17 | 18 | ### Tweak kernel options prior to a build via xconfig 19 | _makexconfig= 20 | 21 | ### Tweak kernel options prior to a build via gconfig 22 | _makegconfig= 23 | 24 | # Compile ONLY used modules to VASTLY reduce the number of modules built 25 | # and the build time. 26 | # 27 | # To keep track of which modules are needed for your specific system/hardware, 28 | # give module_db script a try: https://aur.archlinux.org/packages/modprobed-db 29 | # This PKGBUILD read the database kept if it exists 30 | # 31 | # More at this wiki page ---> https://wiki.archlinux.org/index.php/Modprobed-db 32 | _localmodcfg= 33 | 34 | # Use the current kernel's .config file 35 | # Enabling this option will use the .config of the RUNNING kernel rather than 36 | # the ARCH defaults. Useful when the package gets updated and you already went 37 | # through the trouble of customizing your config options. NOT recommended when 38 | # a new kernel is released, but again, convenient for package bumps. 39 | _use_current= 40 | 41 | ### Selecting the CPU scheduler 42 | # ATTENTION - one of three predefined values should be selected! 43 | # 'bmq' - select 'BitMap Queue CPU scheduler' 44 | # 'pds' - select 'Priority and Deadline based Skip list multiple queue CPU scheduler' 45 | # 'none' - select 'Completely Fair Scheduler' 46 | _projectc='pds' 47 | 48 | ### Enable htmldocs (increases compile time) 49 | _htmldocs_enable= 50 | 51 | ### Do not edit below this line unless you know what you're doing 52 | 53 | # pkgname=('linux-lqx' 'linux-lqx-headers' 'linux-lqx-docs') 54 | _major=6.16 55 | _srcname=linux-${_major} 56 | _lqxpatchname=liquorix-package 57 | _lqxpatchrel=10 58 | _lqxpatchver=${_lqxpatchname}-${_major}-${_lqxpatchrel} 59 | pkgbase=linux-lqx 60 | pkgver=6.16.11.lqx1 61 | pkgrel=1 62 | pkgdesc='Linux Liquorix' 63 | url='https://liquorix.net/' 64 | arch=(x86_64) 65 | license=(GPL-2.0-only) 66 | makedepends=( 67 | bc 68 | cpio 69 | gettext 70 | git 71 | libelf 72 | pahole 73 | perl 74 | python 75 | rust 76 | rust-src 77 | rust-bindgen 78 | tar 79 | xz 80 | zstd 81 | ) 82 | 83 | if [ -n "$_htmldocs_enable" ]; then 84 | makedepends+=( 85 | graphviz 86 | imagemagick 87 | python-sphinx 88 | texlive-latexextra 89 | xmlto 90 | ) 91 | fi 92 | 93 | options=( 94 | !debug 95 | !strip 96 | ) 97 | #_lucjanpath="https://raw.githubusercontent.com/sirlucjan/kernel-patches/master/${_major}" 98 | _lucjanpath="https://gitlab.com/sirlucjan/kernel-patches/raw/master/${_major}" 99 | 100 | source=("https://cdn.kernel.org/pub/linux/kernel/v6.x/${_srcname}.tar.xz" 101 | "https://cdn.kernel.org/pub/linux/kernel/v6.x/${_srcname}.tar.sign" 102 | "https://github.com/damentz/${_lqxpatchname}/archive/${_major}-${_lqxpatchrel}.tar.gz") 103 | validpgpkeys=( 104 | 'ABAF11C65A2970B130ABE3C479BE3E4300411886' # Linus Torvalds 105 | '647F28654894E3BD457199BE38DBBDC86092693E' # Greg Kroah-Hartman 106 | ) 107 | sha512sums=('55a00f89ad6db6db2e26ff5dc5cfc96bbf6654e5bd5d17d2a3b944a47640367e54139716d230923187bebc6cb7756edc9511a620fb8abc6f32c50a658a734784' 108 | 'SKIP' 109 | '5fbb2fb2eff64df1edff62325cf726345352e54acd611f2502dbd532f0048eaed77fc58657bc92e1db049f7ab22fe24d8143719c6487ff96b697f206a9172e9b') 110 | 111 | 112 | 113 | export KBUILD_BUILD_HOST=archlinux 114 | export KBUILD_BUILD_USER=$pkgbase 115 | export KBUILD_BUILD_TIMESTAMP="$(date -Ru${SOURCE_DATE_EPOCH:+d @$SOURCE_DATE_EPOCH})" 116 | 117 | prepare() { 118 | cd $_srcname 119 | 120 | ### Set package version variables 121 | _abiname="$(cat ${srcdir}/${_lqxpatchver}/linux-liquorix/debian/config/defines | grep 'abiname:' | sed -r 's/abiname:\s*//')" 122 | _minor="$(echo "$_abiname" | cut -f1 -d -)" 123 | _patchrel="$(echo "$_abiname" | cut -f2 -d -)" 124 | 125 | ### Add Liquorix patches 126 | local _patchfolder="${srcdir}/${_lqxpatchver}/linux-liquorix/debian/patches" 127 | grep -P '^(zen|lqx)/' "$_patchfolder/series" | while IFS= read -r line 128 | do 129 | echo "Patching sources with $line" 130 | patch -Np1 -i "$_patchfolder/$line" 131 | done 132 | 133 | ### Setting version 134 | echo "Setting version..." 135 | echo "-$pkgrel" > localversion.10-pkgrel 136 | echo "${pkgbase#linux}" > localversion.20-pkgname 137 | 138 | ### Patching sources 139 | for p in $(find ../../ -maxdepth 1 -name '*.patch'); do 140 | echo "Applying patch $p..." 141 | patch -Np1 -i "$p" 142 | done 143 | 144 | ### Setting config 145 | echo "Setting config..." 146 | cat ${srcdir}/${_lqxpatchver}/linux-liquorix/debian/config/kernelarch-x86/config-arch-64 >./.config 147 | make olddefconfig 148 | diff -u ${srcdir}/${_lqxpatchver}/linux-liquorix/debian/config/kernelarch-x86/config-arch-64 .config || : 149 | 150 | ### Prepared version 151 | make -s kernelrelease > version 152 | echo "Prepared $pkgbase version $( ./.config 161 | else 162 | warning "Your kernel was not compiled with IKCONFIG_PROC!" 163 | warning "You cannot read the current config!" 164 | warning "Aborting!" 165 | exit 166 | fi 167 | fi 168 | 169 | ### Selecting the CPU scheduler 170 | if [ "$_projectc" = "bmq" ]; then 171 | echo "Selecting BMQ CPU scheduler..." 172 | scripts/config -e CONFIG_SCHED_BMQ 173 | scripts/config -d CONFIG_SCHED_PDS 174 | elif [ "$_projectc" = "pds" ]; then 175 | echo "Selecting PDS CPU scheduler..." 176 | scripts/config -d CONFIG_SCHED_BMQ 177 | scripts/config -e CONFIG_SCHED_PDS 178 | elif [ "$_projectc" = "none" ]; then 179 | echo "Selecting Completely Fair Scheduler..." 180 | scripts/config -d CONFIG_SCHED_ALT 181 | else 182 | if [ -n "$_projectc" ]; then 183 | error "The value $_projectc is invalid. Choose the correct one again." 184 | else 185 | error "The value is empty. Choose the correct one again." 186 | fi 187 | error "Selecting the CPU scheduler failed!" 188 | exit 189 | fi 190 | 191 | ### Optionally load needed modules for the make localmodconfig 192 | # See https://aur.archlinux.org/packages/modprobed-db 193 | if [ -n "$_localmodcfg" ]; then 194 | if [ -f $HOME/.config/modprobed.db ]; then 195 | echo "Running Steven Rostedt's make localmodconfig now" 196 | make LSMOD=$HOME/.config/modprobed.db localmodconfig 197 | else 198 | echo "No modprobed.db data found" 199 | exit 200 | fi 201 | fi 202 | 203 | ## Use DWARF5 debug info for Arch 204 | echo "Upgrading debug info from toolchain default to DWARF v5..." 205 | scripts/config -e CONFIG_DEBUG_INFO_DWARF5 206 | 207 | ## Use Arch Wiki TOMOYO configuration: https://wiki.archlinux.org/title/TOMOYO_Linux#Installation_2 208 | echo "Replacing Debian TOMOYO configuration with upstream Arch Linux..." 209 | scripts/config --set-str CONFIG_SECURITY_TOMOYO_POLICY_LOADER "/usr/bin/tomoyo-init" 210 | scripts/config --set-str CONFIG_SECURITY_TOMOYO_ACTIVATION_TRIGGER "/usr/lib/systemd/systemd" 211 | 212 | ## Add landlock for pacman sandbox support 213 | echo "Adding 'landlock' to CONFIG_LSM for pacman sandbox support" 214 | scripts/config --set-str CONFIG_LSM "landlock,lockdown,yama,bpf" 215 | 216 | ### Running make nconfig 217 | [[ -z "$_makenconfig" ]] || make nconfig 218 | 219 | ### Running make menuconfig 220 | [[ -z "$_makemenuconfig" ]] || make menuconfig 221 | 222 | ### Running make xconfig 223 | [[ -z "$_makexconfig" ]] || make xconfig 224 | 225 | ### Running make gconfig 226 | [[ -z "$_makegconfig" ]] || make gconfig 227 | 228 | ### Save configuration for later reuse 229 | cat .config > "${startdir}/config.last" 230 | } 231 | 232 | build() { 233 | cd $_srcname 234 | 235 | make all 236 | if [ -n "$_htmldocs_enable" ]; then 237 | make htmldocs 238 | fi 239 | make -C tools/bpf/bpftool vmlinux.h feature-clang-bpf-co-re=1 240 | } 241 | 242 | _package() { 243 | pkgdesc="The $pkgdesc kernel and modules" 244 | depends=(coreutils kmod initramfs) 245 | optdepends=('wireless-regdb: to set the correct wireless channels of your country' 246 | 'linux-firmware: firmware images needed for some devices' 247 | 'sof-firmware: firmware images needed for Sound Open Firmware capable devices' 248 | 'modprobed-db: Keeps track of EVERY kernel module that has ever been probed - useful for those of us who make localmodconfig' 249 | 'uksmd: Userspace KSM helper daemon') 250 | provides=(VIRTUALBOX-GUEST-MODULES WIREGUARD-MODULE UKSMD-BUILTIN VHBA-MODULE) 251 | 252 | cd $_srcname 253 | local modulesdir="$pkgdir/usr/lib/modules/$(