diff options
Diffstat (limited to 'PKGBUILD')
-rw-r--r-- | PKGBUILD | 170 |
1 files changed, 104 insertions, 66 deletions
@@ -1,39 +1,55 @@ # Maintainer: Yurii Kolesnykov <root@yurikoles.com> +# Based on core/linux by Jan Alexander Steffens (heftig) <heftig@archlinux.org> +# +# Pull requests are welcome here: +# https://github.com/yurikoles-aur/linux-amd-staging-drm-next-git # -# Based on the linux-mainline package by: -# Maintainer: Mikael Eriksson <mikael_eriksson@miffe.org> -# Maintainer: Jan Alexander Steffens (heftig) <jan.steffens@gmail.com> -# Maintainer: Tobias Powalowski <tpowa@archlinux.org> -# Maintainer: Thomas Baechler <thomas@archlinux.org> pkgbase=linux-amd-staging-drm-next-git -pkgdesc='Linux kernel with AMDGPU DC patches' -_srcname=${pkgbase} -_branch=amd-staging-drm-next -_kernelname=${pkgbase#linux} -pkgver=5.5.875547.2f2d67238034 +pkgver=6.3.r1177048.5e4d5d939dd6 pkgrel=1 +pkgdesc='Linux kernel with bleeding-edge AMDGPU drivers' +_product="${pkgbase%-git}" +_branch=amd-staging-drm-next +url=https://gitlab.freedesktop.org/agd5f/linux arch=(x86_64) -url='https://cgit.freedesktop.org/~agd5f/linux/' license=(GPL2) makedepends=( - bc kmod libelf - xmlto python-sphinx python-sphinx_rtd_theme graphviz imagemagick + bc + cpio + gettext git + libelf + pahole + perl + python + tar + xz + + # htmldocs + graphviz + imagemagick + python-sphinx + texlive-latexextra ) options=('!strip') -source=("${pkgbase}::git://people.freedesktop.org/~agd5f/linux#branch=${_branch}" - config # the main kernel config file +_srcname=$pkgbase +source=( + "$_srcname::git+https://gitlab.freedesktop.org/agd5f/linux.git#branch=$_branch" + config # the main kernel config file ) sha256sums=('SKIP' - '17c288ec0752b07472e928d447ba1c945c77e24ae0ff006eda319b4672344fdc') + '6508516de94ed941ae755d89807610dc51fe1229dbfecdf8a82604a8d33242ce') +b2sums=('SKIP' + '10f3d6c5c45bdd49b8863f3fb824404f89625c8be4633dce13ae20cd67c542114f73e30b9d09c5365a1728e0ae411f287610d064f3f9039635162191af3292bb') + pkgver() { - cd "${_srcname}" + cd $_srcname + local version="$(grep \^VERSION Makefile|cut -d"=" -f2|cut -d" " -f2)" local patch="$(grep \^PATCHLEVEL Makefile|cut -d"=" -f2|cut -d" " -f2)" - patch=$(( $patch + 1 )) - echo $version.$patch.$(git rev-list --count HEAD).$(git rev-parse --short HEAD) + printf "%s.%s.r%s.%s" "${version}" "${patch}" "$(git rev-list --count HEAD)" "$(git rev-parse --short HEAD)" } export KBUILD_BUILD_HOST=archlinux @@ -43,8 +59,7 @@ export KBUILD_BUILD_TIMESTAMP="$(date -Ru${SOURCE_DATE_EPOCH:+d @$SOURCE_DATE_EP prepare() { cd $_srcname - msg2 "Setting version..." - scripts/setlocalversion --save-scmversion + echo "Setting version..." echo "-$pkgrel" > localversion.10-pkgrel echo "${pkgbase#linux}" > localversion.20-pkgname @@ -52,35 +67,52 @@ prepare() { for src in "${source[@]}"; do src="${src%%::*}" src="${src##*/}" + src="${src%.zst}" [[ $src = *.patch ]] || continue - msg2 "Applying patch $src..." + echo "Applying patch $src..." patch -Np1 < "../$src" done - msg2 "Setting config..." + echo "Setting config..." cp ../config .config make olddefconfig + diff -u ../config .config || : make -s kernelrelease > version - msg2 "Prepared %s version %s" "$pkgbase" "$(<version)" + echo "Prepared $pkgbase version $(<version)" } build() { cd $_srcname - make bzImage modules htmldocs + make all + make htmldocs } _package() { 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') + depends=( + coreutils + initramfs + kmod + ) + optdepends=( + 'wireless-regdb: to set the correct wireless channels of your country' + 'linux-firmware: firmware images needed for some devices' + ) + provides=( + KSMBD-MODULE + VIRTUALBOX-GUEST-MODULES + WIREGUARD-MODULE + ) + replaces=( + virtualbox-guest-modules-arch + wireguard-arch + ) cd $_srcname - local kernver="$(<version)" - local modulesdir="$pkgdir/usr/lib/modules/$kernver" + local modulesdir="$pkgdir/usr/lib/modules/$(<version)" - 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" @@ -88,36 +120,35 @@ _package() { # Used by mkinitcpio to name the kernel echo "$pkgbase" | install -Dm644 /dev/stdin "$modulesdir/pkgbase" - msg2 "Installing modules..." - make INSTALL_MOD_PATH="$pkgdir/usr" modules_install - - # remove build and source links - rm "$modulesdir"/{source,build} + echo "Installing modules..." + ZSTD_CLEVEL=19 make INSTALL_MOD_PATH="$pkgdir/usr" INSTALL_MOD_STRIP=1 \ + DEPMOD=/doesnt/exist modules_install # Suppress depmod - msg2 "Fixing permissions..." - chmod -Rc u=rwX,go=rX "$pkgdir" + # remove build link + rm "$modulesdir"/build } _package-headers() { pkgdesc="Headers and scripts for building modules for the $pkgdesc kernel" + depends=(pahole) cd $_srcname local builddir="$pkgdir/usr/lib/modules/$(<version)/build" - msg2 "Installing build files..." + 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 - # add objtool for external module building and enabled VALIDATION_STACK option + # required when STACK_VALIDATION is enabled install -Dt "$builddir/tools/objtool" tools/objtool/objtool - # add xfs and shmem for aufs building - mkdir -p "$builddir"/{fs/xfs,mm} + # required when DEBUG_INFO_BTF_MODULES is enabled + install -Dt "$builddir/tools/bpf/resolve_btfids" tools/bpf/resolve_btfids/resolve_btfids - 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 @@ -125,18 +156,21 @@ _package-headers() { install -Dt "$builddir/drivers/md" -m644 drivers/md/*.h install -Dt "$builddir/net/mac80211" -m644 net/mac80211/*.h - # http://bugs.archlinux.org/task/13146 + # https://bugs.archlinux.org/task/13146 install -Dt "$builddir/drivers/media/i2c" -m644 drivers/media/i2c/msp3400-driver.h - # http://bugs.archlinux.org/task/20402 + # https://bugs.archlinux.org/task/20402 install -Dt "$builddir/drivers/media/usb/dvb-usb" -m644 drivers/media/usb/dvb-usb/*.h 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..." + # https://bugs.archlinux.org/task/71392 + install -Dt "$builddir/drivers/iio/common/hid-sensors" -m644 drivers/iio/common/hid-sensors/*.h + + 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 @@ -144,19 +178,19 @@ _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 + case "$(file -Sib "$file")" in application/x-sharedlib\;*) # Libraries (.so) strip -v $STRIP_SHARED "$file" ;; application/x-archive\;*) # Libraries (.a) @@ -168,12 +202,12 @@ _package-headers() { esac done < <(find "$builddir" -type f -perm -u+x ! -name vmlinux -print0) - msg2 "Adding symlink..." + echo "Stripping vmlinux..." + strip -v $STRIP_STATIC "$builddir/vmlinux" + + echo "Adding symlink..." mkdir -p "$pkgdir/usr/src" ln -sr "$builddir" "$pkgdir/usr/src/$pkgbase" - - msg2 "Fixing permissions..." - chmod -Rc u=rwX,go=rX "$pkgdir" } _package-docs() { @@ -182,7 +216,7 @@ _package-docs() { cd $_srcname local builddir="$pkgdir/usr/lib/modules/$(<version)/build" - msg2 "Installing documentation..." + echo "Installing documentation..." local src dst while read -rd '' src; do dst="${src#Documentation/}" @@ -190,18 +224,22 @@ _package-docs() { 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") -for _p in "${pkgname[@]}"; do - eval "package_$_p() { - $(declare -f "_package${_p#$pkgbase}") - _package${_p#$pkgbase} +pkgname=( + "${_product}-git" + "${_product}-headers-git" + "${_product}-docs-git" +) +for _package in "${pkgname[@]}"; do + local _package_no_git="${_package%-git}" + local _package_stripped="${_package_no_git#$_product}" + eval "package_${_package}() { + $(declare -f "_package${_package_stripped}") + _package${_package_stripped} }" done + |