-
Notifications
You must be signed in to change notification settings - Fork 3
/
Makefile
45 lines (38 loc) · 1.79 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
obj-m := asus-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-fedora:
install -m 0644 -D asus-switcheroo.ko /lib/modules/$(shell uname -r)/extra/asus-switcheroo/asus-switcheroo.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
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
echo asus-switcheroo >> /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
update-initramfs -u -k $(shell uname -r)