Skip to content

Commit

Permalink
Update OC utilities
Browse files Browse the repository at this point in the history
  • Loading branch information
vulgo committed Apr 20, 2022
1 parent 9198395 commit 081350f
Show file tree
Hide file tree
Showing 25 changed files with 153 additions and 80 deletions.
Binary file modified OpenCore-0.8.0/Utilities/ACPIe/ACPIe
Binary file not shown.
Binary file modified OpenCore-0.8.0/Utilities/ACPIe/ACPIe.exe
Binary file not shown.
Binary file modified OpenCore-0.8.0/Utilities/ACPIe/ACPIe.linux
Binary file not shown.
42 changes: 42 additions & 0 deletions OpenCore-0.8.0/Utilities/FindSerialPort/FindSerialPort.command
Original file line number Diff line number Diff line change
@@ -0,0 +1,42 @@
#!/bin/sh

## @file
# Copyright (c) 2022, joevt. All rights reserved.
# SPDX-License-Identifier: BSD-3-Clause
##

serial_dev=$(ioreg -p IODeviceTree -lw0 | perl -e '
$ioregpath=""; $pcipath=""; while (<>) {
if ( /^([ |]*)\+\-o (.+) <class (\w+)/ ) {
$indent = (length $1) / 2; $name = $2; $class = $3;
$ioregpath =~ s|^((/[^/]*){$indent}).*|$1/$name|;
$pcipath =~ s|^((/[^/]*){$indent}).*|$1/|;
$name = ""; $uid = 0; $classcode = "";
}
if ( $class eq "IOACPIPlatformDevice" ) { if ( /^[ |]*"name" = <"([^\"]*)">/ ) { $name = $1; }; if ( /^[ |]*"_UID" = "(\d+)"/ ) { $uid = $1; } }
elsif ( $class eq "IOPCIDevice" ) { if ( /^[ |]*"pcidebug" = "\d+:(\d+):(\d+).*"/ ) { $name = sprintf("Pci(0x%x,0x%x)", $1, $2); } if ( /^[ |]*"class-code" = <(\w+)>/ ) { $classcode = $1; } }
if ( /^[ |]*}/ && $name ) {
if ( $class eq "IOACPIPlatformDevice" ) {
if ($name eq "PNP0A03") { $name = sprintf ("PciRoot(0x%x)", $uid); }
elsif ($name eq "PNP0A08") { $name = sprintf ("PciRoot(0x%x)", $uid); }
elsif ($name =~ /PNP..../) { $name = sprintf ("Acpi(%s,0x%x)", $name, $uid); }
# not translating all ACPI types since we only care about PCI devices
}
$pcipath .= $name;
if ( $classcode eq "02000700" ) {
$serialdevicepath = $pcipath =~ s/.*PciRoot\(0x0\)//r =~ s|/Pci\(||gr =~ s|\)| 00 00 |gr =~ s|0x||gr =~ s|,| |gr =~ s|\b(\w)\b|0\1|gr =~ s|$|FF|r;
print $ioregpath =~ s|/Root/||r . "\n";
print $pcipath =~ s|/*||r . "\n";
print "xxd -p -r <<< \"" . $serialdevicepath . "\" | base64\n";
print "\n";
}
}
}
')

if [ "$serial_dev" = "" ]; then
echo "No serial device found!"
fi

exit 0
4 changes: 4 additions & 0 deletions OpenCore-0.8.0/Utilities/FindSerialPort/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
FindSerialPort
================

This script finds PCIe serial ports and outputs their paths. Thanks [joevt](https://github.com/joevt) for writing it.
Binary file modified OpenCore-0.8.0/Utilities/LogoutHook/nvramdump
Binary file not shown.
Binary file modified OpenCore-0.8.0/Utilities/acdtinfo/acdtinfo
Binary file not shown.
Binary file modified OpenCore-0.8.0/Utilities/acdtinfo/acdtinfo.exe
Binary file not shown.
Binary file modified OpenCore-0.8.0/Utilities/disklabel/disklabel
Binary file not shown.
Binary file modified OpenCore-0.8.0/Utilities/disklabel/disklabel.exe
Binary file not shown.
Binary file modified OpenCore-0.8.0/Utilities/icnspack/icnspack
Binary file not shown.
Binary file modified OpenCore-0.8.0/Utilities/icnspack/icnspack.exe
Binary file not shown.
5 changes: 4 additions & 1 deletion OpenCore-0.8.0/Utilities/macrecovery/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,4 +2,7 @@

macrecovery is a tool that helps to automate recovery interaction. It can be used to download diagnostics and recovery as well as analyse MLB.

Requires python to run. Run with `-h` argument to see all available arguments.
Requires python3 to run. Run with `-h` argument to see all available arguments.

To create a disk image for a virtual machine installation use `build-image.sh`.

154 changes: 77 additions & 77 deletions OpenCore-0.8.0/Utilities/macrecovery/boards.json
Original file line number Diff line number Diff line change
@@ -1,79 +1,79 @@
{
"Mac-226CB3C6A851A671": "latest",
"Mac-031B6874CF7F642A": "10.15.7",
"Mac-27AD2F918AE68F61": "latest",
"Mac-AA95B1DDAB278B95": "latest",
"Mac-66E35819EE2D0D05": "latest",
"Mac-7BA5B2D9E42DDD94": "latest",
"Mac-7BA5B2794B2CDB12": "10.13.6",
"Mac-06F11F11946D27C5": "latest",
"Mac-AFD8A9D944EA4843": "10.15.7",
"Mac-942B59F58194171B": "10.13.6",
"Mac-B809C3757DA9BB8D": "latest",
"Mac-7DF2A3B5E5D671ED": "10.15.7",
"Mac-35C1E88140C3E6CF": "11.6.3",
"Mac-942459F5819B171B": "10.13.6",
"Mac-77EB7D7DAF985301": "10.15.7",
"Mac-827FB448E656EC26": "latest",
"Mac-7BA5B2DFE22DDD8C": "latest",
"Mac-2E6FAB96566FE58C": "10.15.7",
"Mac-F2208EC8": "10.13.6",
"Mac-BE0E8AC46FE800CC": "11.6.3",
"Mac-00BE6ED71E35EB86": "10.15.7",
"Mac-4B7AC7E43945597E": "10.15.7",
"Mac-CAD6701F7CEA0921": "latest",
"Mac-63001698E7A34814": "latest",
"Mac-937CB26E2E02BB01": "latest",
"Mac-FFE5EF870D7BA81A": "latest",
"Mac-53FDB3D8DB8CA971": "latest",
"Mac-A61BADE1FDAD7B05": "latest",
"Mac-42FD25EABCABB274": "11.6.3",
"Mac-827FAC58A8FDFA22": "latest",
"Mac-1E7E29AD0135F9BC": "latest",
"Mac-3CBD00234E554E41": "11.6.3",
"Mac-66F35F19FE2A0D05": "10.15.7",
"Mac-189A3D4F975D5FFC": "11.6.3",
"Mac-B4831CEBD52A0C4C": "latest",
"Mac-C08A6BB70A942AC2": "10.13.6",
"Mac-8ED6AF5B48C039E1": "10.13.6",
"Mac-FC02E91DDD3FA6A4": "10.15.7",
"Mac-06F11FD93F0323C5": "latest",
"Mac-9AE82516C7C6B903": "latest",
"Mac-6F01561E16C75D06": "10.15.7",
"Mac-F60DEB81FF30ACF6": "latest",
"Mac-473D31EABEB93F9B": "latest",
"Mac-F22589C8": "10.13.6",
"Mac-0CFF9C7C2B63DF8D": "latest",
"Mac-CFF7D910A743CAAF": "latest",
"Mac-942C5DF58193131B": "10.13.6",
"Mac-77F17D7DA9285301": "latest",
"Mac-9F18E312C5C2BF0B": "latest",
"Mac-E1008331FDC96864": "latest",
"Mac-E7203C0F68AA0004": "latest",
"Mac-742912EFDBEE19B3": "10.13.6",
"Mac-27ADBB7B4CEE8E61": "10.15.7",
"Mac-F65AE981FFA204ED": "10.15.7",
"Mac-031AEE4D24BFF0B1": "10.15.7",
"Mac-4B682C642B45593E": "latest",
"Mac-DB15BD556843C820": "latest",
"Mac-937A206F2EE63C01": "latest",
"Mac-81E3E92DD6088272": "11.6.3",
"Mac-E43C1C25D4880AD6": "latest",
"Mac-942452F5819B1C1B": "10.13.6",
"Mac-65CE76090165799A": "latest",
"Mac-551B86E5744E2388": "latest",
"Mac-BE088AF8C5EB4FA2": "latest",
"Mac-A5C67F76ED83108C": "latest",
"Mac-5F9802EFE386AA28": "latest",
"Mac-AF89B6D9451A490B": "latest",
"Mac-94245B3640C91C81": "10.13.6",
"Mac-EE2EBD4B90B839A8": "latest",
"Mac-4BC72D62AD45599E": "10.13.6",
"Mac-2BD1B31983FE1663": "11.6.3",
"Mac-7DF21CB3ED6977E5": "11.6.3",
"Mac-A369DDC4E67F1C45": "latest",
"Mac-94245A3940C91C80": "10.13.6",
"Mac-C3EC7CD22292981F": "10.15.7",
"Mac-35C5E08120C7EEAF": "latest",
"Mac-942B5BF58194151B": "10.13.6"
"Mac-EE2EBD4B90B839A8": "latest",
"Mac-BE0E8AC46FE800CC": "11.6.5",
"Mac-9AE82516C7C6B903": "latest",
"Mac-942452F5819B1C1B": "10.13.6",
"Mac-942C5DF58193131B": "10.13.6",
"Mac-C08A6BB70A942AC2": "10.13.6",
"Mac-742912EFDBEE19B3": "10.13.6",
"Mac-66F35F19FE2A0D05": "10.15.7",
"Mac-2E6FAB96566FE58C": "10.15.7",
"Mac-35C1E88140C3E6CF": "11.6.5",
"Mac-7DF21CB3ED6977E5": "11.6.5",
"Mac-9F18E312C5C2BF0B": "latest",
"Mac-937CB26E2E02BB01": "latest",
"Mac-827FAC58A8FDFA22": "latest",
"Mac-226CB3C6A851A671": "latest",
"Mac-0CFF9C7C2B63DF8D": "latest",
"Mac-C3EC7CD22292981F": "10.15.7",
"Mac-AFD8A9D944EA4843": "10.15.7",
"Mac-189A3D4F975D5FFC": "11.6.5",
"Mac-3CBD00234E554E41": "11.6.5",
"Mac-2BD1B31983FE1663": "11.6.5",
"Mac-06F11FD93F0323C5": "latest",
"Mac-06F11F11946D27C5": "latest",
"Mac-E43C1C25D4880AD6": "latest",
"Mac-473D31EABEB93F9B": "latest",
"Mac-66E35819EE2D0D05": "latest",
"Mac-A5C67F76ED83108C": "latest",
"Mac-B4831CEBD52A0C4C": "latest",
"Mac-CAD6701F7CEA0921": "latest",
"Mac-551B86E5744E2388": "latest",
"Mac-937A206F2EE63C01": "latest",
"Mac-827FB448E656EC26": "latest",
"Mac-1E7E29AD0135F9BC": "latest",
"Mac-53FDB3D8DB8CA971": "latest",
"Mac-E1008331FDC96864": "latest",
"Mac-5F9802EFE386AA28": "latest",
"Mac-E7203C0F68AA0004": "latest",
"Mac-A61BADE1FDAD7B05": "latest",
"Mac-F22589C8": "10.13.6",
"Mac-94245B3640C91C81": "10.13.6",
"Mac-94245A3940C91C80": "10.13.6",
"Mac-942459F5819B171B": "10.13.6",
"Mac-4B7AC7E43945597E": "10.15.7",
"Mac-6F01561E16C75D06": "10.15.7",
"Mac-F60DEB81FF30ACF6": "latest",
"Mac-27AD2F918AE68F61": "latest",
"Mac-F2208EC8": "10.13.6",
"Mac-8ED6AF5B48C039E1": "10.13.6",
"Mac-4BC72D62AD45599E": "10.13.6",
"Mac-7BA5B2794B2CDB12": "10.13.6",
"Mac-031AEE4D24BFF0B1": "10.15.7",
"Mac-F65AE981FFA204ED": "10.15.7",
"Mac-35C5E08120C7EEAF": "latest",
"Mac-7BA5B2DFE22DDD8C": "latest",
"Mac-942B5BF58194151B": "10.13.6",
"Mac-942B59F58194171B": "10.13.6",
"Mac-00BE6ED71E35EB86": "10.15.7",
"Mac-FC02E91DDD3FA6A4": "10.15.7",
"Mac-7DF2A3B5E5D671ED": "10.15.7",
"Mac-031B6874CF7F642A": "10.15.7",
"Mac-27ADBB7B4CEE8E61": "10.15.7",
"Mac-77EB7D7DAF985301": "10.15.7",
"Mac-81E3E92DD6088272": "11.6.5",
"Mac-42FD25EABCABB274": "11.6.5",
"Mac-A369DDC4E67F1C45": "latest",
"Mac-FFE5EF870D7BA81A": "latest",
"Mac-DB15BD556843C820": "latest",
"Mac-65CE76090165799A": "latest",
"Mac-B809C3757DA9BB8D": "latest",
"Mac-4B682C642B45593E": "latest",
"Mac-77F17D7DA9285301": "latest",
"Mac-BE088AF8C5EB4FA2": "latest",
"Mac-AA95B1DDAB278B95": "latest",
"Mac-63001698E7A34814": "latest",
"Mac-CFF7D910A743CAAF": "latest",
"Mac-AF89B6D9451A490B": "latest",
"Mac-7BA5B2D9E42DDD94": "latest"
}
18 changes: 18 additions & 0 deletions OpenCore-0.8.0/Utilities/macrecovery/build-image.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
#!/bin/bash -e

rm -rf Recovery.RO.dmg Recovery.RO.raw Recovery.dmg.sparseimage
hdiutil create -size 800m -layout "UNIVERSAL HD" -type SPARSE -o Recovery.dmg
newDevice=$(hdiutil attach -nomount Recovery.dmg.sparseimage | head -n 1 | awk '{print $1}')
echo newdevice "$newDevice"
diskutil partitionDisk "${newDevice}" 1 MBR fat32 RECOVERY R
N=$(echo "$newDevice" | tr -dc '0-9')
diskutil mount disk"${N}"s1
MOUNT="$(diskutil info disk"${N}"s1 | sed -n 's/.*Mount Point: *//p')"
mkdir -p "$MOUNT/com.apple.recovery.boot"
cp ./*.dmg ./*.chunklist "$MOUNT/com.apple.recovery.boot/"
diskutil umount disk"${N}"s1
hdiutil detach "$newDevice"
hdiutil convert -format UDZO Recovery.dmg.sparseimage -o Recovery.RO.dmg
rm Recovery.dmg.sparseimage
qemu-img convert -f dmg -O raw Recovery.RO.dmg Recovery.raw
rm Recovery.RO.dmg
2 changes: 1 addition & 1 deletion OpenCore-0.8.0/Utilities/macrecovery/macrecovery.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
#!/usr/bin/env python
#!/usr/bin/env python3

"""
Gather recovery information for Macs.
Expand Down
Binary file modified OpenCore-0.8.0/Utilities/macserial/macserial
Binary file not shown.
Binary file modified OpenCore-0.8.0/Utilities/macserial/macserial.exe
Binary file not shown.
Binary file modified OpenCore-0.8.0/Utilities/ocpasswordgen/ocpasswordgen
Binary file not shown.
Binary file modified OpenCore-0.8.0/Utilities/ocpasswordgen/ocpasswordgen.exe
Binary file not shown.
Binary file modified OpenCore-0.8.0/Utilities/ocpasswordgen/ocpasswordgen.linux
Binary file not shown.
8 changes: 7 additions & 1 deletion OpenCore-0.8.0/Utilities/ocvalidate/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ Utility to validate whether a `config.plist` matches requirements and convention
### Global Rules
- All entries must be set once only. Duplication is strictly prohibited.
- All strings (fields with plist `String` format) throughout the whole config only accept ASCII printable characters at most. Stricter rules may apply. For instance, some fields only accept specified values, as indicated in [Configuration.pdf](https://github.com/acidanthera/OpenCorePkg/blob/master/Docs/Configuration.pdf).
- All the paths relative to OpenCore root must be 128 bytes total including '\0' terminator.
- All the paths relative to OpenCore root must be less than or equal to 128 bytes (`OC_STORAGE_SAFE_PATH_MAX`) in total including '\0' terminator.
- Most binary patches must have `Find`, `Replace`, `Mask` (if used), and `ReplaceMask` (if used) identical size set. Also, `Find` requires `Mask` (or `Replace` requires `ReplaceMask`) to be active (set to non-zero) for corresponding bits.
- `MinKernel` and `MaxKernel` entries should follow conventions specified in [Configuration.pdf](https://github.com/acidanthera/OpenCorePkg/blob/master/Docs/Configuration.pdf). (TODO: Bring decent checks for this)
- `MinKernel` cannot be a value that is below macOS 10.4 (Darwin version 8).
Expand Down Expand Up @@ -78,6 +78,12 @@ Utility to validate whether a `config.plist` matches requirements and convention
- DmgLoading: Only `Disabled`, `Signed`, or `Any` are accepted.
- Vault: Only `Optional`, `Basic`, or `Secure` are accepted.
- SecureBootModel: Only `Default`, `Disabled`, `j137`, `j680`, `j132`, `j174`, `j140k`, `j780`, `j213`, `j140a`, `j152f`, `j160`, `j230k`, `j214k`, `j223`, `j215`, `j185`, `j185f`, or `x86legacy` are accepted.
#### Serial
- RegisterAccessWidth: Only `8` or `32` are accepted.
- BaudRate: Only `921600`, `460800`, `230400`, `115200`, `57600`, `38400`, `19200`, `9600`, `7200`, `4800`, `3600`, `2400`, `2000`, `1800`, `1200`, `600`, `300`, `150`, `134`, `110`, `75`, or `50` are accepted.
- PciDeviceInfo: The last byte must be `0xFF`.
- PciDeviceInfo: Excluding the last byte `0xFF`, the rest must be divisible by 4.
- PciDeviceInfo: Maximum allowed size is 41.

### NVRAM
- Requirements here all follow Global Rules. In addition, the following keys and values are checked:
Expand Down
Binary file modified OpenCore-0.8.0/Utilities/ocvalidate/ocvalidate
Binary file not shown.
Binary file modified OpenCore-0.8.0/Utilities/ocvalidate/ocvalidate.exe
Binary file not shown.
Binary file modified OpenCore-0.8.0/Utilities/ocvalidate/ocvalidate.linux
Binary file not shown.

0 comments on commit 081350f

Please sign in to comment.