Skip to content

Commit

Permalink
OCE Build Rewrite (#48)
Browse files Browse the repository at this point in the history
* Upgrade config to new schema

* Refactor build scripts, CI workflows

* Vendor base configuration, cleanup build spec

* Docs: Sync CHANGELOG

* Docs: Update README instructions, sync contributors

* Docs: Cleanup README badges, fix minor formatting inconsistencies

* Docs: Fix !NOTE formatting in README
  • Loading branch information
Qonfused authored Dec 6, 2023
1 parent 10b9e1b commit 156c20f
Show file tree
Hide file tree
Showing 17 changed files with 566 additions and 407 deletions.
5 changes: 0 additions & 5 deletions .devcontainer/devcontainer.json
Original file line number Diff line number Diff line change
@@ -1,11 +1,6 @@
{
"name": "main-devcontainer",
"image": "mcr.microsoft.com/devcontainers/base:ubuntu",
"features": {
"ghcr.io/rocker-org/devcontainer-features/apt-packages:1": {
"packages": "curl,libarchive-tools,acpica-tools"
}
},
"customizations": {
"vscode": {
"extensions": [
Expand Down
1 change: 1 addition & 0 deletions .env-example
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
GITHUB_TOKEN=
8 changes: 2 additions & 6 deletions .github/scripts/run-builds.sh
Original file line number Diff line number Diff line change
Expand Up @@ -9,17 +9,13 @@
# Change CWD for imports
__PWD__=$(pwd); cd "$(realpath "$(dirname "${BASH_SOURCE[0]}")/../../")"

source ./scripts/lib/constants.sh
source ./scripts/lib/oce-build/lib/macros.sh


while read -r BUILD; do
# Set build type in config to target build version
REPLACE="$(sed "s/oce-build: [A-Z]*/oce-build: $BUILD/" src/build.yml)"
REPLACE="$(sed "s/build: [A-Z]*/build: $BUILD/" src/build.yml)"
echo "$REPLACE" > src/build.yml
# Run build script
echo "Building \"EFI-$TAG-$BUILD.zip\"..."
bash scripts/lib/oce-build/build.sh -c "$CONFIG"
bash scripts/build.sh -v
# Compress EFI directory
(cd dist && zip -r -X "../EFI-$TAG-$BUILD.zip" EFI >/dev/null)
done <<< $'RELEASE\nDEBUG'
8 changes: 1 addition & 7 deletions .github/workflows/analyze.yml
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,6 @@ on:
paths:
- '!.github/**'
- '!docs/**'
- '!.gitmodules'
- '!.gitattributes'
- '!.gitignore'
- 'scripts/**'
Expand All @@ -29,15 +28,10 @@ jobs:
#
# The default behavior of @actions/checkout outputs many noisy lines of
# status output in the workflow log, which is problematic for log size.
#
# Refer to the below PR for updates on this issue:
# - https://github.com/actions/checkout/pull/1067
- name: Checkout latest repository commit
# uses: actions/checkout@v3
uses: simonbaird/checkout@no-progress-option
uses: actions/checkout@v4
with:
show-progress: false
submodules: recursive
# Installs shellcheck dependency.
- name: Install Shellcheck dependencies
shell: bash
Expand Down
32 changes: 8 additions & 24 deletions .github/workflows/oce-build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,6 @@ on:
paths:
- '!.github/**'
- '!docs/**'
- '!.gitmodules'
- '!.gitattributes'
- '!.gitignore'
- 'src/**'
Expand All @@ -29,7 +28,7 @@ on:
# Refer to the GitHub docs page for more information on this topic:
# * https://docs.github.com/en/actions/using-jobs/using-concurrency
concurrency:
group: ${{ github.workflow }}-${{ github.event.pull_request.number || github.ref }}
group: ${{ github.workflow }}-${{ github.ref }}
cancel-in-progress: true
jobs:
build:
Expand All @@ -39,40 +38,22 @@ jobs:
outputs:
LOCKFILE_HASH: ${{ steps.prepare-efi.outputs.LOCKFILE_HASH }}
steps:
# Installs dependencies needed for running OCE-Build.
#
# This includes the following required commands:
# - libarchive-tools:
# - **BSDTAR**: Used for unarchiving .zip files.
# - acpica-tools:
# - **iasl**: Required for compiling .dsl files.
- name: Install OCE-Build dependencies
if: runner.os == 'Linux'
run: |
sudo apt install -qq -o=Dpkg::Use-Pty=0 \
libarchive-tools \
acpica-tools
# Fetches remote repository without --progress option.
#
# The default behavior of @actions/checkout outputs many noisy lines of
# status output in the workflow log, which is problematic for log size.
#
# Refer to the below PR for updates on this issue:
# - https://github.com/actions/checkout/pull/1067
- name: Checkout latest repository commit
# uses: actions/checkout@v3
uses: simonbaird/checkout@no-progress-option
uses: actions/checkout@v4
with:
show-progress: false
submodules: recursive
# Runs EFI build pipeline using OCE-Build.
#
# Build **dist** directory containing **dist/EFI** and **dist/scripts**
# Build **dist** directory containing **dist/EFI** and **dist/Utilities**
# folders needed for downstream build tasks.
- id: oce-build
name: Run OCE-Build
shell: sh
run: bash scripts/build.sh --skip-serial
run: bash scripts/build.sh -v
env:
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
# Runs quick validation of config.plist and EFI structure.
Expand All @@ -83,7 +64,10 @@ jobs:
- id: validate-efi
name: Validate OCE-Build output
shell: sh
run: bash scripts/lib/oce-build/scripts/validate-efi.sh -c src/config.yml
run: |
ocvalidate=dist/Utilities/ocvalidate/ocvalidate.linux
chmod +x $ocvalidate
$ocvalidate dist/EFI/OC/config.plist
# Handles compression and lock-hash generation for upload task.
#
# This stores a hash of the output build's lockfile to associate with the
Expand Down
20 changes: 1 addition & 19 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -4,32 +4,14 @@ jobs:
release:
runs-on: ubuntu-latest
steps:
# Installs dependencies needed for running OCE-Build.
#
# This includes the following required commands:
# - libarchive-tools:
# - **BSDTAR**: Used for unarchiving .zip files.
# - acpica-tools:
# - **iasl**: Required for compiling .dsl files.
- name: Install OCE-Build dependencies
if: runner.os == 'Linux'
run: |
sudo apt install -qq -o=Dpkg::Use-Pty=0 \
libarchive-tools \
acpica-tools
# Fetches remote repository without --progress option.
#
# The default behavior of @actions/checkout outputs many noisy lines of
# status output in the workflow log, which is problematic for log size.
#
# Refer to the below PR for updates on this issue:
# - https://github.com/actions/checkout/pull/1067
- name: Checkout latest repository commit
# uses: actions/checkout@v3
uses: simonbaird/checkout@no-progress-option
uses: actions/checkout@v4
with:
show-progress: false
submodules: recursive
# Generate Changelog notes and release info
- id: get-tag
name: Fetches latest release tag
Expand Down
3 changes: 3 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@
!/.devcontainer/
!/.github/
!/.vscode/
!/.env-example
!/.gitattributes
!/.gitignore
!/.gitmodules
Expand All @@ -11,6 +12,8 @@

# Build artifacts
/dist
EFI-*
ocebuild*

# macOS Boot Image
/com.apple.recovery.boot
Expand Down
3 changes: 0 additions & 3 deletions .gitmodules

This file was deleted.

10 changes: 10 additions & 0 deletions docs/CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,16 @@ and this project adheres to [Semantic Versioning](http://semver.org/).

The latest progress can be viewed on this repository's [project board](https://github.com/users/Qonfused/projects/2/views/11).

## [0.6.0] - 2023-12-06

This patch version includes major feature and build system fixes, with some tweaks to post-install scripts.

### Changed
- Modularize analyze workflow ([`1948fcb`](https://github.com/Qonfused/ASUS-ZenBook-Duo-14-UX481-Hackintosh/commit/1948fcb835d185caf379e7aac21999ade04c1cf5))
- Upgraded config to new schema ([`f4b563a`](https://github.com/Qonfused/ASUS-ZenBook-Duo-14-UX481-Hackintosh/commit/f4b563a4284ec93a150787d198511f5218955f12))
- Refactor build scripts, CI workflows ([`845da6a`](https://github.com/Qonfused/ASUS-ZenBook-Duo-14-UX481-Hackintosh/commit/845da6a96097fe242684b3d228f6807e36903cc9))
- Vendor base configuration, cleanup build spec ([`fb0f8aa`](https://github.com/Qonfused/ASUS-ZenBook-Duo-14-UX481-Hackintosh/commit/fb0f8aa916dc7fc7e1a53c52e11281a2265ff2a1))

## [0.5.4] - 2023-05-14

This patch version includes small feature and build system fixes, with some tweaks to post-install scripts.
Expand Down
69 changes: 24 additions & 45 deletions docs/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -13,8 +13,8 @@

<div align="center">

<a href="/LICENSE">![License](https://img.shields.io/badge/⚖_License-BSD_3_Clause-lightblue?labelColor=3f4551)</a>
<a href="/docs/CHANGELOG.md">![SemVer](https://img.shields.io/badge/SemVer-v0.5.4-important?logo=SemVer&labelColor=3f4551)</a>
<a href="/LICENSE">![License](https://img.shields.io/github/license/Qonfused/ASUS-ZenBook-Duo-14-UX481-Hackintosh?label=⚖%20License&labelColor=3f4551&color=9dc4d0)</a>
<a href="/docs/CHANGELOG.md">![SemVer](https://img.shields.io/badge/SemVer-v0.6.0-important?logo=SemVer&labelColor=3f4551)</a>
<a href="">![Supported Models](https://img.shields.io/badge/Supported%20Models-UX481FA%20%7C%20UX481FL-important?labelColor=3f4551)</a>
<a href="https://github.com/acidanthera/OpenCorePkg/releases">![OpenCore](https://img.shields.io/badge/dynamic/yaml?label=OpenCore&logo=Osano&logoColor=0298e1&labelColor=3f4451&prefix=v&query=OpenCorePkg.version&url=https%3A%2F%2Fraw.githubusercontent.com%2FQonfused%2FASUS-ZenBook-Duo-14-UX481-Hackintosh%2Fmain%2Fsrc%2Fbuild.lock)</a>
<a href="https://github.com/Qonfused/ASUS-ZenBook-Duo-14-UX481-Hackintosh/actions/workflows/oce-build.yml">![OCE Build](https://github.com/Qonfused/ASUS-ZenBook-Duo-14-UX481-Hackintosh/actions/workflows/oce-build.yml/badge.svg?branch=main)</a>
Expand All @@ -37,12 +37,12 @@

## ⚙️ Current Progress

> **Note** This repository is still a work in progress.
>
> See this repository's [task board](https://github.com/users/Qonfused/projects/2/views/4) and [issues page](https://github.com/Qonfused/ASUS-ZenBook-Duo-14-UX481-Hackintosh/issues) for current progress.
> Upcoming or planned changes are also tracked on a [roadmap board](https://github.com/users/Qonfused/projects/2/views/9).
>
> Refer to the [CHANGELOG](/docs/CHANGELOG.md) or [SemVer board](https://github.com/users/Qonfused/projects/2/views/11) for changes implemented per release version.
> [!NOTE]
> This repository is still a work in progress.
See this repository's [task board](https://github.com/users/Qonfused/projects/2/views/4) and [issues page](https://github.com/Qonfused/ASUS-ZenBook-Duo-14-UX481-Hackintosh/issues) for current progress. Upcoming or planned changes are also tracked on a [roadmap board](https://github.com/users/Qonfused/projects/2/views/9).

Refer to the [CHANGELOG](/docs/CHANGELOG.md) or [SemVer board](https://github.com/users/Qonfused/projects/2/views/11) for changes implemented per release version.

### macOS Version Support:
<table>
Expand Down Expand Up @@ -177,8 +177,8 @@
</tr>
<tr>
<td>(Physical) Trackpad Buttons</td>
<td style="text-align: center;">🚧</td>
<td>Work in progress (VoodooI2C issue; incorrect button map).</td>
<td style="text-align: center;"></td>
<td>Fully supported.</td>
</tr>
<tr>
<td rowspan=2>Touchscreen<br>(Primary Display)<br>(Screenpad Plus Display)</td>
Expand Down Expand Up @@ -325,54 +325,32 @@

To clone this repository locally with submodules, run the below commands:
```sh
git clone --recurse-submodules https://github.com/Qonfused/ASUS-ZenBook-Duo-14-UX481-Hackintosh
git clone https://github.com/Qonfused/ASUS-ZenBook-Duo-14-UX481-Hackintosh
cd ASUS-ZenBook-Duo-14-UX481-Hackintosh
```

If you've cloned this project without resolving submodules, you'll need to initialize them:
```sh
git submodule init
git submodule update
```

> **Note**: Optionally, you can add git aliases to always resolve submodules:
> ```sh
> git config --global alias.clone-all 'clone --recurse-submodules'
> git config --global alias.pull-all 'pull --recurse-submodules'
> ```
### 2. Build this repository using OCE-Build
> **Note** **OCE-Build** must be run in a Linux or macOS environment.
>
> For Windows users, refer to [aka.ms/wslinstall](aka.ms/wslinstall) and [aka.ms/wsl2](aka.ms/wsl2) for instructions on installing wsl and upgrading to the wsl2 kernel (recommended).
> - You can install a Linux distribution directly from the Microsoft Store (e.g. [Ubuntu 20.04.5 LTS](https://apps.microsoft.com/store/detail/ubuntu-20045-lts/9MTTCL66CPXJ)).
> - Alternatively, you can [setup devcontainers](https://code.visualstudio.com/docs/devcontainers/containers#_installation) with Docker and VSCode to run a containerized Linux environment on top of wsl. The [devcontainer](/.devcontainer/devcontainer.json) for this project will setup and build the project automatically upon container creation.
>
> For Linux users (or wsl), ensure you have the following commands available:
> - **cURL**
> - Check with `curl --version`
> - Install with `sudo apt install curl`
> - **bsdtar**
> - Check with `bsdtar --version`
> - Install with `sudo apt install libarchive-tools`
> - **iasl**
> - Check with `iasl -v`
> - Install with `sudo apt install acpica-tools`

To build this project's EFI, run the below command at the root of the project:
```sh
# Run build pipeline for the UX481FA/FL EFI
bash scripts/build.sh
```

You can also manually download [OCE Build](https://github.com/Qonfused/OCE-Build/releases) and run the `ocebuild build` command from the root of the project.

> [!NOTE]
> For Windows users, running Bash scripts requires a Linux environment (provided by [Cygwin](https://www.cygwin.com/), [MinGW](https://www.mingw-w64.org/), [Git Bash](https://gitforwindows.org/), or [WSL](https://learn.microsoft.com/en-us/windows/wsl/about)).
>
> Refer to [aka.ms/wslinstall](aka.ms/wslinstall) and [aka.ms/wsl2](aka.ms/wsl2) for instructions on installing wsl and upgrading to the wsl2 kernel (recommended).
> - You can install a Linux distribution directly from the Microsoft Store (e.g. [Ubuntu 20.04.5 LTS](https://apps.microsoft.com/store/detail/ubuntu-20045-lts/9MTTCL66CPXJ)).
> - Alternatively, you can [setup devcontainers](https://code.visualstudio.com/docs/devcontainers/containers#_installation) with Docker and VSCode to run a containerized Linux environment on top of wsl. The [devcontainer](/.devcontainer/devcontainer.json) for this project will setup and build the project automatically upon container creation.
### 3. Using this EFI with macOS
Refer to the [Install Guide](https://github.com/Qonfused/ASUS-ZenBook-Duo-14-UX481-Hackintosh/wiki/Install-Guide) and [Post-Install Guide](https://github.com/Qonfused/ASUS-ZenBook-Duo-14-UX481-Hackintosh/wiki/Post-Install-Guide) for installation instructions.

> **Note** To enable **iServices** functionality, please refer to the notice in
> the build-generated **.serialdata** file under the **src/** directory for instructions on validating your
> serial number. This is automatically generated each time you run a new build using the build script as long as no existing **.serialdata** file exists. Remember that you can re-generate this data by running `bash scripts/lib/oce-build/scripts/patch-serial.sh -c src/config.yml` or by removing **.serialdata** and re-running the build script.
>
> You can optionally instead download [GenSMBIOS](https://github.com/corpnewt/GenSMBIOS) follow the [iServices guide](https://dortania.github.io/OpenCore-Post-Install/universal/iservices.html#using-gensmbios) to generate new SMBIOS data for your machine to be applied before running the build script. You'll then need to store your SMBIOS data in a new **.serialdata** file:
> [!NOTE]
> To enable **iServices** functionality, download [GenSMBIOS](https://github.com/corpnewt/GenSMBIOS) follow the [iServices guide](https://dortania.github.io/OpenCore-Post-Install/universal/iservices.html#using-gensmbios) to generate new SMBIOS data for your machine to be applied before running the build script. You'll then need to store your SMBIOS data in a new **.serialdata** file:
> ```yaml
> MLB: String | "M0000000000000001"
> ROM: Data | <112233445566>
Expand All @@ -392,4 +370,5 @@ Refer to [CONTRIBUTING.md](/docs/CONTRIBUTING.md) for instructions (and tips) on
## 🌟 Credits
- [@shiecldk](https://github.com/shiecldk) for their continued contributions and work in the original [Zenbook Pro Duo 15" (UX582) OpenCore configuration and guide](https://github.com/shiecldk/ASUS-ZenBook-Pro-Duo-15-OLED-UX582-Hackintosh) that inspired this project.
- [@UsedDiscord](https://github.com/UsedDiscord) for their contributions and direction helping investigate screenpad and trackpad functionality.
- [@wern-apfel](https://github.com/wern-apfel) for their contribution helping to enable ATKD WMI functionality.
- [@1Revenger](https://github.com/1Revenger1) for their contributions in fixing trackpad buttons and multi-touchscreen inputs in VoodooI2CHID.
- [@wern-apfel](https://github.com/wern-apfel) for their contributions helping to enable ATKD WMI functionality.
11 changes: 2 additions & 9 deletions scripts/build.sh
Original file line number Diff line number Diff line change
Expand Up @@ -11,13 +11,6 @@
# Change CWD for imports
__PWD__=$(pwd); cd "$(realpath "$(dirname "${BASH_SOURCE[0]}")"/../)"

source ./scripts/lib/constants.sh


# Run build script
bash ./scripts/lib/oce-build/build.sh -c "$CONFIG"

# Patch SMBIOS serial data
if printf '%s\n' "$@" | grep -Fxq -- '--skip-serial'; then
echo "Skipping SMBIOS serial generation..."
else bash ./scripts/lib/oce-build/scripts/patch-serial.sh -c "$CONFIG"; fi
curl -sL https://raw.githubusercontent.com/Qonfused/OCE-Build/main/ci/bootstrap.sh \
| bash -s build "$@"
2 changes: 1 addition & 1 deletion scripts/gen-debug.sh → scripts/debug.sh
Original file line number Diff line number Diff line change
Expand Up @@ -71,4 +71,4 @@ run_exec '/usr/sbin/ioreg -lw0 -p IOACPIPlane' > ioreg/IOACPIPlane.txt
run_exec '/usr/sbin/ioreg -rxn IGPU@2' > 'ioreg/devices/[email protected]'


zip -r -X "$__PWD__/debug.zip" $PWD/ > /dev/null 2>&1
zip -r -X "$__PWD__/debug.zip" $PWD/ > /dev/null 2>&1
12 changes: 0 additions & 12 deletions scripts/lib/constants.sh

This file was deleted.

1 change: 0 additions & 1 deletion scripts/lib/oce-build
Submodule oce-build deleted from 175544
Loading

0 comments on commit 156c20f

Please sign in to comment.