Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Trouble Building #3

Closed
Lunascaped opened this issue Feb 6, 2024 · 5 comments · Fixed by #4
Closed

Trouble Building #3

Lunascaped opened this issue Feb 6, 2024 · 5 comments · Fixed by #4
Labels
status:done All issue tasks are completed. type:regression To spot regression issues in the latest version workaround available A workaround is available for this bug.

Comments

@Lunascaped
Copy link

Lunascaped commented Feb 6, 2024

Whenever i attempt to build using WSL, the script tries to delete "OSX-Hyper-V/dist/scripts/bin", which doesn't exist. It then tries to execute "./scripts/lib/oce-build/scripts/patch-serial.sh" and fails due a permission error.

I am running "bash scripts/build.sh", I have tried with sudo and without. I am using WSL2 Ubuntu (5.15.146.1-microsoft-standard-WSL2) on Windows 10.

root@Luna:/mnt/c/users/luna/documents/OSX-Hyper-V# bash scripts/build.sh
rm: cannot remove '/mnt/c/users/luna/documents/OSX-Hyper-V/dist/scripts/bin': No such file or directory
./scripts/lib/oce-build/scripts/patch-serial.sh: line 45: /mnt/c/users/luna/documents/OSX-Hyper-V/dist/scripts/macserial/macserial: Permission denied
md5sum: 29157: No such file or directory
 Please verify that the generated serial number is invalid by copying it into
 the Apple Check Coverage page: https://checkcoverage.apple.com/.

 Your generated serial number is shown below:



 You'll want to see an error along the lines of below:

   We're sorry, we're unable to check coverage for this serial number.

 If you see a 'valid purchase date' or 'purchase date not validated' error
 instead, you'll need to re-run this script to generate a new serial number
 and repeat this process.
@Qonfused
Copy link
Owner

Qonfused commented Feb 6, 2024

Not entirely sure what the cause of this issue is, though this appears to fail after the main build process is finished.

The dist/scripts/bin directory being removed is a temporary directory for extracting executables. This is cleaned up along with a few other directories (which it appears to do successfully). This behavior is odd but safe to ignore for now.

The permission error is caused from the 'patch-serial' script trying to call macserial without the executable permissions set. You'll want to double check that the macserial folder exists under the dist/scripts directory:

  • ls ./dist/scripts/macserial/macserial

If it exists, you may need to manually set executable permissions and re-run the patch-serial script:

  • chmod +x dist/scripts/macserial/macserial
  • bash scripts/lib/oce-build/scripts/patch-serial.sh

Otherwise, there isn't anything actionable in the main build process, though you can always check if there are any errors logged with bash scripts/test.sh.

@Lunascaped
Copy link
Author

Yeah I tried patching mac serial with +x and it just exited with no output after. I'm not home at the moment so I'll try again and tell you the output.

@riverfog7
Copy link

riverfog7 commented Feb 25, 2024

I had the same issue

++ pwd
+ __PWD__=/home/riverfog7/OSX-Hyper-V
+++ dirname scripts/build.sh
++ realpath scripts/../
+ cd /home/riverfog7/OSX-Hyper-V
+ source ./scripts/lib/constants.sh
++ export CONFIG=./src/build.yml
++ CONFIG=./src/build.yml
++ export SERIAL=./src/.serialdata
++ SERIAL=./src/.serialdata
+ bash ./scripts/lib/oce-build/build.sh -c ./src/build.yml
rm: cannot remove '/home/riverfog7/OSX-Hyper-V/dist/scripts/bin': No such file or directory
+ printf '%s\n'
+ grep -Fxq -- --skip-serial
+ bash ./scripts/lib/oce-build/scripts/patch-serial.sh -c ./src/build.yml
++ realpath ./scripts/lib/oce-build
+ pushd /home/riverfog7/OSX-Hyper-V/scripts/lib/oce-build
++ realpath /home/riverfog7/OSX-Hyper-V/./src/build.yml
+ CONFIG=/home/riverfog7/OSX-Hyper-V/src/build.yml
+ source ./lib/config.sh
++ source ./bin/yq/imports.sh
+++ case "$OSTYPE" in
+++ yq_bin=yq_linux_amd64
++++ realpath ./bin/yq/yq_linux_amd64
+++ export yq=/home/riverfog7/OSX-Hyper-V/scripts/lib/oce-build/bin/yq/yq_linux_amd64
+++ yq=/home/riverfog7/OSX-Hyper-V/scripts/lib/oce-build/bin/yq/yq_linux_amd64
++ source ./lib/macros.sh
+ source ./lib/constants.sh
++ source ./lib/config.sh
+++ source ./bin/yq/imports.sh
++++ case "$OSTYPE" in
++++ yq_bin=yq_linux_amd64
+++++ realpath ./bin/yq/yq_linux_amd64
++++ export yq=/home/riverfog7/OSX-Hyper-V/scripts/lib/oce-build/bin/yq/yq_linux_amd64
++++ yq=/home/riverfog7/OSX-Hyper-V/scripts/lib/oce-build/bin/yq/yq_linux_amd64
+++ source ./lib/macros.sh
+++ cfg '"oc-version"' latest
++++ cat /home/riverfog7/OSX-Hyper-V/src/build.yml
++++ sed 's/".":/"wildcard":/'
+++ src='---
oc-version: latest
oc-build: DEBUG
---
include:
  "wildcard":
  - ".contentVisibility"
  acpi:
    SSDT-HV-DEV-WS2022: "ACPI/SSDT-HV-DEV-WS2022.dsl"
    SSDT-HV-DEV: "ACPI/SSDT-HV-DEV.dsl"
    SSDT-HV-VMBUS: "ACPI/SSDT-HV-VMBUS.dsl"
    # This SSDT must be loaded after SSDT-HV-DEV
    SSDT-HV-PLUG: "ACPI/SSDT-HV-PLUG.dsl"
  drivers:
  - HfsPlus
  - OpenCanopy
  - OpenRuntime
  - ResetNvramEntry
  kexts:
    Lilu: latest
    VirtualSMC: latest
    # Core Hyper-V support kext for macOS 12.0 and newer.
    MacHyperVSupportMonterey:
      specifier: "*"
      MinKernel: "21.0.0"
    # Core Hyper-V support kext for macOS 10.4 to 11.0.
    MacHyperVSupport:
      specifier: "latest"
      MaxKernel: "20.9.9"
  tools:
  - OpenShell
exclude:
  "wildcard":
  - ".contentFlavour"'
++++ sed '1{/^---$/!q;};1,/^---$/d'
++++ /home/riverfog7/OSX-Hyper-V/scripts/lib/oce-build/bin/yq/yq_linux_amd64 '."oc-version"'
+++ output=null
+++ [[ -z null ]]
+++ [[ null == \n\u\l\l ]]
++++ /home/riverfog7/OSX-Hyper-V/scripts/lib/oce-build/bin/yq/yq_linux_amd64 --front-matter=extract '."oc-version"'
+++ output=latest
+++ [[ latest != \n\u\l\l ]]
+++ echo latest
++ export OC_VERSION=latest
++ OC_VERSION=latest
+++ cfg '"oc-build"' DEBUG
++++ cat /home/riverfog7/OSX-Hyper-V/src/build.yml
++++ sed 's/".":/"wildcard":/'
+++ src='---
oc-version: latest
oc-build: DEBUG
---
include:
  "wildcard":
  - ".contentVisibility"
  acpi:
    SSDT-HV-DEV-WS2022: "ACPI/SSDT-HV-DEV-WS2022.dsl"
    SSDT-HV-DEV: "ACPI/SSDT-HV-DEV.dsl"
    SSDT-HV-VMBUS: "ACPI/SSDT-HV-VMBUS.dsl"
    # This SSDT must be loaded after SSDT-HV-DEV
    SSDT-HV-PLUG: "ACPI/SSDT-HV-PLUG.dsl"
  drivers:
  - HfsPlus
  - OpenCanopy
  - OpenRuntime
  - ResetNvramEntry
  kexts:
    Lilu: latest
    VirtualSMC: latest
    # Core Hyper-V support kext for macOS 12.0 and newer.
    MacHyperVSupportMonterey:
      specifier: "*"
      MinKernel: "21.0.0"
    # Core Hyper-V support kext for macOS 10.4 to 11.0.
    MacHyperVSupport:
      specifier: "latest"
      MaxKernel: "20.9.9"
  tools:
  - OpenShell
exclude:
  "wildcard":
  - ".contentFlavour"'
++++ sed '1{/^---$/!q;};1,/^---$/d'
++++ /home/riverfog7/OSX-Hyper-V/scripts/lib/oce-build/bin/yq/yq_linux_amd64 '."oc-build"'
+++ output=null
+++ [[ -z null ]]
+++ [[ null == \n\u\l\l ]]
++++ /home/riverfog7/OSX-Hyper-V/scripts/lib/oce-build/bin/yq/yq_linux_amd64 --front-matter=extract '."oc-build"'
+++ output=DEBUG
+++ [[ DEBUG != \n\u\l\l ]]
+++ echo DEBUG
++ export OC_BUILD=DEBUG
++ OC_BUILD=DEBUG
+++ cfg '"oc-commit"'
++++ cat /home/riverfog7/OSX-Hyper-V/src/build.yml
++++ sed 's/".":/"wildcard":/'
+++ src='---
oc-version: latest
oc-build: DEBUG
---
include:
  "wildcard":
  - ".contentVisibility"
  acpi:
    SSDT-HV-DEV-WS2022: "ACPI/SSDT-HV-DEV-WS2022.dsl"
    SSDT-HV-DEV: "ACPI/SSDT-HV-DEV.dsl"
    SSDT-HV-VMBUS: "ACPI/SSDT-HV-VMBUS.dsl"
    # This SSDT must be loaded after SSDT-HV-DEV
    SSDT-HV-PLUG: "ACPI/SSDT-HV-PLUG.dsl"
  drivers:
  - HfsPlus
  - OpenCanopy
  - OpenRuntime
  - ResetNvramEntry
  kexts:
    Lilu: latest
    VirtualSMC: latest
    # Core Hyper-V support kext for macOS 12.0 and newer.
    MacHyperVSupportMonterey:
      specifier: "*"
      MinKernel: "21.0.0"
    # Core Hyper-V support kext for macOS 10.4 to 11.0.
    MacHyperVSupport:
      specifier: "latest"
      MaxKernel: "20.9.9"
  tools:
  - OpenShell
exclude:
  "wildcard":
  - ".contentFlavour"'
++++ sed '1{/^---$/!q;};1,/^---$/d'
++++ /home/riverfog7/OSX-Hyper-V/scripts/lib/oce-build/bin/yq/yq_linux_amd64 '."oc-commit"'
+++ output=null
+++ [[ -z null ]]
+++ [[ null == \n\u\l\l ]]
++++ /home/riverfog7/OSX-Hyper-V/scripts/lib/oce-build/bin/yq/yq_linux_amd64 --front-matter=extract '."oc-commit"'
+++ output=null
+++ [[ null != \n\u\l\l ]]
+++ echo ''
++ export OC_COMMIT=
++ OC_COMMIT=
+++ cfg build_dir ./dist
++++ cat /home/riverfog7/OSX-Hyper-V/src/build.yml
++++ sed 's/".":/"wildcard":/'
+++ src='---
oc-version: latest
oc-build: DEBUG
---
include:
  "wildcard":
  - ".contentVisibility"
  acpi:
    SSDT-HV-DEV-WS2022: "ACPI/SSDT-HV-DEV-WS2022.dsl"
    SSDT-HV-DEV: "ACPI/SSDT-HV-DEV.dsl"
    SSDT-HV-VMBUS: "ACPI/SSDT-HV-VMBUS.dsl"
    # This SSDT must be loaded after SSDT-HV-DEV
    SSDT-HV-PLUG: "ACPI/SSDT-HV-PLUG.dsl"
  drivers:
  - HfsPlus
  - OpenCanopy
  - OpenRuntime
  - ResetNvramEntry
  kexts:
    Lilu: latest
    VirtualSMC: latest
    # Core Hyper-V support kext for macOS 12.0 and newer.
    MacHyperVSupportMonterey:
      specifier: "*"
      MinKernel: "21.0.0"
    # Core Hyper-V support kext for macOS 10.4 to 11.0.
    MacHyperVSupport:
      specifier: "latest"
      MaxKernel: "20.9.9"
  tools:
  - OpenShell
exclude:
  "wildcard":
  - ".contentFlavour"'
++++ sed '1{/^---$/!q;};1,/^---$/d'
++++ /home/riverfog7/OSX-Hyper-V/scripts/lib/oce-build/bin/yq/yq_linux_amd64 .build_dir
+++ output=null
+++ [[ -z null ]]
+++ [[ null == \n\u\l\l ]]
++++ /home/riverfog7/OSX-Hyper-V/scripts/lib/oce-build/bin/yq/yq_linux_amd64 --front-matter=extract .build_dir
+++ output=null
+++ [[ null != \n\u\l\l ]]
+++ echo ./dist
++ export BUILD_DIR=./dist
++ BUILD_DIR=./dist
++ export BUILD_DIR=/home/riverfog7/OSX-Hyper-V/dist
++ BUILD_DIR=/home/riverfog7/OSX-Hyper-V/dist
++ export OC_PKG_URL=https://github.com/acidanthera/OpenCorePkg/
++ OC_PKG_URL=https://github.com/acidanthera/OpenCorePkg/
++ export OC_BIN_URL=https://github.com/acidanthera/OcBinaryData/
++ OC_BIN_URL=https://github.com/acidanthera/OcBinaryData/
++ export DORTANIA_BUILD_URL=https://github.com/dortania/build-repo/releases/download
++ DORTANIA_BUILD_URL=https://github.com/dortania/build-repo/releases/download
++ export DORTANIA_BUILD_CATALOG=https://raw.githubusercontent.com/dortania/build-repo/builds/config.json
++ DORTANIA_BUILD_CATALOG=https://raw.githubusercontent.com/dortania/build-repo/builds/config.json
++ export GENSMBIOS_URL=https://github.com/corpnewt/GenSMBIOS
++ GENSMBIOS_URL=https://github.com/corpnewt/GenSMBIOS
++ export MACIASL_URL=https://github.com/acidanthera/MaciASL/
++ MACIASL_URL=https://github.com/acidanthera/MaciASL/
++ export EFI_DIR=/home/riverfog7/OSX-Hyper-V/dist/EFI
++ EFI_DIR=/home/riverfog7/OSX-Hyper-V/dist/EFI
++ export ACPI_DIR=/home/riverfog7/OSX-Hyper-V/dist/EFI/OC/ACPI
++ ACPI_DIR=/home/riverfog7/OSX-Hyper-V/dist/EFI/OC/ACPI
++ export KEXTS_DIR=/home/riverfog7/OSX-Hyper-V/dist/EFI/OC/Kexts
++ KEXTS_DIR=/home/riverfog7/OSX-Hyper-V/dist/EFI/OC/Kexts
++ export SCR_DIR=/home/riverfog7/OSX-Hyper-V/dist/scripts
++ SCR_DIR=/home/riverfog7/OSX-Hyper-V/dist/scripts
++ export LOCKFILE=./build.lock
++ LOCKFILE=./build.lock
++ OCVALIDATE=/home/riverfog7/OSX-Hyper-V/dist/scripts/ocvalidate/ocvalidate
++ MACSERIAL=/home/riverfog7/OSX-Hyper-V/dist/scripts/macserial/macserial
++ [[ linux-gnu != \d\a\r\w\i\n* ]]
++ OCVALIDATE+=.linux
++ MACSERIAL+=.linux
++ export OCVALIDATE
++ export MACSERIAL
++ IASL=/home/riverfog7/OSX-Hyper-V/dist/scripts/bin/iasl-stable
++ [[ linux-gnu != \d\a\r\w\i\n* ]]
+++ type -p iasl
++ IASL=/usr/bin/iasl
++ export IASL
+ mkdir -p /home/riverfog7/OSX-Hyper-V/dist/tools
+ cp ../convert-efi-disk.ps1 /home/riverfog7/OSX-Hyper-V/dist/scripts/convert-efi-disk.ps1
+ cp ../create-macos-recovery.ps1 /home/riverfog7/OSX-Hyper-V/dist/scripts/create-macos-recovery.ps1
+ cp ../create-virtual-machine.ps1 /home/riverfog7/OSX-Hyper-V/dist/scripts/create-virtual-machine.ps1
+ cp ../optimize-vm.sh /home/riverfog7/OSX-Hyper-V/dist/tools/optimize-vm.sh
+ LOCKFILE=/home/riverfog7/OSX-Hyper-V/src/build.lock
+ pkg=/home/riverfog7/OSX-Hyper-V/dist/.temp/@acidanthera/MacHyperVSupport
++ /home/riverfog7/OSX-Hyper-V/scripts/lib/oce-build/bin/yq/yq_linux_amd64 .MacHyperVSupport.url /home/riverfog7/OSX-Hyper-V/src/build.lock
+ url=https://github.com/dortania/build-repo/releases/download/MacHyperVSupport-e987ee2/MacHyperVSupport-0.9.8-DEBUG.zip
+ mkdir -p /home/riverfog7/OSX-Hyper-V/dist/.temp/@acidanthera/MacHyperVSupport
+ curl -sL https://github.com/dortania/build-repo/releases/download/MacHyperVSupport-e987ee2/MacHyperVSupport-0.9.8-DEBUG.zip
+ bsdtar -xvf- -C /home/riverfog7/OSX-Hyper-V/dist/.temp/@acidanthera/MacHyperVSupport
+ cp -a /home/riverfog7/OSX-Hyper-V/dist/.temp/@acidanthera/MacHyperVSupport/Tools/. /home/riverfog7/OSX-Hyper-V/dist/tools/daemons
+ find /home/riverfog7/OSX-Hyper-V/dist/tools/daemons -maxdepth 1 -type f
+ read -r f
+ daemon=hvshutdownd
+ /home/riverfog7/OSX-Hyper-V/scripts/lib/oce-build/bin/yq/yq_linux_amd64 -i e '.MacHyperVSupport.bundled
    ."hvshutdownd" = { "extract": "./Tools/hvshutdownd", "type": "binary" }' /home/riverfog7/OSX-Hyper-V/src/build.lock
+ read -r f
+ daemon=hvfilecopyd
+ /home/riverfog7/OSX-Hyper-V/scripts/lib/oce-build/bin/yq/yq_linux_amd64 -i e '.MacHyperVSupport.bundled
    ."hvfilecopyd" = { "extract": "./Tools/hvfilecopyd", "type": "binary" }' /home/riverfog7/OSX-Hyper-V/src/build.lock
+ read -r f
+ daemon=hvtimesyncd
+ /home/riverfog7/OSX-Hyper-V/scripts/lib/oce-build/bin/yq/yq_linux_amd64 -i e '.MacHyperVSupport.bundled
    ."hvtimesyncd" = { "extract": "./Tools/hvtimesyncd", "type": "binary" }' /home/riverfog7/OSX-Hyper-V/src/build.lock
+ read -r f
+ rm -r /home/riverfog7/OSX-Hyper-V/dist/.temp
+ popd

Maybe something in ./scripts/lib/oce-build/build.sh is wrong

+ bash ./scripts/lib/oce-build/build.sh -c ./src/build.yml
rm: cannot remove '/home/riverfog7/OSX-Hyper-V/dist/scripts/bin': No such file or directory

@Qonfused
Copy link
Owner

The dist/scripts/bin folder is being disposed of earlier in the build process, which isn't affecting the build (thankfully) but is affecting cleanup.

The dist/scripts/bin directory being removed is a temporary directory for extracting executables. This is cleaned up along with a few other directories (which it appears to do successfully). This behavior is odd but safe to ignore for now.

For now, you can comment out the last line of the build.sh script under scripts/lib/oce-build:

scripts/lib/oce-build/build.sh

  351 | ################################################################################
  352 | #                                 Post-build                                   #
  353 | ################################################################################
  354 | 
  355 | # Cleanup temp resources folder
  356 | rm -r "$BUILD_DIR"/.temp
  357 | rm -r "$BUILD_DIR"/.patches
+ 358 | rm -r "${SCR_DIR:?}"/bin
- 358 | # rm -r "${SCR_DIR:?}"/bin

@Qonfused
Copy link
Owner

There is also a new build system being worked on in #4 that may be better to use in case of any other issues.

@Qonfused Qonfused added status:investigating Issue is currently being investigated. type:regression To spot regression issues in the latest version workaround available A workaround is available for this bug. labels Feb 25, 2024
@Qonfused Qonfused linked a pull request Feb 26, 2024 that will close this issue
@Qonfused Qonfused added status:in-progress Implementation is in progress. and removed status:investigating Issue is currently being investigated. labels Feb 26, 2024
@Qonfused Qonfused added status:done All issue tasks are completed. and removed status:in-progress Implementation is in progress. labels Jun 4, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
status:done All issue tasks are completed. type:regression To spot regression issues in the latest version workaround available A workaround is available for this bug.
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants