aboutsummaryrefslogtreecommitdiffstats
path: root/target/linux/ar71xx/base-files/lib/upgrade/openmesh.sh
diff options
context:
space:
mode:
authorZoltan HERPAI <wigyori@uid0.hu>2016-06-22 14:12:09 +0200
committerZoltan HERPAI <wigyori@uid0.hu>2016-06-22 14:12:09 +0200
commit299c437ccd1fd605eef2e15f07397866864cf896 (patch)
tree13f424074215d071d37938c40af9e89a3b8ace2c /target/linux/ar71xx/base-files/lib/upgrade/openmesh.sh
parent906ce8b22a737a5f880f5f21214580e9f04305b8 (diff)
downloadmaster-187ad058-299c437ccd1fd605eef2e15f07397866864cf896.tar.gz
master-187ad058-299c437ccd1fd605eef2e15f07397866864cf896.tar.bz2
master-187ad058-299c437ccd1fd605eef2e15f07397866864cf896.zip
ar71xx: update bomb
ar71xx: split tp-link image building code into a separate file ar71xx: split legacy image building code into a separate file ar71xx: split ubnt image building code into a separate file ar71xx: move generic device image definitions to a separate file ar71xx: move nand device image definitions to a separate file ar71xx: Add support for initramfs images for OpenMesh devices ar71xx: Generate sysupgrade images for OpenMesh devices ar71xx: Move OpenMesh image target validation into subfunction ar71xx: Allow OpenMesh CE images with more than 3 files ar71xx: add kernel support for the OpenMesh OM2P-HSv3 ar71xx: add user-space support for the OpenMesh OM2P-HSv3 ar71xx: enable sysupgrade for the OpenMesh OM2P-HSv3 package/om-watchdog: add OpenMesh OM2P-HSv3 support package/uboot-envtools: add OpenMesh OM2P-HSv3 support ar71xx: add OM2P-HSv3 to the OM2P profile ar71xx: add kernel support for the OpenMesh MR1750v2 ar71xx: add user-space support for the OpenMesh MR1750v2 ar71xx: enable sysupgrade for the OpenMesh MR1750v2 package/om-watchdog: add OpenMesh MR1750v2 support package/uboot-envtools: add OpenMesh MR1750v2 support ar71xx: extract ath10k wifi board.bin for the OpenMesh MR1750v2 board ar71xx: add MR1750v2 to the MR1750 profile ar71xx/cpe510: split profile into 2 profiles cpe210 and cpe510 ar71xx/cpe510: use second wifi calibration table ar71xx: add GPIO pin for usb power switch for RouterBOARD 912 ar71xx: switch ordering and template to improve readability ar71xx: Fix TL-WR841N v11 LEDs, use separate machine Signed-off-by: Zoltan HERPAI <wigyori@uid0.hu>
Diffstat (limited to 'target/linux/ar71xx/base-files/lib/upgrade/openmesh.sh')
-rw-r--r--target/linux/ar71xx/base-files/lib/upgrade/openmesh.sh75
1 files changed, 42 insertions, 33 deletions
diff --git a/target/linux/ar71xx/base-files/lib/upgrade/openmesh.sh b/target/linux/ar71xx/base-files/lib/upgrade/openmesh.sh
index 209cdaaf90..87b65165b4 100644
--- a/target/linux/ar71xx/base-files/lib/upgrade/openmesh.sh
+++ b/target/linux/ar71xx/base-files/lib/upgrade/openmesh.sh
@@ -36,62 +36,48 @@ platform_add_ramfs_ubootenv()
}
append sysupgrade_pre_upgrade platform_add_ramfs_ubootenv
-platform_check_image_openmesh()
+platform_check_image_target_openmesh()
{
- local img_magic=$1
- local img_path=$2
- local fw_printenv=/usr/sbin/fw_printenv
- local img_board_target= img_num_files= i=0
- local cfg_name= kernel_name= rootfs_name=
-
- case "$img_magic" in
- # Combined Extended Image v1
- 43453031)
- img_board_target=$(trim $(dd if="$img_path" bs=4 skip=1 count=8 2>/dev/null))
- img_num_files=$(trim $(dd if="$img_path" bs=2 skip=18 count=1 2>/dev/null))
- ;;
- *)
- echo "Invalid image ($img_magic). Use combined extended images on this platform"
- return 1
- ;;
- esac
+ img_board_target="$1"
case "$img_board_target" in
OM2P)
- [ "$board" = "om2p" ] && break
- [ "$board" = "om2pv2" ] && break
- [ "$board" = "om2p-lc" ] && break
- [ "$board" = "om2p-hs" ] && break
- [ "$board" = "om2p-hsv2" ] && break
+ [ "$board" = "om2p" ] && return 0
+ [ "$board" = "om2pv2" ] && return 0
+ [ "$board" = "om2p-lc" ] && return 0
+ [ "$board" = "om2p-hs" ] && return 0
+ [ "$board" = "om2p-hsv2" ] && return 0
+ [ "$board" = "om2p-hsv3" ] && return 0
echo "Invalid image board target ($img_board_target) for this platform: $board. Use the correct image for this platform"
return 1
;;
OM5P)
- [ "$board" = "om5p" ] && break
- [ "$board" = "om5p-an" ] && break
+ [ "$board" = "om5p" ] && return 0
+ [ "$board" = "om5p-an" ] && return 0
echo "Invalid image board target ($img_board_target) for this platform: $board. Use the correct image for this platform"
return 1
;;
OM5PAC)
- [ "$board" = "om5p-ac" ] && break
- [ "$board" = "om5p-acv2" ] && break
+ [ "$board" = "om5p-ac" ] && return 0
+ [ "$board" = "om5p-acv2" ] && return 0
echo "Invalid image board target ($img_board_target) for this platform: $board. Use the correct image for this platform"
return 1
;;
MR1750)
- [ "$board" = "mr1750" ] && break
+ [ "$board" = "mr1750" ] && return 0
+ [ "$board" = "mr1750v2" ] && return 0
echo "Invalid image board target ($img_board_target) for this platform: $board. Use the correct image for this platform"
return 1
;;
MR600)
- [ "$board" = "mr600" ] && break
- [ "$board" = "mr600v2" ] && break
+ [ "$board" = "mr600" ] && return 0
+ [ "$board" = "mr600v2" ] && return 0
echo "Invalid image board target ($img_board_target) for this platform: $board. Use the correct image for this platform"
return 1
;;
MR900)
- [ "$board" = "mr900" ] && break
- [ "$board" = "mr900v2" ] && break
+ [ "$board" = "mr900" ] && return 0
+ [ "$board" = "mr900v2" ] && return 0
echo "Invalid image board target ($img_board_target) for this platform: $board. Use the correct image for this platform"
return 1
;;
@@ -100,8 +86,31 @@ platform_check_image_openmesh()
return 1
;;
esac
+}
+
+platform_check_image_openmesh()
+{
+ local img_magic=$1
+ local img_path=$2
+ local fw_printenv=/usr/sbin/fw_printenv
+ local img_board_target= img_num_files= i=0
+ local cfg_name= kernel_name= rootfs_name=
+
+ case "$img_magic" in
+ # Combined Extended Image v1
+ 43453031)
+ img_board_target=$(trim $(dd if="$img_path" bs=4 skip=1 count=8 2>/dev/null))
+ img_num_files=$(trim $(dd if="$img_path" bs=2 skip=18 count=1 2>/dev/null))
+ ;;
+ *)
+ echo "Invalid image ($img_magic). Use combined extended images on this platform"
+ return 1
+ ;;
+ esac
+
+ platform_check_image_target_openmesh "$img_board_target" || return 1
- [ $img_num_files -ne 3 ] && {
+ [ $img_num_files -lt 3 ] && {
echo "Invalid number of embedded images ($img_num_files). Use the correct image for this platform"
return 1
}