makefile - How to rename a built-in linux kernel module? -


i trying extend built-in xfs module of linux kernel. following this post, able compile locally. avoid conflict existing kernel xfs module, rename extension to, xxfs, without changing name of source files.

i've found a related post, following changed relevant lines in makefile to:

obj-$(config_xfs_fs)            += xxfs.o xxfs-objs                       := xfs.o 

but got error saying

make[1]: *** no rule make target '/home/dev/tmp/xxfs/xfs.o', needed '/home/dev/tmp/xxfs/xxfs.o'. stop. makefile:1403: recipe target '_module_/home/dev/tmp/xxfs' failed make: *** [_module_/home/dev/tmp/xxfs] error 2 make: leaving directory '/usr/src/linux-headers-4.4.0-28-generic' 

environment:

ubuntu 16.04 kernel 4.4.0-28-generic.


edit

i got xfs kernel module source file by

  1. installing linux kernel source apt-get source linux-source-4.4.0
  2. copy linux-4.4.0/fs/xfs directory (merely easy maintenance), /home/dev/tmp/xxfs

to compile module, run command make -c /lib/modules/$(uname -r)/build m=$(pwd) modules /home/dev/tmp/xxfs directory, after xfs.ko generated in same directory.

however after change following line in makefile

obj-$(config_xfs_fs)            += xfs.o 

to

obj-$(config_xfs_fs)            += xxfs.o xxfs-objs                       := xfs.o 

everything else not touched, no longer able compile module same command.


Comments