Skip to content

feat(quickget): integrate OpenCore into macOS disk image by default#1811

Merged
flexiondotorg merged 4 commits intomasterfrom
opencore
Jan 24, 2026
Merged

feat(quickget): integrate OpenCore into macOS disk image by default#1811
flexiondotorg merged 4 commits intomasterfrom
opencore

Conversation

@flexiondotorg
Copy link
Member

Create macOS VMs with OpenCore embedded in the EFI partition of disk.qcow2 instead of using a separate OpenCore.qcow2 file. This simplifies VM management by reducing from two disk images to one.

Implementation:

  • Add create_macos_disk_with_opencore() using mtools/sgdisk for cross-platform EFI partition creation without mounting or root privileges
  • Add download_opencore() to extract OpenCore files from OSX-KVM image
  • Use LC_ALL='' with mcopy to prevent FAT directory name mangling
  • Adjust disk size threshold for macOS integrated mode (1GB vs 1.5MB)

Backwards compatibility:

  • If OpenCore.qcow2 exists, use legacy two-disk boot method
  • If mtools/sgdisk unavailable, fall back to legacy method automatically

New dependencies: mtools, gptfdisk (added to devshell.nix and package.nix)

Closes #1720

Type of change

  • New feature (non-breaking change which adds functionality)
  • Packaging (updates the packaging)
  • Documentation (updates the documentation)

Checklist:

  • I have performed a self-review of my code
  • I have tested my code in common scenarios and confirmed there are no regressions
  • I have added comments to my code, particularly in hard-to-understand sections
  • I have made corresponding changes to the documentation (remove if no documentation changes were required)

Create macOS VMs with OpenCore embedded in the EFI partition of disk.qcow2
instead of using a separate OpenCore.qcow2 file. This simplifies VM management
by reducing from two disk images to one.

Implementation:
- Add create_macos_disk_with_opencore() using mtools/sgdisk for cross-platform
  EFI partition creation without mounting or root privileges
- Add download_opencore() to extract OpenCore files from OSX-KVM image
- Use LC_ALL='' with mcopy to prevent FAT directory name mangling
- Adjust disk size threshold for macOS integrated mode (1GB vs 1.5MB)

Backwards compatibility:
- If OpenCore.qcow2 exists, use legacy two-disk boot method
- If mtools/sgdisk unavailable, fall back to legacy method automatically

New dependencies: mtools, gptfdisk (added to devshell.nix and package.nix)

Closes #1720
Copy link
Contributor

@cubic-dev-ai cubic-dev-ai bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

3 issues found across 4 files

Confidence score: 3/5

  • There is some regression risk: quickget’s tool check only verifies mcopy/sgdisk, but later require_mtools() needs mformat/mmd, which can cause the script to exit instead of gracefully falling back.
  • Two mcopy invocations in quickget are missing the LC_ALL='' prefix used elsewhere to prevent FAT directory name mangling, so filenames could be altered unexpectedly.
  • Pay close attention to quickget - ensure all required mtools are checked up front and LC_ALL is set consistently for mcopy.
Prompt for AI agents (all issues)

Check if these issues are valid — if so, understand the root cause of each and fix them.


<file name="quickget">

<violation number="1" location="quickget:307">
P2: Missing `LC_ALL=''` prefix. The `download_opencore()` function uses `LC_ALL=''` with mcopy to prevent FAT directory name mangling (as noted in the comment at line 377), but this mcopy command lacks it. For consistency and to prevent potential name mangling issues, add `LC_ALL=''` here as well.</violation>

<violation number="2" location="quickget:314">
P2: Missing `LC_ALL=''` prefix on this mcopy command as well, for consistency with `download_opencore()` which uses it to prevent FAT directory name mangling.</violation>

<violation number="3" location="quickget:2303">
P1: Incomplete tool check breaks graceful fallback. This check only verifies `mcopy` and `sgdisk`, but `require_mtools()` (called later) also requires `mformat` and `mmd`. If those are missing, the script will exit instead of falling back to the legacy OpenCore.qcow2 method.</violation>
</file>

Reply with feedback, questions, or to request a fix. Tag @cubic-dev-ai to re-run a review.

flexiondotorg and others added 3 commits January 24, 2026 12:38
Co-authored-by: cubic-dev-ai[bot] <191113872+cubic-dev-ai[bot]@users.noreply.github.com>
Co-authored-by: cubic-dev-ai[bot] <191113872+cubic-dev-ai[bot]@users.noreply.github.com>
Co-authored-by: cubic-dev-ai[bot] <191113872+cubic-dev-ai[bot]@users.noreply.github.com>
@flexiondotorg flexiondotorg merged commit 7668519 into master Jan 24, 2026
93 of 94 checks passed
@flexiondotorg flexiondotorg deleted the opencore branch January 24, 2026 12:42
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.

feat: add option to not insert OpenCore boot disk on macOs

1 participant