添加Linux模块:不能做“make menuconfig”

时间:2014-10-07 03:17:13

标签: linux kernel-module kbuild

我正在尝试安装Linux外部内核模块。我已经解压缩了完整的源代码tarball:有源代码(.c),Kconfig和Makefile。

在使用make menuconfig向.config添加选项时,我得到了

  

make:***没有规则来制作目标`menuconfig'。停止。

(我在make menuconfig下尝试了/usr/src/Linux-header-3.xxxx它确实有效;菜单弹出!)

我对这个make menuconfig机制感到有些困惑。我是否必须将我的Kconfig与Linux顶级Makefile(Kconfig?)相关联或添加另一个Kbuild文件?

下面列出了几个文件:

的Kconfig:

    config PMFS
        tristate "Persistent and Protected PM file system support"
        depends on HAS_IOMEM
        select CRC16
        help
           If your system has a block of fast (comparable in access speed to
           system memory) and non-volatile byte-addressable memory and you wish to
           mount a light-weight, full-featured, and space-efficient filesystem over
           it, say Y here, and read <file:Documentation/filesystems/pmfs.txt>.

           To compile this as a module,  choose M here: the module will be
           called pmfs.

    config PMFS_XIP
        bool "Execute-in-place in PMFS"
        depends on PMFS && BLOCK
        help
           Say Y here to enable XIP feature of PMFS.

    config PMFS_WRITE_PROTECT
        bool "PMFS write protection"
        depends on PMFS && MMU && HAVE_SET_MEMORY_RO
        default y
        help
           Say Y here to enable the write protect feature of PMFS.

    config PMFS_TEST
        boolean
        depends on PMFS

    config PMFS_TEST_MODULE
        tristate "PMFS Test"
        depends on PMFS && PMFS_WRITE_PROTECT && m
        select PMFS_TEST
        help
          Say Y here to build a simple module to test the protection of
          PMFS. The module will be called pmfs_test.

生成文件:

    obj-$(CONFIG_PMFS) += pmfs.o
    obj-$(CONFIG_PMFS_TEST_MODULE) += pmfs_test.o

    pmfs-y := bbuild.o balloc.o dir.o file.o inode.o namei.o super.o symlink.o ioctl.o         journal.o

    pmfs-$(CONFIG_PMFS_WRITE_PROTECT) += wprotect.o
    pmfs-$(CONFIG_PMFS_XIP) += xip.o

0 个答案:

没有答案