refactor: Shift to gibMacOS installer workflow, update Linux USB writer
This commit marks a significant architectural change, moving away from
the Docker-OSX VM based approach to a macOS installer creation method
leveraging `corpnewt/gibMacOS` for downloading official macOS assets.
Key changes in this submission:
1. **Core Workflow Change (`main_app.py`):**
* I removed Docker-dependent UI and associated logic.
* I introduced new logic to manage downloading macOS installer assets
using `gibMacOS.py` (assumed to be present in a `./scripts` subdirectory or PATH).
* The UI flow is now:
* Step 1: Download macOS Installer Assets.
* Step 2: Create Bootable USB Installer (using platform-specific writers).
* The USB writing process now expects `macos_download_path` (where
`gibMacOS` saves files) instead of qcow2 image paths.
* Application version in "About" dialog updated to reflect major change.
2. **Refactored `usb_writer_linux.py` for Installer Creation:**
* `__init__` updated to accept `macos_download_path`.
* The `format_and_write` method was substantially rewritten to:
* Partition USB (EFI FAT32, Main HFS+).
* Implement `_find_gibmacos_asset` and `_get_gibmacos_product_folder`
to locate key files (BaseSystem.dmg, InstallAssistant.pkg, etc.)
within the `gibMacOS` download structure.
* Implement `_extract_hfs_from_dmg_or_pkg` to extract the
bootable BaseSystem HFS image from downloaded DMGs/PKGs.
* Write the extracted BaseSystem HFS image to the main USB HFS+
partition.
* Copy essential installer support files (`BaseSystem.dmg`,
`BaseSystem.chunklist`, `InstallInfo.plist`, and the main installer
PKG like `InstallAssistant.pkg`) to standard locations on the USB's
HFS+ partition to make it a more complete installer.
* Set up an OpenCore EFI on the USB's ESP by copying from a
`EFI_template_installer` directory and conditionally calling
`plist_modifier.enhance_config_plist` on its `config.plist`.
* Updated dependency checks (added `7z`, `sgdisk`; removed `qemu-img`, `kpartx`
as direct dependencies for this script's new role).
3. **Created `EFI_template_installer` Directory:**
* Established a basic directory structure for a minimal OpenCore EFI
(EFI/BOOT/BOOTx64.efi, EFI/OC/*, config-template.plist, and placeholder
files for common drivers, kexts, ACPI). This template is used by
`usb_writer_linux.py`.
**Note:**
* `usb_writer_macos.py` and `usb_writer_windows.py` have **not yet** been
refactored for this new installer-based workflow and will require
significant updates in subsequent steps.
* The logic for copying *all* necessary files to make a fully complete
macOS installer partition in `usb_writer_linux.py` (beyond BaseSystem
and key packages) is still a work-in-progress and will need further
refinement based on macOS installer structure research.
This commit lays the foundation for the new installer-centric approach as per
your recent feedback.
This commit is contained in:
parent
e9ffd575ca
commit
b26a68956c