fedora 编译linux内核,fedora 14 编译内核(RPM包)

..rpm"

These commands will install your kernel in /boot, create a new initramfs to bootstrap your kernel, and automatically add your new kernel to your grub bootloader "menu.lst". At this point, you can reboot to give control to your new kernel.

Building Only Kernel Modules (Out Of Tree Modules)

This section needs to be updated and fleshed out

This section is for users who are only interested in working on a kernel module, and who do not wish to build an entire custom kernel. It is not necessary to download and rebuild the entire kernel in order to build a module. To build a module for the currently running kernel, only the matching kernel-devel package is required. Run the following command to install the kernel-devel package using yum.

>>>>    su -c 'yum install kernel-devel'

You may need to install 'kernel-PAE-devel' if you are using the PAE kernel

You can build against any kernel version, as long as you have kernel and kernel-devel packages installed for that version. The rest of this section assumes we're building for the running kernel; if not, replace `uname -r` with the desired version number.

The kernel-doc package contains official Kbuild documentation - see files under Documentation/kbuild, in particular the modules.txt file.

As a simple example, to build the foo.ko module from foo.c, create the following Makefile in the directory containing the foo.c file:

>>>>    obj-m := foo.o

>>>>

>>>>    KDIR  := /lib/modules/$(shell uname -r)/build

>>>>    PWD   := $(shell pwd)

>>>>

>>>>    default:

>>>>    [TAB]$(MAKE) -C $(KDIR) M=$(PWD) modules

[TAB] Denotes a tab character which must come first for makefile lines containing commands.

Then, issue the make command to build the foo.ko module.

The above is a helpful local Makefile wrapper invoking kbuild; in general you can simply do things like

>>>>    # make -C /lib/modules/`uname -r`/build M=`pwd` modules

>>>>    # make -C /lib/modules/`uname -r`/build M=`pwd` clean

>>>>    # make -C /lib/modules/`uname -r`/build M=`pwd` modules_install

etc to build those targets.

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

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值