Date: Saturday, November 18, 2017 @ 22:46:07
  Author: heftig
Revision: 310406

4.14-2: with depmod hook

Added:
  linux/trunk/60-linux.hook
Modified:
  linux/trunk/90-linux.hook
  linux/trunk/PKGBUILD
  linux/trunk/linux.install

---------------+
 60-linux.hook |   12 +++++++++++
 90-linux.hook |    2 -
 PKGBUILD      |   59 +++++++++++++++++++++++++++++++++-----------------------
 linux.install |   17 ----------------
 4 files changed, 48 insertions(+), 42 deletions(-)

Added: 60-linux.hook
===================================================================
--- 60-linux.hook                               (rev 0)
+++ 60-linux.hook       2017-11-18 22:46:07 UTC (rev 310406)
@@ -0,0 +1,12 @@
+[Trigger]
+Type = File
+Operation = Install
+Operation = Upgrade
+Operation = Remove
+Target = usr/lib/modules/%KERNVER%/*
+Target = usr/lib/modules/%EXTRAMODULES%/*
+
+[Action]
+Description = Updating %PKGBASE% module dependencies...
+When = PostTransaction
+Exec = /usr/bin/depmod %KERNVER%

Modified: 90-linux.hook
===================================================================
--- 90-linux.hook       2017-11-18 22:43:42 UTC (rev 310405)
+++ 90-linux.hook       2017-11-18 22:46:07 UTC (rev 310406)
@@ -6,6 +6,6 @@
 Target = usr/lib/initcpio/*
 
 [Action]
-Description = Updating %PKGBASE% initcpios
+Description = Updating %PKGBASE% initcpios...
 When = PostTransaction
 Exec = /usr/bin/mkinitcpio -p %PKGBASE%

Modified: PKGBUILD
===================================================================
--- PKGBUILD    2017-11-18 22:43:42 UTC (rev 310405)
+++ PKGBUILD    2017-11-18 22:46:07 UTC (rev 310406)
@@ -6,7 +6,7 @@
 #pkgbase=linux-custom       # Build kernel with a different name
 _srcname=linux-4.14
 pkgver=4.14
-pkgrel=1
+pkgrel=2
 arch=('x86_64')
 url="https://www.kernel.org/";
 license=('GPL2')
@@ -18,6 +18,7 @@
   #"https://www.kernel.org/pub/linux/kernel/v4.x/patch-${pkgver}.xz";
   #"https://www.kernel.org/pub/linux/kernel/v4.x/patch-${pkgver}.sign";
   'config'         # the main kernel config file
+  '60-linux.hook'  # pacman hook for depmod
   '90-linux.hook'  # pacman hook for initramfs regeneration
   'linux.preset'   # standard config files for mkinitcpio ramdisk
   '0001-platform-x86-hp-wmi-Fix-tablet-mode-detection-for-co.patch'
@@ -29,7 +30,8 @@
 sha256sums=('f81d59477e90a130857ce18dc02f4fbe5725854911db1e7ba770c7cd350f96a7'
             'SKIP'
             'a68e94064f040d60e8e4c3380efeee085b54d252d527e960dd17ac688505d5b6'
-            '834bd254b56ab71d73f59b3221f056c72f559553c04718e350ab2a3e2991afe0'
+            'ae2e95db94ef7176207c690224169594d49445e04249d2499e9d2fbc117a0b21'
+            '75f99f5239e03238f88d1a834c50043ec32b1dc568f2cc291b07d04718483919'
             'ad6344badc91ad0630caacde83f7f9b97276f80d26a20619a87952be65492c65'
             '6f1d9b6a119bfab150a0bc1f550609dd9290328df709b67c984f0a6b0abe8afd')
 
@@ -98,23 +100,18 @@
   _basekernel=${_kernver%%-*}
   _basekernel=${_basekernel%.*}
 
-  mkdir -p "${pkgdir}"/{lib/modules,lib/firmware,boot}
+  mkdir -p "${pkgdir}"/{boot,lib/{modules,firmware},usr}
   make LOCALVERSION= INSTALL_MOD_PATH="${pkgdir}" modules_install
   cp arch/x86/boot/bzImage "${pkgdir}/boot/vmlinuz-${pkgbase}"
 
-  # set correct depmod command for install
-  sed -e "s|%PKGBASE%|${pkgbase}|g;s|%KERNVER%|${_kernver}|g" \
-    "${startdir}/${install}" > "${startdir}/${install}.pkg"
-  true && install=${install}.pkg
+  # make room for external modules
+  local _extramodules="extramodules-${_basekernel}${_kernelname:--ARCH}"
+  ln -s "../${_extramodules}" "${pkgdir}/lib/modules/${_kernver}/extramodules"
 
-  # install mkinitcpio preset file for kernel
-  sed "s|%PKGBASE%|${pkgbase}|g" ../linux.preset |
-    install -Dm644 /dev/stdin "${pkgdir}/etc/mkinitcpio.d/${pkgbase}.preset"
+  # add real version for building modules and running depmod from hook
+  echo "${_kernver}" |
+    install -Dm644 /dev/stdin "${pkgdir}/lib/modules/${_extramodules}/version"
 
-  # install pacman hook for initramfs regeneration
-  sed "s|%PKGBASE%|${pkgbase}|g" ../90-linux.hook |
-    install -Dm644 /dev/stdin 
"${pkgdir}/usr/share/libalpm/hooks/90-${pkgbase}.hook"
-
   # remove build and source links
   rm "${pkgdir}"/lib/modules/${_kernver}/{source,build}
 
@@ -121,21 +118,35 @@
   # remove the firmware
   rm -r "${pkgdir}/lib/firmware"
 
-  # make room for external modules
-  ln -s "../extramodules-${_basekernel}${_kernelname:--ARCH}" 
"${pkgdir}/lib/modules/${_kernver}/extramodules"
+  # now we call depmod...
+  depmod -b "${pkgdir}" -F System.map "${_kernver}"
 
-  # add real version for building modules and running depmod from 
post_install/upgrade
-  echo "${_kernver}" |
-    install -Dm644 /dev/stdin 
"${pkgdir}/lib/modules/extramodules-${_basekernel}${_kernelname:--ARCH}/version"
+  # add vmlinux
+  install -Dt "${pkgdir}/lib/modules/${_kernver}/build" -m644 vmlinux
 
-  # Now we call depmod...
-  depmod -b "${pkgdir}" -F System.map "${_kernver}"
-
   # move module tree /lib -> /usr/lib
   mv -t "${pkgdir}/usr" "${pkgdir}/lib"
 
-  # add vmlinux
-  install -Dm644 vmlinux "${pkgdir}/usr/lib/modules/${_kernver}/build/vmlinux"
+  # 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
+
+  # install mkinitcpio preset file
+  sed "${_subst}" ../linux.preset |
+    install -Dm644 /dev/stdin "${pkgdir}/etc/mkinitcpio.d/${pkgbase}.preset"
+
+  # install pacman hooks
+  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"
 }
 
 _package-headers() {

Modified: linux.install
===================================================================
--- linux.install       2017-11-18 22:43:42 UTC (rev 310405)
+++ linux.install       2017-11-18 22:46:07 UTC (rev 310406)
@@ -1,27 +1,10 @@
-post_install () {
-  # updating module dependencies
-  echo ">>> Updating module dependencies. Please wait ..."
-  depmod %KERNVER%
-}
-
 post_upgrade() {
   if findmnt --fstab -uno SOURCE /boot &>/dev/null && ! mountpoint -q /boot; 
then
     echo "WARNING: /boot appears to be a separate partition but is not 
mounted."
   fi
-
-  # updating module dependencies
-  echo ">>> Updating module dependencies. Please wait ..."
-  depmod %KERNVER%
-
-  if [ $(vercmp $2 3.13) -lt 0 ]; then
-    echo ">>> WARNING: AT keyboard support is no longer built into the kernel."
-    echo ">>>          In order to use your keyboard during early init, you 
MUST"
-    echo ">>>          include the 'keyboard' hook in your mkinitcpio.conf."
-  fi
 }
 
 post_remove() {
-  # also remove the compat symlinks
   rm -f boot/initramfs-%PKGBASE%.img
   rm -f boot/initramfs-%PKGBASE%-fallback.img
 }

Reply via email to