diff options
author | David Cohen | 2023-05-13 01:55:49 -0500 |
---|---|---|
committer | David Cohen | 2023-05-13 01:55:49 -0500 |
commit | 6e99ebef5d43d50c1ee7f4f73560f0a93ac1a01a (patch) | |
tree | f074a67d5b86251a84dac074323912ed050920a8 /PKGBUILD | |
parent | 7a743c2112f27a0a1d38d06ba4d9ea47b3df0808 (diff) | |
download | aur-6e99ebef5d43d50c1ee7f4f73560f0a93ac1a01a.tar.gz |
update PKGBUILD according to Arch linux package
Signed-off-by: David Cohen <dacohen@pm.me>
Diffstat (limited to 'PKGBUILD')
-rw-r--r-- | PKGBUILD | 59 |
1 files changed, 41 insertions, 18 deletions
@@ -21,9 +21,15 @@ backup=( "${_userpatches##/}" ) makedepends=( - bc libelf pahole cpio perl tar xz gettext - xmlto python-sphinx python-sphinx_rtd_theme graphviz imagemagick + bc + cpio + gettext git + libelf + pahole + perl + tar + xz ) options=('!strip') _srcname=linux-torvalds @@ -52,6 +58,11 @@ export KBUILD_BUILD_HOST=archlinux export KBUILD_BUILD_USER=$pkgbase export KBUILD_BUILD_TIMESTAMP="$(date -Ru${SOURCE_DATE_EPOCH:+d @$SOURCE_DATE_EPOCH})" +_make() { + test -s version + make KERNELRELEASE="$(<version)" "$@" +} + pkgver() { cd "$srcdir/$_srcname" if [[ -n "$REMOTE_URL" ]]; then @@ -86,6 +97,9 @@ prepare() { echo "Setting version..." echo "-$pkgrel" > localversion.10-pkgrel echo "${pkgbase#linux}" > localversion.20-pkgname + make defconfig + make -s kernelrelease > version + make mrproper local src for src in "${source[@]}"; do @@ -116,41 +130,52 @@ prepare() { else cat ../config.user >> .config fi - make olddefconfig + _make olddefconfig diff -u ../config .config || : - make -s kernelrelease > version echo "Prepared $pkgbase version $(<version)" } build() { cd $_srcname - make all + _make all } _package() { pkgdesc="The $pkgdesc kernel and modules" - depends=(coreutils kmod initramfs) - optdepends=('wireless-regdb: to set the correct wireless channels of your country' - 'linux-firmware: firmware images needed for some devices') - provides=(VIRTUALBOX-GUEST-MODULES WIREGUARD-MODULE KSMBD-MODULE) - replaces=(virtualbox-guest-modules-arch wireguard-arch) + 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 + ) install="${pkgbase}.install" cd $_srcname - local kernver="$(<version)" - local modulesdir="$pkgdir/usr/lib/modules/$kernver" + local modulesdir="$pkgdir/usr/lib/modules/$(<version)" 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 "$(_make -s image_name)" "$modulesdir/vmlinuz" # Used by mkinitcpio to name the kernel echo "$pkgbase" | install -Dm644 /dev/stdin "$modulesdir/pkgbase" echo "Installing modules..." - make INSTALL_MOD_PATH="$pkgdir/usr" INSTALL_MOD_STRIP=1 \ + _make INSTALL_MOD_PATH="$pkgdir/usr" INSTALL_MOD_STRIP=1 \ DEPMOD=/doesnt/exist modules_install # Suppress depmod # remove build and source links @@ -180,9 +205,7 @@ _package-headers() { install -Dt "$builddir/tools/objtool" tools/objtool/objtool # required when DEBUG_INFO_BTF_MODULES is enabled - if [[ -f "$builddir/tools/bpf/resolve_btfids" ]]; then - install -Dt "$builddir/tools/bpf/resolve_btfids" tools/bpf/resolve_btfids/resolve_btfids - fi + install -Dt "$builddir/tools/bpf/resolve_btfids" tools/bpf/resolve_btfids/resolve_btfids echo "Installing headers..." cp -t "$builddir" -a include @@ -226,7 +249,7 @@ _package-headers() { echo "Stripping build tools..." local file while read -rd '' file; do - case "$(file -Sbi "$file")" in + case "$(file -Sib "$file")" in application/x-sharedlib\;*) # Libraries (.so) strip -v $STRIP_SHARED "$file" ;; application/x-archive\;*) # Libraries (.a) |