Gentoo使用grub2

由于某些原因,grub2没有加入Gentoo portage稳定源中

但这并不能阻止我们使用,使用方法如下:

一. 自己编译grub2

1.从 grub官网 下载 源码 (目前是grub-1.99), ftp站点

2. 编译安装

  1. # tar -zxvf grub-1.99.tar.gz  
  2. # cd grub-1.99  
  3. # ./configure  
  4. # make  
  5. # make install  
  6. # grub-mkconfig  # 自己编译的没有 update-grub 命令  

二. 用 Gentoo 的 emerge 命令安装(参考:http://en.gentoo-wiki.com/wiki/Grub2

1.运行以下命令:

  1. echo "sys-boot/grub:2" >> /etc/portage/package.accept_keywords   
  2. echo "sys-boot/grub:2" >> /etc/portage/package.unmask   
  3. emerge -av sys-boot/grub:2   

2.得到如下提示:

  1. nehc ~ # emerge -av sys-boot/grub:2   
  2.   
  3. These are the packages that would be merged, in order:   
  4.   
  5. Calculating dependencies... done!   
  6. [ebuild  N    ~] sys-boot/os-prober-1.47  25 kB   
  7. [ebuild  N     ] dev-libs/lzo-2.06  USE="-examples -static-libs" 570 kB   
  8. [ebuild     U ~] media-fonts/unifont-5.1.20080914 [1.0-r4] USE="X" 8,351 kB   
  9. [ebuild  N     ] dev-python/pycrypto-2.3  USE="gmp -doc" 324 kB   
  10. [ebuild  N     ] dev-python/setuptools-0.6.21  391 kB   
  11. [ebuild  N     ] dev-scheme/guile-1.8.8-r1  USE="deprecated nls regex threads -debug -debug-freelist -debug-malloc -discouraged -emacs -networking" 3,864 kB   
  12. [ebuild  N     ] dev-libs/libburn-1.0.0  USE="-debug -track-src-odirect" 792 kB   
  13. [ebuild  N     ] sys-devel/autogen-5.11.5  1,016 kB   
  14. [ebuild  N     ] dev-python/paramiko-1.7.7.1  USE="-doc -examples" 804 kB   
  15. [ebuild  N     ] dev-libs/libisofs-1.0.0  USE="acl zlib -debug -verbose-debug -xattr" 669 kB   
  16. [ebuild  N     ] dev-libs/libisoburn-1.0.0  USE="acl readline zlib -debug -external-filters -external-filters-setuid -xattr" 1,015 kB   
  17. [ebuild  N     ] dev-vcs/bzr-2.4.1  USE="sftp -bash-completion -curl -doc -emacs -test" 7,110 kB   
  18. [ebuild  NS   *] sys-boot/grub-9999 [0.97-r10] USE="nls sdl truetype -custom-cflags -debug -device-mapper -efiemu -static" GRUB_PLATFORMS="-coreboot -efi-32 -efi-64 -emu -ieee1275 -multiboot -pc -qemu -qemu-mips -yeeloong" 0 kB   
  19.   
  20. Total: 13 packages (1 upgrade, 11 new, 1 in new slot), Size of downloads: 24,924 kB   
  21.   
  22. The following keyword changes are necessary to proceed:   
  23. #required by sys-boot/grub-9999[truetype], required by sys-boot/grub:2 (argument)   
  24. >=media-fonts/unifont-5.1.20080914 ~amd64   
  25. #required by sys-boot/grub-9999, required by sys-boot/grub:2 (argument)   
  26. >=sys-boot/os-prober-1.47 ~amd64   
  27. #required by sys-boot/grub:2 (argument)   
  28. >=sys-boot/grub-9999 **   
  29.   
  30. NOTE: This --autounmask behavior can be disabled by setting   
  31.       EMERGE_DEFAULT_OPTS="--autounmask=n" in make.conf.   
  32.   
  33. Use --autounmask-write to write changes to config files (honoring CONFIG_PROTECT).   

3.解决依赖(注意上一条命令的提示)

  1. # emerge --autounmask-write sys-boot/grub:2  
  2.   
  3. # etc-update  
  4. .....                   # 此处选择-3用新配置文件替换掉旧的  


4.安装

  1. # emerge sys-boot/grub:2  

如下图:




5.安装、配置

  1. # grub2-mkconfig -o /boot/grub2/grub.cfg  #生成配置文件 grub.cfg  
  2.   
  3.   
  4. # grub2-install --no-floppy /dev/sda      #安装到MBR  


6. 大功告成,可以reboot体验了



  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 1
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论 1
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值