|
回复 #1 2012zhaoping 的帖子
[strike]UEFI貌似只支持GPT类型下启动。[/strike]先把U盘用转换成GPT模式,然后安装GRUB2。
在linux下相对容易点。可以参考wiki。
[script]alert(test)[/script]
来自arch wiki 但是中文版没有下面内容- https://wiki.archlinux.org/index.php/Grub2#Hardware-Specific_UEFI_Examples
复制代码
下载包
For 64-bit aka x86_64 UEFI firmware:
# pacman -S grub-efi-x86_64
For 32-bit aka i386 UEFI firmware:
# pacman -S grub-efi-i386
Install grub-uefi boot files
Install to UEFI System Partition
Note: The below commands assume you are using grub-efi-x86_64 (for grub-efi-i386 replace x86_64 with i386 in the below commands).
Note: To do this, you need to boot using UEFI and not the BIOS. If you booted by just copying the ISO file to the USB drive, you will need to follow this guide or grub-install will show errors.
这里需要挂着U盘,同时建立boot分区,所以相对的命令代码的目录需要适当改变eg:# mkdir -p /boot/efi 变为 /mnt/boot/efi(假设挂载到mnt)
The UEFI system partition will need to be mounted at /boot/efi/ for the GRUB(2) install script to detect it:
# mkdir -p /boot/efi
# mount -t vfat /dev/sdXY /boot/efi
Install GRUB UEFI application to /boot/efi/EFI/arch_grub and its modules to /boot/grub/x86_64-efi (recommended) using:
# modprobe dm-mod
# grub-install --target=x86_64-efi --efi-directory=/boot/efi --bootloader-id=arch_grub --recheck --debug
# mkdir -p /boot/grub/locale
# cp /usr/share/locale/en\@quot/LC_MESSAGES/grub.mo /boot/grub/locale/en.mo
Note: Without --target or --directory option, grub-install cannot determine for which firmware grub(2) is being installed. In such cases grub-install will show source_dir doesn't exist. Please specify --target or --directory message.
If you want to install grub(2) modules and grub.cfg at the directory /boot/efi/EFI/grub and the grubx64.efi application at /boot/efi/EFI/arch_grub (ie. all the grub(2) uefi files inside the UEFISYS partition itself) use:
# modprobe dm-mod
# grub-install --target=x86_64-efi --efi-directory=/boot/efi --bootloader-id=arch_grub --boot-directory=/boot/efi/EFI --recheck --debug
# mkdir -p /boot/efi/EFI/grub/locale
# cp /usr/share/locale/en\@quot/LC_MESSAGES/grub.mo /boot/efi/EFI/grub/locale/en.mo
The --efi-directory option mentions the mountpoint of UEFI SYSTEM PARTITION , --bootloader-id mentions the name of the directory used to store the grubx64.efi file and --boot-directory mentions the directory wherein the actual modules will be installed (and into which grub.cfg should be created).
The actual paths are:
<efi-directory>/<EFI or efi>/<bootloader-id>/grubx64.efi
<boot-directory>/grub/x86_64-efi/<all modules, grub.efi, core.efi, grub.cfg>
Note: the --bootloader-id option does not change <boot-directory>/grub, i.e. you cannot install the modules to <boot-directory>/<bootloader-id>, the path is hard-coded to be <boot-directory>/grub.
In --efi-directory=/boot/efi --boot-directory=/boot/efi/EFI --bootloader-id=grub:
<efi-directory>/<EFI or efi>/<bootloader-id> == <boot-directory>/grub == /boot/efi/EFI/grub
In --efi-directory=/boot/efi --boot-directory=/boot/efi/EFI --bootloader-id=arch_grub:
<efi-directory>/<EFI or efi>/<bootloader-id> == /boot/efi/EFI/arch_grub
<boot-directory>/grub == /boot/efi/EFI/grub
In --efi-directory=/boot/efi --boot-directory=/boot --bootloader-id=arch_grub:
<efi-directory>/<EFI or efi>/<bootloader-id> == /boot/efi/EFI/arch_grub
<boot-directory>/grub == /boot/grub
In --efi-directory=/boot/efi --boot-directory=/boot --bootloader-id=grub:
<efi-directory>/<EFI or efi>/<bootloader-id> == /boot/efi/EFI/grub
<boot-directory>/grub == /boot/grub
The <efi-directory>/<EFI or efi>/<bootloader-id>/grubx64.efi is an exact copy of <boot-directory>/grub/x86_64-efi/core.efi.
Note: In GRUB 2.00, the grub-install option --efi-directory replaces --root-directory and the latter is deprecated.
Note: The options --efi-directory and --bootloader-id are specific to GRUB(2) UEFI.
In all the cases the UEFI SYSTEM PARTITION should be mounted for grub-install to install grubx64.efi in it, which will be launched by the firmware (using the efibootmgr created boot entry in non-Mac systems).
If you notice carefully, there is no <device_path> option (Eg: /dev/sda) at the end of the grub-install command unlike the case of setting up GRUB(2) for BIOS systems. Any <device_path> provided will be ignored by the install script as UEFI bootloaders do not use MBR or Partition boot sectors at all.
You may now be able to UEFI boot your system by creating a grub.cfg file by following #Generate GRUB2 UEFI Config file and #Create GRUB2 entry in the Firmware Boot Manager.
[ 本帖最后由 2011monk 于 2013-3-6 17:37 编辑 ] |
|