Gentoo:带 efi 的 grub2

Gentoo:带 efi 的 grub2

我在 gentoo 上加载 grub2 和 efi 时遇到一个奇怪的问题。也许我错过了一些东西,但我正在尝试这样做:

# mkdir /media/gentoo 
# mount /dev/sda8 /media/gentoo/ 
# mount -t proc none /media/gentoo/proc/ 
# mount --rbind /dev/ /media/gentoo/dev 
# mount --rbind /sys/ /media/gentoo/sys/ 
# chroot /media/gentoo/ /bin/bash 

# env-update  
>>> Regenerating /etc/ld.so.cache... 
# source /etc/profile 
#

...

# parted -l 
Model: ATA ST500LM000-SSHD- (scsi) 
Disk /dev/sda: 500GB 
Sector size (logical/physical): 512B/4096B 
Partition Table: gpt 
Disk Flags: 

Warning: failed to translate partition name 
Warning: failed to translate partition name 
Warning: failed to translate partition name 
Warning: failed to translate partition name 
Number  Start   End     Size    File system  Name                          Flags 
 1      1049kB  1050MB  1049MB  ntfs                                       hidden, diag 
 2      1050MB  1322MB  273MB   fat32                                      boot, hidden, esp 
 3      1322MB  2371MB  1049MB  fat32                                      hidden 
 4      2371MB  2505MB  134MB                Microsoft reserved partition  msftres 
 5      2505MB  108GB   106GB   ntfs         Basic data partition          msftdata 
 8      108GB   459GB   350GB   ext4 
 6      459GB   485GB   26.8GB  ntfs         Basic data partition          msftdata 
 7      485GB   500GB   14.7GB  ntfs                                       hidden, diag

...

# mount /dev/sda2 /boot/efi/ 
# grub2-install --target=x86_64-efi --recheck --debug 
.... 
grub2-install: info: copying `/boot/grub/x86_64-efi/core.efi' -> `/boot/efi/EFI/gentoo/grubx64.efi'. 
grub2-install: info: Registering with EFI: distributor = `gentoo', path = `\EFI\gentoo\grubx64.efi', ESP at hostdisk//dev/sda,gpt2. 
grub2-install: info: executing efibootmgr --version </dev/null >/dev/null. 
grub2-install: info: executing modprobe -q efivars. 
grub2-install: info: executing efibootmgr -b 0003 -B. 
BootCurrent: 0000 
Timeout: 0 seconds 
BootOrder: 0002,2001,0001,2002,2003 
Boot0000* EFI USB Device (UFD 2.0 Silicon-Power8G) 
Boot0001* Lenovo Recovery System 
Boot0002* Windows Boot Manager 
Boot2001* EFI USB Device 
Boot2002* EFI DVD/CDROM 
Boot2003* EFI Network 
grub2-install: info: executing efibootmgr -c -d /dev/sda -p 2 -w -L gentoo -l \EFI\gentoo\grubx64.efi. 
BootCurrent: 0000 
Timeout: 0 seconds 
BootOrder: 0003,0002,2001,0001,2002,2003 
Boot0000* EFI USB Device (UFD 2.0 Silicon-Power8G) 
Boot0001* Lenovo Recovery System 
Boot0002* Windows Boot Manager 
Boot2001* EFI USB Device 
Boot2002* EFI DVD/CDROM 
Boot2003* EFI Network 
Boot0003* gentoo 
Installation finished. No error reported. 

 # grub2-mkconfig -o /boot/grub/grub.cfg 
Generating grub configuration file ... 
Found linux image: /boot/kernel-genkernel-x86_64-3.17.8-gentoo-r1 
Found initrd image: /boot/initramfs-genkernel-x86_64-3.17.8-gentoo-r1 
Found Windows Recovery Environment (loader) on /dev/sda3 
Found Windows 8 (loader) on /dev/sda5 
done 

 # efibootmgr -v 
BootCurrent: 0000 
Timeout: 0 seconds 
BootOrder: 0003,0002,2001,0001,2002,2003 
Boot0000* EFI USB Device (UFD 2.0 Silicon-Power8G)   ACPI(a0341d0,0)PCI(14,0)USB(1,0)HD(1,203f,efe782,c3072e18)RC 
Boot0001* Lenovo Recovery System   HD(3,276800,1f4000,478687c7-6120-42c7-93ab-5e3103e1b9ee)File(\EFI\Microsoft\Boot\LrsBootMgr.efi)RC 
Boot0002* Windows Boot Manager   HD(2,1f4800,82000,025a7d4d-2436-4fec-8e12-c34679d2d76b)File(\EFI\Microsoft\Boot\bootmgfw.efi)WINDOWS.........x...B.C.D.O.B.J.E.C.T.=.{.9.d.e.a.8.6.2.c.-.5.c.d.d.-.4.e.7.0.-.a.c.c.1.-.f.3.2.b.3.4.4.d.4.7.9.5.}...{................ 
Boot0003* gentoo   HD(2,1f4800,82000,025a7d4d-2436-4fec-8e12-c34679d2d76b)File(\EFI\gentoo\grubx64.efi) 
Boot2001* EFI USB Device   RC 
Boot2002* EFI DVD/CDROM   RC 
Boot2003* EFI Network   RC

但重新启动后,我再次看到 Window 8 加载程序。我如何找出出了什么问题(任何日志或调试消息)?或者也许您可以看到,存在一些愚蠢的错误?我已经在上问过这个问题gentoo论坛,但也许我在这里会有更好的运气。

UPD:“Secure boot=Enabled”选项是罪魁祸首。

答案1

/boot/efi必须是 FAT32“efi 系统分区”(ESP),另请参阅http://www.rodsbooks.com/efi-bootloaders/principles.html

相关内容