×

做个迷你型linux内核

消耗积分:0 | 格式:rar | 大小:0.09 MB | 2017-10-30

分享资料个

  hda1----新装的 RH9

  hdc1----64M 的硬盘,生成的小型 linux 就装在这个盘上,还未分区格式化。

  环境:ms 的虚拟机 5.1 版。

  先重新编译内核,把不需要的全部去掉,这样模块也只有几 M 了。编译后生成了

  内核:vmlinuz-2.4.20-8custom

  initrd:initrd-2.4.20-8custom.img(这个没用到,在 GRUB 中使用它反而不能启动了,

  提示要加 init 内核参数。)

  可加载模块:/lib/modules/2.4.20-8custom

  fdisk /dev/hdc 分区,并激活,保存后退出。

  mkext2fs /dev/hdc1

  mkdir /mnt/hd2

  mount /dev/hdc1 /mnt/hd2

  mkdir /mnt/hd2/boot/grub -p

  cp /boot/vmlinuz.2.4.20-8custom /mnt/hd2/boot/ -a

  cp /boot/initrd.2.4.20-8custom /mnt/hd2/boot/ -a

  cp /boot/grub/stage? /mnt/hd2/boot/grub/ -a

  cp /boot/grub/grub.conf /mnt/hd2/boot/grub/ -a

  cp /boot/grub/e2fs_stage1_5 /mnt/hd2/boot/grub/ -a

  然后运行:grub

  root (hdc1,0)

  setup (hdc)

  quit

自己做个迷你型linux内核

声明:本文内容及配图由入驻作者撰写或者入驻合作网站授权转载。文章观点仅代表作者本人,不代表电子发烧友网立场。文章及其配图仅供工程师学习之用,如有内容侵权或者其他违规问题,请联系本站处理。 举报投诉

评论(0)
发评论

下载排行榜

全部0条评论

快来发表一下你的评论吧 !