blob: f37843590f34f5635806d1d2dec1afd16e3cf7c0 (
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
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
|
# Maintainer: Evgeny Myandin <evgeny.myandin[at]gmail[dot]com>
#
# This is original kernel of Manjaro Linux + ACS patch
pkgbase=linux-acs-manjaro
pkgname=('linux-acs-manjaro' 'linux-acs-manjaro-headers')
_kernelname=-ACS-MANJARO
_basekernel=5.15
_basever=515
pkgver=5.15.13
pkgrel=1
arch=('x86_64')
url="https://www.kernel.org/"
license=('GPL2')
makedepends=('bc'
'docbook-xsl'
'libelf'
'pahole'
'git'
'inetutils'
'kmod'
'xmlto'
'cpio'
'perl'
'tar'
'xz')
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"
'config'
# ARCH Patches
'0001-ZEN-Add-sysctl-and-CONFIG-to-disallow-unprivileged-CLONE_NEWUSER.patch'
'0002-PCI_Add_more_NVIDIA_controllers_to_the_MSI_masking_quirk.patch'
'0003-iommu_intel_do_deep_dma-unmapping_to_avoid_kernel-flooding.patch'
'0004-cpufreq_intel_pstate_ITMT_support_for_overclocked_system.patch'
'0005-Bluetooth_btintel_Fix_bdaddress_comparison_with_garbage_value.patch'
'0006-lg-laptop_Recognize_more_models.patch'
# MANJARO Patches
'0101-i2c-nuvoton-nc677x-hwmon-driver.patch'
# '0102-iomap-iomap_bmap-should-accept-unwritten-maps.patch'
'0103-futex.patch' # https://github.com/sirlucjan/kernel-patches
'0104-revert-xhci-Add-support-for-Renesas-controller-with-memory.patch'
'0105-quirk-kernel-org-bug-210681-firmware_rome_error.patch'
'0108-drm_i915_Add_workaround_numbers_to_GEN7_COMMON_SLICE_CHICKEN1_whitelisting.patch::https://patchwork.freedesktop.org/patch/463650/raw/'
# Lenovo + AMD
'0201-lenovo-wmi2.patch'
# other patches
# Bootsplash
'0301-revert-fbcon-remove-now-unusued-softback_lines-cursor-argument.patch'
'0302-revert-fbcon-remove-no-op-fbcon_set_origin.patch'
'0303-revert-fbcon-remove-soft-scrollback-code.patch'
'0401-bootsplash.patch'
'0402-bootsplash.patch'
'0403-bootsplash.patch'
'0404-bootsplash.patch'
'0405-bootsplash.patch'
'0406-bootsplash.patch'
'0407-bootsplash.patch'
'0408-bootsplash.patch'
'0409-bootsplash.patch'
'0410-bootsplash.patch'
'0411-bootsplash.patch'
'0412-bootsplash.patch'
'0413-bootsplash.gitpatch'
'0999-acs.gitpatch')
sha256sums=('57b2cf6991910e3b67a1b3490022e8a0674b6965c74c12da1e99d138d1991ee8'
'660362158b5dbe3044d027d568b2cb8a0fb510dd7713e1671dc701456b3d9e10'
'7c65b68bd250de8726c3dd5befa556cde515393c871dd0e0b599f40a5c33ac41'
'986f8d802f37b72a54256f0ab84da83cb229388d58c0b6750f7c770818a18421'
'e2823eff3355b7c88a3fa327ea2f84f23cbd36569e0a5f0f76599023f63a52ca'
'ce53090a4572cd6162d22225113082f7e4df5028a1230529d170460e26dcf849'
'ab0360eac59329eb84f028c2f402ee4a17e4b3dfacb7957355e6178d35af87b9'
'76701599bbafa49b90ccb073ef29ce2dc3731566e8fa852bd1e9e7796e184754'
'a2a0a0542055a6a921542fbb05cedb6eb6f3d3fb0c038bfb2304bfd3931a0f71'
'7823d7488f42bc4ed7dfae6d1014dbde679d8b862c9a3697a39ba0dae5918978'
'844e66a95d7df754c55ac2f1ce7e215b1e56e20ca095462d926a993d557b20e0'
'd9330ea593829a6ef3b824db9570253280cbff7da2b4beb47cbc037824d1a29b'
'5e804e1f241ce542f3f0e83d274ede6aa4b0539e510fb9376f8106e8732ce69b'
'e8e6120035977903a7117ba215809b9b162b64a789848107513f219180baaada'
'1d58ef2991c625f6f0eb33b4cb8303932f53f1c4694e42bae24c9cd36d2ad013'
'2b11905b63b05b25807dd64757c779da74dd4c37e36d3f7a46485b1ee5a9d326'
'94a8538251ad148f1025cc3de446ce64f73dc32b01815426fb159c722e8fa5bc'
'1f18c5c10a3c63e41ecd05ad34cd9f6653ba96e9f1049ce2b7bb6da2578ae710'
'59202940d4f12bad23c194a530edc900e066866c9945e39748484a6545af96de'
'e096b127a5208f56d368d2cb938933454d7200d70c86b763aa22c38e0ddb8717'
'8c1c880f2caa9c7ae43281a35410203887ea8eae750fe8d360d0c8bf80fcc6e0'
'1144d51e5eb980fceeec16004f3645ed04a60fac9e0c7cf88a15c5c1e7a4b89e'
'dd4b69def2efacf4a6c442202ad5cb93d492c03886d7c61de87696e5a83e2846'
'028b07f0c954f70ca37237b62e04103e81f7c658bb8bd65d7d3c2ace301297dc'
'a0c548c5703d25ae34b57931f1162de8b18937e676e5791a0f039922090881e7'
'8dbb5ab3cb99e48d97d4e2f2e3df5d0de66f3721b4f7fd94a708089f53245c77'
'a7aefeacf22c600fafd9e040a985a913643095db7272c296b77a0a651c6a140a'
'e9f22cbb542591087d2d66dc6dc912b1434330ba3cd13d2df741d869a2c31e89'
'27471eee564ca3149dd271b0817719b5565a9594dc4d884fe3dc51a5f03832bc'
'60e295601e4fb33d9bf65f198c54c7eb07c0d1e91e2ad1e0dd6cd6e142cb266d'
'035ea4b2a7621054f4560471f45336b981538a40172d8f17285910d4e0e0b3ef'
'6d6b327ec7c7798f628f98ab964f4457d3cf043bad2632eb8f27548478a83cc1')
prepare() {
cd "linux-${_basekernel}"
# add upstream patch
msg "add upstream patch"
patch -p1 -i "../patch-${pkgver}"
local src
for src in "${source[@]}"; do
src="${src%%::*}"
src="${src##*/}"
[[ $src = *.patch ]] || continue
msg2 "Applying patch: $src..."
patch -Np1 < "../$src"
done
msg2 "0513-bootsplash"
git apply -p1 < "../0413-bootsplash.gitpatch"
msg2 "0999-acs"
patch --ignore-whitespace --fuzz 3 -p1 < "../0999-acs.gitpatch"
msg2 "add config"
cat "../config" > ./.config
if [ "${_kernelname}" != "" ]; then
sed -i "s|CONFIG_LOCALVERSION=.*|CONFIG_LOCALVERSION=\"${_kernelname}\"|g" ./.config
sed -i "s|CONFIG_LOCALVERSION_AUTO=.*|CONFIG_LOCALVERSION_AUTO=n|" ./.config
fi
msg "set extraversion to pkgrel"
sed -ri "s|^(EXTRAVERSION =).*|\1 -${pkgrel}|" Makefile
# set patchlevel to 14
#sed -ri "s|^(PATCHLEVEL =).*|\1 14|" Makefile
msg "don't run depmod on 'make install'"
# We'll do this ourselves in packaging
sed -i '2iexit 0' scripts/depmod.sh
msg "get kernel version"
make prepare
msg "rewrite configuration"
yes "" | make config >/dev/null
}
build() {
cd "linux-${_basekernel}"
msg "build"
make ${MAKEFLAGS} LOCALVERSION= bzImage modules
}
package_linux-acs-manjaro() {
pkgdesc="The Linux Manjaro standart kernel and modules with ACS patch"
depends=('coreutils' 'linux-firmware' 'kmod' 'mkinitcpio>=27')
optdepends=('crda: to set the correct wireless channels of your country')
provides=(VIRTUALBOX-GUEST-MODULES WIREGUARD-MODULE)
replaces=(virtualbox-guest-modules wireguard)
cd "linux-${_basekernel}"
# get kernel version
_kernver="$(make LOCALVERSION= kernelrelease)"
mkdir -p "${pkgdir}"/{boot,usr/lib/modules}
make LOCALVERSION= INSTALL_MOD_PATH="${pkgdir}/usr" INSTALL_MOD_STRIP=1 modules_install
# systemd expects to find the kernel here to allow hibernation
# https://github.com/systemd/systemd/commit/edda44605f06a41fb86b7ab8128dcf99161d2344
cp arch/x86/boot/bzImage "${pkgdir}/usr/lib/modules/${_kernver}/vmlinuz"
# Used by mkinitcpio to name the kernel
echo "${pkgbase}" | install -Dm644 /dev/stdin "${pkgdir}/usr/lib/modules/${_kernver}/pkgbase"
# add kernel version
echo "${pkgver}-${pkgrel}${_kernelname} x64" > "${pkgdir}/boot/${pkgbase}-${CARCH}.kver"
# make room for external modules
local _extramodules="extramodules-${_basekernel}${_kernelname:--MANJARO}"
ln -s "../${_extramodules}" "${pkgdir}/usr/lib/modules/${_kernver}/extramodules"
# add real version for building modules and running depmod from hook
echo "${_kernver}" |
install -Dm644 /dev/stdin "${pkgdir}/usr/lib/modules/${_extramodules}/version"
# remove build and source links
rm "${pkgdir}"/usr/lib/modules/${_kernver}/{source,build}
# now we call depmod...
depmod -b "${pkgdir}/usr" -F System.map "${_kernver}"
}
package_linux-acs-manjaro-headers() {
pkgdesc="Headers and scripts for building modules for the Linux Manjaro standart kernel with ACS patch"
depends=('gawk' 'python' 'libelf' 'pahole')
cd "linux-${_basekernel}"
local _builddir="${pkgdir}/usr/lib/modules/${_kernver}/build"
install -Dt "${_builddir}" -m644 Makefile .config Module.symvers
install -Dt "${_builddir}/kernel" -m644 kernel/Makefile
install -Dt "${_builddir}" -m644 vmlinux
mkdir "${_builddir}/.tmp_versions"
cp -t "${_builddir}" -a include scripts
install -Dt "${_builddir}/arch/x86" -m644 "arch/x86/Makefile"
install -Dt "${_builddir}/arch/x86/kernel" -m644 "arch/x86/kernel/asm-offsets.s"
cp -t "${_builddir}/arch/x86" -a "arch/x86/include"
install -Dt "${_builddir}/drivers/md" -m644 drivers/md/*.h
install -Dt "${_builddir}/net/mac80211" -m644 net/mac80211/*.h
# https://bugs.archlinux.org/task/13146
install -Dt "${_builddir}/drivers/media/i2c" -m644 drivers/media/i2c/msp3400-driver.h
# https://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
# https://bugs.archlinux.org/task/71392
install -Dt "${_builddir}/drivers/iio/common/hid-sensors" -m644 drivers/iio/common/hid-sensors/*.h
# add xfs and shmem for aufs building
mkdir -p "${_builddir}"/{fs/xfs,mm}
# 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}"
done
# remove documentation files
rm -r "${_builddir}/Documentation"
# strip scripts directory
local file
while read -rd '' file; do
case "$(file -bi "$file")" in
application/x-sharedlib\;*) # Libraries (.so)
strip $STRIP_SHARED "$file" ;;
application/x-archive\;*) # Libraries (.a)
strip $STRIP_STATIC "$file" ;;
application/x-executable\;*) # Binaries
strip $STRIP_BINARIES "$file" ;;
application/x-pie-executable\;*) # Relocatable binaries
strip $STRIP_SHARED "$file" ;;
esac
done < <(find "${_builddir}" -type f -perm -u+x ! -name vmlinux -print0 2>/dev/null)
strip $STRIP_STATIC "${_builddir}/vmlinux"
# remove unwanted files
find ${_builddir} -name '*.orig' -delete
}
|