Skip to content

New mkbootimg arg

New mkbootimg arg #41

Workflow file for this run

name: patch-boot
on:
push:
workflow_dispatch:
jobs:
build-uefi-secureboot:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: actions/checkout@v4
with:
repository: map220v/MU-sm8150pkg
ref: nabu-secureboot
path: MU
- name: Build UEFI (SB)
run: |
cd MU
git config --global user.name 'github-actions[bot]'
git config --global user.email 'github-actions[bot]@users.noreply.github.com'
git submodule update --init MU_BASECORE
sed -i 's/Zeex/wyrover/g' MU_BASECORE/.gitmodules
git submodule update --init --recursive
docker build -t mu:v1 .
docker run -v $(pwd):/build/ mu:v1 ./build_uefi.py -d xiaomi-nabu
find . -type f -name 'SM8150_EFI.fd' -exec cp '{}' ../SM8150_EFI_SB.fd ';'
find . -type f -name 'xiaomi-nabu.img' -exec cp '{}' ../uefi_secureboot.img ';'
- uses: actions/upload-artifact@v4
with:
name: SM8150_EFI_SB.fd
path: |
SM8150_EFI_SB.fd
- uses: actions/upload-artifact@v4
with:
name: uefi_secureboot.img
path: |
uefi_secureboot.img
build-uefi-no-secureboot:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: actions/checkout@v4
with:
repository: map220v/MU-sm8150pkg
ref: nabu-secureboot
path: MU
- name: Build UEFI (NOSB)
run: |
cd MU
git config --global user.name 'github-actions[bot]'
git config --global user.email 'github-actions[bot]@users.noreply.github.com'
git submodule update --init MU_BASECORE
sed -i 's/Zeex/wyrover/g' MU_BASECORE/.gitmodules
git submodule update --init --recursive
git am ../0001-Revert-Enable-Secure-Boot.patch
docker build -t mu:v1 .
docker run -v $(pwd):/build/ mu:v1 ./build_uefi.py -d xiaomi-nabu
find . -type f -name 'SM8150_EFI.fd' -exec cp '{}' ../SM8150_EFI_NOSB.fd ';'
find . -type f -name 'xiaomi-nabu.img' -exec cp '{}' ../uefi_no_secureboot.img ';'
- uses: actions/upload-artifact@v4
with:
name: SM8150_EFI_NOSB.fd
path: |
SM8150_EFI_NOSB.fd
- uses: actions/upload-artifact@v4
with:
name: uefi_no_secureboot.img
path: |
uefi_no_secureboot.img
patch:
needs: [build-uefi-secureboot,build-uefi-no-secureboot]
strategy:
matrix:
uefi-type: [SB, NOSB]
name: [Xiaomi_HyperOS_Global_1.0.6.0, Xiaomi_HyperOS_Europe_1.0.6.0, Xiaomi_HyperOS_India_1.0.9.0, Xiaomi_HyperOS_China_1.0.3.0]
include:
- name: Xiaomi_HyperOS_Global_1.0.6.0
url: https://cdnorg.d.miui.com/OS1.0.6.0.TKXMIXM/nabu_global_images_OS1.0.6.0.TKXMIXM_20240914.0000.00_13.0_global_3693ddb728.tgz
- name: Xiaomi_HyperOS_Europe_1.0.6.0
url: https://cdnorg.d.miui.com/OS1.0.6.0.TKXEUXM/nabu_eea_global_images_OS1.0.6.0.TKXEUXM_20240914.0000.00_13.0_eea_dd27c36677.tgz
- name: Xiaomi_HyperOS_India_1.0.9.0
url: https://cdnorg.d.miui.com/OS1.0.9.0.TKXINXM/nabu_in_global_images_OS1.0.9.0.TKXINXM_20240914.0000.00_13.0_in_6851e32a0e.tgz
- name: Xiaomi_HyperOS_China_1.0.3.0
url: https://cdnorg.d.miui.com/OS1.0.3.0.TKXCNXM/nabu_images_OS1.0.3.0.TKXCNXM_20240516.0000.00_13.0_cn_ff15a7adfc.tgz
runs-on: ubuntu-latest
steps:
- id: time
uses: boredland/[email protected]
with:
format: 'YYYYMMDD'
- uses: actions/checkout@v4
- uses: actions/download-artifact@v4
with:
name: SM8150_EFI_${{ matrix.uefi-type }}.fd
- name: Setup tools
run: |
wget -nv "https://github.com/WOA-Project/mu_andromeda_platforms/raw/main/ImageResources/mkbootimg.py"
wget -nv "https://github.com/WOA-Project/SurfaceDuo-Guides/raw/main/Files/unpack_bootimg.py"
wget -nv "https://github.com/woa-msmnile/DualBootKernelPatcher/releases/download/v1.2.0.0/DualBootKernelPatcher-Linux-x64.zip"
unzip DualBootKernelPatcher-Linux-x64.zip
wget -nv "https://github.com/woa-msmnile/DualBootKernelPatcher/releases/download/v1.2.0.0/Shellcodes.zip"
unzip Shellcodes.zip
wget -nv "https://github.com/woa-msmnile/DualBootKernelPatcher/releases/download/v1.2.0.0/Config.zip"
unzip Config.zip
chmod +x DualBootKernelPatcher
- name: Download & patch boot image
run: |
mkdir -p ota
pushd ota
wget -nv --retry-connrefused --waitretry=1 --read-timeout=20 --timeout=15 -t 0 ${{ matrix.url }} -O ota.tgz
tar zxvf ota.tgz --wildcards --no-anchored 'boot.img'
find . -type f -name 'boot.img' -exec cp '{}' ../ ';'
popd
rm -rf ota
python3 ./unpack_bootimg.py --boot_img ./boot.img --format=mkbootimg | tee mkbootimg_args
./DualBootKernelPatcher out/kernel SM8150_EFI_${{ matrix.uefi-type }}.fd out/PatchedKernel Config/DualBoot.Sm8150.cfg ShellCode.Nabu.bin
sed -i 's/out\/kernel/out\/PatchedKernel/g' mkbootimg_args
python3 ./mkbootimg.py -o boot_${{ matrix.name }}_${{ matrix.uefi-type }}.img $(cat mkbootimg_args) --pagesize 4096 --base 0x0 --second_offset 0xf00000
- uses: actions/upload-artifact@v4
with:
name: ${{ matrix.name }}_${{ matrix.uefi-type }}
path: boot_${{ matrix.name }}_${{ matrix.uefi-type }}.img
- name: Release assets
if: github.ref == 'refs/heads/main'
uses: softprops/action-gh-release@v2
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
tag_name: ${{ steps.time.outputs.time }}
target_commitish: ${{ github.sha }}
name: DualBoot UEFI (${{ steps.time.outputs.time }})
body_path: README.md
draft: false
prerelease: false
files: |
boot_${{ matrix.name }}_${{ matrix.uefi-type }}.img