summarylogtreecommitdiffstats
path: root/PKGBUILD_change.patch
blob: 2b941f114e643820e6b3ab1af9dc75d7fd3aa52d (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
--- a/PKGBUILD
+++ b/PKGBUILD
@@ -1,3 +1,9 @@
+# Contributor: Andrey Alekseev <andrey.android7890@gmail.com>
+# used original PKGBUILD from Manjaro linux: https://gitlab.manjaro.org/packages/core/linux58
+# https://aur.archlinux.org/packages/linux-xanmod/
+# see "PKGBUILD_change.patch" for details
+
+
 # Maintainer: Philip Müller <philm[at]manjaro[dot]org>
 # Maintainer: Bernhard Landauer <bernhard[at]manjaro[dot]org>
 # Maintainer: Helmut Stult <helmut[at]manjaro[dot]org>
@@ -9,17 +15,18 @@
 # Cloud Server
 _server=cpx51
 
-pkgbase=linux58
-pkgname=('linux58' 'linux58-headers')
-_kernelname=-MANJARO
+pkgbase=linux-manjaro-xanmod
+pkgname=("${pkgbase}" "${pkgbase}-headers")
+_kernelname=-MANJARO-Xanmod
 _basekernel=5.8
 _basever=58
 _aufs=20200622
-pkgver=5.8.5
-pkgrel=2
+pkgver=5.8.6
+xanmod=1
+pkgrel=1
 arch=('x86_64')
 url="http://www.kernel.org/"
-license=('GPL2')
+license=('custom')
 makedepends=('bc'
     'docbook-xsl'
     'elfutils'
@@ -30,6 +37,11 @@
 options=('!strip')
 source=("https://www.kernel.org/pub/linux/kernel/v5.x/linux-${_basekernel}.tar.xz"
         "https://www.kernel.org/pub/linux/kernel/v5.x/patch-${pkgver}.xz"
+        "git+https://gitlab.manjaro.org/packages/core/linux58.git"
+        # xanmod patch
+        "https://github.com/xanmod/linux/releases/download/${pkgver}-xanmod${xanmod}/patch-${pkgver}-xanmod${xanmod}.xz"
+        # gcc optimizations
+        choose-gcc-optimization.sh
         # the main kernel config files
         'config' 'config.aufs' 'config.anbox'
         # ARCH Patches
@@ -65,7 +77,10 @@
         '0012-bootsplash.patch'
         '0013-bootsplash.gitpatch')
 sha256sums=('e7f75186aa0642114af8f19d99559937300ca27acaf7451b36d4f9b0f85cf1f5'
-            '69855667f003f3f6f9899dba5f3f9e05ab967bd8a7384f18033bdbece443ebb0'
+            'b4ab9987a715753e64f0aa264dac91c3d7ca0651bfdd8fa5d19c8990f3b08abc'
+            'SKIP'
+            'SKIP'
+            '88af7b1e73f8e8d4d7e04da7f41564dbd4431a7f888efa7d12b64df19550141d'
             '0ecba3688f213c56b443145c5ffcf3ddfbe9cb0ee4c1fc4bd1351266224ad997'
             'b44d81446d8b53d5637287c30ae3eb64cae0078c3fbc45fcf1081dd6699818b5'
             'c079a87a7de0001f5f2b7a42a822c262e31f19f2c547613885f273822c9d4dcc'
@@ -96,6 +111,12 @@
 prepare() {
   cd "${srcdir}/linux-${_basekernel}"
 
+  # Apply Xanmod patch
+  patch -Np1 -i ../patch-${pkgver}-xanmod${xanmod}
+  
+  # Let's user choose microarchitecture optimization in GCC
+  sh ${srcdir}/choose-gcc-optimization.sh $_microarchitecture
+  
   # add upstream patch
   msg "add upstream patch"
   patch -p1 -i "${srcdir}/patch-${pkgver}"
@@ -134,7 +155,7 @@
   #make menuconfig # CLI menu for configuration
   #make nconfig # new CLI menu for configuration
   #make xconfig # X-based configuration
-  #make oldconfig # using old config from previous kernel version
+  make oldconfig # using old config from previous kernel version
   # ... or manually edit .config
 
   msg "rewrite configuration"
@@ -148,8 +169,8 @@
   make ${MAKEFLAGS} LOCALVERSION= bzImage modules
 }
 
-package_linux58() {
-  pkgdesc="The ${pkgbase/linux/Linux} kernel and modules"
+package_linux-manjaro-xanmod() {
+  pkgdesc="The Linux kernel and modules with Xanmod and Manjaro patches"
   depends=('coreutils' 'linux-firmware' 'kmod' 'mkinitcpio>=27')
   optdepends=('crda: to set the correct wireless channels of your country')
   provides=("linux=${pkgver}" VIRTUALBOX-GUEST-MODULES WIREGUARD-MODULE)
@@ -193,8 +214,8 @@
   install -Dt "${pkgdir}/usr/lib/modules/${_kernver}/build" -m644 vmlinux
 }
 
-package_linux58-headers() {
-  pkgdesc="Header files and scripts for building modules for ${pkgbase/linux/Linux} kernel"
+package_linux-manjaro-xanmod-headers() {
+  pkgdesc="Header files and scripts for building modules for ${pkgbase} kernel"
   provides=("linux-headers=$pkgver")
 
   cd "${srcdir}/linux-${_basekernel}"