Jump to content

OpenCore command line tool


rusty-bits
 Share

22 posts in this topic

Recommended Posts

help.png.440127cb7a8213e1442bec632353e531.png

 

Command line tool that will build a working EFI folder based on the settings in the config.plist file.

https://github.com/rusty-bits/OC-tool

 

finder03.png.b8bc8331fbd4632d515389807c3c4253.png 

you can also copy your config.plist to the RELEASE folder and double-click OC-tool  

this is the same as running

./OC-tool -uo build release

from the command line  

 

see the wiki for more info  

 

https://github.com/rusty-bits/OC-tool/wiki

 

added functionality to the -T option  (update ver 1.6pt)  

optT.png.3f9fd7949fbef6df83182b22adab536a.png

TUI (Text based User Interface) now has limited functionality  

kexts, drivers, tools and quirks can be toggled on or off, then by pressing g an EFI folder will be created based on what you set  

 

 

working:  

- BOOT/BOOTx64.efi built automatically  

- OC/OpenCore.efi build automatically

- OC/ACPI folder built automatically from settings in ACPI/Add section of config.plist  

- - the tool can compile .dsl to .aml on the fly if iasl is present, but I recommend compiling them to .aml yourself for the tool to move over  

- OC/Drivers folder built automatically from settings in UEFI/Drivers section of config.plist  

- OC/kexts folder built automatically from settings in Kernel/Add section of config.plist  

- OC/Tools/Shell.efi built automatically from setings in Misc/Tools section of config.plist  

- OC/vault.plist and OC/vault.sig are built automatically from the Misc/Security/RequireVault setting in config.plist  

- can specify debug or release version of resources to be built  

- parses plist files internally, no longer needs to call /usr/libexec/PlistBuddy which may not exist on Catalina  

- kexts, drivers, tools and quirks can be enabled or disabled before building the EFI by using the -T option  

 

Edited by rusty-bits
update
  • Like 5
  • Thanks 1
Link to comment
Share on other sites

update ver 1.0p(0907)   checked with opencore DBG-050-2019-09-07 + macOS 10.14.6 (18G95)

 

changed -s option to -q for quiet - more consistent with other command line tools   

 

added -u update option

    if used alone it will update the tool and any pulled repos, then exit, same as the update command

    if used before the build command it will update first, then build the EFI folder

 

-V verbose option will dump all output to the screen instead of the log file

    I find using the combined -uV options to be useful at times

 

-A will pull and build all available repos

    used alone it will build DEBUG and RELEASE versions

    specify -A debug, or -A release to only build those specific versions

    useful if you want all built resources to be local

    I just use it to check my code for bugs

 

-X will delete all local pulled and built resources

   I use it when I've messed up something and need a clean start

 

added code to check missing built files as well as updated repos

 

to do:

    still working on a way to grab prebuilt resources on the fly, for now any Drivers or Kexts that the tool can't pull and build on its own can be placed in the extras folder, the tool will see them in there and copy them to the EFI folder

  • Like 1
Link to comment
Share on other sites

update ver 1.1p(0911)

 

added support for the ACPI folder  

- the tool will compile .dsl files into .aml files if you have iasl installed, but I recommend building the .aml files yourself and placing them in the extras folder.  

- the tool will always check the extras folder first for ACPI files and use those if found  

 

cleaned up the swap function a bit, this makes sure that ...  

- the debug version of Lilu.kext is built before any other kexts

- the debug version of VirtualSMC.kext is built before AsusSMC.kext (if you're using that)  

- Shell.efi is built last since it uses patched UDK2018 tools instead of acidanthera/audk  

 

removed the -A option, there was little need for the tool to build every resource it was aware of.  I was just using that option for testing.  

 

removed the update command since it seemed redundant.  

The -u option will check for updates and exit if used alone.  If used before the build or copy commands the tool will check for updates first.   

Edited by rusty-bits
clarity
  • Like 2
Link to comment
Share on other sites

update ver 1.1p(0913)

 

added -o option   

- this will open up to the EFI folder in the macOS finder when done building  

 

changed tool name to OC-tool to be more consistent  

- old tool name, OpenCore-tool, will still work for now but will issue a notice at . the end about the new name.  

 

beginning work on removing the need to use PlistBuddy or plutil in the tool, will parse the config.plist file in the tool itself to insure compatibility with Catalina, etc.

  • Like 2
Link to comment
Share on other sites

update ver 1.3p(0918)  

 

added -U  (uppercase U) option

lowercase -u will check for updates before building the EFI folder

uppercase -U will check for updates and only build the EFI if there were changes,  

    if nothing changed it will exit  

  

fixed -q option, will now be quiet when checking for updates too  

 

3872946A-E9C1-424E-8C8E-25C2E55D18C7.thumb.jpeg.a4fc6035b35bcee5762ebb9a8068fd49.jpeg

Link to comment
Share on other sites

Hello Rusty.

OC-tool, build from scratch, build with -u (adding VoodooHDA) works fine on an Haswell Platform (H87M-e, i5-4440, 20 Gb DDR3 1600 Mhz, MSI GTX 650 Ti ...), more details in attachement.

 

So thanks

Best regards

Capture d’écran 2019-09-23 à 12.01.40.png

  • Like 1
Link to comment
Share on other sites

I'm glad it worked for you, and glad to see it's working well on Catalina!  And in French!  ;)  

  

Hopefully I'll find a way to reliably download the latest versions of resources such as VoodooHDA from sourceforge.net and add files like VoodooHDA.kext to the known files list of OC-tool, but I'm working on a Text based user interface right now.  

Link to comment
Share on other sites

Hello, I'm glad it updated to beta 9, but sad you're stuck on the Apple screen.  

I have no experience with Catalina or a Haswell system, I'm on Mojave with a Coffee Lake  

I don't think there is anything I can do with OC-tool to help, since all it does is build the latest files and copy them into an EFI folder, but please let me know what you find.  If OC-tool has a problem I want to know.  

The text based user interface, TUI, I'm working on will list options that OC-tool sees in the config.plist file.  If you want to try it out, do ...  

 

git pull
git checkout TUI
git pull
./OC-tool -T

 

40F73CAA-626F-41D1-9475-295C0608D851.thumb.jpeg.7f2ed968aa3615b993fb734fe29834f0.jpeg  

 

It might show something unexpected   

use `git checkout master` to return to the main version of OC-tool  

 

Edited by rusty-bits
git pull
Link to comment
Share on other sites

Hello,

first all, ./OC-tool -T and the result is imageproxy.php?img=&key=c17464ef1b1b51c71501619472_Capturedecran2019-09-25a15_30_17.thumb.png.d29385068ba6b2c99165c6e40828a368.png

no doubt with OC-tool, it's my fault, my own fault, certainly a lack in content of "config.plist" or in use of "efi" or "kext" component(s).

For example, after Catalina update l haded XhciDxe.efi which is present in my Clover EFI kexts section and this causes problems, so I'll remove it and I'll try with GenericUSBXHCI.kext.

For me OpenCore is fabulous and your OC-tool a very helpful tool.

Thanks

Best regards

Edited by matxpa
Link to comment
Share on other sites

update ver 1.5pt(0925)  

 

added -T option  

it opens a Text based User Interface - TUI  

it doesn't do much of anything yet, but I'm working on ways it can turn options on and off  

 

also, added double-click support from the Finder  

double-clicking on OC-tool is the same as running 

./OC-tool -uo build release

you can see more about that on the wiki  

https://github.com/rusty-bits/OC-tool/wiki/OC-tool-from-the-Finder  

 

finder03.png.b8bc8331fbd4632d515389807c3c4253.png

Edited by rusty-bits
add link
Link to comment
Share on other sites

@rusty-bits

Is is possible the get your brilliant tool to construct config.plist from Clovers config.plist, obviously just take the needed bits, and populate what Clover does not have.

Building a config from scratch is pretty daunting, so a bit of a helping hand would be nice.;)

Thanks again for your wonderfull tool, I have not used it yet, stuck on config.plist, hence the reason for my comment.

 

 

Edited by STLVNUB
  • Like 1
Link to comment
Share on other sites

Hello Stlvnub,

maybe you already know that tool "OpenCore Configurator", same dev. makes Clover one.

You can convert (recover a lot of content) a Clover "config.plist" but this one will not be realy usable, if you try as this you'll have a message like "...config.plist corrupted ..." at boot. It's just a working base, recover "SMBIOS" section is usefull.

IMG_20190926_084152.png

Link to comment
Share on other sites

@STLVNUB

While it may be possible to construct a tool that will convert a clover config.plist to an opencore config.plist it is not a feature I am going to add to OC-tool  

OpenCore is changing frequently and I don't see any way to guarantee it would be stable right now.  

Plus, good old UNIX "rules" have one command do one job, and I only plan on having OC-tool take an OpenCore config.plist and produce a workable EFI folder.  

If in the future I or someone else has a command line tool that can convert a Clover to an OpenCore you could just pipe the output into OC-tool.  That would be interesting, but I really feel that people should learn how to set up their own config.plist.  I'm still working on understanding every bit of it myself!

Link to comment
Share on other sites

@rusty-bits

 

Hello Rusty.


./OC-tool -T execution

 

In T.U.I code I'll suggest you 3 little modif. and/or adds in next functions : text_user_interface(), draw_screen() and finally draw_footer()

 

1) text_user_interface() (add and modification)

  a)  If you navigate with A, K, l, h, ... you keep display attributes of the active word when you "quite" ( prompt is green, red or other         color,  because of attributes manipulation in navigation)
  b) When you "quite", the last cursor position kept results from "unselect_MSG()", so prompt appears at last kept number line +1 ( msg "\n")  with lost echo and CR. (« stty -echo » at line 605)

 

2) draw_screen() (add)
  at the end of details lines draw, a new variable (Footer_Line) to keep value of that last drawn line number to position Footer N lines after.

 

3) draw_footer() (modification)

  In content of « msg » parameter,  initial Footer position  $(R-1) is replaced by ${Footer_Line}, and a space added at end. 

 

You can see details in the « rtf » file attached

Hope y'll be interested by OC-tool modif switch -T.rtf

 

Edited by matxpa
Link to comment
Share on other sites

@matxpa thanks for taking an interest  

1) thanks for pointing this out, I would never notice this on my terminal because I have my prompt set to show me info with colored status  

(just fixed it hopefully)

 

2,3) I plan on having a list of all the keyboard options and commands on the screen as well, not sure where the footer will be when I'm done  

  Also, I plan on having multiple screens to show the other options set in config.plist, so I may want to keep the color key at the bottom.

Edited by rusty-bits
add fixed note
Link to comment
Share on other sites

update ver 1.6pt(0930)  

 

added functionality to the -T option  

optT.png.3f9fd7949fbef6df83182b22adab536a.png

 

./OC-tool -T

will default to the build release options and use the RELEASE/config.plist  

and modifications made to the config.plist in OC-tool will be saved to Docs/config.plist (currently the tabs are stripped out, but still a valid plist)  

pressing g will build an EFI folder based on the what you edit on the screen  

./OC-tool -T build debug

will use the DEBUG/config.plist

Link to comment
Share on other sites

ver 1.7pt(1006)

 

Fixed bug causing copy failure for AppleGenericInput.efi - it has been migrated to OcSupportPkg - no longer in config.plist  

 

Started adding feature in TUI that shows the description of the highlighted item - by pressing i  

677642071_ScreenShot2019-10-06at7_37_44PM.png.e1ef1f53e2adb9db9549b75a9d773340.png

Link to comment
Share on other sites

 Share

×
×
  • Create New...