[arch-commits] Commit in linux-hardened/trunk (4 files)

Levente Polyak anthraxx at archlinux.org
Fri Aug 3 14:06:41 UTC 2018


    Date: Friday, August 3, 2018 @ 14:06:40
  Author: anthraxx
Revision: 330486

upgpkg: linux-hardened 4.17.12.a-1

Modified:
  linux-hardened/trunk/60-linux.hook
  linux-hardened/trunk/PKGBUILD
  linux-hardened/trunk/config.x86_64
Deleted:
  linux-hardened/trunk/ACPICA-AML-Parser-ignore-control-method-status-in-module-level-code.patch

---------------------------------------------------------------------------+
 60-linux.hook                                                             |    2 
 ACPICA-AML-Parser-ignore-control-method-status-in-module-level-code.patch |   53 --
 PKGBUILD                                                                  |  254 +++++-----
 config.x86_64                                                             |    4 
 4 files changed, 133 insertions(+), 180 deletions(-)

Modified: 60-linux.hook
===================================================================
--- 60-linux.hook	2018-08-03 12:01:19 UTC (rev 330485)
+++ 60-linux.hook	2018-08-03 14:06:40 UTC (rev 330486)
@@ -9,4 +9,4 @@
 [Action]
 Description = Updating %PKGBASE% module dependencies...
 When = PostTransaction
-Exec = /usr/bin/depmod %KERNVER%
+Exec = /usr/bin/depmod --quick %KERNVER%

Deleted: ACPICA-AML-Parser-ignore-control-method-status-in-module-level-code.patch
===================================================================
--- ACPICA-AML-Parser-ignore-control-method-status-in-module-level-code.patch	2018-08-03 12:01:19 UTC (rev 330485)
+++ ACPICA-AML-Parser-ignore-control-method-status-in-module-level-code.patch	2018-08-03 14:06:40 UTC (rev 330486)
@@ -1,53 +0,0 @@
-From f51d7e02375963169fb1c1148ac3f96d54e97ec4 Mon Sep 17 00:00:00 2001
-From: Erik Schmauss <erik.schmauss at intel.com>
-Date: Sat, 28 Jul 2018 14:49:55 +0200
-Subject: [PATCH] ACPICA: AML Parser: ignore control method status in
- module-level code
-
-Previous change in the AML parser code blindly set all non-successful
-dispatcher statuses to AE_OK. This approach is incorrect because
-successful control method invocations from module-level return
-AE_CTRL_TRANSFER. Overwriting AE_OK to this status causes the AML
-parser to think that there was no return value from the control
-method invocation.
-
-fixes: 73c2a01c52b6 (ACPICA: AML Parser: ignore dispatcher error status during table load)
-
-Reported-by: Linus Torvalds <torvalds at linux-foundation.org>
-Signed-off-by: Erik Schmauss <erik.schmauss at intel.com>
----
- drivers/acpi/acpica/psloop.c | 19 ++++++++++++-------
- 1 file changed, 12 insertions(+), 7 deletions(-)
-
-diff --git a/drivers/acpi/acpica/psloop.c b/drivers/acpi/acpica/psloop.c
-index ee840be150b5e..44f35ab3347d1 100644
---- a/drivers/acpi/acpica/psloop.c
-+++ b/drivers/acpi/acpica/psloop.c
-@@ -709,15 +709,20 @@ acpi_status acpi_ps_parse_loop(struct acpi_walk_state *walk_state)
- 			} else
- 			    if ((walk_state->
- 				 parse_flags & ACPI_PARSE_MODULE_LEVEL)
-+				&& status != AE_CTRL_TRANSFER
- 				&& ACPI_FAILURE(status)) {
- 				/*
--				 * ACPI_PARSE_MODULE_LEVEL means that we are loading a table by
--				 * executing it as a control method. However, if we encounter
--				 * an error while loading the table, we need to keep trying to
--				 * load the table rather than aborting the table load. Set the
--				 * status to AE_OK to proceed with the table load. If we get a
--				 * failure at this point, it means that the dispatcher got an
--				 * error while processing Op (most likely an AML operand error.
-+				 * ACPI_PARSE_MODULE_LEVEL flag means that we are currently
-+				 * loading a table by executing it as a control method.
-+				 * However, if we encounter an error while loading the table,
-+				 * we need to keep trying to load the table rather than
-+				 * aborting the table load (setting the status to AE_OK
-+				 * continues the table load). If we get a failure at this
-+				 * point, it means that the dispatcher got an error while
-+				 * processing Op (most likely an AML operand error) or a
-+				 * control method was called from module level and the
-+				 * dispatcher returned AE_CTRL_TRANSFER. In the latter case,
-+				 * leave the status alone, there's nothing wrong with it.
- 				 */
- 				status = AE_OK;
- 			}

Modified: PKGBUILD
===================================================================
--- PKGBUILD	2018-08-03 12:01:19 UTC (rev 330485)
+++ PKGBUILD	2018-08-03 14:06:40 UTC (rev 330486)
@@ -4,7 +4,7 @@
 # Contributor: Thomas Baechler <thomas at archlinux.org>
 
 pkgbase=linux-hardened
-_pkgver=4.17.11
+_pkgver=4.17.12
 _hardenedver=a
 _srcname=linux-${_pkgver}
 pkgver=${_pkgver}.${_hardenedver}
@@ -28,21 +28,19 @@
         Revert-drm-i915-edp-Allow-alternate-fixed-mode-for-e.patch
         # Fix iwd provoking a BUG
         mac80211-disable-BHs-preemption-in-ieee80211_tx_cont.patch
-        ACPICA-AML-Parser-ignore-control-method-status-in-module-level-code.patch
 )
 replaces=('linux-grsec')
-sha256sums=('db1e84ed4f213b43d50f3373627b2ffcdb3b65f3430f746a38f801554ef3728c'
+sha256sums=('c098e2e4dcb64f8e3fb5cec35e872ff383edefa18532744ddf35bbba829cb5a3'
             'SKIP'
-            '586f3a84cf79cee5a7839941b6b434be519515c317abc8e6d491174652ac93cb'
+            'e7878739a4a95c2d9c19dc27747c92313c6a603989e3c5686b351ffc18c95590'
             'SKIP'
-            'c48ac112b4f1bfb25486a6417103d3564a5b4ca55d62fce0ff5975bb9e6c0763'
-            'ae2e95db94ef7176207c690224169594d49445e04249d2499e9d2fbc117a0b21'
+            '03d7a0cbf5433fa8cca72a2d57cc78f5f9bbde76d2c39113f02609c20d287f99'
+            '36e326d8a88b4087a3a0ee0d47643fc03baeda487659980d0e9d08791e4c729c'
             '75f99f5239e03238f88d1a834c50043ec32b1dc568f2cc291b07d04718483919'
             'ad6344badc91ad0630caacde83f7f9b97276f80d26a20619a87952be65492c65'
             'd744e7f4552896670bc8b99361534eec7ba095bebc2462ef0e5ee433e6341a0a'
             '8114295b8c07795a15b9f8eafb0f515c34661a1e05512da818a34581dd30f87e'
-            'ef7c149d9af24efea551cec86e26f52c9c1cc02714335e948f929985ff414676'
-            '25a0c0de5bae21f30557ed32815759be147a6a33020dc289e913d3147d3244f3')
+            'ef7c149d9af24efea551cec86e26f52c9c1cc02714335e948f929985ff414676')
 validpgpkeys=(
               'ABAF11C65A2970B130ABE3C479BE3E4300411886' # Linus Torvalds
               '647F28654894E3BD457199BE38DBBDC86092693E' # Greg Kroah-Hartman
@@ -49,189 +47,197 @@
               '65EEFE022108E2B708CBFCF7F9E712E59AF5F22A' # Daniel Micay
               'E240B57E2C4630BA768E2F26FC1B547C8D8172C8' # Levente Polyak
              )
+
 _kernelname=${pkgbase#linux}
 : ${_kernelname:=-hardened}
 
 prepare() {
-  cd ${_srcname}
+  cd $_srcname
 
-  # apply all patches
-  for _patch in "${source[@]}"; do
-    _patch=${_patch%%::*}
-    _patch=${_patch##*/}
-    if [[ "${_patch}" =~ \.patch$ ]] &&
-       [[ "${_patch}" != "${pkgbase}-${pkgver}.patch" ]]; then
-      msg2 "Applying patch ${_patch}"
-      patch -Np1 < "../${_patch}"
-    fi
+  msg2 "Setting version..."
+  sed -e "/^EXTRAVERSION =/s/=.*/= .${_hardenedver}/" -i Makefile
+  scripts/setlocalversion --save-scmversion
+  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
 
-  # linux hardened patch
-  msg2 "Applying hardened patch"
-  patch -Np1 < ../${pkgbase}-${pkgver}.patch
+  msg2 "Setting config..."
+  cp ../config.x86_64 .config
+  make olddefconfig
 
-  cat ../config.x86_64 - >.config <<END
-CONFIG_LOCALVERSION="${_kernelname}"
-CONFIG_LOCALVERSION_AUTO=n
-END
-
-  # set extraversion to pkgrel and empty localversion
-  sed -e "/^EXTRAVERSION =/s/=.*/= .${_hardenedver}-${pkgrel}/" \
-      -e "/^EXTRAVERSION =/aLOCALVERSION =" \
-      -i Makefile
-
-  make olddefconfig
+  make -s kernelrelease > ../version
+  msg2 "Prepared %s version %s" "$pkgbase" "$(<../version)"
 }
 
 build() {
-  cd ${_srcname}
+  cd $_srcname
   make bzImage modules
 }
 
 _package() {
   pkgdesc="The ${pkgbase/linux/Linux} kernel and modules"
-  [ "${pkgbase}" = "linux" ] && groups=('base')
-  depends=('coreutils' 'linux-firmware' 'kmod' 'mkinitcpio>=0.7')
+  [[ $pkgbase = linux ]] && groups=(base)
+  depends=(coreutils linux-firmware kmod mkinitcpio)
   optdepends=('crda: to set the correct wireless channels of your country'
               'usbctl: deny_new_usb control')
-  backup=("etc/mkinitcpio.d/${pkgbase}.preset")
+  backup=("etc/mkinitcpio.d/$pkgbase.preset")
   install=linux.install
 
-  cd ${_srcname}
+  local kernver="$(<version)"
 
-  # get kernel version
-  _kernver="$(make kernelrelease)"
-  _basekernel=${_kernver%%-*}
-  _basekernel=${_basekernel%.*}
+  cd $_srcname
 
-  mkdir -p "${pkgdir}"/{boot,usr/lib/modules}
-  make INSTALL_MOD_PATH="${pkgdir}/usr" DEPMOD=/doesnt/exist modules_install
-  cp arch/x86/boot/bzImage "${pkgdir}/boot/vmlinuz-${pkgbase}"
+  msg2 "Installing boot image..."
+  install -Dm644 "$(make -s image_name)" "$pkgdir/boot/vmlinuz-$pkgbase"
 
-  # make room for external modules
-  local _extramodules="extramodules-${_basekernel}${_kernelname}"
-  ln -s "../${_extramodules}" "${pkgdir}/usr/lib/modules/${_kernver}/extramodules"
+  msg2 "Installing modules..."
+  local modulesdir="$pkgdir/usr/lib/modules/$kernver"
+  mkdir -p "$modulesdir"
+  make INSTALL_MOD_PATH="$pkgdir/usr" DEPMOD=/doesnt/exist modules_install
 
-  # add real version for building modules and running depmod from hook
-  echo "${_kernver}" |
-    install -Dm644 /dev/stdin "${pkgdir}/usr/lib/modules/${_extramodules}/version"
+  # a place for external modules,
+  # with version file for building modules and running depmod from hook
+  local extramodules="extramodules$_kernelname"
+  local extradir="$pkgdir/usr/lib/modules/$extramodules"
+  install -Dt "$extradir" -m644 ../version
+  ln -sr "$extradir" "$modulesdir/extramodules"
 
   # remove build and source links
-  rm "${pkgdir}"/usr/lib/modules/${_kernver}/{source,build}
+  rm "$modulesdir"/{source,build}
 
-  # now we call depmod...
-  depmod -b "${pkgdir}/usr" -F System.map "${_kernver}"
+  msg2 "Running depmod..."
+  depmod -b "$pkgdir/usr" -E Module.symvers -e "$kernver"
 
-  # add vmlinux
-  install -Dt "${pkgdir}/usr/lib/modules/${_kernver}/build" -m644 vmlinux
+  msg2 "Installing hooks..."
 
   # sed expression for following substitutions
-  local _subst="
-    s|%PKGBASE%|${pkgbase}|g
-    s|%KERNVER%|${_kernver}|g
-    s|%EXTRAMODULES%|${_extramodules}|g
+  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
+  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"
+  # fill in mkinitcpio preset and pacman hooks
+  sed "$subst" ../linux.preset | install -Dm644 /dev/stdin \
+    "$pkgdir/etc/mkinitcpio.d/$pkgbase.preset"
+  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"
 
-  # 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"
+  msg2 "Fixing permissions..."
+  chmod -Rc u=rwX,go=rX "$pkgdir"
 }
 
 _package-headers() {
   pkgdesc="Header files and scripts for building modules for ${pkgbase/linux/Linux} kernel"
 
-  cd ${_srcname}
-  local _builddir="${pkgdir}/usr/lib/modules/${_kernver}/build"
+  local builddir="$pkgdir/usr/lib/modules/$(<version)/build"
 
-  install -Dt "${_builddir}" -m644 Makefile .config Module.symvers
-  install -Dt "${_builddir}/kernel" -m644 kernel/Makefile
+  cd $_srcname
 
-  mkdir "${_builddir}/.tmp_versions"
+  msg2 "Installing build files..."
+  install -Dt "$builddir" -m644 Makefile .config Module.symvers System.map vmlinux
+  install -Dt "$builddir/kernel" -m644 kernel/Makefile
+  install -Dt "$builddir/arch/x86" -m644 arch/x86/Makefile
+  cp -t "$builddir" -a scripts
 
-  cp -t "${_builddir}" -a include scripts
+  # add objtool for external module building and enabled VALIDATION_STACK option
+  install -Dt "$builddir/tools/objtool" tools/objtool/objtool
 
-  install -Dt "${_builddir}/arch/x86" -m644 arch/x86/Makefile
-  install -Dt "${_builddir}/arch/x86/kernel" -m644 arch/x86/kernel/asm-offsets.s
+  # add xfs and shmem for aufs building
+  mkdir -p "$builddir"/{fs/xfs,mm}
 
-  cp -t "${_builddir}/arch/x86" -a arch/x86/include
+  # ???
+  mkdir "$builddir/.tmp_versions"
 
-  install -Dt "${_builddir}/drivers/md" -m644 drivers/md/*.h
-  install -Dt "${_builddir}/net/mac80211" -m644 net/mac80211/*.h
+  msg2 "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
 
+  install -Dt "$builddir/drivers/md" -m644 drivers/md/*.h
+  install -Dt "$builddir/net/mac80211" -m644 net/mac80211/*.h
+
   # http://bugs.archlinux.org/task/13146
-  install -Dt "${_builddir}/drivers/media/i2c" -m644 drivers/media/i2c/msp3400-driver.h
+  install -Dt "$builddir/drivers/media/i2c" -m644 drivers/media/i2c/msp3400-driver.h
 
   # http://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
+  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
 
-  # add xfs and shmem for aufs building
-  mkdir -p "${_builddir}"/{fs/xfs,mm}
+  msg2 "Installing KConfig files..."
+  find . -name 'Kconfig*' -exec install -Dm644 {} "$builddir/{}" \;
 
-  # copy in Kconfig files
-  find . -name Kconfig\* -exec install -Dm644 {} "${_builddir}/{}" \;
-
-  # add objtool for external module building and enabled VALIDATION_STACK option
-  install -Dt "${_builddir}/tools/objtool" tools/objtool/objtool
-
-  # remove unneeded architectures
-  local _arch
-  for _arch in "${_builddir}"/arch/*/; do
-    [[ ${_arch} == */x86/ ]] && continue
-    rm -r "${_arch}"
+  msg2 "Removing unneeded architectures..."
+  local arch
+  for arch in "$builddir"/arch/*/; do
+    [[ $arch = */x86/ ]] && continue
+    echo "Removing $(basename "$arch")"
+    rm -r "$arch"
   done
 
-  # remove files already in linux-docs package
-  rm -r "${_builddir}/Documentation"
+  msg2 "Removing documentation..."
+  rm -r "$builddir/Documentation"
 
-  # remove now broken symlinks
-  find -L "${_builddir}" -type l -printf 'Removing %P\n' -delete
+  msg2 "Removing broken symlinks..."
+  find -L "$builddir" -type l -printf 'Removing %P\n' -delete
 
-  # Fix permissions
-  chmod -R u=rwX,go=rX "${_builddir}"
+  msg2 "Removing loose objects..."
+  find "$builddir" -type f -name '*.o' -printf 'Removing %P\n' -delete
 
-  # strip scripts directory
-  local _binary _strip
-  while read -rd '' _binary; do
-    case "$(file -bi "${_binary}")" in
-      *application/x-sharedlib*)  _strip="${STRIP_SHARED}"   ;; # Libraries (.so)
-      *application/x-archive*)    _strip="${STRIP_STATIC}"   ;; # Libraries (.a)
-      *application/x-executable*) _strip="${STRIP_BINARIES}" ;; # Binaries
-      *) continue ;;
+  msg2 "Stripping build tools..."
+  local file
+  while read -rd '' file; do
+    case "$(file -bi "$file")" in
+      application/x-sharedlib\;*)      # Libraries (.so)
+        strip -v $STRIP_SHARED "$file" ;;
+      application/x-archive\;*)        # Libraries (.a)
+        strip -v $STRIP_STATIC "$file" ;;
+      application/x-executable\;*)     # Binaries
+        strip -v $STRIP_BINARIES "$file" ;;
+      application/x-pie-executable\;*) # Relocatable binaries
+        strip -v $STRIP_SHARED "$file" ;;
     esac
-    /usr/bin/strip ${_strip} "${_binary}"
-  done < <(find "${_builddir}/scripts" -type f -perm -u+w -print0 2>/dev/null)
+  done < <(find "$builddir" -type f -perm -u+x ! -name vmlinux -print0)
+
+  msg2 "Fixing permissions..."
+  chmod -Rc u=rwX,go=rX "$pkgdir"
 }
 
 _package-docs() {
   pkgdesc="Kernel hackers manual - HTML documentation that comes with the ${pkgbase/linux/Linux} kernel"
 
-  cd ${_srcname}
-  local _builddir="${pkgdir}/usr/lib/modules/${_kernver}/build"
+  local builddir="$pkgdir/usr/lib/modules/$(<version)/build"
 
-  mkdir -p "${_builddir}"
-  cp -t "${_builddir}" -a Documentation
+  cd $_srcname
 
-  # Fix permissions
-  chmod -R u=rwX,go=rX "${_builddir}"
+  msg2 "Installing documentation..."
+  mkdir -p "$builddir"
+  cp -t "$builddir" -a Documentation
+
+  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=("$pkgbase" "$pkgbase-headers" "$pkgbase-docs")
+for _p in "${pkgname[@]}"; do
+  eval "package_$_p() {
+    $(declare -f "_package${_p#$pkgbase}")
+    _package${_p#$pkgbase}
   }"
 done
 

Modified: config.x86_64
===================================================================
--- config.x86_64	2018-08-03 12:01:19 UTC (rev 330485)
+++ config.x86_64	2018-08-03 14:06:40 UTC (rev 330486)
@@ -53,8 +53,8 @@
 CONFIG_INIT_ENV_ARG_LIMIT=32
 CONFIG_CROSS_COMPILE=""
 # CONFIG_COMPILE_TEST is not set
-CONFIG_LOCALVERSION="-hardened"
-# CONFIG_LOCALVERSION_AUTO is not set
+CONFIG_LOCALVERSION=""
+CONFIG_LOCALVERSION_AUTO=y
 CONFIG_HAVE_KERNEL_GZIP=y
 CONFIG_HAVE_KERNEL_BZIP2=y
 CONFIG_HAVE_KERNEL_LZMA=y



More information about the arch-commits mailing list