Skip to content

Conversation

@jaminmc
Copy link

@jaminmc jaminmc commented Jul 23, 2025

When launching the GenSMBIO.command or .bat, It now checks for python 3, and prompts to install if needed. It also creates a .venv to not cause any problems with the rest of the system.

Modenized the code to Python 3. No more python 2. Python 2 was sunseted over 5 years ago.

Now run in GUI by default, but can still use text interface with a --tui, or if tkinter is not installed. like in a linux terminal.

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"
}
```
When launching the GenSMBIO.command or .bat, It now checks for python 3, and prompts to install if needed. It also creates a .venv to not cause any problems with the rest of the system.

Modenized the code to Python 3. No more python 2. Python 2 was sunseted over 5 years ago.

Now wuns in gui by default, but can still use text interface with a --tui, or is tkinter is not installed. like in a linux terminal.
@corpnewt
Copy link
Owner

Hey there - I don't really see much need for a GUI for this tool - I also have preserved py2 support on purpose, as many use legacy OS versions that are not able to leverage py3.

I can review some of the CLI stuffs - but at that point, why not just use macserial directly? The original purpose for this script was to implement a TUI that made some of the nuances of generating the SMBIOS and adding that info to the config.plist easier.

-CorpNewt

@jaminmc
Copy link
Author

jaminmc commented Jul 25, 2025

I see, I mainly created the cli commands so that I could easily script the modifing of the SMBIOS for OpenCore config's in the https://github.com/luchina-gabriel/OSX-PROXMOX project.

Then I got carried away and though that a GUI would be cool for easily making it to be able to change the SMBIOS for Clover or OpenCore. The macserial does not generate the other sections that your script does to make it more complete for the plist configurations.

I also didn't realize that the Python 2 was still needed.

If the GUI is kept, using py2app could create a standalone Mac app that would work no matter what version of python is installed, as it will bundle whatever is needed.

I created a new CLI pull request. The only code that was changed was the CLI, and some code reformatting. But your code is unmodified with exception of the formatting.

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.

2 participants