Skip to content

Commit

Permalink
ONIE Installer debug flag -j
Browse files Browse the repository at this point in the history
This provides the option of disabling checksums and
printing out script execution to debug installer issues.

-j was chosen as it does not and is not likely to conflict
with existing or future arguments.

Signed-off-by: Alex Doyle <[email protected]>
  • Loading branch information
ehdoyle committed Oct 16, 2021
1 parent d9f6aa3 commit 905482c
Show file tree
Hide file tree
Showing 3 changed files with 21 additions and 3 deletions.
5 changes: 5 additions & 0 deletions installer/grub-arch/install-arch
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,8 @@ args_arch="d:"
usage_arch=$(cat <<EOF
-d
Target ONIE install device. Must be a valid block device.
-j
Debug installer.
EOF
)

Expand All @@ -44,6 +46,9 @@ parse_arg_arch()
d)
onie_dev="$optarg"
;;
j)
set -x
;;
*)
return 1
;;
Expand Down
8 changes: 7 additions & 1 deletion installer/install.sh
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,7 @@ true ${onie_config_version=0}
# assign the value from onie_machine.
onie_build_machine=${onie_build_machine:-$onie_machine}

args="hivfqx${args_arch}"
args="hivfqxj${args_arch}"

usage()
{
Expand All @@ -76,6 +76,8 @@ COMMAND LINE OPTIONS
-f
Force ONIE update opteration, bypassing any safety
checks.
-j
Debug.
$usage_arch
EOF
Expand Down Expand Up @@ -107,6 +109,10 @@ while getopts "$args" a ; do
cat ./machine-build.conf
exit 0
;;
j)
set -x
;;

*)
parse_arg_arch "$a" "$OPTARG" || {
echo "Unknown argument: $a"
Expand Down
11 changes: 9 additions & 2 deletions installer/sharch_body.sh
Original file line number Diff line number Diff line change
Expand Up @@ -16,12 +16,17 @@

extract=no
quiet=no
args=":xq"
do_debug=no
args=":xqj"
while getopts "$args" a ; do
case $a in
x)
extract=yes
;;
j)
set -x
do_debug="yes"
;;
q)
quiet=yes
;;
Expand All @@ -40,7 +45,9 @@ if [ "$sha1" != "$payload_sha1" ] ; then
echo "ERROR: Unable to verify archive checksum"
echo "Expected: $payload_sha1"
echo "Found : $sha1"
exit 1
if [ "$do_debug" = "no" ];then
exit 1
fi
fi

[ "$quiet" = "no" ] && echo " OK."
Expand Down

0 comments on commit 905482c

Please sign in to comment.