Skip to content

Commit

Permalink
Calculate the size dynamically (LSPosed#427)
Browse files Browse the repository at this point in the history
  • Loading branch information
Howard20181 authored Jun 21, 2022
1 parent a9bb843 commit 1f3721d
Showing 1 changed file with 8 additions and 7 deletions.
15 changes: 8 additions & 7 deletions .github/workflows/magisk.yml
Original file line number Diff line number Diff line change
Expand Up @@ -270,17 +270,17 @@ jobs:
urllib.request.urlretrieve(link, out_file)
print("done", flush=True)
- name: Extract GApps and expand images
- name: Extract GApps
if: ${{ github.event.inputs.gapps_variant != 'none' && github.event.inputs.gapps_variant != '' }}
run: |
mkdir gapps
unzip -p gapps.zip {Core,GApps}/'*.lz' | tar --lzip -C gapps -xvf - -i --strip-components=2 --exclude='setupwizardtablet-x86_64' --exclude='packageinstallergoogle-all' --exclude='speech-common' --exclude='markup-lib-arm' --exclude='markup-lib-arm64' --exclude='markup-all' --exclude='setupwizarddefault-x86_64' --exclude='pixellauncher-all' --exclude='pixellauncher-common'
# TODO: calculate the size dynamically for better compatibility
e2fsck -yf ${{ matrix.arch }}/system_ext.img
resize2fs ${{ matrix.arch }}/system_ext.img 200M
- name: Expand vendor and system
- name: Expand images
run: |
e2fsck -yf ${{ matrix.arch }}/system_ext.img
system_ext_size=$(( $(du -sB512 ${{ matrix.arch }}/system_ext.img | cut -f1) + 20000 ))
resize2fs ${{ matrix.arch }}/system_ext.img "$system_ext_size"s
e2fsck -yf ${{ matrix.arch }}/product.img
product_size=$(( $(du -sB512 ${{ matrix.arch }}/product.img | cut -f1) + 20000 ))
if [ -d gapps/product ]; then
Expand All @@ -300,7 +300,8 @@ jobs:
fi
resize2fs ${{ matrix.arch }}/system.img "$system_size"s
e2fsck -yf ${{ matrix.arch }}/vendor.img
resize2fs ${{ matrix.arch }}/vendor.img 400M
vendor_size=$(( $(du -sB512 ${{ matrix.arch }}/vendor.img | cut -f1) + 20000 ))
resize2fs ${{ matrix.arch }}/vendor.img "$vendor_size"s
- name: Mount images
run: |
sudo mkdir system
Expand Down Expand Up @@ -662,7 +663,7 @@ jobs:
fi
echo "artifact_name=WSA${name1}${name2}_${{ env.WSA_VER }}_${{ matrix.arch }}_${{ env.WSA_REL }}" >> $GITHUB_ENV
- name: Upload WSA
uses: actions/upload-artifact@v2
uses: actions/upload-artifact@v3
with:
name: ${{ env.artifact_name }}
path: "./${{ matrix.arch }}/*"
Expand Down

0 comments on commit 1f3721d

Please sign in to comment.