요약·해설과 원문, 전문 번역을 서로 분리했습니다. API 이름, symbol, source path는 원문 표기를 사용합니다.
1. 요약·해설
원문의 핵심 논리와 kernel programming 관점의 보충 설명입니다. 아래의 전문 번역과는 별도로 작성했습니다.
2. 영어 원문 전체
번역 기준이 된 Linux v6.18.37 원문입니다. 줄 번호는 이 버전의 파일 좌표입니다.
원문 전체 펼치기
.. SPDX-License-Identifier: GPL-2.0
=====================================
General note on [U]EFI x86_64 support
=====================================
The nomenclature EFI and UEFI are used interchangeably in this document.
Although the tools below are _not_ needed for building the kernel,
the needed bootloader support and associated tools for x86_64 platforms
with EFI firmware and specifications are listed below.
1. UEFI specification: http://www.uefi.org
2. Booting Linux kernel on UEFI x86_64 platform can either be
done using the <Documentation/admin-guide/efi-stub.rst> or using a
separate bootloader.
3. x86_64 platform with EFI/UEFI firmware.
Mechanics
---------
Refer to <Documentation/admin-guide/efi-stub.rst> to learn how to use the EFI stub.
Below are general EFI setup guidelines on the x86_64 platform,
regardless of whether you use the EFI stub or a separate bootloader.
- Build the kernel with the following configuration::
CONFIG_FB_EFI=y
CONFIG_FRAMEBUFFER_CONSOLE=y
If EFI runtime services are expected, the following configuration should
be selected::
CONFIG_EFI=y
CONFIG_EFIVAR_FS=y or m # optional
- Create a VFAT partition on the disk with the EFI System flag
You can do this with fdisk with the following commands:
1. g - initialize a GPT partition table
2. n - create a new partition
3. t - change the partition type to "EFI System" (number 1)
4. w - write and save the changes
Afterwards, initialize the VFAT filesystem by running mkfs::
mkfs.fat /dev/<your-partition>
- Copy the boot files to the VFAT partition:
If you use the EFI stub method, the kernel acts also as an EFI executable.
You can just copy the bzImage to the EFI/boot/bootx64.efi path on the partition
so that it will automatically get booted, see the <Documentation/admin-guide/efi-stub.rst> page
for additional instructions regarding passage of kernel parameters and initramfs.
If you use a custom bootloader, refer to the relevant documentation for help on this part.
- If some or all EFI runtime services don't work, you can try following
kernel command line parameters to turn off some or all EFI runtime
services.
noefi
turn off all EFI runtime services
reboot_type=k
turn off EFI reboot runtime service
- If the EFI memory map has additional entries not in the E820 map,
you can include those entries in the kernels memory map of available
physical RAM by using the following kernel command line parameter.
add_efi_memmap
include EFI memory map of available physical RAM
3. 한국어 전문 번역
영어 원문의 문단 순서와 의미를 유지한 전체 번역입니다. 코드, 함수명, symbol과 URL은 원문 표기를 유지합니다.
x86_64 EFI/UEFI 지원 요소
1-20이 문서는 `SPDX-License-Identifier: GPL-2.0`으로 배포되며 EFI와 UEFI 명칭을 서로 바꿔 사용합니다. 아래 tool은 kernel build 자체에는 필요하지 않지만 EFI firmware와 specification을 사용하는 x86_64 platform에 필요한 bootloader support와 관련 요소를 설명합니다.
- UEFI specification: http://www.uefi.org
- UEFI x86_64 platform의 Linux kernel은 `Documentation/admin-guide/efi-stub.rst`의 EFI stub 또는 별도 bootloader로 boot할 수 있습니다.
- EFI/UEFI firmware가 있는 x86_64 platform이 필요합니다.
EFI kernel configuration
21-39EFI stub 사용법은 `Documentation/admin-guide/efi-stub.rst`를 참고하십시오. 다음 내용은 EFI stub과 별도 bootloader 중 어느 것을 쓰든 적용되는 x86_64 platform의 일반 EFI setup guideline입니다.
kernel은 다음 configuration으로 build합니다.
CONFIG_FB_EFI=y
CONFIG_FRAMEBUFFER_CONSOLE=y
EFI runtime service가 필요하면 다음 configuration도 선택합니다.
CONFIG_EFI=y
CONFIG_EFIVAR_FS=y or m # optional
EFI System VFAT partition과 boot file
40-60disk에 EFI System flag를 가진 VFAT partition을 만듭니다. `fdisk`에서는 다음 순서로 작업합니다.
1. g - initialize a GPT partition table
2. n - create a new partition
3. t - change the partition type to "EFI System" (number 1)
4. w - write and save the changes
그 다음 `mkfs`로 VFAT filesystem을 initialize합니다.
mkfs.fat /dev/<your-partition>
boot file을 VFAT partition에 복사합니다. EFI stub method에서는 kernel 자체가 EFI executable로도 동작하므로 `bzImage`를 partition의 `EFI/boot/bootx64.efi` path에 복사하면 자동으로 boot됩니다.
kernel parameter와 initramfs 전달에 관한 추가 instruction은 `Documentation/admin-guide/efi-stub.rst`를 참고하십시오. custom bootloader를 사용한다면 해당 bootloader 문서를 따릅니다.
EFI runtime과 memory-map option
61-75EFI runtime service 일부 또는 전부가 동작하지 않으면 다음 kernel command-line parameter로 service를 끌 수 있습니다.
| parameter | 동작 |
|---|---|
| `noefi` | 모든 EFI runtime service를 비활성화합니다. |
| `reboot_type=k` | EFI reboot runtime service를 비활성화합니다. |
| `add_efi_memmap` | EFI memory map에만 있고 E820 map에는 없는 available physical RAM entry를 kernel memory map에 포함합니다. |
요약과 해설
uefi.rst:1-75x86_64는 EFI stub 또는 별도 bootloader로 UEFI boot할 수 있으며 kernel EFI config와 VFAT EFI System Partition을 준비해야 합니다.
runtime 문제가 있으면 `noefi`나 `reboot_type=k`로 service를 제한하고 `add_efi_memmap`으로 E820에 없는 EFI RAM entry를 포함할 수 있습니다.