otrx: change command line API to start with a mode

This will allow adding more modes without options conflict.

Signed-off-by: Rafał Miłecki <zajec5@gmail.com>

git-svn-id: svn://svn.openwrt.org/openwrt/trunk@45443 3c298f89-4303-0410-b956-a3cf2f4a3e73
This commit is contained in:
Rafał Miłecki
2015-04-14 20:50:46 +00:00
parent bd81f54e15
commit 0d8a721eb1
4 changed files with 77 additions and 63 deletions

View File

@@ -79,7 +79,7 @@ platform_check_image() {
error=1
}
if ! otrx -c "$1" -o "$header_len"; then
if ! otrx check "$1" -o "$header_len"; then
echo "No valid TRX firmware in the CHK image"
error=1
fi
@@ -94,13 +94,13 @@ platform_check_image() {
error=1
}
if ! otrx -c "$1" -o 32; then
if ! otrx check "$1" -o 32; then
echo "No valid TRX firmware in the CyberTAN image"
error=1
fi
;;
"trx")
if ! otrx -c "$1"; then
if ! otrx check "$1"; then
echo "Invalid (corrupted?) TRX firmware"
error=1
fi
@@ -140,7 +140,7 @@ platform_pre_upgrade() {
# Extract partitions from trx
rm -fR $dir
mkdir -p $dir
otrx -e "$trx" \
otrx extract "$trx" \
-1 $dir/kernel \
-2 $dir/root

View File

@@ -98,7 +98,7 @@ platform_check_image() {
error=1
}
if ! otrx -c "$1" -o "$header_len"; then
if ! otrx check "$1" -o "$header_len"; then
echo "No valid TRX firmware in the CHK image"
error=1
fi
@@ -113,13 +113,13 @@ platform_check_image() {
error=1
}
if ! otrx -c "$1" -o 32; then
if ! otrx check "$1" -o 32; then
echo "No valid TRX firmware in the CyberTAN image"
error=1
fi
;;
"trx")
if ! otrx -c "$1"; then
if ! otrx check "$1"; then
echo "Invalid (corrupted?) TRX firmware"
error=1
fi