热门关键字:  ubuntu  分区  函数  Fedora  linux系统进程

当前位置 :| 主页>Linux发行版>Fedora>

终于在Fedora5上安装上源代码了

来源: 作者: 时间:2008-06-10 Tag: 点击:
玩了好几天Fedora5了,今天终于把FC5的源代码安装上了。
默认安装的FC5是不会安装源代码的,这个原因我也不清楚,记得Redhat以前安装后是直接安装了源代码的,所以作内核级开发的调试的时候不用管那么多。
安装源代码的整个过程我差不多是按Fedora5发行注记操作的:http://docs.fedoraproject.org/release-notes/fc5/release-notes-ISO/zh_CN/
同时参考了其他一些人写的心得。但是,在做这一步的时候发生了很多warning,(
rpmbuild -bp --target $(uname -m) kernel-2.6.spec

我前几次没有继续走下去,而是分析解决这个warning,但始终未能解决,后来索性忽视了这个warning,没想到居然成功了。
测试模块:
/*hello.c*/
#include <linux/kernel.h>
#include <linux/init.h>
#include <linux/module.h>
MODULE_LICENSE("Dual BSD/GPL");

static int hello_init(void)
{
printk(KERN_ALERT "Hello World\n" );
return 0;
}

static void hello_exit(void)
{
printk(KERN_ALERT "Goodbye World\n" );
}

module_init(hello_init);
module_exit(hello_exit);

Makefile:

TARGET = hello
KDIR = /lib/modules/$(shell uname -r)/build
PWD = $(shell pwd)
obj-m := $(TARGET).o
default:
make -C $(KDIR) M=$(PWD) modules

最新评论共有 0 位网友发表了评论
发表评论
评论内容:不能超过250字,需审核,请自觉遵守互联网相关政策法规。
用户名: 密码:
匿名?
注册