Jump to content
SoThOr

Creating EFI Boot entries using bcdedit in Windows.

1 post in this topic

Recommended Posts

This was spurred on from a discussion in the Clover General thread. Where there was a debate on bcdedit being able create/read/edit (U)EFI Boot entries. I didn't think it appropriate to post all this information there and somebody may want to make use of this and its likely to get lost in that massive thread.

 

Out of curiosity I decided to see if I could create an EFI entry using bcdedit. What can I say I like a challenge. :dev: Whilst is not a documented method by Microsoft, as it turns out in a round about way it IS possible to create an EFI entry using bcdedit and these are the steps I went through to add UEFI Shell located on a USB stick to the EFI entries. 

 

Third party software is available that can create and edit UEFI entries from Windows with better support and more features. I'm just making this information available in case those options are unavailable. 

 

DISCLAIMER - This is not a supported method. Use at your own risk. I recommend backing up your BCD/Firmware variables/settings beforehand.

 

1) Copy {bootmgr} entry.

C:\Windows\System32>bcdedit /copy {bootmgr} /d "UEFI Shell"
The entry was successfully copied to {34e8383c-73a7-11e9-9cb0-94de8078a7b5}.

2) Edit the new entry using the new GUID bcdedit generated in the copy step.

  a) Set the device and path for UEFI shell on my USB stick.

bcdedit /set {34e8383d-73a7-11e9-9cb0-94de8078a7b5} device partition=G:
bcdedit /set {34e8383d-73a7-11e9-9cb0-94de8078a7b5} path \EFI\SHELL\SHELLX64.efi

  b) Clean up some of the stuff that was copied from {bootmgr} (optional as far as I can tell, just makes things tidier in bcdedit)

Spoiler

bcdedit /deletevalue {34e8383d-73a7-11e9-9cb0-94de8078a7b5} locale
bcdedit /deletevalue {34e8383d-73a7-11e9-9cb0-94de8078a7b5} inherit
bcdedit /deletevalue {34e8383d-73a7-11e9-9cb0-94de8078a7b5} default
bcdedit /deletevalue {34e8383d-73a7-11e9-9cb0-94de8078a7b5} resumeobject
bcdedit /deletevalue {34e8383d-73a7-11e9-9cb0-94de8078a7b5} displayorder
bcdedit /deletevalue {34e8383d-73a7-11e9-9cb0-94de8078a7b5} toolsdisplayorder
bcdedit /deletevalue {34e8383d-73a7-11e9-9cb0-94de8078a7b5} timeout

 

3) Put the new EFI entry first in boot order. (optional)

Spoiler

bcdedit /set {fwbootmgr} displayorder {34e8383d-73a7-11e9-9cb0-94de8078a7b5} /addfirst

 

 

After completing the steps above, here is what "bcdedit /enum firmware" shows:

Spoiler

Firmware Boot Manager
---------------------
identifier              {fwbootmgr}
displayorder            {34e8383d-73a7-11e9-9cb0-94de8078a7b5}
                        {bootmgr}
                        {eace909f-3cb3-11e5-b87a-c28123693819}
timeout                 1

Windows Boot Manager
--------------------
identifier              {34e8383d-73a7-11e9-9cb0-94de8078a7b5}
device                  partition=G:
path                    \EFI\SHELL\SHELLX64.efi
description             UEFI Shell

Windows Boot Manager
--------------------
identifier              {bootmgr}
device                  partition=S:
path                    \EFI\Microsoft\Boot\bootmgfw.efi
description             Windows Boot Manager
locale                  en-US
inherit                 {globalsettings}
default                 {current}
resumeobject            {631bdfec-580c-11e8-9c1a-9d7903c42521}
displayorder            {current}
toolsdisplayorder       {memdiag}
timeout                 0

Firmware Application (101fffff)
-------------------------------
identifier              {eace909f-3cb3-11e5-b87a-c28123693819}
device                  partition=\Device\HarddiskVolume8
path                    \EFI\Microsoft\Boot\bootmgfw.efi
description             Windows Boot Manager

 

I shutdown my computer and when I turned my computer back on it booted up into UEFI Shell. After exiting the shell my PC went on to boot Windows.

Here is the resulting dump using "bcfg boot dump -v" from that shell:

Spoiler

Option: 00. Variable: Boot0001   
  Desc    - UEFI Shell
  DevPath - HD(1,MBR,0x00020fa6,0x3f,0x64000)/\EFI\SHELL\SHELLX64.efi
  Optional- Y
  00000000: 57 49 4E 44 4F 57 53 00-01 00 00 00 88 00 00 00  *WINDOWS.........*
  00000010: 78 00 00 00 42 00 43 00-44 00 4F 00 42 00 4A 00  *x...B.C.D.O.B.J.*
  00000020: 45 00 43 00 54 00 3D 00-7B 00 33 00 34 00 65 00  *E.C.T.=.{.3.4.e.*
  00000030: 38 00 33 00 38 00 33 00-64 00 2D 00 37 00 33 00  *8.3.8.3.d.-.7.3.*
  00000040: 61 00 37 00 2D 00 31 00-31 00 65 00 39 00 2D 00  *a.7.-.1.1.e.9.-.*
  00000050: 39 00 63 00 62 00 30 00-2D 00 39 00 34 00 64 00  *9.c.b.0.-.9.4.d.*
  00000060: 65 00 38 00 30 00 37 00-38 00 61 00 37 00 62 00  *e.8.0.7.8.a.7.b.*
  00000070: 35 00 7D 00 00 00 30 00-01 00 00 00 10 00 00 00  *5.}...0.........*
  00000080: 04 00 00 00 7F FF 04 00-                         *........*
Option: 01. Variable: Boot0000   
  Desc    - Windows Boot Manager
  DevPath - HD(2,GPT,1aca364d-82dd-4f63-ac0e-aa9aa224e877,0xe1800,0x31800)/\EFI\Microsoft\Boot\bootmgfw.efi
  Optional- Y
  00000000: 57 49 4E 44 4F 57 53 00-01 00 00 00 88 00 00 00  *WINDOWS.........*
  00000010: 78 00 00 00 42 00 43 00-44 00 4F 00 42 00 4A 00  *x...B.C.D.O.B.J.*
  00000020: 45 00 43 00 54 00 3D 00-7B 00 39 00 64 00 65 00  *E.C.T.=.{.9.d.e.*
  00000030: 61 00 38 00 36 00 32 00-63 00 2D 00 35 00 63 00  *a.8.6.2.c.-.5.c.*
  00000040: 64 00 64 00 2D 00 34 00-65 00 37 00 30 00 2D 00  *d.d.-.4.e.7.0.-.*
  00000050: 61 00 63 00 63 00 31 00-2D 00 66 00 33 00 32 00  *a.c.c.1.-.f.3.2.*
  00000060: 62 00 33 00 34 00 34 00-64 00 34 00 37 00 39 00  *b.3.4.4.d.4.7.9.*
  00000070: 35 00 7D 00 00 00 30 00-01 00 00 00 10 00 00 00  *5.}...0.........*
  00000080: 04 00 00 00 7F FF 04 00-                         *........*
Option: 02. Variable: Boot0004   
  Desc    - Windows Boot Manager
  DevPath - HD(2,GPT,8429c978-b940-4995-82c2-1981df946ece,0x96800,0x32000)/\EFI\Microsoft\Boot\bootmgfw.efi
  Optional- N
 

 

You may notice that the shell shows as "Windows Boot Manager" in the bcdedit output. This I believe is because of the "WINDOWS" at the beginning of the option data that bcdedit added to the EFI Boot entry. I also believe this why bcdedit shows my Windows 8 installation as "Firmware Application" because it has no option data. I don't know how to remove this data using bcdedit nor do I know how the option data, that bcdedit adds, will affect other EFI applications.


There might be a way to create the EFI entry without copying the Windows entry but if there is I'm unable to find any documentation on how one would do so. If you use the create command then it just puts it in the BCD and I'm unaware of a way to tell it to create it in EFI instead, other than by doing the above.

Share this post


Link to post
Share on other sites
Advertisement

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

  • Recently Browsing   0 members

    No registered users viewing this page.

  • Similar Content

    • By kushwavez
      Acer Aspire V15 V5-591G - Catalina 10.15
      Original link:
      https://osxlatitude.com/forums/topic/11355-acer-aspire-v-15-v5-591g-catalina-windows-10/
      (Note: mine is 55TU version, but the bootpack will work fine with another versions of 591G, for example: V5-591G-71K2, -764Z, -59PU, etc.)
      Specifications:
      - Motherboard: USOPP_SLS (Skylake-H PCH)
      - BIOS: Insyde Corp. v 1.15
      - CPU: Intel Core i5-6300HQ 2.3 GHz (Skylake)
      - GPU: NVIDIA GeForce GTX 950M 2 GB (Optimus) & Intel HD Graphics 530
      - RAM: SK hynix 4 GB DDR4 (Later I bought + KINGSTON 4 GB) 2133 MHz
      - WiFi + Bluetooth: Qualcomm Atheros QCNFA344A 5 GHz (Later -> Broadcom BRCM94352Z M.2 5 GHz WiFi + 4.0 Bluetooth)
      - Audio: Realtek HD Audio: ALC 255 
      - Ethernet: Realtek RTL8168/8111
      - Card Reader: Realtek USB 2.0 Card Reader (USB2.0-CRW)
      - Webcam: HD Webcam
      - HDD: TOSHIBA MQ01ACF032 320 GB HDD
      - SSD: SPCC M.2 230 GB SSD
      - Display: 1366x768 (15.6", Matte)
      - Battery: 6 cell 56Wh / 5040mAh
      - Connectors: 
      1x SD Card Reader 2x USB 3.0 (1x USB Charging), 1x USB 2.0 1x VGA 1x HDMI 1x 3.5mm microphone/audio combined jack connector 1x Ethernet (Rj-45) - Keyboard & Touchpad: Multi-Touch & Multi-gestures ELAN 501 Touchpad, Backlight Keyboard.
      Working:  
      - Wi-Fi (with BCM94352Z)
      - Bluetooth hand-off (With BCM94352Z)
      - Full Graphics enabled on HD 530: ig-platform-id: 0x191b0000 (HD 530 Mobile)
      - Display: if default colour profile is corrupted (blue is not actual blue but purplish) Use "Rec. ITU-R BT. 709-5" Color Profile (System Pref. -> Displays -> Color)
      - HDMI & VGA Outputs: AppleGraphicsDevicePolicy.kext Clover patch
      - Audio (ALC 255): (Internal Speakers, Internal Microphone, Headphone jack with AppleALC, ALCPlugFix -> layout-id=17)
      - Ethernet Realtek 8168/8111: RealtekRTL8111.kext
      - App Store, Messages, FaceTime, Siri, iCloud (native)
      - Integrated webcam (native)
      - 3.0 USB (native)
      - Touchpad and Keyboard (ELAN501): Fn keys are good, the weird thing is the Brightness key. On my keyboard it's Pause Break:Br-up, Fn+F12:Br-dwn-> To fix this try Karabiner (VoodoPS2Controller.kext), - for gestures try SmartTouchpad drivers
      - Battery info: Install ACPIBatteryManager.kext with Kext Utility or other installer.
      - Sleep Mode
      - SSD with TRIM enabled (to enable trim, open Terminal and write "sudo trimforce enable")
      Not working:
      - Original Wi-Fi (Qualcomm Atheros QCNFA344A):  unsupported, you need switch to BCM94352Z or just use a mini usb wifi dongle.
      - NVIDIA GeForce GTX 950M: Optimus not supported.
      - Card Reader: Unsupported -> Can't really fix because I don't have any SD Card at the moment, maybe can be fixed by adding Prod & Ven IDs to AppleStorageDevices.kext, I never used it anyway. name: "USB2.0-CRW" Prod ID: "0x0129" Ven ID: "0x0bda  (Realtek Semiconductor Corp.)"
      For Wi-Fi:
      - 1st method: You can choose an external USB wifi dongle (I used TP-Link Archer T1U (5GHz support), TP-Link has official macOS drivers, you just need to install it
      - 2nd and I think the best method: Replace your M.2 Qualcomm Card with a compatible BCM94352Z card (you will have hand-off Bluetooth too), just install the kexts (enabled with BrcmFirmwareRepo.kext, BrcmPatchRAM2.kext, FakePCIID.kext, FakePCIID_Broadcom_WiFi.kext, they're all in my attached zip). You could buy this card from ebay, aliexpress, or amazon
       
      Issues:
      - None
      BIOS Settings:
      - BIOS version 1.15 (irrelevant)
      - Secure Boot: Disabled
      - Touchpad: Advanced
      - Boot mode: UEFI
      Getting ready for Installation:
      - Download the Catalina install zip (bootpack & postinstall): acer_aspire_V591G-55TU_cata.zip
      Installation:
      - Create an installer with any method you know (- Mac: createinstallmedia - Windows: Transmac, Vmware, Win32diskimager)
      - Copy my Clover folder to the USB's EFI folder
      - Boot with the Installer USB
      - If you stuck in boot, reboot and in the Clover bootloader select "config_debug.cfg" -> you'll have more informations about the freeze
       
      Please open the README.rtf in my install zip for more informations about the USB Installer & Post installation!
      For any system kext installation\modification you need to boot with config_debug.plist (or disable SIP manually)
      Also on Catalina the System folder is read-only, so you need to remount in rw. 
      If you have a single RAM and getting panic at boot, then you need to edit the "config.plist" with these (SMBIOS->after "Version 1.0"):
      ->Edit "Frequency" and "Size" to match your RAM values
      <key>Version</key> <string>1.0</string> <key>Memory</key> <dict> <key>Channels</key> <integer>1</integer> <key>SlotCount</key> <integer>1</integer> <key>Modules</key> <array> <dict> <key>Slot</key> <integer>0</integer> <key>Size</key> <integer>8192</integer> <key>Frequency</key> <integer>2133</integer> <key>Type</key> <string>DDR4</string> </dict> </array> </dict> </dict>  
      PowerManagement  fix:
      Set HWPEnable=YES in Clover (already set), CPUFloor to "700", Frequency to "2300" and "3200"(Normal and Turbo, if you have i7-6700HQ version then it should be "2600", "3500") and "FrequencyVectors" from "0x0d000000" to "0x07000000" in "S/L/E/IOPlatformPluginFamily.kext/Contents/PlugIns/X86PlatformPlugin.kext/Contents/Resources/Mac-A5C67F76ED83108C.plist", MSR _xcpm_idle Patch to KernelToPatch in Clover (If you have High Sierra, change "MatchOS" to 10.13):

      <key>KernelToPatch</key> <array> <dict> <key>Comment</key> <string>MSR 0xE2 _xcpm_idle instant reboot(c) Pike R. Alpha</string> <key>Disabled</key> <false/> <key>Find</key> <data> ILniAAAADzA= </data> <key>MatchOS</key> <string>10.14</string> <key>Replace</key> <data> ILniAAAAkJA= </data> </dict> </array> Reboot, and it's 800MHz in idle state, same on Windows.
       

      Elan SmartTouchpad
      I only use scrolling, one-, double- & tripletap
      If you want to try other gestures go to this link for more informations, options (v4.6.5) ->  DETAILS ABOUT THE SMART TOUCHPAD DRIVER FEATURES
      Fn Brightness keys not working with this, tried several things without success. With VoodoPS2Controller it's working, but you'll have no gestures (neither scrolling).
       
       
      Before updating to a new version of Catalina please update kexts (and clover if necessary) to newer versions to avoid kernel panics.
      Generate a serial number with Clover Configurator.app (open up your config.plist with CC then -> SMBIOS -> Serial Number -> Generate New)
       
      Catalina & Windows 10 Dual-Boot:
      Dual-boot clean install (on one drive), UEFI Only:
       
       Boot into your Mac installer, Create 2 partitions in GUID table (1 for Win (I used FAT32 but I think it doesn't matter what you choose), 1 for Mac),   Install Mac, boot with your USB, mount your EFI partition (use terminal or an EFI mounter app), create an EFI folder (if there is no folder), copy the CLOVER folder I attached to the EFI folder, restart,  Boot into your Win installer, Format the partition you created for Win, install.   Now, it's automatically booting into Windows. To use Clover open cmd in administrator, type:  bcdedit /set {bootmgr} path \EFI\CLOVER\CLOVERX64.efi       5.  You're done! It will booting into Clover when you start the system, and you can select Win or Mac (or another OS if installed on a 3rd partition).
       
      Dual-boot with Windows installed first (on one drive), UEFI Only:
      If you already have Windows and you don't want to lose all your data there is a hope:
      I created a video from this restore method: [Hackintosh] Dual-Boot High Sierra & Windows - when Windows already installed - no data waste - UEFI
      You need bootable Mac Installer and a full system restore image (link is in my video's description).
      (You may see errors if your EFI partition is not 200 MB)
       Boot into your Windows, resize your partition or create one for Mac.  Boot into your Mac installer and in Disk Utility format the partition you created.  Restore from image: select your full system restore image.  When it's finished restoring you just need to restart, then boot to the system with your usb.  When you successfully booted to Mac desktop, mount your EFI partition (use terminal or an EFI mounter app), open EFI, you will see there is a Microsoft folder already (don't touch that!). Copy my CLOVER folder to the EFI folder then Restart.  Now, it's automatically booting into Windows. To use Clover open cmd in administrator, type:  bcdedit /set {bootmgr} path \EFI\CLOVER\CLOVERX64.efi       7.  You're done! You can select your old Windows and your new macOS!
      (Only tried with Windows 8/8.1/10. I don't know Windows 7,etc.)
       
      IF YOU GETTING ERRORS DURING MAC RESTORE:
      - Make sure you have partitions in GPT
      - Windows using 100 MB EFI and will annoy the Mac restore. Don't worry, just ignore the errors.
       
      IF YOU GETTING ERRORS DURING WINDOWS INSTALLATION (could not be formatted, etc):
      - Make sure you have GPT partitions, and GPT (UEFI) installer, also disconnect all external storage drives (except the installer USB)
       
      IF YOU USED RESTORE METHOD THEN CAN'T MOUNT YOUR EFI PARTITION (No EFI partition found):
      - It's because your EFI is not 200 MB or not an "Apple" original EFI,  but do not worry, try another EFI mounter, or mount from terminal (I used EFI mounter v3: Getting errors, but you can mount and use without problem)
      - You also could "mount" the EFI from Windows:
      1st method: open cmd in administrator mode and type:
      diskpart list vol (Now select the "System" volume,(FAT 32) For example I select 4) sel vol 4 list part (Select System type partition, for example 2) sel part 2 assign letter=b (This will "mount" your EFI partition) Open Explorer++ or TotalCommander in administrator mode to manage EFI remove letter=b (This will "unmount" your EFI) 2nd method: open cmd in administrator mode and type:
      mountvol b: /s (This will mount your EFI) Open Explorer++ or TotalCommander in administrator mode to manage EFI mountvol b: /d (This will unmount your EFI) Thanks to all OSXLatitude members for helping me out! (Jake Lo, Hervé, Bronxteck, black.dragon74)!
      Notes:
      2019.10.09: Installed macOS Catalina 10.15 -> Updated Clover, kexts & config.plist -> no problem so far
      2019.08.18: Updated to 10.14.6 -> no problem when/after installing
      2019.06.01: Updated to 10.14.5 -> no problem when/after installing
      2019.04.25: Optimized touchpad scrolling -> updated install files
      2019.03.30: Fixed USB 3.0 ports, fixed Bluetooth crashes after sleep -> updated bootpack
      2019.03.28: Updated to 10.14.4. Unexpected crashes while updating to 10.14.4 -> fixed by updating Clover to the latest (v4910) version. Bluetooth crashes appeared -> fixed by downgraded Brcm*.kexts. Updated bootpack.
      2019.02.24: Bluetooth crashes after sleep -> fixed, updated bootpack. 
      2019.02.22: Updated to 10.14.3. Fixed HDMI Audio by installing "FakePCIID_Intel_HDMI_Audio.kext" -> fixed freezing during boot. Fixed brightness levels by installing "AppleBacklightFixup.kext". Also updated bootpack & postinstall zip down in attachments.
      2019.01.21: Removed FakeSMC.kext, SMCHelper-64.efi, replaced by VirtualSMC.kext, VirtualSMC.efi because I got random freezes when booting system (kextd stall[0], (120s): 'AppleACPICPU' -> CPU is at 100%, fans are spinning fast), also updated bootpack in the attachments "acer_aspire_v591g-55tu_clover.zip" -> Freeze continued, brought back FakeSMC, deleted VirtualSMC (caused BT crashes).
      2019.01.18: HDMI Audio is fixed, I didn't do anything HDMI Audio is not fixed, sometimes it worked but most likely not. (no idea why)
      2018.12.09: Updated to 10.14.2 -> did without any complication
      2018.11.28: Fixed combo-jack garbage sound output by installing ALCPlugFix and CodecCommander.kext
      2018.11.01: Updated to 10.14.1 -> HDMI & VGA ports are gone again. -> Fixed by "AppleIntelSKLGraphicsFramebuffer.kext" rollback from 10.14.
      2018.09.28: Updated to Mojave 10.14 -> Fixed HDMI & VGA Outputs by adding "AppleGraphicsDevicePolicy.kext" patches to config.plist, HDMI audio not working
    • By Barry_dhb52
      How to directly boot into  specific volume, for me MACOS,Just like clover DefaultVolume. Thanks 
       
      EFI: https://github.com/dhb52/z370-opencore
       
      BTW, another question. I use Clover install on ssd along with macOS installed.
      And I use a GUID partitioned HHD for TimeMachine backup, which I have my OC EFI installed to boot the same `macOS`.
      by comparing usage of both booters, it seems that when using OC, my Win7(Paralled Desktop 14 vm) uses more memory, 
      by opening Task Manager.
       
    • By ErmaC
      Slice is glad to present a new EFI bootloader.

      CLOVER
      Now version 2 rEFIt based.


      It is open source based on different projects: Chameleon, rEFIt, XNU, VirtualBox. The main is EDK2 latest revision.
      I also want to thank all who help Slice with the development. Credits and copyrights remain in the sources.
      https://sourceforge.net/projects/cloverefiboot/?source=directory
      There is a WIKI 
      http://clover-wiki.zetam.org/
      Main features:


      If you have a question please provide outputs from DarwinDumper (formed from Trauma tool). Thanks Trauma!
      Continued by blackosx and STLVNUB.
      Post#2 CloverGrower - create Clover by yourself Post#3 Downloads Post#4 Installation of the bootloader Post#5 How to do UEFI boot Post#6 How to use - common words Post#7 Calculator for Automatic DSDT fix Post#8 Instructions for GraphicsInjector Post#9 ATIConnector patching Post#10 Any kexts patching with some Samples Post#11 CustomEDID Post#12 Hiding unnecessary menu entries Post#13 Instruction for DSDT corrections to do DeviceInjection works Post#14 Development Post#15 Themes Post#16 About kexts injection Post#17 Instructions for P- and C-states generator Post#18 Patching DSDT to get Sleep working Post#19 CPU settings and geekbench Post#20 ACPI tables loading Post#21 DSDTmini Post#22 Custom SMBios Post#23 F.A.Q. Post#24 iCloudFix Post#25 Using mouse. Post#26 How to make orange icons to be metallic Post#27 How to make software RAID (by Magnifico) Post#28 How to modify InstallESD.dmg (by shiecldk) Post#29 Config.plist settings Post#30 Using extra kexts and skipping kernelcache Post#31 Choosing EFI drivers Post#32 Configuration files Post#33 Automatic config.plist creating Post#34 Custom DSDT patches Post#35 How to do sleep/wake working with UEFI BOOT Post#36 DeviceID substitution (FakeID) Post#37 Using Custom OS Icons Post#38 Hibernation Post#39 Floating regions Post#41 Property List Editor Post#42 Blocking Bad Kext Post#43 AAPL,slot-name Post#44 FakeCPUID for unsupported CPU Post#45 Multiple Boot Options - to write into UEFI BIOS boot menu Post#46 How to install Windows UEFI Post#47 How to speedup Clover boot Post#48 Info.plist patching Post#49 Arbitrary device injection Post#50 Non-Standard Legacy Boot Files Post#51 Reboot to Windows UEFI from Mac OSX Post#52 Deprecated Features Post#53 Using UDK2018 Post#54 Device Properties Post#55 Scalable themes Post#56 How to search Clover mistakes (bisection) -----------------
       
      Slice:
      I edited all posts in the thread to correspond to actual Clover revision.
      Please install Clover at least 2652 and use new instructions.
×