UEFI » История » Редакция 2
« Предыдущее |
Редакция 2/3
(Разница(diff))
| Следующее »
Андрей Волков, 2012-10-12 12:41
UEFI загрузка¶
Создаем новую таблицу разделов:¶
gdisk /dev/sdb
GPT fdisk (gdisk) version 0.8.4 Partition table scan: MBR: not present BSD: not present APM: not present GPT: not present Creating new GPT entries.
Command (? for help): o
This option deletes all partitions and creates a new protective MBR.
Proceed? (Y/N): y
Command (? for help): n
Partition number (1-128, default 1):
First sector (34-488395021, default = 2048) or {+-}size{KMGTP}:
Last sector (2048-488395021, default = 488395021) or {+-}size{KMGTP}: +195M
Current type is 'Linux filesystem'
Hex code or GUID (L to show codes, Enter = 8300): EF00
Changed type of partition to 'EFI System'
Command (? for help): n
Partition number (2-128, default 2):
First sector (34-488395021, default = 401408) or {+-}size{KMGTP}:
Last sector (401408-488395021, default = 488395021) or {+-}size{KMGTP}:
Current type is 'Linux filesystem'
Hex code or GUID (L to show codes, Enter = 8300): FD00
Changed type of partition to 'Linux RAID'
Command (? for help): p
Disk /dev/sdb: 488395055 sectors, 232.9 GiB Logical sector size: 512 bytes Disk identifier (GUID): 47C154D0-7F67-4EDB-8871-9C80E6836A6F Partition table holds up to 128 entries First usable sector is 34, last usable sector is 488395021 Partitions will be aligned on 2048-sector boundaries Total free space is 2014 sectors (1007.0 KiB) Number Start (sector) End (sector) Size Code Name 1 2048 401407 195.0 MiB EF00 EFI System 2 401408 488395021 232.7 GiB FD00 Linux RAID
Command (? for help): w
Final checks complete. About to write GPT data. THIS WILL OVERWRITE EXISTING PARTITIONS!!
Do you want to proceed? (Y/N): y
OK; writing new GUID partition table (GPT) to /dev/sdb. The operation has completed successfully.
Готовим ядро для загрузки через UEFI:¶
CONFIG_EFI=y CONFIG_EFI_STUB=y CONFIG_RELOCATABLE=y CONFIG_FB_EFI=y CONFIG_FRAMEBUFFER_CONSOLE=y CONFIG_EFI_PARTITION=y CONFIG_VFAT_FS=y CONFIG_EFI_VARS=m
Устанавливаем пакет для управления UEFI.¶
/etc/paludis/keywords.conf
=sys-boot/efibootmgr-0.5.4 ~amd64
cave resolve -xz efibootmgr
Создаем нужные папки¶
mkdir /boot/efi
Создаем ФС¶
cave resolve -xz sys-fs/dosfstools
mkfs.vfat -F32 -n efi /dev/sdb1
mkfs.vfat 3.0.12 (29 Oct 2011)
Добавляем в fstab¶
/etc/fstab
LABEL=efi /boot/efi vfat noatime 0 2
Пересобираем grub2 с поддержкой uefi-64¶
/etc/paludis/use.conf
sys-boot/grub GRUB_PLATFORMS: efi-64
cave resolve -1xz sys-boot/grub
Готовимся к первой загрузке через UEFI¶
Для работы с UEFI нужно чтобы ОС загружена через UEFI.
Это можно сделать через специальный UEFI shell.
x86_64 UEFI Shell 1.0 (Old)¶
https://edk2.svn.sourceforge.net/svnroot/edk2/trunk/edk2/EdkShellBinPkg/FullShell/X64/Shell_Full.efi
x86_64 UEFI Shell 2.0 (Beta)¶
https://edk2.svn.sourceforge.net/svnroot/edk2/trunk/edk2/ShellBinPkg/UefiShell/X64/Shell.efi
Выбираем 1.0 (Old)
wget -O /boot/efi/ShellX64.efi 'https://edk2.svn.sourceforge.net/svnroot/edk2/trunk/edk2/EdkShellBinPkg/FullShell/X64/Shell_Full.efi'
Отключаем лишнее¶
chmod -x /etc/grub.d/{20_linux_xen,30_os-prober,40_custom,41_custom}
Устанавливаем загрузчик по временной схеме (без прописки в UEFI)¶
grub2-install --target=x86_64-efi --efi-directory=/boot/efi --removable --modules='part_gpt lvm'
Перезагружаемся через uefi shell (через BIOS)¶
Попадаем в UEFI консоль
shell > fs0: fs0> cd EFI fs0> cd BOOT fs0> BOOTX64.EFI
Устанавливаем по нормальной схеме:¶
grub2-install --target=x86_64-efi --efi-directory=/boot/efi --boot-directory=/boot
BootCurrent: 0003 Timeout: 5 seconds BootOrder: 0000,0003 Boot0003* UEFI: Built-in EFI Shell Boot0000* gentoo Installation finished. No error reported.
Удаляем старые загрузчики:¶
rm -rfv /boot/efi/EFI/BOOT
rm -rfv /boot/grub/i386-pc
Перегенерируем конфигурацию grub2¶
grub2-mkconfig -o /boot/grub2/grub.cfg
Generating grub.cfg ... Found linux image: /boot/vmlinuz-3.4.9-gentoo-f-64 Found initrd image: /boot/initrd-3.4.9-gentoo-f-64 Found linux image: /boot/vmlinuz-3.4.9-gentoo-e-64 Found initrd image: /boot/initrd-3.4.9-gentoo-e-64 Found linux image: /boot/vmlinuz-3.3.8-gentoo-e-64 Found initrd image: /boot/initrd-3.3.8-gentoo-e-64 Found linux image: /boot/vmlinuz-3.2.12-gentoo-e-64 Found initrd image: /boot/initrd-3.2.12-gentoo-e-64 Found linux image: /boot/vmlinuz-3.2.12-gentoo-d-64 Found initrd image: /boot/initrd-3.2.12-gentoo-d-64 Found linux image: /boot/vmlinuz-3.2.1-gentoo-r2-d-64 Found initrd image: /boot/initrd-3.2.1-gentoo-r2-d-64 done
Обновлено Андрей Волков около 12 лет назад · 3 изменени(я, ий)