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 ++++++++++++++++++++++++++++++--------------------------------- 1 file changed, 154 insertions(+), 169 deletions(-) (limited to 'PKGBUILD') 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/$(