diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index 510897a3a31..4c59a398ea4 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -75,7 +75,7 @@ jobs: strategy: matrix: vendor: [ protectli ] - model: [ vp46xx, V1210, V1410, V1610 ] + model: [ vp46xx, V1210, V1410, V1610, FW6 ] steps: - name: Checkout repository uses: actions/checkout@v3 diff --git a/build.sh b/build.sh index 42b532f2d61..9ec7a867226 100755 --- a/build.sh +++ b/build.sh @@ -160,6 +160,47 @@ function build_v1x10 { fi } +function build_fw6 { + DEFCONFIG="configs/config.protectli_fw6" + FW_VERSION=$(cat ${DEFCONFIG} | grep CONFIG_LOCALVERSION | cut -d '=' -f 2 | tr -d '"') + + if [ ! -d 3rdparty/blobs/mainboard ]; then + git submodule update --init --checkout + fi + + if [ ! -d 3rdparty/blobs/mainboard/protectli/vault_kbl ]; then + if [ -f protectli_blobs.zip ]; then + unzip protectli_blobs.zip -d 3rdparty/blobs/mainboard + else + echo "Platform blobs missing! You must obtain them first." + exit 1 + fi + fi + + docker run --rm -t -u $UID -v $PWD:/home/coreboot/coreboot \ + -v $HOME/.ssh:/home/coreboot/.ssh \ + -w /home/coreboot/coreboot coreboot/coreboot-sdk:2021-09-23_b0d87f753c \ + /bin/bash -c "make distclean" + + cp $DEFCONFIG .config + + echo "Building Dasharo for Protectli FW6 (version $FW_VERSION)" + + docker run --rm -t -u $UID -v $PWD:/home/coreboot/coreboot \ + -v $HOME/.ssh:/home/coreboot/.ssh \ + -w /home/coreboot/coreboot coreboot/coreboot-sdk:$SDKVER \ + /bin/bash -c "make olddefconfig && make -j$(nproc)" + + cp build/coreboot.rom protectli_fw6_${FW_VERSION}.rom + if [ $? -eq 0 ]; then + echo "Result binary placed in $PWD/protectli_fw6_${FW_VERSION}.rom" + sha256sum protectli_fw6_${FW_VERSION}.rom > protectli_fw6_${FW_VERSION}.rom.sha256 + else + echo "Build failed!" + exit 1 + fi +} + CMD="$1" @@ -192,6 +233,9 @@ case "$CMD" in "v1610" | "V1610" ) build_v1x10 "v1610" ;; + "fw6" | "FW6" ) + build_fw6 + ;; *) echo "Invalid command: \"$CMD\"" usage