Giter VIP home page Giter VIP logo

octool's Introduction

octool

license downloads CI release

A small project to help me continue my learning of the Rust language. All suggestions and criticisms are welcome (but that doesn't mean I'll get to them in a timely manner, I can be lazy at times)
You can build from the included source by running cargo build --release (if you have the Rust environment installed) or you can use the binary from the Releases section on GitHub. Unlike my older OC-tool, this tool does not auto update itself to the latest version, but it will let you know if there is an update.

You can find a basic picture guide for the use of octool here https://rusty-bits.github.io/octool/

Command line options

./octool [options] [-V x.y.z] [INPUT_folder || config.plist]

-d use debug versions for EFI instead of release versions

-h print help/usage message then exit

-v print octool version information and booted OpenCore version if the var is in NVRAM then exit

-V x.y.z select OpenCore version number to use e.g. -V 0.9.7

  • without this option octool will make a quick guess as to which version to use based on the INPUT config.plist, if no INPUT config.plist is provided, octool will default to the latest OpenCore version

octool takes a path to a folder whos name contains INPUT at any point. This folder contains a config.plist and additional files for a specific build which allows the user to have numerous differing configs. octool will also take a direct path to a specific config.plist to use if desired and will gather what is needed for that specific config in the generic INPUT folder If you run octool with no path provided ./octool will look for config.plist in the generic INPUT folder, if it doesn't find it there it will use the OpenCorePkg/Docs/Sample.plist file.

At startup, octool checks for a local copy of the builds branch of the Dortania/build-repo so it will know the urls and hashes of the prebuilt binary resources. Thank you dhinakg, hieplpvip, and khronokernel.

  • It will update or download it to the build-repo into the tool_config_files folder as needed.

Next, octool does the same thing for the master branch of the Acidanthera OpenCorePkg source files, thanks to the people of Acidanthera, in order to have the corresponding Sample.plist and Configuration.tex files, etc. for the version of OpenCore that you are building. They will be placed into the resources folder along with the corresponding binaries from the Dortania builds. This will allow octool to use Acidanthera tools while building the EFI, such as the ocvalitate and CreateVault tools. Thanks, again dhinakg.

Lastly, octool will run the input config.plist through ocvalitade and give you the option to quit or continue.
If you continue you then enter the

config.plist editor...

Navigation: arrow keys or some standard vi keys
          'up'/'k'            jump to top of section
              ^                       't'
              |                        ^
'left'/'h' <-- --> 'right'/'l'         |
              |                        v
              v                       'b'
          'down'/'j'          jump to bottom of section

Usage:
'ENTER' will switch to edit mode for string, integer, or data fields. When editing a data field 'TAB' will toggle between editing the data as hex or as a string.

  • 'ENTER' will save any changes made
  • 'ESC' will discard and changes
  • if the field being edited has values listed in the Configuration.tex file, octool will display a list of them

'SPACE' will toggles boolean value between true/false

  • 'SPACE' will also toggle the Enabled status of kexts, drivers, tools, and amls when they are highlighted in the section list
  • and will toggle binary values for fields that have bit values listed in the Configuration.tex file

'a' add - if in a resource section there is option to select from a list of known resources, or add a blank resource template to the working plist from the Sample.plist

  • if in another section you can select a type and key name to add to the working plist

'ctrl-c' copy - copy the highlighted field or section

'd' delete - will delete the highlighted field or section after confirmation (dd command). The deleted data can be replaced by using the 'p' paste command

'f' find - find all occurances of a string in the plist

  • if there is only one occurance, it will jump to the location
  • if there is more than one occurance, it will present a list to select from
  • 'n' can be used to go to the next item without needing to do another find command

'G' go (capital G) - make an OUTPUT/EFI/OC folder from the config.plist

  • if OpenCanopy.efi is enabled it will copy the OcBinaryData Resources to OUTPUT/EFI/OC/Resources
  • if Misc > Security > Vault is set to Basic or Secure, octool will compute the required files and sign the OpenCore.efi if needed
  • octool will ignore resources that it doesn't know unless they are placed in the INPUT folder, it will print out a warning, but it will not make a change to the config.plist for the unknown resource
  • any file placed in the INPUT folder will take priority and will be used for the OUTPUT/EFI, even if a more recent version of that resource is available elsewhere. This is good for using a specific version of a kext, for example, or for using a specific SSDT or USBMap
  • lastly, it will again validate the OUTPUT/EFI/OC/config.plist file with ocvalidate

'i' show info of highlighted item.

  • If item is resource such as a kext or driver, octool will show the source of the file it will place in the OUTPUT/EFI folder.
  • Otherwise, octool will show the description and info from the corresponding Acidanthera Configuration.tex file.

'I' - Capital I - Insert - enter the path to a plist file, or drop it on the window, and octool will add the fields from that plist

  • useful to add a plist that just contains Patches, for example the patches_OC.plist file created by CorpNewt's SSDTTime tool

'K' Key - capital K - edit the name of the highlighted key

'M' merge - capital M - will add missing fields to the config.plist from the Sample.plist without changing any existing fields.

  • this command, coupled with its companion Purge command (capital P) will update a config.plist when OpenCore plist format changes occur

'n' next - jump to the next found item if more than one occurance was found

'O' order - Capital O - if currently in the Kernel > Add section the 'O' command will check the order and dependencies of kexts.

  • If a kext is in the wrong order based on a dependency then octool will reorder them.
  • If a required dependency is missing then octool will add and enable the required dependency.
  • If there are any duplicate enabled kexts then octool will disable the duplicates.

'P' purge - Capital P - removes fields from the config.plist that are not in the Sample.plist

  • this command, coupled with it's companion merge command (capital M) will update a config.plist when OpenCore plst format changes occur

'p' paste - places the last deleted or modified etc. item into the plist (for those familiar with vi commands)

  • if pasting into a dictionary, octool will append -copy to the pasted item

'q' quit - if unsaved changes were made to the config.plist octool will show a warning so changes can be saved

'r' reset - if a single item is selected, reset its value to the same as the Sample.plist value

  • if a section is highlighted, reset the whole section to the same as the section in the Sample.plist

's' save a copy of the config.plist as INPUT/modified_config.plist

  • modified_ will be added to the begining of the saved file unless you are already working on a modified_ file
  • the saved file will be checked with ocvalidate for any errors

'V' Version - Capital V - change the version of OpenCore that will be checked against and used in the OUTPUT EFI

  • or, if 'V' is used while a resource is highlighted, you can change the version of that specific resource

'ctrl-x' cut - remove the highlighted field or section from the plist

'y' yank - copy the highlighted field or section (included for those vim users used to 'y' for copying)

'ctrl-v' paste - place the last cut, copied, etc. item into the plist

File and Folder Descriptions

tool_config_files folder - contains various json formatted files

  • octool_config.json - settings for octool itself, octool will create this if it doesn't exist
  • resource_list.json - list of resources by full name e.g. Lilu.kext and their parent resource, octool will create this if it doesn't exist
  • build-repo folder - contains the config.json file from the Dortania builds repo with url, version, hash, date created, etc. info for the parent resources. octool will download this from Dortania if it doesn't exist
  • other.json - contains a list of additional parent resources not included in the Dortania build--repo, octool will create this if it doesn't exist

INPUT folder - place your config.plist here along with other files to be included in the OUTPUT/EFI, such as custom SSDT files, custom Drivers, custom OpenCanopy themes, etc.

  • octool will not overwrite the input config.plist on save, instead it will save a version called modified_config.plist in this folder so the original config.plist can still be used if needed
  • octool will also automatically save a config.plist titled last_built_config.plist when the build command is run for easy reference to a copy of the config.plist that is in the OUTPUT/EFI folder

OUTPUT folder - location where octool will put the created EFI folder

resources folder - location where octool places the resources needed to create the OUTPUT/EFI folder. Can be deleted if desired, octool will gather any resources it needs when run

To Do:

  • change tool configuration from inside tool, the configuration file tool_config_files/octool_config.json contains vars to set up octool, for example the language versions of the audio files for OpenCanopy for e.g. en
  • keep the highlighted item on screen while reading long info from the Configuration.tex so the user can edit the field while also reading the info
  • fix some style formatting of the info screens so underline, bold, etc. looks better when it crosses multiple lines

octool's People

Contributors

dreamwhite avatar rusty-bits avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar

Forkers

dreamwhite iq-scm

octool's Issues

[Feature Request] OpenCanopy Resources override

I don't know if this topic has already been discovered or not but... In case you wanna use a custom Resources folder (e.g. no Audio folder or dropped themes) it would be very convenient to specify a custom Resources folder in INPUT directory that will be copied during the EFI building process.
What do you think about it? Is this thing achievable?
Greetings
dreamwhite

[Question] Error

1] Getting a config.plist error but boots without issues
2] can't find the listed errors in the config.plist
3] octool not generating a log file

Screenshot 2022-03-08 at 01 46 38

Thanks

[Feature Request] New add templates

Thank you so much for the effort you're putting in this project.
It would be very useful having a add template for the following entries in the config.plist:

  • ACPI/Delete
  • ACPI/Patch
  • Booter/MmioWhitelist
  • Booter/Patch
  • DeviceProperties/Add
  • Kernel/Block
  • Kernel/Force
  • Kernel/Patch
  • Misc/BlessOverride
  • Misc/Entries

What are your thoughts on this? Is this thing achievable?
Greetings
dreamwhite

[Feedback] Tool updates, compile from sources and other tidbits

After a long hiatus on the OSX scene, I am back, and decided to give your rust-based tool a shot. Being able to run it purely on console is what keeps me hooked in. I'm impressed on how easy it is to do what it does, however coming from your old shell based tool, a bit sad on how limited it currently feels. It seems this tool aggregate files from Dortania, with a nice front-end to the ocvalidate tool. The option to specify on the fly which version of OC to use is great, but not sure if allowing usage of a previous version has any implications with newer Lilu and friends - should not, but again, keyword should.

One great advantage your previous shell code had was the ability to compile modules from their sources. Any chances of this feature to make a come back?

Another "missing" feature is the ability to add other extension sources (such as VoodooI2C) into a list of extensions to be fetched online. Not sure how easy (or feasible) would be to add them to the config.json manually - perhaps via a "custom.json" file added into the INPUT/ folder and read during build time to make it less prone to be overwritten during updates.

On the octool update front, it seems (from a comment on another issue) your tool does not auto update, since it is a binary file. Perhaps you could add the compiled binaries into the git repository, with their respective checksums, and add a call to fetch and process these files during a self updating routine. Makes for a more user-friendly experience.

Keep up with the great work, and thank you for the tool!

octool Working Great!!

I decided to give octool another try. Updated opencore to 0.7.6, worked perfectly.

The only kext I added to the input was the recently released RadeonSensor.kext. would it be possible for octool to pull it from the repo?

Screenshot 2021-12-06 at 23 42 34

Thank You

Help Needed

Hi,
I'm finding this version confusing not sure where I'm going wrong

Screenshot 2021-11-01 at 21 22 49

Thanks

-o option doesn't seem to work

it seems to try to treat my -o 0.7.6 input as the config.plist argument

`
% ./octool -o 0.7.6

Did not find config at "/Users/bkmartin/opencore/octool/-o"
Using tool_config_files/OpenCorePkg/Docs/Sample.plist
`

New options for 0.8.1

The new driver efi files for ResetNvramEntry.efi and ToggleSipEntry.efi have to be in the input directory. They are not fetched automatically. Also the obsolete entries are not removed.

Maybe an update is needed for 0.9.0

Hi rusty ๐Ÿ˜„ ,

Maybe theres an update needed for 0.9.0 ?
Or is there reaaly something wrong with the hash?
They are equal.

Checking local OpenCorePkg 0.9.0 binaries ... "OpenCore-0.9.0-RELEASE" local copy not found, Downloading
remote hash 156fc6371e07dc17c3363e5da1812c1df5355782e1f5e1895b3ded3be1b8158b
  local sum a036578d90d783bde5aad5be6f4eb8b9b1569e67e748f1f381cb2713b3f633fa
thread 'main' panicked at 'Sum of "resources/OpenCore-0.9.0-RELEASE/OpenCore-0.9.0-RELEASE.zip" does not match 156fc6371e07dc17c3363e5da1812c1df5355782e1f5e1895b3ded3be1b8158b', src/res.rs:285:13
                             note: run with `RUST_BACKTRACE=1` environment variable to display a backtrace
                                                                                                          zsh: abort      ./octool -V 0.9.0

regards,
Henk

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.