-
Notifications
You must be signed in to change notification settings - Fork 3
/
Makefile
114 lines (101 loc) · 5.84 KB
/
Makefile
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
obj-m := asus-switcheroo.o i915-jprobe.o nouveau-jprobe.o byo-switcheroo.o
KDIR := /lib/modules/$(shell uname -r)/build
PWD := $(shell pwd)
default:
$(MAKE) -C $(KDIR) M=$(PWD) modules
clean:
$(MAKE) -C $(KDIR) M=$(PWD) clean
install-slackware:
install -m 0644 -D asus-switcheroo.ko /lib/modules/$(shell uname -r)/extra/asus-switcheroo/asus-switcheroo.ko
install -m 0644 -D byo-switcheroo.ko /lib/modules/$(shell uname -r)/extra/asus-switcheroo/byo-switcheroo.ko
install -m 0644 -D i915-jprobe.ko /lib/modules/$(shell uname -r)/extra/asus-switcheroo/i915-jprobe.ko
install -m 0644 -D nouveau-jprobe.ko /lib/modules/$(shell uname -r)/extra/asus-switcheroo/nouveau-jprobe.ko
depmod -a
install -m 0755 asus-switcheroo-pm /etc/pm/sleep.d/75-asus-switcheroo-pm
install -m 0644 asus-switcheroo.conf-modprobe.d /etc/modprobe.d/50-asus-switcheroo.conf
uninstall-slackware:
rm -rf /lib/modules/$(shell uname -r)extra/asus-switcheroo
depmod -a
rm -f /etc/pm/sleep.d/75-asus-switcheroo-pm
rm -f /etc/modprobe.d/50-asus-switcheroo.conf
install-fedora:
install -m 0644 -D asus-switcheroo.ko /lib/modules/$(shell uname -r)/extra/asus-switcheroo/asus-switcheroo.ko
install -m 0644 -D byo-switcheroo.ko /lib/modules/$(shell uname -r)/extra/asus-switcheroo/byo-switcheroo.ko
install -m 0644 -D i915-jprobe.ko /lib/modules/$(shell uname -r)/extra/asus-switcheroo/i915-jprobe.ko
install -m 0644 -D nouveau-jprobe.ko /lib/modules/$(shell uname -r)/extra/asus-switcheroo/nouveau-jprobe.ko
depmod -a
install -m 0755 asus-switcheroo-pm /etc/pm/sleep.d/75-asus-switcheroo-pm
install -m 0644 asus-switcheroo.conf-modprobe.d /etc/modprobe.d/asus-switcheroo.conf
install -m 0644 asus-switcheroo.conf-dracut /etc/dracut.conf.d/asus-switcheroo.conf
cp /boot/initramfs-$(shell uname -r).img /boot/initramfs-$(shell uname -r).img.bak
dracut -f /boot/initramfs-$(shell uname -r).img $(shell uname -r)
uninstall-fedora:
rm -fr /lib/modules/$(shell uname -r)/extra/asus-swticheroo
depmod -a
rm -f /etc/pm/sleep.d/75-asus-switcheroo-pm
rm -f /etc/modprobe.d/asus-switcheroo.conf
rm -f /etc/dracut.conf.d/asus-switcheroo.conf
dracut -f /boot/initramfs-$(shell uname -r).img $(shell uname -r)
install-ubuntu:
install -m 0644 -D asus-switcheroo.ko /lib/modules/$(shell uname -r)/extra/asus-switcheroo/asus-switcheroo.ko
install -m 0644 -D byo-switcheroo.ko /lib/modules/$(shell uname -r)/extra/asus-switcheroo/byo-switcheroo.ko
install -m 0644 -D i915-jprobe.ko /lib/modules/$(shell uname -r)/extra/asus-switcheroo/i915-jprobe.ko
install -m 0644 -D nouveau-jprobe.ko /lib/modules/$(shell uname -r)/extra/asus-switcheroo/nouveau-jprobe.ko
depmod -a
install -m 0755 asus-switcheroo-pm /etc/pm/sleep.d/75-asus-switcheroo-pm
install -m 0644 asus-switcheroo.conf-modprobe.d /etc/modprobe.d/asus-switcheroo.conf
sed -i -e "/asus-switcheroo/D" /etc/initramfs-tools/modules
sed -i -e "/i915-jprobe/D" /etc/initramfs-tools/modules
sed -i -e "/nouveau-jprobe/D" /etc/initramfs-tools/modules
echo asus-switcheroo >> /etc/initramfs-tools/modules
echo i915-jprobe >> /etc/initramfs-tools/modules
echo nouveau-jprobe >> /etc/initramfs-tools/modules
cp /boot/initrd.img-$(shell uname -r) /boot/initrd.img-$(shell uname -r).bak
update-initramfs -u -k $(shell uname -r)
uninstall-ubuntu:
rm -fr /lib/modules/$(shell uname -r)/extra/asus-switcheroo
depmod -a
rm -f /etc/pm/sleep.d/75-asus-switcheroo-pm
rm -f /etc/modprobe.d/asus-switcheroo.conf
sed -i -e "/asus-switcheroo/D" /etc/initramfs-tools/modules
sed -i -e "/i915-jprobe/D" /etc/initramfs-tools/modules
sed -i -e "/nouveau-jprobe/D" /etc/initramfs-tools/modules
update-initramfs -u -k $(shell uname -r)
install-arch:
install -m 0644 -D asus-switcheroo.ko /lib/modules/$(shell uname -r)/extra/asus-switcheroo/asus-switcheroo.ko
install -m 0644 -D byo-switcheroo.ko /lib/modules/$(shell uname -r)/extra/asus-switcheroo/byo-switcheroo.ko
install -m 0644 -D i915-jprobe.ko /lib/modules/$(shell uname -r)/extra/asus-switcheroo/i915-jprobe.ko
install -m 0644 -D nouveau-jprobe.ko /lib/modules/$(shell uname -r)/extra/asus-switcheroo/nouveau-jprobe.ko
depmod -a
install -m 0755 asus-switcheroo-pm /etc/pm/sleep.d/75-asus-switcheroo-pm
install -m 0644 asus-switcheroo.conf-modprobe.d /etc/modprobe.d/asus-switcheroo.conf
sed -i -e "s/asus-switcheroo i915-jprobe nouveau-jprobe //" /etc/rc.conf
sed -i -e "s/MODULES=(/MODULES=(asus-switcheroo i915-jprobe nouveau-jprobe /" /etc/rc.conf
cp /boot/kernel26.img /boot/kernel26.img.bak
mkinitcpio -p kernel26
uninstall-arch:
rm -fr /lib/modules/$(shell uname -r)/extra/asus-switcheroo
depmod -a
rm -f /etc/pm/sleep.d/75-asus-switcheroo-pm
rm -f /etc/modprobe.d/asus-switcheroo.conf
sed -i -e "s/asus-switcheroo i915-jprobe nouveau-jprobe //" /etc/rc.conf
mkinitcpio -p kernel26
install-opensuse:
install -m 0644 -D asus-switcheroo.ko /lib/modules/$(shell uname -r)/extra/asus-switcheroo/asus-switcheroo.ko
install -m 0644 -D byo-switcheroo.ko /lib/modules/$(shell uname -r)/extra/asus-switcheroo/byo-switcheroo.ko
install -m 0644 -D i915-jprobe.ko /lib/modules/$(shell uname -r)/extra/asus-switcheroo/i915-jprobe.ko
install -m 0644 -D nouveau-jprobe.ko /lib/modules/$(shell uname -r)/extra/asus-switcheroo/nouveau-jprobe.ko
depmod -a
install -m 0755 asus-switcheroo-pm /etc/pm/sleep.d/75-asus-switcheroo-pm
install -m 0644 asus-switcheroo.conf-modprobe.d /etc/modprobe.d/50-asus-switcheroo.conf
sed -i -e "s/asus-switcheroo i915-jprobe nouveau-jprobe //" /etc/sysconfig/kernel
sed -i -e "s/INITRD_MODULES=\"/INITRD_MODULES=\"asus-switcheroo i915-jprobe nouveau-jprobe /" /etc/sysconfig/kernel
cp /boot/initrd-$(shell uname -r) /boot/initrd-$(shell uname -r).bak
mkinitrd
uninstall-opensuse:
rm -fr /lib/modules/$(shell uname -r)/extra/asus-switcheroo
depmod -a
rm -f /etc/pm/sleep.d/75-asus-switcheroo-pm
rm -f /etc/modprobe.d/50-asus-switcheroo.conf
sed -i -e "s/asus-switcheroo i915-jprobe nouveau-jprobe//" /etc/sysconfig/kernel
mkinitrd