iop: ssh_upgrade: Remove iopu support

iopu has been removed in IOWRT 6 and has never really been supported.
Remove any support for it in the ssh_upgrade helper script.

Signed-off-by: Andreas Gnau <andreas.gnau@iopsys.eu>
This commit is contained in:
Andreas Gnau 2022-06-09 16:54:19 +02:00
parent 243642c35e
commit 30bfe70fb3

View file

@ -13,7 +13,6 @@ function upd_usage {
echo " -c Keep configuration"
echo " -x Force install even if firmware is not for this board"
echo " -b Force install of bootloader regardless of version installed"
echo " -s Use sysupgade. old upgrade method, needed for old releases that do not have iopu"
}
function set_config_string {
@ -33,14 +32,8 @@ function upd_ask_ok {
if [ "$upd_forceboot" == "1" ]; then printf "Yes\n"; else printf "No\n"; fi
printf "%20s: " "Force image upgrade"
if [ "$upd_forceimage" == "1" ]; then printf "Yes\n"; else printf "No\n"; fi
printf "%20s: " "Use sysupgrade"
if [ "$upd_sysupgrade" == "1" ]; then printf "Yes\n"; else printf "No\n"; fi
echo "-----------------------------------------"
if [ "$upd_sysupgrade" == "0" ]; then
if [ "$upd_keepconf" == "1" ]; then echo "keeping config is just a fantasy it's not yet implemented, try sysupgrade"; fi
fi
echo -n "Continue? [Y/n/q]:"
read answer
@ -157,24 +150,6 @@ function upd_select_forceimage {
esac
}
function upd_select_sysupgrade {
dialog --keep-tite --radiolist "Use the old way to upgrade a board" \
$((lines - 5)) $((cols - 5)) $((lines - 5 - 5)) \
"iopu" "Use the iop upgrade methode" $(if [ "$upd_sysupgrade" == "0" ]; then echo "ON"; else echo "OFF"; fi) \
"sysupgrade" "Use the old sysupgrade methode" $(if [ "$upd_sysupgrade" == "1" ]; then echo "ON"; else echo "OFF"; fi) \
2>$tempfile
res=$(cat $tempfile)
case $res in
"iopu")
upd_sysupgrade=0
;;
"sysupgrade")
upd_sysupgrade=1
;;
esac
}
function upd_select {
dialog --keep-tite --ok-label "Select" --cancel-label "Done" --menu "Select Item to change" \
@ -185,7 +160,6 @@ function upd_select {
"Keep config" $(if [ "$upd_keepconf" == "1" ]; then printf "Yes\n"; else printf "No\n"; fi) \
"Force bootloader" $(if [ "$upd_forceboot" == "1" ]; then printf "Yes\n"; else printf "No\n"; fi) \
"Force image upgrade" $(if [ "$upd_forceimage" == "1" ]; then printf "Yes\n"; else printf "No\n"; fi) \
"sysupgrade" $(if [ "$upd_sysupgrade" == "1" ]; then printf "Yes\n"; else printf "No\n"; fi) \
2>$tempfile
case $(cat $tempfile) in
@ -207,9 +181,6 @@ function upd_select {
"Force image upgrade")
upd_select_forceimage
;;
"sysupgrade")
upd_select_sysupgrade
;;
*)
return
;;
@ -233,10 +204,9 @@ function ssh_upgrade {
upd_fw_base=""
upd_fw=""
upd_host="192.168.1.1"
upd_sysupgrade=1
do_dialog=0
while getopts "f:hnxt:iscb" opt; do
while getopts "f:hnxt:icb" opt; do
case $opt in
n)
upd_noreboot=1
@ -262,9 +232,6 @@ function ssh_upgrade {
i)
do_dialog=1
;;
s)
upd_sysupgrade=1
;;
h)
upd_usage
exit 1
@ -287,8 +254,6 @@ function ssh_upgrade {
# if target uses pkgtb
if [ -z "$firmwares"]; then
# pkgtb files can not be streamed so copy over the file witch scp
use_scp=1
firmwares=$(
cd bin/targets/$CONFIG_TARGET_BOARD/generic/
ls -t last.pkgtb
@ -316,28 +281,13 @@ function ssh_upgrade {
exit 1
fi
if [ $upd_sysupgrade -eq 0 ]; then
extra_args=""
[ $upd_noreboot -eq 1 ] && extra_args="$extra_args -n"
[ $upd_forceimage -eq 1 ] && extra_args="$extra_args -x"
[ $upd_forceboot -eq 1 ] && extra_args="$extra_args -b"
extra_args=""
[ $upd_noreboot -eq 1 ] && extra_args="$extra_args -d"
[ $upd_keepconf -eq 0 ] && extra_args="$extra_args -n"
file_size_kb=$(du -k "$upd_fw" | cut -f1)
if [ "$use_scp" == "1" ]; then
scp $upd_fw root@$upd_host:/tmp/ &&
ssh -o ConnectTimeout=60 root@$upd_host "iopu $extra_arg -f /tmp/$upd_fw_base"
else
cat $upd_fw | pv -s ${file_size_kb}k | ssh root@$upd_host "iopu $extra_args"
fi
else
extra_args=""
[ $upd_noreboot -eq 1 ] && extra_args="$extra_args -d"
[ $upd_keepconf -eq 0 ] && extra_args="$extra_args -n"
scp $upd_fw root@$upd_host:/tmp/ &&
ssh -o ConnectTimeout=60 root@$upd_host "sysupgrade -v $extra_args /tmp/$upd_fw_base" &&
echo "sysupgrade done!"
fi
scp $upd_fw root@$upd_host:/tmp/ &&
ssh -o ConnectTimeout=60 root@$upd_host "sysupgrade -v $extra_args /tmp/$upd_fw_base" &&
echo "sysupgrade done!"
}
register_command "ssh_upgrade" "-h <host> -f <file> [opts] Install firmware on remote host with SSH"