I am trying to build a device-tree overlay using DKMS for a running kernel (4.4). My naive Makefile is as follows:
PWD := $(shell pwd)
dtbo-y += my-awsome-overlay.dtbo
targets += $(dtbo-y)
all:
make -C /lib/modules/${kernelver}/build M=$(PWD) dtbs
clean:
make -C /lib/modules/${kernelver}/build M=$(PWD) clean
However, I am getting the following error:
make[1]: Entering directory '/usr/src/linux-headers-4.4.13-v7+'
/bin/sh: 1: cannot create arch/arm/boot/dts/overlays/modules.order: Permission denied
How can I fix it? It should be possible without root privileges, right?
How would a standard Makefile for building dt overlays using DKMS look like?
Edit: I think I have solved the problem, see below. However, a qualified answer would still be welcome.
Change my-awsome-overlay.dtbo
to my-awsome.dtbo
. Assuming the dts file name is my-awsome-overlay.dts
.
Add always := $(dtbo-y)
.
Invoke make
without a target (remove dtbs
).
Here is a working Makefile:
PWD := $(shell pwd)
dtbo-y += my-awsome.dtbo
targets += $(dtbo-y)
always := $(dtbo-y)
all:
make -C /lib/modules/${kernelver}/build M=$(PWD)
clean:
make -C /lib/modules/${kernelver}/build M=$(PWD) clean