Skip to content

Commit 73687f3

Browse files
committed
Support yocto builds
Yocto module class uses KERNEL_SRC instead of the widespread KDIR. Make sure we honor that variable too. Remove now redundant Kbuild include, and simplify rules while at it. Signed-off-by: Benjamin Mugnier <benjamin.mugnier@foss.st.com>
1 parent 2ec6c2d commit 73687f3

3 files changed

Lines changed: 11 additions & 12 deletions

File tree

Jenkinsfile

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -33,7 +33,7 @@ pipeline {
3333
stage('Build') {
3434
steps {
3535
dir('pristine') {
36-
sh 'make KVERSION=$(ls /lib/modules/)'
36+
sh 'make KDIR=/lib/modules/$(ls /lib/modules/)/build'
3737
}
3838
}
3939
}

Kbuild

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
obj-$(CONFIG_DRIVER_VD1943) += vd1943.o
1+
obj-m += vd1943.o

Makefile

Lines changed: 9 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,12 @@
1-
ifneq ($(KERNELRELEASE),)
2-
include Kbuild
1+
KDIR ?= /lib/modules/`uname -r`/build
2+
KERNEL_SRC ?= $(KDIR)
3+
SRC := $(shell pwd)
34

4-
else
5-
KVERSION ?= `uname -r`
6-
KDIR ?= /lib/modules/${KVERSION}/build
7-
default:
8-
CONFIG_DRIVER_VD1943=m $(MAKE) -C $(KDIR) M=$$PWD
5+
all:
6+
$(MAKE) -C $(KERNEL_SRC) M=$(SRC)
97

10-
clean:
11-
CONFIG_DRIVER_VD1943=m $(MAKE) -C $(KDIR) M=$$PWD clean
8+
modules_install:
9+
$(MAKE) -C $(KERNEL_SRC) M=$(SRC) modules_install
1210

13-
endif
11+
clean:
12+
$(MAKE) -C $(KERNEL_SRC) M=$(SRC) clean

0 commit comments

Comments
 (0)