Jump to content











Photo
- - - - -

Change BCD Path in bootx64.efi

bootx64.efi grub pxe winpe

  • Please log in to reply
13 replies to this topic

#1 Walitix

Walitix
  • Members
  • 2 posts
  • Location:Toulon
  •  
    France

Posted 18 February 2015 - 02:49 PM

Hello ,
 
I have made an PXE server that boot to a GRUB menu with grubnetx64.efi.
 
I have a menuentry "WINPE" which chainload BOOTX64.EFI.(it's work perfectly)

The problem is when I create a second menuentry for a WINPE located in /WINPE2/BOOTX64.EFI , the second BOOTX64.EFI take the BCD in /boot/BCD of the tftp root.
 
I want to install one more WINPE so I ask you if there is a solution to modify in the bootx64.efi file to change the BCD path like :

/bootx64.efi-1
/bootx64.efi-2
/boot/BCD-1
.........../BCD-2

The boot process will be :

grubnetx64.efi -> grub.cfg -> bootx64.efi-1 -> BCD-1 -> boot.sdi -> boot.wim-1
.......................................................-> bootx64.efi-2 -> BCD-2 -> boot.sdi -> boot.wim-2

Thanks

Edited by Walitix, 18 February 2015 - 03:01 PM.


#2 d4vr0s

d4vr0s

    Member

  • Advanced user
  • 38 posts
  • Location:The greatest computer in the universe of time and space, designed by Deep Thought
  •  
    United States

Posted 18 February 2015 - 03:54 PM

You can edit your BCD to include more than one operating system.

I use BootICE for this purpose.

 

http://reboot.pro/to...sed/?hl=bootice



#3 Walitix

Walitix
  • Members
  • 2 posts
  • Location:Toulon
  •  
    France

Posted 18 February 2015 - 04:11 PM

Ok thanks i will try this soft.

#4 erwan.l

erwan.l

    Gold Member

  • Developer
  • 1937 posts
  • Location:Nantes - France
  •  
    France

Posted 18 February 2015 - 08:33 PM

Hi,

 

You can also use dhcp option 252 as in the picture below.

 

Regards,

Erwan

 

gHw9sxp.png



#5 steve6375

steve6375

    Platinum Member

  • Developer
  • 6619 posts
  • Location:UK
  • Interests:computers, programming (masm,vb6,C,vbs), photography,TV,films,guitars
  •  
    United Kingdom

Posted 30 June 2017 - 12:31 PM

You can patch the .EFI file.

Instead of using grub4dos, you could use a Hex editor.

http://www.rmprepusb...dit_efi_for_bcd



#6 Wonko the Sane

Wonko the Sane

    The Finder

  • Advanced user
  • 13694 posts
  • Location:The Outside of the Asylum (gate is closed)
  •  
    Italy

Posted 30 June 2017 - 01:57 PM

Isn't nowadays Wimboot preferred?

http://ipxe.org/howto/winpe

http://ipxe.org/wimboot

 

It allows to specify the path of each file served, unless I am mistaken.

 

:duff:

Wonko



#7 IAmTheTrueMeaningOfCovfefe

IAmTheTrueMeaningOfCovfefe

    Silver Member

  • Advanced user
  • 555 posts
  • Location:In hiding
  • Interests:An investigation is underway to determine whether Trump has any ties to America.
  •  
    United States

Posted 01 July 2017 - 02:04 AM

I do believe that Microsoft's bootx64.efi is signed with a digital signature, so even if it could be patched, you might break something else. Tampering with the file will break the signature, no way around this. My advice: Don't mess with it. There are other ways to do what you're looking for.

#8 steve6375

steve6375

    Platinum Member

  • Developer
  • 6619 posts
  • Location:UK
  • Interests:computers, programming (masm,vb6,C,vbs), photography,TV,films,guitars
  •  
    United Kingdom

Posted 01 July 2017 - 05:11 AM

The BCD is modified to disable integrity checks.
I don't think it will cause a problem for winpe booting.
If you know of any other way to uefi multiboot from grub2 without using a multi-selection BCD then please tell me.

I have tried wimboot + grub2 but for uefi I cannot get it to work and cannot find anyone who has got it working.

#9 nguyentu

nguyentu

    Member

  • Members
  • 75 posts
  •  
    Vietnam

Posted 01 July 2017 - 06:55 AM

Wimboot does not work in UEFI mode. Others say it works with PXE, but for Grub2 it does not.
If I change the BCD path, does it work for Secure Boot?
 


#10 Wonko the Sane

Wonko the Sane

    The Finder

  • Advanced user
  • 13694 posts
  • Location:The Outside of the Asylum (gate is closed)
  •  
    Italy

Posted 01 July 2017 - 07:05 AM

I have tried wimboot + grub2 but for uefi I cannot get it to work and cannot find anyone who has got it working.

It's strange :unsure: the page explicitly mentions EFI/UEFI usage:

http://ipxe.org/wimboot

 

Maybe it is it's use combined with GRUB2 that creates issues? :dubbio:

 

I have seen here and there the usual unfinalized references to wimboot not running when invoked via linux16 GRUB2 command, possibly that is the issue. :unsure:

 

Here is a hint about chainloading differently the thingy (by loading the ipxe): 

http://forum.ipxe.or...ad.php?tid=8112

but not a definite answer. :(

 

:duff:

Wonko



#11 steve6375

steve6375

    Platinum Member

  • Developer
  • 6619 posts
  • Location:UK
  • Interests:computers, programming (masm,vb6,C,vbs), photography,TV,films,guitars
  •  
    United Kingdom

Posted 01 July 2017 - 07:58 AM

GRUB2 MBR + wimboot works OK, but not with UEFI.

It just crashes. It seems that wimboot will work under iPXE but not when loaded by grub2 .

 

This is a grub2 menu (for E2B grub2 menu system)

#works
if [ $BIT64 = true and $MBR = true ] ; then
menuentry "Windows 10 PE 64-bit" --unrestricted {
set root=$root2
linux16 /wimboot
initrd16 \
newc:bootmgr:/Win10x64/bootmgr \
newc:bcd:/Win10x64/bcd   \
newc:boot.sdi:/Win10x64/boot.sdi \
newc:boot.wim:/Win10x64/boot.wim
  boot
}
fi

#crashes!
if [ $BIT64 = true and $EFI = true ] ; then
menuentry "Windows 10 PE UEFI 64-bit" --unrestricted {
set root=$root2
linux /wimboot
initrd \
newc:bootx64.efi:/Win10x64/bootx64.efi \
newc:bcd:/Win10x64/bcd   \
newc:boot.sdi:/Win10x64/boot.sdi \
newc:boot.wim:/Win10x64/boot.wim
  boot
}
fi


#12 steve6375

steve6375

    Platinum Member

  • Developer
  • 6619 posts
  • Location:UK
  • Interests:computers, programming (masm,vb6,C,vbs), photography,TV,films,guitars
  •  
    United Kingdom

Posted 01 July 2017 - 08:56 AM

The iPXE enhancement mentioned here seems promising.

I could use kernel file:wimboot  etc to load wimboot under ipXE environment perhaps?

But I cannot find a ipxe.efi 64-bit binary that understands  file:  as a local URI.

I tried making a version using the Romomatic generator here and ticked the local files option (advanced) but still it does not seem to understand  file: syntax.

 

e.g.

chainloader /ipxe.efi   >> loads file

boot    >> boots to iPxe

<press CTRL.B>

kernel file:wimboot   >> 'Could not start download :no such file or directory'  ERROR MSG



#13 Wonko the Sane

Wonko the Sane

    The Finder

  • Advanced user
  • 13694 posts
  • Location:The Outside of the Asylum (gate is closed)
  •  
    Italy

Posted 01 July 2017 - 09:18 AM

Yep, mcb30 (Michael Brown that wrote or co-wrote the thingy) in the given link seemingly suggested is that is possible INSTEAD of chainloading Wimboot (and use the initrd) to chainload directly the ipxe efi.

 

This part of direct chainloading the ipxe.efi seems to work just fine, what is not clear in the link is whether the user (that did not follow up) did some mistake in the settings or what created the issue, the relevant part of 

 

 

Provide access to local files via the "file://" URI scheme. There are
three syntaxes:

- An opaque URI with a relative path (e.g. "file:script.ipxe").
This will be interpreted as a path relative to the iPXE binary.

- A hierarchical URI with a non-network absolute path
(e.g. "file:/boot/script.ipxe"). This will be interpreted as a
path relative to the root of the filesystem from which the iPXE
binary was loaded.

- A hierarchical URI with a network path in which the authority is a
volume label (e.g. "file://bootdisk/script.ipxe"). This will be
interpreted as a path relative to the root of the filesystem with
the specified volume label.

Note that the potentially desirable shell mappings (e.g. "fs0:" and
"blk0:") are concepts internal to the UEFI shell binary, and do not
seem to be exposed in any way to external executables. The old
EFI_SHELL_PROTOCOL (which did provide access to these mappings) is no
longer installed by current versions of the UEFI shell.

Isn't clear (at least to me) and I cannot find actual practical examples of the various syntaxes.

 

What were the contents of the boot.ipxe in your test?

 

Should be *something like* :unsure:

 

kernel ${boot-url}/wimboot/wimboot gui pause
initrd ${boot-url}/wimboot/bcd BCD
initrd ${boot-url}/wimboot/boot.sdi boot.sdi
initrd ${boot-url}/wimboot/boot.wim boot.wim
boot || goto failed

 

 

I suspect that there are two separate things talked about in that thread (one thing is "local access" and another is "chianloading ipxe.efi and have it run the script).

 

In the screenshot on the given thread, the ipxe.efi loaded just fine, than a "menu.ipxe" failed to load, and seemingly the ipxe attempted to load it from several different (local) paths.

 

As always I would try to use the ipxe command line to load the (remote) wimboot and other files before attempting to use a script. :dubbio:

 

:duff:

Wonko



#14 Wonko the Sane

Wonko the Sane

    The Finder

  • Advanced user
  • 13694 posts
  • Location:The Outside of the Asylum (gate is closed)
  •  
    Italy

Posted 08 July 2017 - 12:43 PM

Only to keep everything as together as possible, Steve6375 has just confirmed that it is possible to use wimboot with UEFI:

http://reboot.pro/to...o-old/?p=204066

 

:duff:

Wonko







Also tagged with one or more of these keywords: bootx64.efi, grub, pxe, winpe

0 user(s) are reading this topic

0 members, 0 guests, 0 anonymous users