-
Notifications
You must be signed in to change notification settings - Fork 2.4k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Da Xue
authored and
lc-engineering-bot
committed
Oct 4, 2023
1 parent
7f7f8fe
commit 5f7cdae
Showing
5 changed files
with
60 additions
and
9 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,38 @@ | ||
#!/bin/bash | ||
|
||
declare -A BOOTLOADER_OFFSET=( | ||
[all-h3-cc-h3]=16 | ||
[all-h3-cc-h5]=16 | ||
[aml-a311d-cc]=1 | ||
[aml-s805x-ac]=1 | ||
[aml-s905x-cc]=1 | ||
[aml-s905x-cc-v2]=1 | ||
[aml-s905d-pc]=1 | ||
[aml-s905d3-cc]=1 | ||
[roc-rk3328-cc]=64 | ||
[roc-rk3399-pc]=64 | ||
) | ||
|
||
BOOTLOADER_URL="https://boot.libre.computer/ci/" | ||
BOOTLOADER_BLK_SIZE=512 | ||
|
||
BOOTLOADER_getOffset(){ | ||
local board=$1 | ||
echo -n $((${BOOTLOADER_OFFSET[$board]} * BOOTLOADER_BLK_SIZE)) | ||
} | ||
|
||
BOOTLOADER_getURL(){ | ||
echo -n "${BOOTLOADER_URL}${1}" | ||
} | ||
|
||
BOOTLOADER_getHeaders(){ | ||
WGET_getHeaders "$BOOTLOADER_URL/$1" | ||
} | ||
|
||
BOOTLOADER_get(){ | ||
local board=$1 | ||
local bl=$2 | ||
echo "$FUNCNAME: downloading $board bootloader to $bl." | ||
echo | ||
wget -nc -O $bl "$BOOTLOADER_URL/$board" 2>&1 && echo "$FUNCNAME: downloaded $board bootloader to $bl." || echo "$FUNCNAME: noop $board bootloader exists at $bl." | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,14 +1,21 @@ | ||
#!/bin/bash | ||
set -x | ||
set -ex | ||
|
||
BOARD=$2 | ||
|
||
SCRIPT_DIR=$(dirname "${BASH_SOURCE[0]}") | ||
. $SCRIPT_DIR/../bootloader.sh | ||
|
||
GENIMG_CFG=$BINARIES_DIR/genimage.cfg | ||
|
||
wget -nc https://boot.libre.computer/ci/$BOARD -O $BINARIES_DIR/$BOARD | ||
BOOTLOADER_get $BOARD $BINARIES_DIR/$BOARD | ||
|
||
#wget -nc https://boot.libre.computer/ci/$BOARD -O $BINARIES_DIR/$BOARD | ||
|
||
cp -f $(dirname "${BASH_SOURCE[0]}")/genimage.cfg "$BINARIES_DIR/" | ||
cp -f $(dirname "${BASH_SOURCE[0]}")/boot.ini "$BINARIES_DIR/" | ||
cp -f $SCRIPT_DIR/genimage.cfg "$BINARIES_DIR/" | ||
cp -f $SCRIPT_DIR/boot.ini "$BINARIES_DIR/" | ||
|
||
sed -i "s/__BL_OFFSET__/$(BOOTLOADER_getOffset $BOARD)/" "$GENIMG_CFG" | ||
sed -i "s/__BOARD__/$BOARD/" "$GENIMG_CFG" | ||
|
||
support/scripts/genimage.sh -c "$GENIMG_CFG" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,16 +1,22 @@ | ||
#!/bin/bash | ||
set -x | ||
set -ex | ||
|
||
BOARD=$2 | ||
SCRIPT_DIR=$(dirname "${BASH_SOURCE[0]}") | ||
. $SCRIPT_DIR/../bootloader.sh | ||
|
||
IMAGE_SIZE=$(stat -c %s $BINARIES_DIR/Image) | ||
IMAGE_SIZE=$((((IMAGE_SIZE + (17 << 20) - 1) >> 23 << 3) - 1)) | ||
GENIMG_CFG=$BINARIES_DIR/genimage.cfg | ||
|
||
wget https://boot.libre.computer/ci/$BOARD -O $BINARIES_DIR/$BOARD | ||
BOOTLOADER_get $BOARD $BINARIES_DIR/$BOARD | ||
|
||
#wget -nc https://boot.libre.computer/ci/$BOARD -O $BINARIES_DIR/$BOARD | ||
|
||
cp -f $(dirname "${BASH_SOURCE[0]}")/genimage.cfg "$GENIMG_CFG" | ||
cp -f $SCRIPT_DIR/genimage.cfg "$BINARIES_DIR/" | ||
|
||
sed -i "s/__SIZE__/$IMAGE_SIZE/" "$GENIMG_CFG" | ||
sed -i "s/__BL_OFFSET__/$(BOOTLOADER_getOffset $BOARD)/" "$GENIMG_CFG" | ||
sed -i "s/__BOARD__/$BOARD/" "$GENIMG_CFG" | ||
|
||
support/scripts/genimage.sh -c "$GENIMG_CFG" |