Martin L Roth has uploaded this change for review. ( https://review.coreboot.org/c/em100/+/62937 )
Change subject: makechips.sh: Clean up shellcheck errors and formatting ......................................................................
makechips.sh: Clean up shellcheck errors and formatting
Clean up shellcheck errors Add braces around variable names > 1 character
Signed-off-by: Martin Roth gaumless@gmail.com Change-Id: Ia756d67d0a0464971e395189027b01787b6b19bd --- M makechips.sh 1 file changed, 19 insertions(+), 19 deletions(-)
git pull ssh://review.coreboot.org:29418/em100 refs/changes/37/62937/1
diff --git a/makechips.sh b/makechips.sh index b4c43d0..ddf1953 100755 --- a/makechips.sh +++ b/makechips.sh @@ -25,53 +25,53 @@
FILE=EM100Pro.msi TEMP=$(mktemp -d /tmp/makech.XXXXXX) -WD=$(cd "$(dirname `eval echo "$0"`)"; pwd) -TD=$WD/em100_home +WD="$(cd "$(dirname "$(eval echo "$0")")" || exit 1; pwd)" +TD="${WD}/em100_home"
-cd $TEMP -if [ -r $WD/$FILE ]; then +cd "${TEMP}" || exit 1 +if [ -r "${WD}/${FILE}" ]; then echo " Copying $FILE..." - cp $WD/$FILE . + cp "${WD}/${FILE}" . || exit 1 else echo " Downloading $FILE..." - curl -s $URL -o $FILE || exit + curl -s $URL -o $FILE || exit 1 fi echo " Unpacking ..." if ! msiextract $FILE > /dev/null ; then echo " Could not unpack Windows installer..." - rm -rf $TEMP + rm -rf "${TEMP}" exit 1 fi VERSION="$( strings -e l Program\ Files/DediProg/EM100/EM100.exe | grep -A1 ProductVersion | grep EM100 )" echo " Detected SPI flash database "$VERSION""
echo " Creating configs..." -mkdir -p $TD/configs -cp -a $TEMP/Program\ Files/DediProg/EM100/config/EM100Pro/*.cfg $TD/configs -echo -n "${VERSION}" > $TD/configs/VERSION +mkdir -p "${TD}/configs" +cp -a "${TEMP}"/Program\ Files/DediProg/EM100/config/EM100Pro/*.cfg "${TD}/configs" || exit 1 +echo -n "${VERSION}" > "${TD}/configs/VERSION"
echo " Extract firmware files..." -mkdir -p $TD/firmware -for i in $TEMP/Program\ Files/DediProg/EM100/firmware/EM100ProFW_* +mkdir -p "${TD}/firmware" +for i in "${TEMP}"/Program\ Files/DediProg/EM100/firmware/EM100ProFW_* do - firmware=$( basename "$i" ) + firmware="$( basename "$i" )" tuple=${firmware#EM100ProFW_} v=${tuple: -3} voltage=${v/V/.}V mcu_version=${tuple: 1:1}.${tuple: 2:2} fpga_version=${tuple: 4:1}.${tuple: 5:2}
- $WD/makedpfw -m "$i/2.bin" -M $mcu_version -f "$i/1.bin" -F $fpga_version \ - -o $TD/firmware/em100pro_fw_${mcu_version}_${fpga_version}_${voltage}.dpfw + "${WD}/makedpfw" -m "$i/2.bin" -M "${mcu_version}" -f "$i/1.bin" -F "${fpga_version}" \ + -o "${TD}/firmware/em100pro_fw_${mcu_version}_${fpga_version}_${voltage}.dpfw" || exit done -echo -n "${VERSION}" > $TD/firmware/VERSION +echo -n "${VERSION}" > "${TD}/firmware/VERSION"
-cd $TD +cd "${TD}" || exit 1 LANG=C tar cJf configs.tar.xz --sort=name configs LANG=C tar cJf firmware.tar.xz --sort=name firmware echo -n "Time: " > VERSION date +%s >> VERSION echo "Version: ${VERSION}" >> VERSION -cd $WD +cd "${WD}" || exit 1
-rm -rf $TEMP +rm -rf "${TEMP}"