Skip to content

Conversation

@jaminmc
Copy link

@jaminmc jaminmc commented Jul 25, 2025

Here is the CLI for GenSMBIOS. My 2nd commit refined the options, and the logic.

jaminmc added 2 commits July 20, 2025 11:15
Added a CLI interface, so this can be used for scripts. 

Here is a sample:
```
(base) user@users-MacBook-Pro-M1-2 GenSMBIOS % python3 GenSMBIOS.py -h                                                                              
usage: GenSMBIOS.py [-h] [--install] [--plist PLIST] [--plist-type {clover,opencore}] [--generate GENERATE [GENERATE ...]] [--uuid] [--rom] [--list]
                    [--toggle-rom] [--args ARGS] [--clear-args] [--version] [-j JSON]

GenSMBIOS CLI

options:
  -h, --help            show this help message and exit
  --install             Install/Update MacSerial
  --plist PLIST         Path to config.plist
  --plist-type {clover,opencore}
                        Specify plist type if not auto-detected
  --generate GENERATE [GENERATE ...]
                        Generate SMBIOS: <type> [times] (e.g., iMac18,3 5)
  --uuid                Generate UUID
  --rom                 Generate ROM
  --list                List current SMBIOS
  --toggle-rom          Toggle generate ROM with SMBIOS
  --args ARGS           Set additional args for macserial
  --clear-args          Clear additional args for macserial
  --version             Show MacSerial version
  -j JSON, --json JSON  Export generated SMBIOS to JSON file
 % python3 GenSMBIOS.py --plist ~/Documents/OCC/EfiMaker/2025-07-19-22h39m38s/EFI/OC/config.plist -j /tmp/test.json --generate iMac18,3 1

  #######################################################
 #          Getting MacSerial Remote Version           #
#######################################################

Gathering latest macserial info...
 - Gathering info from OpenCorePkg...
iMac18,3 SMBIOS Info
Type:         iMac18,3
Serial:       C02YL8YJJ1GJ
Board Serial: C029164054NJ0PGJA
SmUUID:       D74CF4E7-536D-43C2-9FAE-A23D26661530
Apple ROM:    24240E5554D7

Flushing SMBIOS entry to /Users/user/Documents/OCC/EfiMaker/2025-07-19-22h39m38s/EFI/OC/config.plist

Exported to /tmp/test.json
(base) user@users-MacBook-Pro-M1-2 GenSMBIOS % cat /tmp/test.json
{
    "Type": "iMac18,3",
    "Serial": "C02YL8YJJ1GJ",
    "Board Serial": "C029164054NJ0PGJA",
    "SmUUID": "D74CF4E7-536D-43C2-9FAE-A23D26661530",
    "ROM": "24240E5554D7"
}
```
Now if it is started with a --plist and one specified, it will load the menu with the plist already loaded.

Shorter options make less typing.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant