Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 9 additions & 1 deletion .github/workflows/build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,10 @@ on:
device_tree:
type: string
required: true
header_version:
type: string
required: false
default: ''
workflow_dispatch:
inputs:
device:
Expand All @@ -36,6 +40,10 @@ on:
device_tree:
type: string
required: true
header_version:
type: string
required: false
default: ''

jobs:
build:
Expand All @@ -55,7 +63,7 @@ jobs:
- name: Build u-boot
run: |
cd u-boot/builder
./build_container.sh "${{ inputs.config }}" "${{ inputs.device_tree }}"
./build_container.sh "${{ inputs.config }}" "${{ inputs.device_tree }}" "${{ inputs.header_version }}"
mv output/u-boot.img output/u-boot-${{ inputs.device }}.img

- name: Upload build artifacts
Expand Down
8 changes: 5 additions & 3 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -25,17 +25,19 @@ jobs:
config: "qcom_defconfig phone.config"
device_tree: "qcom/sdm845-xiaomi-beryllium-tianma"
- device: fairphone-fp5
repo: https://git.codelinaro.org/clo/qcomlt/u-boot.git
ref: 6fc40f2499b1a517487933d7d81a482f6dce7751
config: "qcom_defconfig phone.config"
repo: https://source.denx.de/u-boot/u-boot
ref: next
config: "qcm6490_defconfig qcom-phone.config"
device_tree: "qcom/qcm6490-fairphone-fp5"
header_version: "2"
uses: ./.github/workflows/build.yml
with:
device: ${{ matrix.target.device }}
repo: ${{ matrix.target.repo }}
ref: ${{ matrix.target.ref }}
config: ${{ matrix.target.config }}
device_tree: ${{ matrix.target.device_tree }}
header_version: ${{ matrix.target.header_version }}

release:
needs: [ build ]
Expand Down
17 changes: 14 additions & 3 deletions build.sh
Original file line number Diff line number Diff line change
Expand Up @@ -4,12 +4,23 @@ set -uexo pipefail

CONFIG="$1"
DEVICE_TREE="$2"
HEADER_VERSION="${3:-}"

cd ..
make $CONFIG
make -j $(nproc) DEVICE_TREE="$DEVICE_TREE"
make -j $(nproc)
gzip u-boot-nodtb.bin -c > u-boot-nodtb.bin.gz
cat u-boot-nodtb.bin.gz dts/upstream/src/arm64/$DEVICE_TREE.dtb > u-boot-dtb
mkbootimg --kernel_offset '0x00008000' --pagesize '4096' --kernel u-boot-dtb -o u-boot.img

if [ "$HEADER_VERSION" = "2" ]; then
# Boot image v2 requires separate --dtb parameter
MKBOOTIMG_ARGS="--kernel u-boot-nodtb.bin.gz --dtb dts/upstream/src/arm64/$DEVICE_TREE.dtb --pagesize 4096 --base 0x0 --kernel_offset 0x8000 --ramdisk_offset 0x1000000 --tags_offset 0x100 --dtb_offset 0x1f00000 --header_version 2 -o u-boot.img"
else
# Legacy format: concatenate kernel and dtb
cat u-boot-nodtb.bin.gz dts/upstream/src/arm64/$DEVICE_TREE.dtb > u-boot-dtb

MKBOOTIMG_ARGS="--kernel u-boot-dtb --pagesize 4096 --base 0x0 --kernel_offset 0x8000 -o u-boot.img"
fi

mkbootimg $MKBOOTIMG_ARGS
mkdir -p builder/output/
cp u-boot.img builder/output/u-boot.img
2 changes: 1 addition & 1 deletion build_container.sh
Original file line number Diff line number Diff line change
Expand Up @@ -4,5 +4,5 @@ podman run --rm -it -v..:/srv:z -w/srv fedora:43 bash -c \
"
dnf -y install bison flex android-tools make gcc glibc-devel openssl-devel openssl-devel-engine gnutls-devel awk xxd
cd builder
./build.sh \"${1}\" \"${2}\"
./build.sh \"${1}\" \"${2}\" \"${3}\"
"