Differences
This shows you the differences between two versions of the page.
| Both sides previous revision Previous revision Next revision | Previous revision | ||
| docs:guide-developer:uefi-bootable-image [2018/03/04 01:25] – [Status] Add note about kernel panic when booted on bios mode alive4ever | docs:guide-developer:uefi-bootable-image [2021/06/28 13:50] (current) – [Status] replace git commit ID with actual link to the commit fiouz | ||
|---|---|---|---|
| Line 2: | Line 2: | ||
| ===== Introduction ===== | ===== Introduction ===== | ||
| - | UEFI based systems | + | |
| + | UEFI boot has been required for years now, boards that only support | ||
| + | |||
| + | https:// | ||
| + | |||
| + | http:// | ||
| To accommodate this, it's necessary for OpenWrt build system to generate UEFI bootable images. | To accommodate this, it's necessary for OpenWrt build system to generate UEFI bootable images. | ||
| Line 8: | Line 13: | ||
| ===== Status ===== | ===== Status ===== | ||
| + | As of OpenWrt '' | ||
| - | There are pending commits related to add UEFI bootable OpenWrt under | ||
| - | [[https:// | ||
| - | Beware that the generated uefi gpt image causes kernel panic when booted on bios based system. | ||
| - | A fix for this issue is in progress. | ||
| ===== Building UEFI bootable OpenWrt image ===== | ===== Building UEFI bootable OpenWrt image ===== | ||
| - | The commits necessary to build uefi bootable | + | To build an EFI-compatible |
| - | < | + | * Run '' |
| - | ba837608fb3676ceaf2f463e2efc013e5d232895 tools: add libopt host build | + | |
| - | 3775232366ab903a631379ab7916514286c96e2d tools: add sgdisk host build | + | |
| - | 8752bdcbda84361e91548b2314fbf3c6e3b4d233 Generate EFI grub images for x86 platforms | + | |
| - | b3bd0031cd8bc59c38b1c4cbb4454a415d464d15 grub: use different build directories per variant | + | |
| - | </ | + | |
| - | To build the image, cherry pick those commits, i.e. | + | * Go to **Target Images** and make sure that the option |
| - | + | ||
| - | <code bash> | + | |
| - | $ git remote add jow-staging https:// | + | |
| - | $ git fetch jow-staging | + | |
| - | $ git checkout -b uefi-capable --track origin/ | + | |
| - | $ for commit in \ | + | |
| - | ba837608fb3676ceaf2f463e2efc013e5d232895 \ | + | |
| - | 3775232366ab903a631379ab7916514286c96e2d \ | + | |
| - | 8752bdcbda84361e91548b2314fbf3c6e3b4d233 \ | + | |
| - | b3bd0031cd8bc59c38b1c4cbb4454a415d464d15 \ | + | |
| - | ; do \ | + | |
| - | git cherry-pick $commmit ; done | + | |
| - | </ | + | |
| - | + | ||
| - | After cherry-picking those commits, run '' | + | |
| - | + | ||
| - | Go to **Target Images** and make sure that **Build EFI grub images** | + | |
| Select additional packages as necessary and finally save changes and exit menuconfig. | Select additional packages as necessary and finally save changes and exit menuconfig. | ||
| Line 48: | Line 28: | ||
| Run '' | Run '' | ||
| - | The resulting image will be available | + | The resulting image(s) will be available |
| + | |||
| + | Note that these are **disk images**, not partition images, which must be written to a block device directly e.g. ''/ | ||
| ===== UEFI Secure Boot ===== | ===== UEFI Secure Boot ===== | ||
| Line 57: | Line 39: | ||
| The related packages feed repository contains stuffs needed to sign efi binaries, i.e. gnu-efi and sbsigntool and stuffs to manipulate efi variables, i.e. efivar, efibootmgr, and efitools. | The related packages feed repository contains stuffs needed to sign efi binaries, i.e. gnu-efi and sbsigntool and stuffs to manipulate efi variables, i.e. efivar, efibootmgr, and efitools. | ||
| + | |||
| + | <code bash> | ||
| + | # Add the development git repository | ||
| + | $ git remote add devrepo https:// | ||
| + | $ git fetch devrepo | ||
| + | $ git checkout feature-uefi-secure-boot | ||
| + | |||
| + | # Configure the corresponding package repository | ||
| + | $ echo ' | ||
| + | $ ./ | ||
| + | $ ./ | ||
| + | $ ./ | ||
| + | $ ./ | ||
| + | |||
| + | # Now, configure the build system | ||
| + | # Select x86 as Target, x86_64 as Subtarget | ||
| + | # make sure to select 'Sign EFI executable binaries' | ||
| + | # UEFI related tools are available under Utilities section, | ||
| + | # which consist of efitools, efibootmgr, efivar, and sbsigntool | ||
| + | $ make menuconfig | ||
| + | |||
| + | # The certificate and key need to be generated | ||
| + | # to perform uefi binary signing | ||
| + | $ OLD_UMASK=$(umask) | ||
| + | $ umask 077 | ||
| + | $ openssl req -new -x509 -sha256 \ | ||
| + | -days 90 -out ./db.crt \ | ||
| + | -subj '/ | ||
| + | -newkey rsa:2048 -nodes \ | ||
| + | -keyout ./db.key | ||
| + | $ umask $OLD_UMASK | ||
| + | |||
| + | # run make to generate UEFI secure bootable OpenWrt image | ||
| + | $ make | ||
| + | |||
| + | </ | ||
| + | |||
| + | Remember to import '' | ||