From 8a1a216bcfa246c376bf9d9744b2be55c79452a9 Mon Sep 17 00:00:00 2001 From: jc_gargma Date: Fri, 24 Aug 2018 06:41:23 -0700 Subject: Updated to 4.18.2.a --- PKGBUILD | 323 +++++----- config.x86_64 | 664 +++++++++++---------- ...the-alternate-fixed-mode-if-its-asked-for.patch | 39 -- increase-timeout-in-lspcon_wait_mode.patch | 23 + ...lly-revert-swiotlb-remove-various-exports.patch | 26 - 5 files changed, 520 insertions(+), 555 deletions(-) delete mode 100644 drm-i915-edp-Only-use-the-alternate-fixed-mode-if-its-asked-for.patch create mode 100644 increase-timeout-in-lspcon_wait_mode.patch delete mode 100644 partially-revert-swiotlb-remove-various-exports.patch diff --git a/PKGBUILD b/PKGBUILD index 70fea65..dec0cef 100644 --- a/PKGBUILD +++ b/PKGBUILD @@ -4,23 +4,23 @@ # Contributor: Thomas Baechler pkgbase=linux-libre-hardened -_majver=4.16 -_minver=8 -_fullver=${_majver}.${_minver} -_basever=${_majver}-gnu -_pkgver=${_fullver}-gnu -_hardver=a -_srcname=linux-${_majver} -pkgver=${_fullver}.${_hardver} +_majver=4.18 +_minver=2 +_pkgver=${_majver}.${_minver} +_gnumajver=${_majver}-gnu +_gnupkgver=${_pkgver}-gnu +_hardenedver=a +_srcname=linux-${_pkgver} +pkgver=${_pkgver}.${_hardenedver} pkgrel=1 url='https://github.com/anthraxx/linux-hardened' arch=('x86_64') license=('GPL2') makedepends=('xmlto' 'kmod' 'inetutils' 'bc' 'libelf') options=('!strip') -source=(https://linux-libre.fsfla.org/pub/linux-libre/releases/${_basever}/linux-libre-${_basever}.tar.xz{,.sign} - https://linux-libre.fsfla.org/pub/linux-libre/releases/${_pkgver}/patch-${_basever}-${_pkgver}.xz{,.sign} - https://github.com/anthraxx/linux-hardened/releases/download/${_fullver}.${_hardver}/linux-hardened-${_fullver}.${_hardver}.patch{,.sig} +source=(https://linux-libre.fsfla.org/pub/linux-libre/releases/${_gnumajver}/linux-libre-${_gnumajver}.tar.xz{,.sign} + https://linux-libre.fsfla.org/pub/linux-libre/releases/${_gnupkgver}/patch-${_gnumajver}-${_gnupkgver}.xz{,.sign} + https://github.com/anthraxx/linux-hardened/releases/download/${_pkgver}.${_hardenedver}/linux-hardened-${_pkgver}.${_hardenedver}.patch{,.sig} https://github.com/graysky2/kernel_gcc_patch/raw/master/enable_additional_cpu_optimizations_for_gcc_v8.1+_kernel_v4.13+.patch ath9k-regdom-hack.patch config.x86_64 # the main kernel config files @@ -28,234 +28,219 @@ source=(https://linux-libre.fsfla.org/pub/linux-libre/releases/${_basever}/linux 90-linux.hook # pacman hook for initramfs regeneration linux.preset # standard config files for mkinitcpio ramdisk - # https://bugs.archlinux.org/task/56711 - drm-i915-edp-Only-use-the-alternate-fixed-mode-if-its-asked-for.patch - partially-revert-swiotlb-remove-various-exports.patch + increase-timeout-in-lspcon_wait_mode.patch ) -sha256sums=('5bd4ee95a0a9d7d2f962504f4b684b441b07f5a136e8bb8ad959f2d29ab9b913' +sha256sums=('55ddf20702311cf3e32127135a38cb272313679962e8a798c108b01cadaeca4f' 'SKIP' - '92a98e334984f8f3f5e9bb57d4cb9586c14bcf1eba582ddf594023ac8d7681a3' + '174b7cf8222e0c304aafd1a564b47f1109efeae7382b60fb89796d90eca8cef1' 'SKIP' - '07b1933643a36d3c69ce2254309be95fbba5ba7a61dda6366e026b14a1197933' + 'fc50a9b4c735229161bca195e4a3d9c6815e2884a7dcfcf6b7738bfe08bef6ce' 'SKIP' '9f7177679c8d3f8d699ef0566a51349d828436dba04603bc2223f98c60d2d178' 'e7ebf050c22bcec0028c0b3c79fd6d3913b0370ecc6a23dfe78ce475630cf503' - 'b6fd5d6c3ea767582f3874ff97d3cd3ae9518df03b4feb0943757bb208f3b5f3' + '5057e0adb2531916af7890daf59eb0e3274507893ed3173dc1e011e42be3c154' 'ae2e95db94ef7176207c690224169594d49445e04249d2499e9d2fbc117a0b21' '75f99f5239e03238f88d1a834c50043ec32b1dc568f2cc291b07d04718483919' 'ad6344badc91ad0630caacde83f7f9b97276f80d26a20619a87952be65492c65' - 'c08d12c699398ef88b764be1837b9ee11f2efd3188bd1bf4e8f85dfbeee58148' - '87a0849079db7bf1deefb687bcf43170f1b209d27af9950f98b049cdf233b447') + '0fa6899b57d32988b70050f1a67f435936273ce1aa98575271d564ccfaf45f77') validpgpkeys=( '474402C8C582DAFBE389C427BCB7CF877E7D47A7' # Alexandre Oliva '65EEFE022108E2B708CBFCF7F9E712E59AF5F22A' # Daniel Micay 'E240B57E2C4630BA768E2F26FC1B547C8D8172C8' # Levente Polyak ) + _kernelname=${pkgbase#linux-libre} -: ${_kernelname:=-ARCH} +: ${_kernelname:=-hardened} prepare() { - cd ${_srcname} + cd $_srcname + + msg2 "Setting version..." + sed -e "/^EXTRAVERSION =/s/=.*/= .${_hardenedver}/" -i Makefile + scripts/setlocalversion --save-scmversion + echo "-$pkgrel" > localversion.10-pkgrel + echo "$_kernelname" > localversion.20-pkgname # add upstream patch msg2 "Applying upstream patch" - patch -p1 -i "${srcdir}/patch-${_basever}-${_pkgver}" - - # Hotfixes - patch -p1 -i "${srcdir}/drm-i915-edp-Only-use-the-alternate-fixed-mode-if-its-asked-for.patch" - patch -p1 -i "${srcdir}/partially-revert-swiotlb-remove-various-exports.patch" - - # linux hardened patch - msg2 "Applying hardened patch" - patch -p1 -i "${srcdir}/linux-hardened-${pkgver}.patch" - - # graysky2 gcc patch - patch -p1 -i "${srcdir}/enable_additional_cpu_optimizations_for_gcc_v8.1+_kernel_v4.13+.patch" - - # Ignore ath9k eeprom patch - patch -p1 -i "${srcdir}/ath9k-regdom-hack.patch" - - - # add latest fixes from stable queue, if needed - # http://git.kernel.org/?p=linux/kernel/git/stable/stable-queue.git - - cat ../config.x86_64 - >.config </dev/null + 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-hardened" ] && groups=('base') - depends=('coreutils' 'linux-libre-firmware' 'kmod' 'mkinitcpio>=0.7') - optdepends=('crda: to set the correct wireless channels of your country') - backup=("etc/mkinitcpio.d/${pkgbase}.preset") + [[ ${pkgbase} = linux-libre ]] && groups=(base) + depends=(coreutils linux-libre-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") install=linux.install - cd ${_srcname} + local kernver="$( "${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" + sed "$subst" "$startdir/$install" > "$startdir/$install.pkg" + true && install=$install.pkg + + # 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" + + 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/$(/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/$( -Date: Mon, 6 Nov 2017 13:38:57 -0800 -Subject: [PATCH] drm/i915/edp: Only use the alternate fixed mode if it's asked - for - -In commit dc911f5bd8aa ("drm/i915/edp: Allow alternate fixed mode for -eDP if available."), the patch allows for the use of an alternate fixed -mode if it is available, but the patch was not ensuring that the only -time the alternate mode is used is when it is specifically requested. -This patch adds an additional comparison to intel_edp_compare_alt_mode -to ensure that we only use the alternate mode if it is directly -requested. - -Fixes: dc911f5bd8aac ("Allow alternate fixed mode for eDP if available.") -Cc: David Weinehall -Cc: Rodrigo Vivi -Signed-off-by: Jim Bride ---- - drivers/gpu/drm/i915/intel_dp.c | 3 ++- - 1 file changed, 2 insertions(+), 1 deletion(-) - -diff --git a/drivers/gpu/drm/i915/intel_dp.c b/drivers/gpu/drm/i915/intel_dp.c -index d27c014..8164c59 100644 ---- a/drivers/gpu/drm/i915/intel_dp.c -+++ b/drivers/gpu/drm/i915/intel_dp.c -@@ -1621,7 +1621,8 @@ static bool intel_edp_compare_alt_mode(struct drm_display_mode *m1, - m1->vdisplay == m2->vdisplay && - m1->vsync_start == m2->vsync_start && - m1->vsync_end == m2->vsync_end && -- m1->vtotal == m2->vtotal); -+ m1->vtotal == m2->vtotal && -+ m1->vrefresh == m2->vrefresh); - return bres; - } - --- -2.7.4 - diff --git a/increase-timeout-in-lspcon_wait_mode.patch b/increase-timeout-in-lspcon_wait_mode.patch new file mode 100644 index 0000000..b94872a --- /dev/null +++ b/increase-timeout-in-lspcon_wait_mode.patch @@ -0,0 +1,23 @@ +From f9199cfdc7f09601adbb40827077991a1f6bd73a Mon Sep 17 00:00:00 2001 +From: "Jan Alexander Steffens (heftig)" +Date: Mon, 13 Aug 2018 00:40:29 +0200 +Subject: [PATCH] Increase timeout in lspcon_wait_mode + +From https://bugs.freedesktop.org/attachment.cgi?id=141051&action=edit +--- + drivers/gpu/drm/i915/intel_lspcon.c | 2 +- + 1 file changed, 1 insertion(+), 1 deletion(-) + +diff --git a/drivers/gpu/drm/i915/intel_lspcon.c b/drivers/gpu/drm/i915/intel_lspcon.c +index 8ae8f42f430a1..be1b08f589a46 100644 +--- a/drivers/gpu/drm/i915/intel_lspcon.c ++++ b/drivers/gpu/drm/i915/intel_lspcon.c +@@ -74,7 +74,7 @@ static enum drm_lspcon_mode lspcon_wait_mode(struct intel_lspcon *lspcon, + DRM_DEBUG_KMS("Waiting for LSPCON mode %s to settle\n", + lspcon_mode_name(mode)); + +- wait_for((current_mode = lspcon_get_current_mode(lspcon)) == mode, 100); ++ wait_for((current_mode = lspcon_get_current_mode(lspcon)) == mode, 1000); + if (current_mode != mode) + DRM_ERROR("LSPCON mode hasn't settled\n"); + diff --git a/partially-revert-swiotlb-remove-various-exports.patch b/partially-revert-swiotlb-remove-various-exports.patch deleted file mode 100644 index 3a09135..0000000 --- a/partially-revert-swiotlb-remove-various-exports.patch +++ /dev/null @@ -1,26 +0,0 @@ -From be536681bd2439bf8e95df124fa282cf4a2e7846 Mon Sep 17 00:00:00 2001 -From: "Jan Alexander Steffens (heftig)" -Date: Fri, 6 Apr 2018 16:19:38 +0200 -Subject: [PATCH 3/5] Partially revert "swiotlb: remove various exports" - -This partially reverts commit 4bd89ed39b2ab8dc4ac4b6c59b07d420b0213bec. -The proprietary NVIDIA driver needs one of the exports. ---- - lib/swiotlb.c | 1 + - 1 file changed, 1 insertion(+) - -diff --git a/lib/swiotlb.c b/lib/swiotlb.c -index 44f7eb408fdb..0bb1bb65ad6b 100644 ---- a/lib/swiotlb.c -+++ b/lib/swiotlb.c -@@ -1016,6 +1016,7 @@ swiotlb_map_sg_attrs(struct device *hwdev, struct scatterlist *sgl, int nelems, - } - return nelems; - } -+EXPORT_SYMBOL(swiotlb_map_sg_attrs); - - /* - * Unmap a set of streaming mode DMA translations. Again, cpu read rules --- -2.17.0 - -- cgit v1.2.1