-
Notifications
You must be signed in to change notification settings - Fork 25
Expand file tree
/
Copy pathprepare-for-current-kernel.sh
More file actions
executable file
·35 lines (32 loc) · 1.25 KB
/
Copy pathprepare-for-current-kernel.sh
File metadata and controls
executable file
·35 lines (32 loc) · 1.25 KB
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
#!/bin/sh
VERSION=`uname -r | grep -o '^[0-9]\+\.[0-9]\+'`
if { echo $VERSION ; echo "5.7" ; } | sort -V -c 2>/dev/null
then
PATCHFILE="patch"
elif { echo $VERSION ; echo "5.99" ; } | sort -V -c 2>/dev/null
then
PATCHFILE="patch5.8"
elif { echo $VERSION ; echo "6.1" ; } | sort -V -c 2>/dev/null
then
PATCHFILE="patch6.0"
elif { echo $VERSION ; echo "6.10" ; } | sort -V -c 2>/dev/null
then
PATCHFILE="patch6.2"
elif { echo $VERSION ; echo "6.16" ; } | sort -V -c 2>/dev/null
then
PATCHFILE="patch6.11"
elif { echo $VERSION ; echo "6.18" ; } | sort -V -c 2>/dev/null
then
PATCHFILE="patch6.17"
elif { echo $VERSION ; echo "6.99" ; } | sort -V -c 2>/dev/null
then
PATCHFILE="patch6.19"
else
PATCHFILE="patch7.0"
fi
echo "Using: $PATCHFILE - version: $VERSION"
wget "https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git/plain/drivers/platform/x86/asus-wmi.c?h=linux-$VERSION.y" -O 'asus-wmi.c'
wget "https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git/plain/drivers/platform/x86/asus-wmi.h?h=linux-$VERSION.y" -O 'asus-wmi.h'
wget "https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git/plain/drivers/platform/x86/asus-nb-wmi.c?h=linux-$VERSION.y" -O 'asus-nb-wmi.c'
patch -p1 < $PATCHFILE
find . -maxdepth 1 -iname '*.orig' -delete