Skip to content

Commit dadaa79

Browse files
committed
Add amd.ps1 script
Resolves #53, using ocebuild's `-e/--exec` argument to invoke the remote `amd.py` script.
1 parent 43fe2b0 commit dadaa79

File tree

3 files changed

+22
-8
lines changed

3 files changed

+22
-8
lines changed

docs/README.md

Lines changed: 4 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -519,15 +519,12 @@ You can also manually add the below plist entry to your config.plist:
519519
> and using `08` for the `cpuid_cores_per_package` patch (see [#37](https://github.com/Qonfused/OSX-Hyper-V/issues/37)).
520520
521521
> [!TIP]
522-
> You can use OCE-Build's [`amd.py`](https://github.com/Qonfused/OCE-Build/blob/main/scripts/amd.py) script to automatically generate these AMD
523-
> patches for your CPU.
524-
>
525-
> First [install UV](https://docs.astral.sh/uv/getting-started/installation) (or run `pip install uv` if you have Python 3 installed) and then run the below command:
526-
> ```shell
527-
> uv run https://raw.githubusercontent.com/Qonfused/OCE-Build/refs/heads/main/scripts/amd.py --cpu <core_count> --hyperv --out src/patches.amd.yml
522+
> You can use the `amd.ps1` script to automatically generate these AMD patches for your CPU by running the below command:
523+
> ```powershell
524+
> .\scripts\amd.ps1 --cpu <core_count>
528525
> ```
529526
>
530-
> Notice that this requires the `--cpu` option to be set to the number of cores assigned to the VM (at the end of the command).
527+
> Notice that this requires the `--cpu` option to be set to the number of cores assigned to the VM.
531528
532529
```xml
533530
<?xml version="1.0" encoding="UTF-8"?>

scripts/amd.ps1

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,17 @@
1+
## @file
2+
# AMD CPU patch script for OSX Hyper-V
3+
#
4+
# Copyright (c) 2023-2025, Cory Bennett. All rights reserved.
5+
# SPDX-License-Identifier: BSD-3-Clause
6+
##
7+
8+
[CmdletBinding(PositionalBinding=$false)]
9+
param (
10+
[string]$pwd = "$((Get-Item "$PSScriptRoot\..").FullName)",
11+
# Script arguments
12+
[parameter(ValueFromRemainingArguments)][string[]]$arguments
13+
)
14+
15+
icm `
16+
-ScriptBlock $([Scriptblock]::Create($(iwr 'https://raw.githubusercontent.com/Qonfused/OCE-Build/main/ci/bootstrap.ps1'))) `
17+
-ArgumentList (@("-c $pwd -e https://raw.githubusercontent.com/Qonfused/OCE-Build/refs/heads/main/scripts/amd.py --hyperv --out src/patch.amd.yml $($arguments -join ' ')"))

scripts/build.ps1

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -41,7 +41,7 @@ if ((Test-Path "$pwd\src\patch.amd.yml") -or
4141

4242
icm `
4343
-ScriptBlock $([Scriptblock]::Create($(iwr 'https://raw.githubusercontent.com/Qonfused/OCE-Build/main/ci/bootstrap.ps1'))) `
44-
-ArgumentList (@("build -c $pwd $patches") + $arguments)
44+
-ArgumentList (@("build -c $pwd $patches $($arguments -join ' ')"))
4545

4646
# Run the post-build script
4747
Write-Host "`nRunning post-build script..."

0 commit comments

Comments
 (0)