Update scripts

This commit is contained in:
Lee Lup Yuen 2024-06-25 14:46:56 +08:00
parent 8e92642558
commit 614f5175b5
5 changed files with 39 additions and 28 deletions

View file

@ -2,8 +2,11 @@
## Validate NuttX Release for Milk-V Duo S
## Based on https://cwiki.apache.org/confluence/display/NUTTX/Validating+a+staged+Release
## Sample Output: https://gist.github.com/lupyuen/d211428dc43d85b8ec1fd803275e9f26
## clear && cd /tmp && script /tmp/release-milkvduos.log ~/nuttx-release/release-milkvduos.sh && echo Done! /tmp/release-milkvduos.log
## clear && ~/nuttx-release/release.sh milkvduos
echo ----- Validate NuttX Release for Milk-V Duo S
echo release=$release
echo candidate=$candidate
echo hash=$hash
## TODO: Update PATH
export PATH="$HOME/xpack-riscv-none-elf-gcc-13.2.0-2/bin:$PATH"
@ -15,10 +18,6 @@ rm -r checkrelease
set -e ## Exit when any command fails
set -x ## Echo commands
## TODO: Update release and candidate
release=12.5.1
candidate=RC0
## Build NuttX
function build_nuttx {

View file

@ -2,8 +2,11 @@
## Validate NuttX Release for Ox64
## Based on https://cwiki.apache.org/confluence/display/NUTTX/Validating+a+staged+Release
## Sample Output: https://gist.github.com/lupyuen/d211428dc43d85b8ec1fd803275e9f26
## clear && cd /tmp && script /tmp/release-ox64.log -c ~/nuttx-release/release-ox64.sh && echo Done! /tmp/release-ox64.log
## clear && ~/nuttx-release/release.sh ox64
echo ----- Validate NuttX Release for Ox64
echo release=$release
echo candidate=$candidate
echo hash=$hash
## TODO: Update PATH for xPack riscv-none-elf-gcc
## export PATH="$HOME/xpack-riscv-none-elf-gcc-13.2.0-2/bin:$PATH"
@ -15,10 +18,6 @@ rm -r checkrelease
set -e ## Exit when any command fails
set -x ## Echo commands
## TODO: Update release and candidate
release=12.5.1
candidate=RC0
## Build NuttX
function build_nuttx {

View file

@ -2,8 +2,11 @@
## Validate NuttX Release for PinePhone
## Based on https://cwiki.apache.org/confluence/display/NUTTX/Validating+a+staged+Release
## Sample Output: https://gist.github.com/lupyuen/5760e0375d44a06b3c730a10614e4d24
## clear && cd /tmp && script /tmp/release-pinephone.log -c ~/nuttx-release/release-pinephone.sh && echo Done! /tmp/release-pinephone.log
## clear && ~/nuttx-release/release.sh pinephone
echo ----- Validate NuttX Release for PinePhone
echo release=$release
echo candidate=$candidate
echo hash=$hash
## TODO: Update PATH for Arm GNU Toolchain aarch64-none-elf
## export PATH="$HOME/arm-gnu-toolchain-13.2.Rel1-x86_64-aarch64-none-elf/bin:$PATH"
@ -15,10 +18,6 @@ rm -r checkrelease
set -e ## Exit when any command fails
set -x ## Echo commands
## TODO: Update release and candidate
release=12.5.1
candidate=RC0
## Build NuttX
function build_nuttx {

View file

@ -2,8 +2,11 @@
## Validate NuttX Release for Star64
## Based on https://cwiki.apache.org/confluence/display/NUTTX/Validating+a+staged+Release
## Sample Output: https://gist.github.com/lupyuen/0ea8f3ac61e07d8b6e308e31ed5f7734
## clear && cd /tmp && script /tmp/release-star64.log -c ~/nuttx-release/release-star64.sh && echo Done! /tmp/release-star64.log
## clear && ~/nuttx-release/release.sh star64
echo ----- Validate NuttX Release for Star64
echo release=$release
echo candidate=$candidate
echo hash=$hash
## TODO: Update PATH for xPack riscv-none-elf-gcc
## export PATH="$HOME/xpack-riscv-none-elf-gcc-13.2.0-2/bin:$PATH"
@ -15,10 +18,6 @@ rm -r checkrelease
set -e ## Exit when any command fails
set -x ## Echo commands
## TODO: Update release and candidate
release=12.5.1
candidate=RC0
## Build NuttX
function build_nuttx {

View file

@ -1,16 +1,17 @@
#!/usr/bin/env bash
## Validate NuttX Release: release.sh milkvduos / ox64 / star64 / pinephone
set -e ## Exit when any command fails
set -x ## Echo commands
## TODO: Update for the release
release=12.5.1
candidate=RC0
hash=abc
export release=12.5.1
export candidate=RC0
export hash=9e8753d625
device=$1
echo ----- Validate NuttX Release for $device
echo https://github.com/lupyuen/nuttx-release/blob/main/release-$1.sh
set -e ## Exit when any command fails
set -x ## Echo commands
## Get the Script Directory
script_path="${BASH_SOURCE}"
@ -30,11 +31,25 @@ script $log_file \
$script_option \
$script_dir/release-$device.sh
popd
echo Done! $log_file
## Strip the control chars
tmp_file=/tmp/release-tmp.log
cat $log_file \
| tr -d '\r' \
| tr -d '\r' \
| sed 's/\x08/ /g' \
| sed 's/\x1B(B//g' \
| sed 's/\x1B\[K//g' \
| sed 's/\x1B[<=>]//g' \
| sed 's/\x1B\[[0-9:;<=>?]*[!]*[A-Za-z]//g' \
| sed 's/\x1B[@A-Z\\\]^_]\|\x1B\[[0-9:;<=>?]*[-!"#$%&'"'"'()*+,.\/]*[][\\@A-Z^_`a-z{|}~]//g' \
>$tmp_file
mv $tmp_file $log_file
echo ----- "Done! $log_file"
## Check for hash
grep $hash $log_file || true
matches=$(grep $hash $log_file | wc -c)
matches=$(grep $hash $log_file | grep -v "hash=" | wc -c)
if [ "$matches" -eq "0" ]; then
echo ----- "ERROR: Hash $hash not found!"
exit 1