網頁

2016年2月29日 星期一

USB Boot with UEFI Shell Environment.

如何在 UEFI-aware platform 上讓 USB 直接開機進 shell





在 UEFI platform 上(若不考慮 CSM 時), BDS phase 在開機時會主動搜尋 media 上的 /efi/boot/bootx64.efi 或 bootia32.efi 做為開機的起點. 而這檔案就分別是 X64 或 IA32 版的 shell.efi .

有 EDK II/UDK2010 的人, 可以把 EdkShellBinPkg 裡的 shell 複製到 UFD (請確定 UFD 是FAT 格式)裡:
    FullShell\Ia32\Shell_Full.efi to \efi\boot\bootia32.efi
    FullShell\X64\Shell_Full.efi to \efi\boot\bootx64.efi

    or


    MinimumShell\Ia32\Shell.efi to \efi\boot\bootia32.efi
    MinimumShell\X64\Shell.efi to \efi\boot\bootx64.efi

Ps.可以只複製 bootx64.efi 就夠了

順帶一提,手上有 AMI Aptio code 的人可以找一下 addon 裡面, 依樣劃葫蘆:

addon\shell.efi to \efi\boot\bootx64.efi

如此一來,就可以在 Aptio Setup Utility 的 Boot 裡選用 "UEFI:" 開頭的 USB device 開機了. (當然了, 直接選用 Save & Exit 裡的 Boot Override 也可以). 這樣當你在沒包 shell UEFI-aware platform 上, 就可以不必用 Launch EFI Shell from filesystem device 的方法來手動 boot to shell 了. (這方法得把 shell.efi 複製到根目錄,並改為 shellx64.efi)


Reference: UEFI 2.5 - Chapter 12.3.1.3 Directory Structure 

沒有留言:

張貼留言