BCD: {ramdiskoptions} 절을 사용하여 여러 WinPE 이름 지정

BCD: {ramdiskoptions} 절을 사용하여 여러 WinPE 이름 지정

여러 WinPE 버전에 대한 설명이 표시되는 BCD 부팅 메뉴를 원합니다. 버전 3.1에서 10, x64 및 x32까지 여러 WinPE 환경으로의 부팅을 지원하는 썸 드라이브와 나중에 PXE를 만들었습니다. 문제는 PE로 부팅하기 위해 BCD 저장소를 만들 때 {ramdiskoptions} 절을 사용해야 한다는 것입니다. 이 경우 부팅 시 메뉴에 각 항목의 "설명"이 표시되지 않고 {ramdiskoptions} 항목의 설명만 표시되므로 "Ramdisk 옵션"이라는 이름의 여러 옵션이 표시됩니다. 이 작업을 수행한 방법을 보여 드리겠습니다( %STR%BCD 저장소에 대한 전체 경로가 있고 %GUID%가 아래 예에 설명되어 있다고 가정).

1) bcdedit /createstore %STR%
2) bcdedit /store %STR% /create {ramdiskoptions} /d "Ramdisk Options"
3) bcdedit /store %STR% /set {ramdiskoptions} ramdisksdidevice Boot
4) bcdedit /store %STR% /set {ramdiskoptions} ramdisksdipath \Boot\boot.sdi
5) bcdedit /store %STR% /create /d "WinPE x86 3.1" /application osloader
6) bcdedit /store %STR% /set %GUID% systemroot \Windows
7) bcdedit /store %STR% /set %GUID% detecthal Yes
8) bcdedit /store %STR% /set %GUID% winpe Yes
9) bcdedit /store %STR% /set %GUID% osdevice ramdisk=[boot]\Boot\winpex86-31.wim,{ramdiskoptions}
10) bcdedit /store %STR% /set %GUID% device ramdisk=[boot]\Boot\winpex86-31.wim,{ramdiskoptions}
11) (repeat lines 5 to 10 as needed)
12) bcdedit /store %STR% /create {bootmgr} /d "Windows Boot Manager"
13) bcdedit /store %STR% /set {bootmgr} displayorder %GUID% ........

따라서 WinPE v5 x86, v3.1 x64, v5 x64 및 v10에 대해 5~10행을 반복합니다. 5행에 새 설명을 설정하고, 새로운 %GUID%를 얻고, 9행과 10행에 적절한 이미지를 설정할 때마다 마지막으로 방금 생성된 모든 %GUID%에 대해 표시 순서를 수행합니다. 그런 다음 드라이브를 부팅하면 다음과 같이 표시됩니다.

Ramdisk Options
Ramdisk Options
Ramdisk Options
Ramdisk Options
Ramdisk Options

와 같은 모든 항목의 설명을 표시하고 싶습니다 WinPE x86 3.1. 내가 뭘 잘못하고 있는지 조언 해주십시오. 또한 easy-bcd를 사용하여 항목을 수정하려고 시도했지만 성공하지 못했습니다.

편집하다

좀 더 살펴보니 다른 저장소를 만들고 거기에 {ramdiskoptions}만 만들었습니다. 두 개의 명령을 실행했으며 출력은 다음과 같습니다(ID와 유형만 표시).

d:\!@>bcdedit /store %str% /enum all /V
Setup Ramdisk Options
---------------------
identifier              {ae5534e0-a924-466c-b836-758539a3ee3a}
d:\!@>bcdedit /store %str% /enum all
Setup Ramdisk Options
---------------------
identifier              {ramdiskoptions}

따라서 모든 것은 "램디스크 설정 옵션" 유형의 또 다른 항목을 생성하는 것으로 귀결되지만 bcdeditor의 도움말에서는 이에 대한 적절한 명령을 찾을 수 없습니다. BTW Visual BCD는 저장소를 수정하는 외부 프로그램에 대한 임의의 오류를 처리하므로 쓸모가 없습니다.

답변1

이것 좀 봐기사. 기본적으로 하나의 램디스크 장치 아래에 여러 항목을 갖는 대신 여러 개의 램디스크 장치를 정의할 수 있습니다.

하나의 {ramdiskoptions} 객체만 생성할 수 있지만 다음 해결 방법을 사용하면 {ramdiskoptions} ramdisksdipath에 지정된 것과 다른 .sdi 파일을 사용할 수 있습니다. 현재 나는 이것을 구현하기 위한 실제 용도를 찾지 못했습니다. 그러나 cdob이 지적한 것처럼 미래에는 필요할 수 있습니다.

bcdedit.exe /store C:\Boot\BCD /create /device

이 첫 번째 명령을 실행하면 GUID(Globally Unique IDentifier) ​​값(예: {e05b4c23-618a-11df-89c6-001d925a73cf})이 반환됩니다. 모든 후속 명령에서 {ramdisk_guid}를 이 값으로 바꿉니다.

bcdedit.exe /store C:\Boot\BCD /set {ramdisk_guid} ramdisksdidevice partition=C:

bcdedit.exe /store C:\Boot\BCD /set {ramdisk_guid} ramdisksdipath \Boot\different.sdi

이제 이것을 사용하여 WinPE를 부팅하려면 -

bcdedit.exe /store C:\Boot\BCD /create /application osloader

이 명령을 실행하면 GUID(Globally Unique IDentifier) ​​값(예: {bdaf610c-622d-11df-a7ee-a711d7fae90e})이 반환됩니다. 모든 후속 명령에서 {guid}를 이 값으로 바꾸고, {ramdisk_guid}를 1단계에서 명령을 실행하여 생성된 GUID로 바꿉니다.

bcdedit.exe /store C:\Boot\BCD /set {guid} detecthal Yes
bcdedit.exe /store C:\Boot\BCD /set {guid} winpe Yes
bcdedit.exe /store C:\Boot\BCD /set {guid} osdevice ramdisk=[C:]\Sources\boot.wim,{ramdisk_guid}
bcdedit.exe /store C:\Boot\BCD /set {guid} device ramdisk=[C:]\Sources\boot.wim,{ramdisk_guid}
bcdedit.exe /store C:\Boot\BCD /set {guid} description "Windows PE"
bcdedit.exe /store C:\Boot\BCD /displayorder {guid} /addlast

답변2

Windows BCD 저장소의 모든 개체에는 적절한 경우 해당 개체를 연결하는 데 사용할 수 있는 GUID가 있습니다.

당신이 사용할 수있는비주얼 BCD 편집기모든 wim 로더에 대해 별도의 장치 옵션 개체를 만듭니다. 필요에 따라 이러한 개체의 설명 요소 이름을 지정합니다.

그런 다음 필요에 따라 모든 로더의 모든 애플리케이션 장치 및 OS 장치 요소에서 해당 GUID를 대체합니다.

{ramdiskoptions}는 사전 정의된 고정 GUID가 있는 장치 옵션 개체입니다.

BCD의 개체가 연결되는 방법에 대한 설명도 참조하세요.Windows 7 VHD 부팅.

답변3

버그로 인해 {ramdiskoptions} 설명이 설정된 경우 후속 WinPE 기반 개체는 자체 설명을 표시하지 않습니다.

그래서

2) bcdedit /store %STR% /create {ramdiskoptions} /d "Ramdisk Options"

다음으로 변경되어야 합니다.

2) bcdedit /store %STR% /create {ramdiskoptions} 

이 작은 트릭은 최신 Win10 2004 Edition까지 Win8/Win10 기반의 모든 PE에서 "Ramdisk 옵션" 문제로 표시된 부팅 관리자 항목을 완벽하게 수정했습니다.

다음은 샘플 스크립트입니다.

rem Creates BCD (boot configuration data) for three Windows PE 2.0 images or later
rem This script must be running in windows 7/8/10 and run as administrator
rem Or you can run it in the PE 2.or later environment
rem
Rem This script based on the Win10 Installation USB drive
Rem Put you PE wim file inside the \boot folder
Rem Put this script inside the \boot folder
Rem Modifi this script, change the description and the wim file name the match you wim file
Rem At last, run this script to generate BCD file.
Rem ** If you want to change the Boot menut of the UEFI boot, copy the new BCD file to \efi\microsoft\boot\ folder


set BCD-File=.\BCD
del %BCD-File%.bak
ren %BCD-File%  bcd.bak
pause
Bcdedit -createstore %BCD-File%
Bcdedit -store %BCD-File% -create {ramdiskoptions} 
Bcdedit -store %BCD-File% -set {ramdiskoptions} ramdisksdidevice  boot
Bcdedit -store %BCD-File% -set {ramdiskoptions} ramdisksdipath  \boot\boot.sdi


for /f "tokens=1-3" %%a in ('Bcdedit -store %BCD-File% -create /d "1. Win8PEx64 XiaoBai" /application osloader') do set guid4=%%c
Bcdedit -store %BCD-File% -set %guid4% systemroot \Windows
Bcdedit -store %BCD-File% -set %guid4% detecthal Yes
Bcdedit -store %BCD-File% -set %guid4% winpe Yes
Bcdedit -store %BCD-File% -set %guid4% osdevice ramdisk=[boot]\Boot\xiaobaiNT63PEX64.WIM,{ramdiskoptions} 
Bcdedit -store %BCD-File% -set %guid4% device ramdisk=[boot]\Boot\xiaobaiNT63PEX64.WIM,{ramdiskoptions}



for /f "tokens=1-3" %%a in ('Bcdedit -store %BCD-File% -create /d "2. Windows 10 x64 Installation" /application osloader') do set guid6=%%c
Bcdedit -store %BCD-File% -set %guid6% device ramdisk=[boot]\sources\boot.WIM,{ramdiskoptions} 
Bcdedit -store %BCD-File% -set %guid6% path \windows\system32\boot\winload.exe 
Bcdedit -store %BCD-File% -set %guid6% osdevice ramdisk=[boot]\sources\boot.WIM,{ramdiskoptions} 
Bcdedit -store %BCD-File% -set %guid6% systemroot \Windows
Bcdedit -store %BCD-File% -set %guid6% detecthal Yes
Bcdedit -store %BCD-File% -set %guid6% winpe Yes

Bcdedit -store %BCD-File% -create {bootmgr} /d "Windows PE Boot Manager"
Bcdedit -store %BCD-File% -set {bootmgr} timeout 10
Bcdedit -store %BCD-File% -set {bootmgr} displayorder %guid4%  %guid6%
Bcdedit -store %BCD-File% /enum all

관련 정보