[arch-commits] Commit in linux-grsec/trunk (3 files)

Daniel Micay thestinger at archlinux.org
Thu Dec 1 15:29:26 UTC 2016


    Date: Thursday, December 1, 2016 @ 15:29:25
  Author: thestinger
Revision: 197614

upgpkg: linux-grsec 1:4.8.11.r201611271225-2

Added:
  linux-grsec/trunk/99-linux.hook
Modified:
  linux-grsec/trunk/PKGBUILD
  linux-grsec/trunk/linux-grsec.install

---------------------+
 99-linux.hook       |   11 +++++++++++
 PKGBUILD            |   28 ++++++++++++++--------------
 linux-grsec.install |   18 ++++--------------
 3 files changed, 29 insertions(+), 28 deletions(-)

Added: 99-linux.hook
===================================================================
--- 99-linux.hook	                        (rev 0)
+++ 99-linux.hook	2016-12-01 15:29:25 UTC (rev 197614)
@@ -0,0 +1,11 @@
+[Trigger]
+Type = File
+Operation = Install
+Operation = Upgrade
+Target = boot/vmlinuz-%PKGBASE%
+Target = usr/lib/initcpio/*
+
+[Action]
+Description = Updating %PKGBASE% initcpios
+When = PostTransaction
+Exec = /usr/bin/mkinitcpio -p %PKGBASE%

Modified: PKGBUILD
===================================================================
--- PKGBUILD	2016-12-01 13:47:15 UTC (rev 197613)
+++ PKGBUILD	2016-12-01 15:29:25 UTC (rev 197614)
@@ -13,7 +13,7 @@
 _grsec_patch="grsecurity-$_grsecver-$_pkgver-$_timestamp.patch"
 epoch=1
 pkgver=$_pkgver.r$_timestamp
-pkgrel=1
+pkgrel=2
 arch=('i686' 'x86_64')
 url=https://grsecurity.net/
 license=('GPL2')
@@ -27,9 +27,12 @@
         "https://grsecurity.net/test/${_grsec_patch}.sig"
         # the main kernel config files
         'config' 'config.x86_64'
+        # pacman hook for initramfs regeneration
+        '99-linux.hook'
         # standard config files for mkinitcpio ramdisk
         'linux.preset'
-        'change-default-console-loglevel.patch')
+        'change-default-console-loglevel.patch'
+        )
 
 sha256sums=('3e9150065f193d3d94bcf46a1fe9f033c7ef7122ab71d75a7fb5a2f0c9a7e11a'
             'SKIP'
@@ -39,6 +42,7 @@
             'SKIP'
             '705ef1b95c7c6c2835d7772b848d2cb25359664ff4db36d5f766a54a39fbeae6'
             '68ced2f2ad616724ada3e7c8ca3f5648b226554cd18541bfdf3fd1e8fdfe692e'
+            '834bd254b56ab71d73f59b3221f056c72f559553c04718e350ab2a3e2991afe0'
             'ca7e718375b3790888756cc0a64a7500cd57dddb9bf7e10a0df22c860d91f74d'
             '1256b241cd477b265a3c2d64bdc19ffe3c9bbcee82ea3994c590c2c76e767d99')
 validpgpkeys=(
@@ -129,22 +133,18 @@
   cp arch/$KARCH/boot/bzImage "${pkgdir}/boot/vmlinuz-${pkgbase}"
 
   # set correct depmod command for install
-  cp -f "${startdir}/${install}" "${startdir}/${install}.pkg"
+  sed -e "s|%PKGBASE%|${pkgbase}|g;s|%KERNVER%|${_kernver}|g" \
+    "${startdir}/${install}" > "${startdir}/${install}.pkg"
   true && install=${install}.pkg
-  sed \
-    -e  "s/KERNEL_NAME=.*/KERNEL_NAME=${_kernelname}/" \
-    -e  "s/KERNEL_VERSION=.*/KERNEL_VERSION=${_kernver}/" \
-    -i "${startdir}/${install}"
 
   # install mkinitcpio preset file for kernel
-  install -D -m644 "${srcdir}/linux.preset" "${pkgdir}/etc/mkinitcpio.d/${pkgbase}.preset"
-  sed \
-    -e "1s|'linux.*'|'${pkgbase}'|" \
-    -e "s|ALL_kver=.*|ALL_kver=\"/boot/vmlinuz-${pkgbase}\"|" \
-    -e "s|default_image=.*|default_image=\"/boot/initramfs-${pkgbase}.img\"|" \
-    -e "s|fallback_image=.*|fallback_image=\"/boot/initramfs-${pkgbase}-fallback.img\"|" \
-    -i "${pkgdir}/etc/mkinitcpio.d/${pkgbase}.preset"
+  sed "s|%PKGBASE%|${pkgbase}|g" "${srcdir}/linux.preset" |
+    install -D -m644 /dev/stdin "${pkgdir}/etc/mkinitcpio.d/${pkgbase}.preset"
 
+  # install pacman hook for initramfs regeneration
+  sed "s|%PKGBASE%|${pkgbase}|g" "${srcdir}/99-linux.hook" |
+    install -D -m644 /dev/stdin "${pkgdir}/usr/share/libalpm/hooks/99-${pkgbase}.hook"
+
   # remove build and source links
   rm -f "${pkgdir}"/lib/modules/${_kernver}/{source,build}
   # remove the firmware

Modified: linux-grsec.install
===================================================================
--- linux-grsec.install	2016-12-01 13:47:15 UTC (rev 197613)
+++ linux-grsec.install	2016-12-01 15:29:25 UTC (rev 197614)
@@ -1,15 +1,7 @@
-# arg 1:  the new package version
-# arg 2:  the old package version
-
-KERNEL_NAME=
-KERNEL_VERSION=
-
 post_install() {
   # updating module dependencies
   echo ">>> Updating module dependencies. Please wait ..."
-  depmod ${KERNEL_VERSION}
-  echo ">>> Generating initial ramdisk, using mkinitcpio. Please wait..."
-  mkinitcpio -p linux${KERNEL_NAME}
+  depmod %KERNVER%
 }
 
 post_upgrade() {
@@ -19,9 +11,7 @@
 
   # updating module dependencies
   echo ">>> Updating module dependencies. Please wait ..."
-  depmod ${KERNEL_VERSION}
-  echo ">>> Generating initial ramdisk, using mkinitcpio. Please wait..."
-  mkinitcpio -p linux${KERNEL_NAME}
+  depmod %KERNVER%
 
   if [ $(vercmp $2 3.13) -lt 0 ]; then
     echo ">>> WARNING: AT keyboard support is no longer built into the kernel."
@@ -32,6 +22,6 @@
 
 post_remove() {
   # also remove the compat symlinks
-  rm -f boot/initramfs-linux${KERNEL_NAME}.img
-  rm -f boot/initramfs-linux${KERNEL_NAME}-fallback.img
+  rm -f boot/initramfs-%PKGBASE%.img
+  rm -f boot/initramfs-%PKGBASE%-fallback.img
 }



More information about the arch-commits mailing list