Gentoo使用grub2

來源:互聯網
上載者:User

由於某些原因,grub2沒有加入Gentoo portage穩定源中

但這並不能阻止我們使用,使用方法如下:

一. 自己編譯grub2

1.從
grub官網 下載 源碼 (目前是grub-1.99), ftp網站

2. 編譯安裝

# tar -zxvf grub-1.99.tar.gz# cd grub-1.99# ./configure# make# make install# grub-mkconfig  # 自己編譯的沒有 update-grub 命令

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

1.運行以下命令:

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

2.得到如下提示:

nehc ~ # emerge -av sys-boot/grub:2 These are the packages that would be merged, in order: Calculating dependencies... done! [ebuild  N    ~] sys-boot/os-prober-1.47  25 kB [ebuild  N     ] dev-libs/lzo-2.06  USE="-examples -static-libs" 570 kB [ebuild     U ~] media-fonts/unifont-5.1.20080914 [1.0-r4] USE="X" 8,351 kB [ebuild  N     ] dev-python/pycrypto-2.3  USE="gmp -doc" 324 kB [ebuild  N     ] dev-python/setuptools-0.6.21  391 kB [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 [ebuild  N     ] dev-libs/libburn-1.0.0  USE="-debug -track-src-odirect" 792 kB [ebuild  N     ] sys-devel/autogen-5.11.5  1,016 kB [ebuild  N     ] dev-python/paramiko-1.7.7.1  USE="-doc -examples" 804 kB [ebuild  N     ] dev-libs/libisofs-1.0.0  USE="acl zlib -debug -verbose-debug -xattr" 669 kB [ebuild  N     ] dev-libs/libisoburn-1.0.0  USE="acl readline zlib -debug -external-filters -external-filters-setuid -xattr" 1,015 kB [ebuild  N     ] dev-vcs/bzr-2.4.1  USE="sftp -bash-completion -curl -doc -emacs -test" 7,110 kB [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 Total: 13 packages (1 upgrade, 11 new, 1 in new slot), Size of downloads: 24,924 kB The following keyword changes are necessary to proceed: #required by sys-boot/grub-9999[truetype], required by sys-boot/grub:2 (argument) >=media-fonts/unifont-5.1.20080914 ~amd64 #required by sys-boot/grub-9999, required by sys-boot/grub:2 (argument) >=sys-boot/os-prober-1.47 ~amd64 #required by sys-boot/grub:2 (argument) >=sys-boot/grub-9999 ** NOTE: This --autounmask behavior can be disabled by setting       EMERGE_DEFAULT_OPTS="--autounmask=n" in make.conf. Use --autounmask-write to write changes to config files (honoring CONFIG_PROTECT). 

3.解決依賴(注意上一條命令的提示)

# emerge --autounmask-write sys-boot/grub:2# etc-update.....                   # 此處選擇-3用新設定檔替換掉舊的

4.安裝

# emerge sys-boot/grub:2

如:



5.安裝、配置

# grub2-mkconfig -o /boot/grub2/grub.cfg  #組建組態檔案 grub.cfg# grub2-install --no-floppy /dev/sda      #安裝到MBR

6. 大功告成,可以reboot體驗了

聯繫我們

該頁面正文內容均來源於網絡整理,並不代表阿里雲官方的觀點,該頁面所提到的產品和服務也與阿里云無關,如果該頁面內容對您造成了困擾,歡迎寫郵件給我們,收到郵件我們將在5個工作日內處理。

如果您發現本社區中有涉嫌抄襲的內容,歡迎發送郵件至: info-contact@alibabacloud.com 進行舉報並提供相關證據,工作人員會在 5 個工作天內聯絡您,一經查實,本站將立刻刪除涉嫌侵權內容。

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.