Skip to content

Commit 6efacef

Browse files
committed
firmware-update-pacakge: Update to follow shellcheck best practices
Signed-off-by: Li Hua Qian <huaqian.li@siemens.com>
1 parent 43dff71 commit 6efacef

File tree

1 file changed

+12
-12
lines changed

1 file changed

+12
-12
lines changed

meta-example/recipes-devtools/firmware-update-package/files/iot2050-generate-fwu-tarball.sh

Lines changed: 12 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -64,27 +64,27 @@ generate_fwu_tarball()
6464
{
6565
echo "Generating the firmware tarball..."
6666

67-
if [ ! -e $2/iot2050-pg1-image-boot.bin ] || \
68-
[ ! -e $2/iot2050-pg2-image-boot.bin ]; then
67+
if [ ! -e "$2/iot2050-pg1-image-boot.bin" ] || \
68+
[ ! -e "$2/iot2050-pg2-image-boot.bin" ]; then
6969
echo "Error: iot2050-pg1/2-image-boot.bin doesn't exist!"
7070
exit 2
7171
fi
7272

73-
if [ ! -e $2/u-boot-initial-env ]; then
73+
if [ ! -e "$2/u-boot-initial-env" ]; then
7474
echo "Error: u-boot-initial-env doesn't exist!"
7575
exit 2
7676
fi
7777

78-
mkdir -p $2/.tarball
78+
mkdir -p "$2/.tarball"
7979

80-
cp $1/update.conf.json.tmpl $2/.tarball/update.conf.json
81-
update_json $2/.tarball/update.conf.json $3
82-
cp $2/iot2050-pg*-image-boot.bin $2/.tarball
83-
cp $2/u-boot-initial-env $2/.tarball
80+
cp "$1/update.conf.json.tmpl" "$2/.tarball/update.conf.json"
81+
update_json "$2/.tarball/update.conf.json" "$3"
82+
cp "$2"/iot2050-pg*-image-boot.bin "$2/.tarball"
83+
cp "$2/u-boot-initial-env" "$2/.tarball"
8484

85-
cd $2/.tarball
86-
tar -cJvf $2/IOT2050-FW-Update-PKG-$3.tar.xz *
87-
cd - && rm -rf $2/.tarball
85+
cd "$2/.tarball" || exit
86+
tar -cJvf "$2/IOT2050-FW-Update-PKG-$3.tar.xz" ./*
87+
cd - && rm -rf "$2/.tarball"
8888
}
8989

90-
generate_fwu_tarball $*
90+
generate_fwu_tarball "$@"

0 commit comments

Comments
 (0)