Advertisement
Guest User

Untitled

a guest
Apr 7th, 2020
94
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.07 KB | None | 0 0
  1. Recipe directory structure:
  2. .
  3. ├── afrgb-stm32mp1_0.1.bb
  4. └── files
  5. ├── afrgb-stm32mp1.c
  6. └── Makefile
  7.  
  8.  
  9.  
  10. afrgb-stm32mp1_0.1.bb:
  11. inherit module
  12.  
  13. SUMMARY = "Adafruit RGB LED Matrix Driver for STM32MP1xx devices"
  14. LICENSE = "CLOSED"
  15.  
  16. #SRC_URI = "git://code.technokrat.ch/ecarup/afrgb-stm32mp1.git;protocol=https;branch=rolling"
  17. SRC_URI = "file://Makefile \
  18. file://afrgb-stm32mp1.c \
  19. "
  20. S = "${WORKDIR}"
  21. PROVIDES_${PN} += "kernel-module-afrgb-stm32mp1"
  22.  
  23.  
  24. afrgb-stm32mp1.c:
  25. #include <linux/module.h>
  26.  
  27. int init_module(void)
  28. {
  29. printk(KERN_ALERT "gay\n");
  30. return 0;
  31. }
  32.  
  33. void cleanup_module(void)
  34. {
  35. printk(KERN_ALERT "oh no!\n");
  36. }
  37.  
  38. MODULE_LICENSE("GPL");
  39.  
  40.  
  41.  
  42. Makefile:
  43. obj-m := afrgb-stm32mp1.o
  44.  
  45. SRC := $(shell pwd)
  46.  
  47. all:
  48. $(MAKE) -C $(KERNEL_SRC) M=$(SRC)
  49.  
  50. modules_install:
  51. $(MAKE) -C $(KERNEL_SRC) M=$(SRC) modules_install
  52.  
  53. clean:
  54. rm -f *.o *~ core .depend .*.cmd *.ko *.mod.c
  55. rm -f Module.markers Module.symvers modules.order
  56. rm -rf .tmp_versions Modules.symvers
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement