当前位置:  技术问答>linux和unix

無法編譯外部的kernel module

    来源: 互联网  发布时间:2016-03-15

    本文导语:  用Makefile編一個hello.ko的module但卻不行 發生 make: Nothing to be done for `modules'. 該Makefile為 #ifeq ($(KERNELRELEASE),)     # Assume the source tree is where the running kernel was built     # You should set KERNELDIR in the environ...

用Makefile編一個hello.ko的module但卻不行
發生
make: Nothing to be done for `modules'.

該Makefile為
#ifeq ($(KERNELRELEASE),)

    # Assume the source tree is where the running kernel was built
    # You should set KERNELDIR in the environment if it's elsewhere
    KERNELDIR ?= /lib/modules/$(shell uname -r)/build
    # The current directory is passed to sub-makes as argument
    PWD := $(shell pwd)

modules:

$(MAKE) -C /lib/modules/2.6.23/build/ M=$(PWD) modules
#modules_install:
#       $(MAKE) -C $(KERNELDIR) M=$(PWD) modules_install

clean:
        rm -rf *.o *~ core .depend .*.cmd *.ko *.mod.c .tmp_versions

.PHONY: modules modules_install clean

#else
    # called from kernel build system: just declare what our modules are
   obj-m := hello.o

#endif

|
##Makefile --- 

## Author: hefuhua@163.com
## Version: $Id: Makefile,v 0.0 2007/01/26 02:02:51 leno Exp $
## Keywords: 
## X-URL: 


ifneq ($(KERNELRELEASE),)
        obj-m := -DEXPORT_SYMTAB
        obj-m := hello.o
else

KERNELDIR ?= /home/leno/linux-2.6.24.2
PWD := $(shell pwd)
default:
        $(MAKE) -C $(KERNELDIR) M=$(PWD) modules

endif

###===============================
其实你也可以直接指到内核源码上,

    
 
 

您可能感兴趣的文章:

  • Linux:为什么/lib/modules/linux/kernel文件夹里内容突然没有了
  • linux kernel module中,怎样进行dma转送
  • FATAL:Error inserting parport(/lib/modules/.../kernel/drivers/parport/parport.ko
  • can't find most modules after compiled kernel-2.6.0
  • couldn 't find the kernel version the module was compiled for
  • Linux_kernel_module
  • Linux Kernel module下如何动态分配内存
  • 如何调试linux kernel module啊?
  • 驱动加载时出现“couldn't find the kernel version the module was compiled for”
  • linux kernel-module version mismatch ??? please help me ,thanks
  • No module BusLogic found for kernel 2.6.4?
  • The kernel module can't be loaded correctly during the system booting
  • insmod hello.o:couldn't find the kernel version the module was compiled for
  • 如何搭建跨平台的module编程环境?target:arm-linux kernel:2.6.x
  • FC4下安装kernel-module-ntfs-2.6.11-1.1369_FC4-2.1.22-0.rr.6.0.i686.rpm出错啦
  • 我装的是fedora,但是没有内核开发的工具,在/usr/include/linux下面没有kernel.h和module.h文件。要装什么包?
  • couldn't find the kernel version the module was compiled for???
  • 朋友们有谁会Linux下的System Call程序和Linux Kernel Module Programming (内核模块编程)?基础知识
  •  
    本站(WWW.)旨在分享和传播互联网科技相关的资讯和技术,将尽最大努力为读者提供更好的信息聚合和浏览方式。
    本站(WWW.)站内文章除注明原创外,均为转载、整理或搜集自网络。欢迎任何形式的转载,转载请注明出处。












  • 相关文章推荐
  • java命名空间java.awt.image类kernel的类成员方法: kernel定义及介绍
  • lock_kernel unlock_kernel编译不通过
  • java命名空间java.awt.image类kernel的类成员方法: getheight定义及介绍
  • linux-3ES-13.9.5安装oracle10g时更改/etc/sysctl.conf没有kernel.shmmax,kernel.shmmni
  • java命名空间java.awt.image类kernel的类成员方法: getwidth定义及介绍
  • ▲求助:kernel panic:No init found.try passing init=option to kernel.
  • java命名空间java.awt.image类kernel的类成员方法: getkerneldata定义及介绍
  • kernel too old , kernel panic原因
  • java命名空间java.awt.image类kernel的类成员方法: getyorigin定义及介绍
  • 区分uboot和kernel的宏
  • java命名空间java.awt.image类kernel的类成员方法: clone定义及介绍
  • kernel升级问题,初学,大家指教。
  • Linux Kernel 'sctp_v6_xmit()'函数信息泄露漏洞
  • 关于www.kernel.org结构
  • CentOS 6.5 下载地址及如何升级内核(kernel)版本到 3.10.28
  • __kernel_vsyscall 是什么?
  • 急!怎么没有/usr/src/kernel目录啊?
  • Uncompressing Linux... done, booting the kernel
  • Come in please! About the kernel.3X
  • 一个Kernel panic的问题怎么解决?
  • [救命]安装Ubuntu 时的Kernel Panic - not syncing 错误~


  • 站内导航:


    特别声明:169IT网站部分信息来自互联网,如果侵犯您的权利,请及时告知,本站将立即删除!

    ©2012-2021,,E-mail:www_#163.com(请将#改为@)

    浙ICP备11055608号-3