如何让内核生成对应KO文件

文章讲述了如何生成configfs内核模块,包括打开并编辑Kconfig和Makefile文件,设置CONFIG_CONFIGFS_FS选项,使用makemenuconfig进行配置,以及通过makemodules编译生成configfs.ko文件。configfs是一个基于内存的文件系统,用于用户空间驱动的配置。
摘要由CSDN通过智能技术生成

例如要生成文件fs/configfs/configfs.ko。

打开Kconfig 和 Makefile。

Kconfig

config CONFIGFS_FS
	tristate "Userspace-driven configuration filesystem"
	select SYSFS
	help
	  configfs is a RAM-based filesystem that provides the converse
	  of sysfs's functionality. Where sysfs is a filesystem-based
	  view of kernel objects, configfs is a filesystem-based manager
	  of kernel objects, or config_items.

	  Both sysfs and configfs can and should exist together on the
	  same system. One is not a replacement for the other.

Makefile

#
# Makefile for the configfs virtual filesystem
#

obj-$(CONFIG_CONFIGFS_FS)	+= configfs.o

configfs-objs	:= inode.o file.o dir.o symlink.o mount.o item.o

 根据Makefile。需要定义了CONFIG_CONFIGFS_FS 才可以编译 configfs

make menuconfig.  后输入/CONIFIGFS_FS 。回车搜索。

 可以找到配置CONIFIGFS_FS。 在 File systems/Pseudo filesystems/Userspace-driven configuration filesystem          选择M.

然后 make moudules 可以生成 configfs.ko

 

  • 1
    点赞
  • 1
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值