Skip to content

Commit f22578c

Browse files
committed
buildimg.sh: add bl2 replacement (BPI-R4 8G)
1 parent 2b9bf8e commit f22578c

1 file changed

Lines changed: 11 additions & 0 deletions

File tree

buildimg.sh

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -82,6 +82,17 @@ if [[ $? -ne 0 ]];then echo "losetup ${LDEV} failed (${newimgfile%.*})"; exit 1;
8282
echo "mounting loopdev..."
8383
sudo partprobe ${LDEV}
8484
if [[ $? -ne 0 ]];then echo "partprobe failed"; exit 1; fi
85+
86+
#replacing bl2 (e.g. R4 8GB)
87+
if [[ -n "$replacebl2" ]] && [[ -n "$bl2file" ]] && [[ -e "$bl2file" ]];then
88+
echo "replace BL2 with $bl2file";
89+
if [[ "$board" =~ ^bpi-r4 ]];then
90+
sudo dd if=$bl2file of=${LDEV}p1
91+
else
92+
echo "BL2 replacement for $board not supported"
93+
fi
94+
fi
95+
8596
mkdir -p mnt/BPI-{B,R}OOT
8697
sudo mount ${LDEV}p${mmcbootpart} mnt/BPI-BOOT
8798
if [[ $? -ne 0 ]];then echo "mounting BPI-BOOT failed"; exit 1; fi

0 commit comments

Comments
 (0)