1

I'm trying to install a Linux external kernel module. I've unpacked the full source tarball: there are source codes (.c), Kconfig, and Makefile.

While adding options to .config with make menuconfig, I got

make: *** No rule to make target `menuconfig'. Stop.

(I tried make menuconfig under /usr/src/Linux-header-3.xxxx and it did work; the menu pops out!)

I'm a little confused with this make menuconfig mechanism. Did I have to link my Kconfig with Linux top-level Makefile (Kconfig?) or add another Kbuild file?

several files are listed below:

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.

Makefile:

    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
artless noise
  • 21,212
  • 6
  • 68
  • 105
qweeah
  • 199
  • 2
  • 10
  • 1
    You need an actual kernel source tree (and not just the headers) to run `menuconfig`. What distribution are you targeting, and have you thoroughly read the documentation? – Elliott Frisch Oct 07 '14 at 03:19
  • 2
    `make menuconfig` only makes sense at top level. You configure the kernel as a whole, not individual modules. If you have an external module you normally don't need to make any config file. If you want to include your module in the top-level build, you want to source your kconfig from an upper-level kconfig as ezplained e.g. [here](http://www.makelinux.net/books/lkd2/ch16lev1sec5). – n. m. could be an AI Oct 07 '14 at 03:27
  • @n.m. thanks a lot.Is there any CONVENTION that I should add my Kconfig to a 'specific node' of the whole kernel source tree? – qweeah Oct 07 '14 at 03:45

0 Answers0