summarylogtreecommitdiffstats
diff options
context:
space:
mode:
authorANDRoid78902020-09-06 18:21:38 +0400
committerANDRoid78902020-09-06 18:21:38 +0400
commit4b39d5fa5721a4de4ee913c7fad755163f659c3c (patch)
tree181746a62312f42af95af925915279355ef97437
parentd0922d87e4ea90e985ff74a03d48bff11040ea22 (diff)
downloadaur-4b39d5fa5721a4de4ee913c7fad755163f659c3c.tar.gz
Initial import
-rw-r--r--PKGBUILD15
-rwxr-xr-xchoose-gcc-optimization.sh118
2 files changed, 128 insertions, 5 deletions
diff --git a/PKGBUILD b/PKGBUILD
index ed78e9aebce..b17b7dcfa2c 100644
--- a/PKGBUILD
+++ b/PKGBUILD
@@ -36,10 +36,11 @@ makedepends=('bc'
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"
- #xanmod patch
+ "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"
- #
- "https://aur.archlinux.org/cgit/aur.git/tree/choose-gcc-optimization.sh?h=linux-xanmod"
+ # gcc optimizations
+ choose-gcc-optimization.sh
# the main kernel config files
'config' 'config.aufs' 'config.anbox'
# ARCH Patches
@@ -78,6 +79,7 @@ sha256sums=('e7f75186aa0642114af8f19d99559937300ca27acaf7451b36d4f9b0f85cf1f5'
'b4ab9987a715753e64f0aa264dac91c3d7ca0651bfdd8fa5d19c8990f3b08abc'
'SKIP'
'SKIP'
+ '88af7b1e73f8e8d4d7e04da7f41564dbd4431a7f888efa7d12b64df19550141d'
'0ecba3688f213c56b443145c5ffcf3ddfbe9cb0ee4c1fc4bd1351266224ad997'
'b44d81446d8b53d5637287c30ae3eb64cae0078c3fbc45fcf1081dd6699818b5'
'c079a87a7de0001f5f2b7a42a822c262e31f19f2c547613885f273822c9d4dcc'
@@ -107,6 +109,9 @@ sha256sums=('e7f75186aa0642114af8f19d99559937300ca27acaf7451b36d4f9b0f85cf1f5'
'035ea4b2a7621054f4560471f45336b981538a40172d8f17285910d4e0e0b3ef')
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
@@ -149,7 +154,7 @@ prepare() {
#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"
@@ -164,7 +169,7 @@ build() {
}
package_linux-manjaro-xanmod() {
- pkgdesc="The Linux kernel and modules with Xanmod patches"
+ 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)
diff --git a/choose-gcc-optimization.sh b/choose-gcc-optimization.sh
new file mode 100755
index 00000000000..ccf182e9119
--- /dev/null
+++ b/choose-gcc-optimization.sh
@@ -0,0 +1,118 @@
+#!/usr/bin/env bash
+
+. /usr/share/makepkg/util/message.sh
+colorize
+
+Detect_CPU=$(gcc -c -Q -march=native --help=target | grep march | awk '{print $2}' | head -1)
+
+msg "Detected CPU architecture: $Detect_CPU"
+
+cat << EOF
+
+ Available CPU microarchitectures:
+
+ 1) AMD K6/K6-II/K6-III
+ 2) AMD Athlon/Duron/K7
+ 3) AMD Opteron/Athlon64/Hammer/K8
+ 4) AMD Opteron/Athlon64/Hammer/K8 with SSE3
+ 5) AMD 61xx/7x50/PhenomX3/X4/II/K10
+ 6) AMD Family 10h (Barcelona)
+ 7) AMD Family 14h (Bobcat)
+ 8) AMD Family 16h (Jaguar)
+ 9) AMD Family 15h (Bulldozer)
+ 10) AMD Family 15h (Piledriver)
+ 11) AMD Family 15h (Steamroller)
+ 12) AMD Family 15h (Excavator)
+ 13) AMD Family 17h (Zen)
+ 14) AMD Family 17h (Zen 2)
+ 15) Transmeta Crusoe
+ 16) Transmeta Efficeon
+ 17) IDT Winchip C6
+ 18) Winchip-2/Winchip-2A/Winchip-3
+ 19) AMD Elan
+ 20) Geode GX1 (Cyrix MediaGX)
+ 21) AMD Geode GX and LX
+ 22) Cyrix III or C3
+ 23) VIA C3 "Nehemiah"
+ 24) VIA C7
+ 25) Intel Pentium 4, Pentium D and older Nocona/Dempsey Xeon CPUs with Intel 64bit
+ 26) Intel Atom
+ 27) Intel Core 2 and newer Core 2 Xeons (Xeon 51xx and 53xx)
+ 28) Intel 1st Gen Core i3/i5/i7-family (Nehalem)
+ 29) Intel 1.5 Gen Core i3/i5/i7-family (Westmere)
+ 30) Intel Silvermont
+ 31) Intel Goldmont (Apollo Lake and Denverton)
+ 32) Intel Goldmont Plus (Gemini Lake)
+ 33) Intel 2nd Gen Core i3/i5/i7-family (Sandybridge)
+ 34) Intel 3rd Gen Core i3/i5/i7-family (Ivybridge)
+ 35) Intel 4th Gen Core i3/i5/i7-family (Haswell)
+ 36) Intel 5th Gen Core i3/i5/i7-family (Broadwell)
+ 37) Intel 6th Gen Core i3/i5/i7-family (Skylake)
+ 38) Intel 6th Gen Core i7/i9-family (Skylake X)
+ 39) Intel 8th Gen Core i3/i5/i7-family (Cannon Lake)
+ 40) Intel 8th Gen Core i7/i9-family (Ice Lake)
+ 41) Xeon processors in the Cascade Lake family
+
+ 42) Native optimizations autodetected by GCC
+
+ 0) Generic (default)
+
+EOF
+
+sleep 1
+answer=$1
+
+case $answer in
+ 1) Microarchitecture=CONFIG_MK6 ;;
+ 2) Microarchitecture=CONFIG_MK7 ;;
+ 3) Microarchitecture=CONFIG_MK8 ;;
+ 4) Microarchitecture=CONFIG_MK8SSE3 ;;
+ 5) Microarchitecture=CONFIG_MK10 ;;
+ 6) Microarchitecture=CONFIG_MBARCELONA ;;
+ 7) Microarchitecture=CONFIG_MBOBCAT ;;
+ 8) Microarchitecture=CONFIG_MJAGUAR ;;
+ 9) Microarchitecture=CONFIG_MBULLDOZER ;;
+ 10) Microarchitecture=CONFIG_MPILEDRIVER ;;
+ 11) Microarchitecture=CONFIG_MSTEAMROLLER ;;
+ 12) Microarchitecture=CONFIG_MEXCAVATOR ;;
+ 13) Microarchitecture=CONFIG_MZEN ;;
+ 14) Microarchitecture=CONFIG_MZEN2 ;;
+ 15) Microarchitecture=CONFIG_MCRUSOE ;;
+ 16) Microarchitecture=CONFIG_MEFFICEON ;;
+ 17) Microarchitecture=CONFIG_MWINCHIPC6 ;;
+ 18) Microarchitecture=CONFIG_MWINCHIP3D ;;
+ 19) Microarchitecture=CONFIG_MELAN ;;
+ 20) Microarchitecture=CONFIG_MGEODEGX1 ;;
+ 21) Microarchitecture=CONFIG_MGEODE_LX ;;
+ 22) Microarchitecture=CONFIG_MCYRIXIII ;;
+ 23) Microarchitecture=CONFIG_MVIAC3_2 ;;
+ 24) Microarchitecture=CONFIG_MVIAC7 ;;
+ 25) Microarchitecture=CONFIG_MPSC ;;
+ 26) Microarchitecture=CONFIG_MATOM ;;
+ 27) Microarchitecture=CONFIG_MCORE2 ;;
+ 28) Microarchitecture=CONFIG_MNEHALEM ;;
+ 29) Microarchitecture=CONFIG_MWESTMERE ;;
+ 30) Microarchitecture=CONFIG_MSILVERMONT ;;
+ 31) Microarchitecture=CONFIG_MGOLDMONT ;;
+ 32) Microarchitecture=CONFIG_MGOLDMONTPLUS ;;
+ 33) Microarchitecture=CONFIG_MSANDYBRIDGE ;;
+ 34) Microarchitecture=CONFIG_MIVYBRIDGE ;;
+ 35) Microarchitecture=CONFIG_MHASWELL ;;
+ 36) Microarchitecture=CONFIG_MBROADWELL ;;
+ 37) Microarchitecture=CONFIG_MSKYLAKE ;;
+ 38) Microarchitecture=CONFIG_MSKYLAKEX ;;
+ 39) Microarchitecture=CONFIG_MCANNONLAKE ;;
+ 40) Microarchitecture=CONFIG_MICELAKE ;;
+ 41) Microarchitecture=CONFIG_MCASCADELAKE ;;
+ 42) Microarchitecture=CONFIG_MNATIVE ;;
+ *) default=CONFIG_GENERIC_CPU ;;
+esac
+
+warning "According to PKGBUILD variable _microarchitecture, your choice is $answer"
+msg "Building this package for microarchitecture: $Microarchitecture$default"
+sleep 5
+
+sed -e 's|^CONFIG_GENERIC_CPU=y|# CONFIG_GENERIC_CPU is not set|g' -i .config
+sed -e "s|^# $Microarchitecture is not set|$Microarchitecture=y|g" -i .config
+
+echo