-
Notifications
You must be signed in to change notification settings - Fork 71
/
Makefile
39 lines (28 loc) · 873 Bytes
/
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
obj-m := src/facer.o
KERNELDIR ?= /lib/modules/$(shell uname -r)/build
PWD := $(shell pwd)
# Sign the kernel module for secure boot (Ubuntu)
# https://wiki.ubuntu.com/UEFI/SecureBoot/Signing
KEY := /var/lib/shim-signed/mok/MOK.priv
X509 := /var/lib/shim-signed/mok/MOK.der
all: default
default:
$(MAKE) -C $(KERNELDIR) M=$(PWD) modules
if [ -f "$(KEY)" ] && [ -f "$(X509)" ]; then \
sudo kmodsign sha512 $(KEY) $(X509) src/facer.ko; \
fi
install:
$(MAKE) -C $(KERNELDIR) M=$(PWD) modules_install
clean:
rm -rf src/*.o src/*~ src/.*.cmd src/*.ko src/*.mod.c \
.tmp_versions modules.order Module.symvers
dkmsclean:
@dkms remove facer/0.1 --all || true
@dkms remove facer/0.2 --all || true
dkms: dkmsclean
dkms add .
dkms install -m facer -v 0.2
onboot:
echo "facer" > /etc/modules-load.d/facer.conf
noboot:
rm -f /etc/modules-load.d/facer.conf