Chinaunix首页 | 论坛 | 博客
  • 博客访问: 1521645
  • 博文数量: 290
  • 博客积分: 3468
  • 博客等级: 中校
  • 技术积分: 3461
  • 用 户 组: 普通用户
  • 注册时间: 2010-12-28 22:21
文章分类

全部博文(290)

文章存档

2016年(13)

2015年(3)

2014年(42)

2013年(67)

2012年(90)

2011年(75)

分类: LINUX

2011-03-25 23:03:17

系统环境:ubuntu10.04

内核源码下载地址:

安装软件:libncurses5-dev

# tar -xvf  linux-2.6.36.tar.bz2 -C /usr/src

# make mrproper          净化解压后的源代码 

# cp /boot/config-2.6.32-28-generic  ./.config

# make menuconfig        对内核选项进行配置 

# make dep               建立模块间的依赖信息 

# make clean             删除配置时留下的一些不用的文件 

# make bzImage           编译内核,内核较小时可以用make zImage 

# make modules           编译内核模块 

# make modules_install   安装内核模块 

# make install           安装内核 

# cd / 

# mkinitramfs 2.6.36 -o /boot/initrd.img-2.6.36-generic  //生成initrd.img文件

到此为止,构建内核完毕,把内核映象和System.map拷贝到/boot/下 

# cp /usr/src/linux-2.6.36/arch/i386/boot/bzImage /boot/vmlinuz-2.6.36-generic 

# cp System.map /boot/System.map-KERNEL_VERSION 

# ln -s /boot/System.map-KERNEL_VERSION /boot/System.map 

# rm /boot/vmlinuz-2.6.36

# update-grub2

制作x86启动盘

# mkdir /home/loongson/initrd

# cp /boot/initrd.img-2.6.36-generic /home/loongson/initrd

# cd /home/loongson/initrd

# mv initrd.img-2.6.36-generic initrd.img-2.6.36-generic.gz

# gunzip initrd.img-2.6.36-generic.gz

# cpio -i < ./initrd.img-2.6.36-generic

# mkdir /home/loongson/ramdisk

# rm initrd.img-2.6.36-generic

# cp * -a /home/loongson/ramdisk

# cp /home/loongson/ramdisk -a /usr/src/linux-2.6.36/arch/i386

# cd /usr/src/linux-2.6.36/

# make menuconfig

在内核选项里加入支持ramdisk启动选项(全局设置里面)

并且在文件系统选项中把ext2,ext3,ext4全部选上 

# make //编译内核

# cp /usr/src/linux-2.6.36/arch/i386/bzImage /boot

# reboot 

进入 grub (grub2) 

grub > linux /boot/bzImage

grub > boot 


阅读(2023) | 评论(0) | 转发(0) |
0

上一篇:debian6 使用记录

下一篇:龙芯启动盘制作

给主人留下些什么吧!~~