Building drivers without source on BBB

47 views
Skip to first unread message

Raul Piper

unread,
Jul 19, 2016, 7:36:00 AM7/19/16
to BeagleBoard

HI, 
I am using this Makefile to build the kernel driver on the BBB itself(already apt-get installed build-essenatials on it).
obj-m += myDrvr.o

all:
make -C /lib/modules/$(shell uname -r)/build M=$(PWD) modules

clean:
make -C /lib/modules/$(shell uname -r)/build M=$(PWD) clean


But I am getting this error : 
make -C /lib/modules/4.1.22-bone21/build M=/home/ubuntu/bb/exploringBB/chp06/GPIO/tests/hello-linux-module modules
Makefile:4: recipe for target 'all' failed


I checked that inside ls -l /lib/modules/  there is 4.1.22-bone21 folder is present which is symbolically linked with the build pointing to /path_to_kernel_sources_on_pc_WHERE_I_BUILT_MY_KERNEL

Is this some error I did while building the image for BBB.How can I compile my kernel module?

Thanks and Rgds,
Rp

ZeekHuge

unread,
Jul 19, 2016, 12:25:54 PM7/19/16
to BeagleBoard
Hi Raul Piper,

You should probably not worry about the /lib/modules/4.1.22-bone21/ files.

But there might be a problem in your Makefile. You should try adding 'all' and 'clean' as PHONY targets in your makefile.
You can see this Makefile for reference : https://github.com/ZeekHuge/BeagleScope/blob/port_to_4.4.12-ti-r31%2B/examples/kernel_examples/n-blinky/module/Makefile

Good Luck

Raul Piper

unread,
Jul 20, 2016, 12:08:16 AM7/20/16
to BeagleBoard
No It did not work.I just replaced the name of my module in your
example Makefile .Did you follow any pre-steps before this?
Rp
> --
> For more options, visit http://beagleboard.org/discuss
> ---
> You received this message because you are subscribed to a topic in the
> Google Groups "BeagleBoard" group.
> To unsubscribe from this topic, visit
> https://groups.google.com/d/topic/beagleboard/j30OiI9DWMg/unsubscribe.
> To unsubscribe from this group and all its topics, send an email to
> beagleboard...@googlegroups.com.
> To view this discussion on the web visit
> https://groups.google.com/d/msgid/beagleboard/daa95f3f-8c1c-44f3-92c8-536db1a0f134%40googlegroups.com.
>
> For more options, visit https://groups.google.com/d/optout.
Reply all
Reply to author
Forward
0 new messages