summarylogtreecommitdiffstats
path: root/asix-dkms.install
diff options
context:
space:
mode:
authorAndré Ericson2015-07-07 00:16:58 -0300
committerAndré Ericson2015-07-07 00:16:58 -0300
commit16d34ec61a2d13499778d4caf8f5e47661b6acbd (patch)
treeb667aa0030cb2d054eed7e0011cd9992e92b030b /asix-dkms.install
downloadaur-16d34ec61a2d13499778d4caf8f5e47661b6acbd.tar.gz
Initial commit
Diffstat (limited to 'asix-dkms.install')
-rw-r--r--asix-dkms.install50
1 files changed, 50 insertions, 0 deletions
diff --git a/asix-dkms.install b/asix-dkms.install
new file mode 100644
index 00000000000..da6973d6c4a
--- /dev/null
+++ b/asix-dkms.install
@@ -0,0 +1,50 @@
+post_install (){
+ DKMS=$(which dkms)
+
+ $DKMS add -m asix -v v4.17.0
+ $DKMS build -m asix -v v4.17.0
+ $DKMS install -m asix -v v4.17.0
+
+ echo " >> "
+ echo " >> rmmod asix"
+ rmmod asix
+ echo " >> depmod -a"
+ depmod -a
+ echo " >> modprobe asix"
+ modprobe asix
+ echo " >> done "
+
+}
+
+pre_upgrade(){
+ pre_remove
+}
+
+post_upgrade(){
+ post_install
+}
+
+pre_remove (){
+ _inmemory=$(/usr/bin/lsmod | /usr/bin/grep asix)
+ if [ ! -z "$_inmemory" ]; then
+ /usr/bin/rmmod asix &> /dev/null
+ fi
+
+ DKMS=$(which dkms)
+
+ _line=$($DKMS status -m asix)
+ if echo "$_line" | grep -E 'added|built|installed'; then
+ version=$(echo "$_line" | sed 's/asix,\([^,]*\)[,:].*/\1/;t;d')
+ $DKMS remove -m asix -v $version --all
+ fi
+
+}
+
+post_remove () {
+ /sbin/depmod -a
+ modprobe asix
+}
+
+op=$1
+shift
+$op $*