diff options
Diffstat (limited to 'PKGBUILD')
-rw-r--r-- | PKGBUILD | 257 |
1 files changed, 105 insertions, 152 deletions
@@ -26,15 +26,12 @@ _1k_HZ_ticks=y # See, https://bugs.archlinux.org/task/31187 _NUMAdisable=y -# Compile ONLY probed modules -# Build in only the modules that you currently have probed in your system VASTLY -# reducing the number of modules built and the build time. -# -# WARNING - ALL modules must be probed BEFORE you begin making the pkg! +# Compile ONLY used modules to VASTLYreduce the number of modules built +# and the build time. # # To keep track of which modules are needed for your specific system/hardware, # give module_db script a try: https://aur.archlinux.org/packages/modprobed-db -# This PKGBUILD will call it directly to probe all the modules you have logged! +# This PKGBUILD read the database kept if it exists # # More at this wiki page ---> https://wiki.archlinux.org/index.php/Modprobed-db _localmodcfg= @@ -50,63 +47,64 @@ _use_current= pkgbase=linux-rt-bfq # pkgname=('linux-rt-bfq' 'linux-rt-bfq-headers' 'linux-rt-bfq-docs') -_major=4.19 -_minor=37 -_rtver=19 +_major=5.6 +_minor=17 +_rtver=10 _rtpatchver=rt${_rtver} pkgver=${_major}.${_minor}.${_rtpatchver} _pkgver=${_major}.${_minor} _srcname=linux-${_pkgver} pkgrel=1 +pkgdesc='Linux RT-BFQ-dev' arch=('x86_64') -url="https://github.com/Algodev-github/bfq-mq/" +url="https://github.com/sirlucjan/bfq-mq-lucjan" license=('GPL2') options=('!strip') -makedepends=('kmod' 'inetutils' 'bc' 'libelf') -_bfq_sq_mq_path="bfq-sq-mq" -_bfq_sq_mq_ver='v10r1' -_bfq_sq_mq_rel='2K190411-rc1' -_bfq_sq_mq_patch="${_major}-bfq-sq-mq-${_bfq_sq_mq_ver}-${_bfq_sq_mq_rel}.patch" +makedepends=('kmod' 'bc' 'libelf' 'python-sphinx' 'python-sphinx_rtd_theme' + 'graphviz' 'imagemagick') #_lucjanpath="https://raw.githubusercontent.com/sirlucjan/kernel-patches/master/${_major}" _lucjanpath="https://gitlab.com/sirlucjan/kernel-patches/raw/master/${_major}" -_gcc_path="https://raw.githubusercontent.com/graysky2/kernel_gcc_patch/master" -_gcc_patch="enable_additional_cpu_optimizations_for_gcc_v8.1+_kernel_v4.13+.patch" - -source=("https://www.kernel.org/pub/linux/kernel/v4.x/${_srcname}.tar.xz" - "https://www.kernel.org/pub/linux/kernel/v4.x/${_srcname}.tar.sign" +# Some patches for BFQ conflict with patches for BFQ-dev. +# To use linux-bfq-git smoothly apply bfq-reverts before bfq-dev patch. +# Otherwise the kernel will not compile. +_bfq_rev_path="bfq-reverts-all-v2" +_bfq_rev_patch="0001-bfq-reverts.patch" +_bfq_path="bfq-dev-lucjan" +_bfq_ver="v11" +_bfq_rel="r2K200514" +_bfq_patch="${_major}-${_bfq_path}-${_bfq_ver}-${_bfq_rel}.patch" +_gcc_path="cpu-patches-v4-sep" +_gcc_patch="0001-cpu-${_major}-merge-graysky-s-patchset.patch" + +source=("https://www.kernel.org/pub/linux/kernel/v5.x/${_srcname}.tar.xz" + "https://www.kernel.org/pub/linux/kernel/v5.x/${_srcname}.tar.sign" "http://www.kernel.org/pub/linux/kernel/projects/rt/${_major}/patch-${_pkgver}-${_rtpatchver}.patch.xz" "http://www.kernel.org/pub/linux/kernel/projects/rt/${_major}/patch-${_pkgver}-${_rtpatchver}.patch.sign" - "${_lucjanpath}/${_bfq_sq_mq_path}/${_bfq_sq_mq_patch}" - "${_lucjanpath}/0100-Check-presence-on-tree-of-every-entity-after-every-a.patch" - "${_gcc_path}/${_gcc_patch}" - "${_lucjanpath}/arch-patches/0001-add-sysctl-to-disallow-unprivileged-CLONE_NEWUSER-by.patch" - "${_lucjanpath}/aur-patches/fix-race-in-PRT-wait-for-completion-simple-wait-code_Nvidia-RT-160319.patch" + "${_lucjanpath}/${_bfq_rev_path}/${_bfq_rev_patch}" + "${_lucjanpath}/${_bfq_path}/${_bfq_patch}" + "${_lucjanpath}/${_gcc_path}/${_gcc_patch}" + "${_lucjanpath}/arch-patches-v16-sep/0001-ZEN-Add-sysctl-and-CONFIG-to-disallow-unprivileged-C.patch" + "${_lucjanpath}/arch-patches-v16-sep/0002-gcc-plugins-drop-support-for-GCC-4.7.patch" + 'sphinx-workaround.patch' # the main kernel config files - 'config' - # pacman hook for depmod - '60-linux.hook' - # pacman hook for initramfs regeneration - '90-linux.hook' - # pacman hook for remove initramfs - '99-linux.hook' - # standard config files for mkinitcpio ramdisk - 'linux.preset') - -_kernelname=${pkgbase#linux} -: ${_kernelname:=-rt-bfq} + 'config') + +export KBUILD_BUILD_HOST=archlinux +export KBUILD_BUILD_USER=$pkgbase +export KBUILD_BUILD_TIMESTAMP="$(date -Ru${SOURCE_DATE_EPOCH:+d @$SOURCE_DATE_EPOCH})" prepare() { - cd ${_srcname} + cd $_srcname ### Add rt patch - msg2 "Add rt patch" + echo "Add rt patch" patch -Np1 -i ../patch-${_pkgver}-${_rtpatchver}.patch ### Setting version - msg2 "Setting version..." + echo "Setting version..." scripts/setlocalversion --save-scmversion echo "-$pkgrel" > localversion.10-pkgrel - echo "$_kernelname" > localversion.20-pkgname + echo "${pkgbase#linux}" > localversion.20-pkgname ### Patching sources local src @@ -114,47 +112,46 @@ prepare() { src="${src%%::*}" src="${src##*/}" [[ $src = *.patch ]] || continue - msg2 "Applying patch $src..." + echo "Applying patch $src..." patch -Np1 < "../$src" done ### Setting config - msg2 "Setting config..." + echo "Setting config..." cp ../config .config make olddefconfig ### Prepared version - make -s kernelrelease > ../version - msg2 "Prepared %s version %s" "$pkgbase" "$(<../version)" + make -s kernelrelease > version + echo "Prepared $pkgbase version $(<version)" ### Optionally use running kernel's config # code originally by nous; http://aur.archlinux.org/packages.php?ID=40191 if [ -n "$_use_current" ]; then if [[ -s /proc/config.gz ]]; then - msg2 "Extracting config from /proc/config.gz..." + echo "Extracting config from /proc/config.gz..." # modprobe configs zcat /proc/config.gz > ./.config else - warning "You kernel was not compiled with IKCONFIG_PROC!" + warning "Your kernel was not compiled with IKCONFIG_PROC!" warning "You cannot read the current config!" warning "Aborting!" exit fi fi - ### Optionally set tickrate to 1000 if [ -n "$_1k_HZ_ticks" ]; then - msg2 "Setting tick rate to 1k..." + echo "Setting tick rate to 1k..." sed -i -e 's/^CONFIG_HZ_300=y/# CONFIG_HZ_300 is not set/' \ -i -e 's/^# CONFIG_HZ_1000 is not set/CONFIG_HZ_1000=y/' \ -i -e 's/^CONFIG_HZ=300/CONFIG_HZ=1000/' ./.config fi - + ### Optionally disable NUMA for 64-bit kernels only # (x86 kernels do not support NUMA) if [ -n "$_NUMAdisable" ]; then - msg2 "Disabling NUMA from kernel config..." + echo "Disabling NUMA from kernel config..." sed -i -e 's/CONFIG_NUMA=y/# CONFIG_NUMA is not set/' \ -i -e '/CONFIG_AMD_NUMA=y/d' \ -i -e '/CONFIG_X86_64_ACPI_NUMA=y/d' \ @@ -170,30 +167,25 @@ prepare() { ### Optionally load needed modules for the make localmodconfig # See https://aur.archlinux.org/packages/modprobed-db if [ -n "$_localmodcfg" ]; then - msg2 "If you have modprobed-db installed, running it in recall mode now" - if [ -e /usr/bin/modprobed-db ]; then - [[ -x /usr/bin/sudo ]] || { - echo "Cannot call modprobe with sudo. Install sudo and configure it to work with this user." - exit 1; } - sudo /usr/bin/modprobed-db recall - make localmodconfig + if [ -f $HOME/.config/modprobed.db ]; then + echo "Running Steven Rostedt's make localmodconfig now" + make LSMOD=$HOME/.config/modprobed.db localmodconfig + else + echo "No modprobed.db data found" + exit fi fi ### Running make nconfig - [[ -z "$_makenconfig" ]] || make nconfig - + ### Running make menuconfig - [[ -z "$_makemenuconfig" ]] || make menuconfig - + ### Running make xconfig - [[ -z "$_makexconfig" ]] || make xconfig - + ### Running make gconfig - [[ -z "$_makegconfig" ]] || make gconfig ### Save configuration for later reuse @@ -201,79 +193,49 @@ prepare() { } build() { - cd ${_srcname} + cd $_srcname - make bzImage modules + make all + make htmldocs } _package() { - pkgdesc="The ${pkgbase/linux/Linux} kernel and modules with the RT patch and the BFQ-MQ scheduler." - depends=('coreutils' 'linux-firmware' 'mkinitcpio>=0.7') - optdepends=('crda: to set the correct wireless channels of your country' 'modprobed-db: Keeps track of EVERY kernel module that has ever been probed - useful for those of us who make localmodconfig') - backup=("etc/mkinitcpio.d/${pkgbase}.preset") - install=linux.install + pkgdesc="The $pkgdesc kernel and modules" + depends=('coreutils' 'kmod' 'initramfs') + optdepends=('crda: to set the correct wireless channels of your country' + 'linux-firmware: firmware images needed for some devices' + 'modprobed-db: Keeps track of EVERY kernel module that has ever been probed - useful for those of us who make localmodconfig') + provides=(VIRTUALBOX-GUEST-MODULES WIREGUARD-MODULE) + cd $_srcname local kernver="$(<version)" local modulesdir="$pkgdir/usr/lib/modules/$kernver" - cd $_srcname - - msg2 "Installing boot image..." + echo "Installing boot image..." # systemd expects to find the kernel here to allow hibernation # https://github.com/systemd/systemd/commit/edda44605f06a41fb86b7ab8128dcf99161d2344 install -Dm644 "$(make -s image_name)" "$modulesdir/vmlinuz" - install -Dm644 "$modulesdir/vmlinuz" "$pkgdir/boot/vmlinuz-$pkgbase" - msg2 "Installing modules..." - make INSTALL_MOD_PATH="$pkgdir/usr" modules_install + # Used by mkinitcpio to name the kernel + echo "$pkgbase" | install -Dm644 /dev/stdin "$modulesdir/pkgbase" - # a place for external modules, - # with version file for building modules and running depmod from hook - local extramodules="extramodules$_kernelname" - local extradir="$pkgdir/usr/lib/modules/$extramodules" - install -Dt "$extradir" -m644 ../version - ln -sr "$extradir" "$modulesdir/extramodules" + echo "Installing modules..." + make INSTALL_MOD_PATH="$pkgdir/usr" modules_install # remove build and source links rm "$modulesdir"/{source,build} - - msg2 "Installing hooks..." - - # sed expression for following substitutions - local subst=" - s|%PKGBASE%|$pkgbase|g - s|%KERNVER%|$kernver|g - s|%EXTRAMODULES%|$extramodules|g - " - - # hack to allow specifying an initially nonexisting install file - sed "$subst" "$startdir/$install" > "$startdir/$install.pkg" - true && install=$install.pkg - - # fill in mkinitcpio preset and pacman hooks - sed "$subst" ../linux.preset | install -Dm644 /dev/stdin \ - "$pkgdir/etc/mkinitcpio.d/$pkgbase.preset" - sed "$subst" ../60-linux.hook | install -Dm644 /dev/stdin \ - "$pkgdir/usr/share/libalpm/hooks/60-${pkgbase}.hook" - sed "$subst" ../90-linux.hook | install -Dm644 /dev/stdin \ - "$pkgdir/usr/share/libalpm/hooks/90-${pkgbase}.hook" - sed "$subst" ../99-linux.hook | install -Dm644 /dev/stdin \ - "$pkgdir/usr/share/libalpm/hooks/99-${pkgbase}.hook" - - msg2 "Fixing permissions..." - chmod -Rc u=rwX,go=rX "$pkgdir" } _package-headers() { - pkgdesc="Header files and scripts for building modules for ${pkgbase/linux/Linux} kernel" + pkgdesc="Headers and scripts for building modules for the $pkgdesc kernel" depends=('linux-rt-bfq') - local builddir="$pkgdir/usr/lib/modules/$(<version)/build" - cd $_srcname + local builddir="$pkgdir/usr/lib/modules/$(<version)/build" - msg2 "Installing build files..." - install -Dt "$builddir" -m644 Makefile .config Module.symvers System.map vmlinux + echo "Installing build files..." + install -Dt "$builddir" -m644 .config Makefile Module.symvers System.map \ + localversion.* version vmlinux install -Dt "$builddir/kernel" -m644 kernel/Makefile install -Dt "$builddir/arch/x86" -m644 arch/x86/Makefile cp -t "$builddir" -a scripts @@ -284,10 +246,7 @@ _package-headers() { # add xfs and shmem for aufs building mkdir -p "$builddir"/{fs/xfs,mm} - # ??? - mkdir "$builddir/.tmp_versions" - - msg2 "Installing headers..." + echo "Installing headers..." cp -t "$builddir" -a include cp -t "$builddir/arch/x86" -a arch/x86/include install -Dt "$builddir/arch/x86/kernel" -m644 arch/x86/kernel/asm-offsets.s @@ -303,10 +262,10 @@ _package-headers() { install -Dt "$builddir/drivers/media/dvb-frontends" -m644 drivers/media/dvb-frontends/*.h install -Dt "$builddir/drivers/media/tuners" -m644 drivers/media/tuners/*.h - msg2 "Installing KConfig files..." + echo "Installing KConfig files..." find . -name 'Kconfig*' -exec install -Dm644 {} "$builddir/{}" \; - msg2 "Removing unneeded architectures..." + echo "Removing unneeded architectures..." local arch for arch in "$builddir"/arch/*/; do [[ $arch = */x86/ ]] && continue @@ -314,16 +273,16 @@ _package-headers() { rm -r "$arch" done - msg2 "Removing documentation..." + echo "Removing documentation..." rm -r "$builddir/Documentation" - msg2 "Removing broken symlinks..." + echo "Removing broken symlinks..." find -L "$builddir" -type l -printf 'Removing %P\n' -delete - msg2 "Removing loose objects..." + echo "Removing loose objects..." find "$builddir" -type f -name '*.o' -printf 'Removing %P\n' -delete - msg2 "Stripping build tools..." + echo "Stripping build tools..." local file while read -rd '' file; do case "$(file -bi "$file")" in @@ -338,32 +297,29 @@ _package-headers() { esac done < <(find "$builddir" -type f -perm -u+x ! -name vmlinux -print0) - msg2 "Adding symlink..." + echo "Adding symlink..." mkdir -p "$pkgdir/usr/src" - ln -sr "$builddir" "$pkgdir/usr/src/$pkgbase-$pkgver" - - msg2 "Fixing permissions..." - chmod -Rc u=rwX,go=rX "$pkgdir" + ln -sr "$builddir" "$pkgdir/usr/src/$pkgbase" } _package-docs() { - pkgdesc="Kernel hackers manual - HTML documentation that comes with the ${pkgbase/linux/Linux} kernel" + pkgdesc="Documentation for the $pkgdesc kernel" depends=('linux-rt-bfq') - local builddir="$pkgdir/usr/lib/modules/$(<version)/build" - cd $_srcname + local builddir="$pkgdir/usr/lib/modules/$(<version)/build" - msg2 "Installing documentation..." - mkdir -p "$builddir" - cp -t "$builddir" -a Documentation + echo "Installing documentation..." + local src dst + while read -rd '' src; do + dst="${src#Documentation/}" + dst="$builddir/Documentation/${dst#output/}" + install -Dm644 "$src" "$dst" + done < <(find Documentation -name '.*' -prune -o ! -type d -print0) - msg2 "Adding symlink..." + echo "Adding symlink..." mkdir -p "$pkgdir/usr/share/doc" ln -sr "$builddir/Documentation" "$pkgdir/usr/share/doc/$pkgbase" - - msg2 "Fixing permissions..." - chmod -Rc u=rwX,go=rX "$pkgdir" } pkgname=("$pkgbase" "$pkgbase-headers" "$pkgbase-docs") @@ -374,20 +330,17 @@ for _p in "${pkgname[@]}"; do }" done -sha512sums=('c11d9d9737568756666c9c9f15bb7be87d39e55162d2df1a1501d26c30d2f2211525507cb3121f6d19a9dd6f27a0f38e4f9deca0a14c610f9c0616ac33489f59' +sha512sums=('7d42eb0327997df85b4c5c7c0babab738f0dd85ef3e739cbc7ce6a21e19821acb72ca6f0beb7636f988b95c29e61b9bf79175ecbdb309835a517f5f538cbc2b3' 'SKIP' - '717f28ccd4deee6c25388243412e98bbaaec2e689431d973d2f15b1081c1d64e9c1cb66c992152a652313d7f24d17614b0970eae97f4e76d4a6a853520941a59' + '5d5c7ff8da7a06aba70de38a03cfd25a4f3913c79d6723fd44a88fd7a5e9478a925587fda278b8552d14868c1c9c460105eb96fd2d80c3ce2043309e9cdedbad' 'SKIP' - 'b00bb8b30cbde781f95b41791a2675bad51c5d52e28a3cefa815f6e1eb0bdfe3650d38bf0772e6e6673095fd888af97d83069e53401badef5c7d6b636a786d9d' - '0f96fa9ad784709973b32eea82075ceb3e9dc2482df6441a4607612806f069254e63508b1b562279622394e4a1fbebef1b87af8401c0b1210d5d0de9954245c8' - 'e62aa377a0acc4f63f394e27a0fb7316583ff1a6a6afdfcc97593ddffd7d2bc224cfd70b552cb3fb9513cf6b8db4c2fd913d21ec2380db8cd642e37d4d67370c' - '560920b4ebf8d7b753f058a41da62d20fde1e4b42a42e73be11461d3fe25b59bc36250a66d9c1c6e3c499426b237427af5ba7586daa7c549d2cf7bb7087932a1' - '86f717f596c613db3bc40624fd956ed379b8a2a20d1d99e076ae9061251fe9afba39cf536623eccd970258e124b8c2c05643e3d539f37bd910e02dc5dd498749' - '17e85ed5227b679884987f3a3ab8420eb5c10d2204d13ddc7f6bfbf4b75345234729b3db4c15e14bad04dd39c83f6979d5638230b84dfe667a363b9c50cf1d97' - '7ad5be75ee422dda3b80edd2eb614d8a9181e2c8228cd68b3881e2fb95953bf2dea6cbe7900ce1013c9de89b2802574b7b24869fc5d7a95d3cc3112c4d27063a' - '2718b58dbbb15063bacb2bde6489e5b3c59afac4c0e0435b97fe720d42c711b6bcba926f67a8687878bd51373c9cf3adb1915a11666d79ccb220bf36e0788ab7' - '8742e2eed421e2f29850e18616f435536c12036ff793f5682a3a8c980cf5dbfc88d17fd9539c87de15d9e4663dc3190f964f18a4722940465437927b6052abbf' - '2dc6b0ba8f7dbf19d2446c5c5f1823587de89f4e28e9595937dd51a87755099656f2acec50e3e2546ea633ad1bfd1c722e0c2b91eef1d609103d8abdc0a7cbaf') + '31141f3afa388dbfc7a0a1c0a7b7fc58a6824befea1fc044eb76fc0e6d4c55f249e3e0f7e63c0697ba736dc902d85128c0d78eeffe8eca3c207a573664c74514' + '1962d021d48236f287736383acac9176e6f992cf980b5c66c1ba006288b1f2039c02caa81ebf44e99edc0dcaf09160a3fe8e4aece7541b09ec5f30cd8d834dc5' + 'd33662ee0009bfec94c66e18a7ba545d777741fd7b2e5bf7663eaf1b9f1ab8e093769c5f2aeafe7f3eb590e49c6f36f504030ea1c0e265d1842927165fbe4206' + '8c0ca7ab292e6f1a75fd4ae0de797259bf68a5f1512b9f0c905250446ebb924531589d4b8d4d9d7fb1cdd65658b32a8528a7fb7056947d7b31bdc87b4e424752' + '4ef82534e202188bec24232a60af73d48870c7f0b3403ec821b132c38cdccc9917037d74dd94cbcbc6be70cf45006e7ace928c32623cecb5289251c2eb4ea1d8' + '98e97155f86bbe837d43f27ec1018b5b6fdc6c372d6f7f2a0fe29da117d53979d9f9c262f886850d92002898682781029b80d4ee923633fc068f979e6c8254be' + 'efbb7005a81c86abfd19d070d683ecbc185e7015780cbbd77a32838a5cc953b7f4e0ee3944807e7b4631d326db50945a0838be7b7cdd945cf657a61fc39fad00') validpgpkeys=( 'ABAF11C65A2970B130ABE3C479BE3E4300411886' # Linus Torvalds |