Skip to content

Commit

Permalink
add sdcard image with EFI partition
Browse files Browse the repository at this point in the history
  • Loading branch information
jfliu committed Jul 28, 2023
1 parent e34219f commit 2e77566
Show file tree
Hide file tree
Showing 2 changed files with 15 additions and 2 deletions.
8 changes: 6 additions & 2 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -68,12 +68,16 @@ jobs:
- name: Build platform
shell: bash
run: |
./build.sh --device ${{matrix.PLATFORM}} --release ${{matrix.CONFIGURATION}}
./build.sh --device ${{matrix.PLATFORM}} --release ${{matrix.CONFIGURATION}}
mv RK3588_NOR_FLASH.img ${{matrix.PLATFORM}}_UEFI_${{matrix.CONFIGURATION}}_${{steps.get_version_tag.outputs.version}}.img
mv RK3588_SDCARD_EFI.img ${{matrix.PLATFORM}}_SDCARD_EFI_${{matrix.CONFIGURATION}}_${{steps.get_version_tag.outputs.version}}.img
xz -T0 ${{matrix.PLATFORM}}_SDCARD_EFI_${{matrix.CONFIGURATION}}_${{steps.get_version_tag.outputs.version}}.img
- name: Upload artifact
uses: actions/upload-artifact@v3
with:
name: ${{matrix.PLATFORM}} UEFI ${{matrix.CONFIGURATION}} image
path: ./*.img
path: |
./*.img
./*.img.xz
if-no-files-found: error
9 changes: 9 additions & 0 deletions build.sh
Original file line number Diff line number Diff line change
Expand Up @@ -76,6 +76,14 @@ function _pack(){
# FIT Image at 0x100000
dd if=${WORKSPACE}/${DEVICE}_EFI.itb of=${WORKSPACE}/RK3588_NOR_FLASH.img bs=1K seek=1024
cp ${WORKSPACE}/RK3588_NOR_FLASH.img ${ROOTDIR}/

echo " => Building SDCard image with a 300MB EFI partition"
fallocate -l 331M RK3588_SDCARD_EFI.img
parted -s RK3588_SDCARD_EFI.img mklabel gpt
parted -s RK3588_SDCARD_EFI.img unit s mkpart loader 64 32767
parted -s RK3588_SDCARD_EFI.img unit s mkpart EFI 32768 331MB
dd if=${WORKSPACE}/idblock.bin of=RK3588_SDCARD_EFI.img seek=64 conv=notrunc
dd if=${WORKSPACE}/${DEVICE}_EFI.itb of=RK3588_SDCARD_EFI.img seek=20480 conv=notrunc
}

function _build(){
Expand All @@ -101,6 +109,7 @@ function _build(){

# based on the instructions from edk2-platform
rm -f "${OUTDIR}/RK35*_NOR_FLASH.img"
rm -f "${OUTDIR}/RK35*_SDCARD_EFI.img"

case "${MODE}" in
RELEASE) _MODE=RELEASE;;
Expand Down

0 comments on commit 2e77566

Please sign in to comment.