[arch-commits] Commit in linux-zen/trunk (PKGBUILD)

Jan Steffens heftig at archlinux.org
Wed Aug 1 20:53:37 UTC 2018


    Date: Wednesday, August 1, 2018 @ 20:53:37
  Author: heftig
Revision: 330435

4.17.11.zen1-2

Modified:
  linux-zen/trunk/PKGBUILD

----------+
 PKGBUILD |   27 ++++++++++++++++++---------
 1 file changed, 18 insertions(+), 9 deletions(-)

Modified: PKGBUILD
===================================================================
--- PKGBUILD	2018-08-01 20:53:03 UTC (rev 330434)
+++ PKGBUILD	2018-08-01 20:53:37 UTC (rev 330435)
@@ -7,7 +7,7 @@
 #pkgbase=linux-custom       # Build kernel with a different name
 _srcver=4.17.11-zen1
 pkgver=${_srcver//-/.}
-pkgrel=1
+pkgrel=2
 arch=(x86_64)
 url="https://github.com/zen-kernel/zen-kernel/commits/v$_srcver"
 license=(GPL2)
@@ -32,16 +32,26 @@
             '75f99f5239e03238f88d1a834c50043ec32b1dc568f2cc291b07d04718483919'
             'ad6344badc91ad0630caacde83f7f9b97276f80d26a20619a87952be65492c65')
 
+_kernelname=${pkgbase#linux}
+: ${_kernelname:=-ARCH}
+
 prepare() {
   cd $_srcname
 
-  # Insert patches or cherry-picks here
-
   msg2 "Setting version..."
   scripts/setlocalversion --save-scmversion
-  echo "${pkgbase#linux}" > localversion.10-pkgname
-  echo "-$pkgrel" > localversion.20-pkgrel
+  echo "-$pkgrel" > localversion.10-pkgrel
+  echo "$_kernelname" > localversion.20-pkgname
 
+  local src
+  for src in "${source[@]}"; do
+    src="${src%%::*}"
+    src="${src##*/}"
+    [[ $src = *.patch ]] || continue
+    msg2 "Applying patch $src..."
+    patch -Np1 < "../$src"
+  done
+
   msg2 "Setting config..."
   cp ../config .config
   make olddefconfig
@@ -64,7 +74,6 @@
   install=linux.install
 
   local kernver="$(<version)"
-  local basekernel="$(<version cut -d. -f1-2)"
 
   cd $_srcname
 
@@ -78,7 +87,7 @@
 
   # a place for external modules,
   # with version file for building modules and running depmod from hook
-  local extradir="$pkgdir/usr/lib/modules/extramodules-${basekernel}${pkgbase#linux}"
+  local extradir="$pkgdir/usr/lib/modules/extramodules$_kernelname"
   install -Dt "$extradir" -m644 ../version
   ln -sr "$extradir" "$modulesdir/extramodules"
 
@@ -94,7 +103,7 @@
   local subst="
     s|%PKGBASE%|$pkgbase|g
     s|%KERNVER%|$kernver|g
-    s|%EXTRAMODULES%|$extramodules|g
+    s|%EXTRAMODULES%|$extradir|g
   "
 
   # hack to allow specifying an initially nonexisting install file
@@ -157,7 +166,7 @@
   msg2 "Removing unneeded architectures..."
   local arch
   for arch in "$builddir"/arch/*/; do
-    [[ $arch == */x86/ ]] && continue
+    [[ $arch = */x86/ ]] && continue
     echo "Removing $(basename "$arch")"
     rm -r "$arch"
   done



More information about the arch-commits mailing list