diff options
author | Zoltan HERPAI <wigyori@uid0.hu> | 2016-06-22 14:12:09 +0200 |
---|---|---|
committer | Zoltan HERPAI <wigyori@uid0.hu> | 2016-06-22 14:12:09 +0200 |
commit | 299c437ccd1fd605eef2e15f07397866864cf896 (patch) | |
tree | 13f424074215d071d37938c40af9e89a3b8ace2c /target/linux/ar71xx/base-files/lib/upgrade | |
parent | 906ce8b22a737a5f880f5f21214580e9f04305b8 (diff) | |
download | master-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')
-rw-r--r-- | target/linux/ar71xx/base-files/lib/upgrade/openmesh.sh | 75 | ||||
-rwxr-xr-x | target/linux/ar71xx/base-files/lib/upgrade/platform.sh | 6 |
2 files changed, 48 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 } diff --git a/target/linux/ar71xx/base-files/lib/upgrade/platform.sh b/target/linux/ar71xx/base-files/lib/upgrade/platform.sh index 0d6aa6b67e..bfab73cc7c 100755 --- a/target/linux/ar71xx/base-files/lib/upgrade/platform.sh +++ b/target/linux/ar71xx/base-files/lib/upgrade/platform.sh @@ -280,6 +280,7 @@ platform_check_image() { return 0 ;; + cpe210|\ cpe510) tplink_pharos_check_image "$1" && return 0 return 1 @@ -314,6 +315,7 @@ platform_check_image() { return 0; ;; mr1750 | \ + mr1750v2 | \ mr600 | \ mr600v2 | \ mr900 | \ @@ -322,6 +324,7 @@ platform_check_image() { om2pv2 | \ om2p-hs | \ om2p-hsv2 | \ + om2p-hsv3 | \ om2p-lc | \ om5p | \ om5p-an | \ @@ -385,6 +388,7 @@ platform_check_image() { tl-wr841n-v7 | \ tl-wr841n-v8 | \ tl-wr841n-v9 | \ + tl-wr841n-v11 | \ tl-wr842n-v2 | \ tl-wr842n-v3 | \ tl-wr941nd | \ @@ -573,6 +577,7 @@ platform_do_upgrade() { platform_do_upgrade_dir825b "$ARGV" ;; mr1750 | \ + mr1750v2 | \ mr600 | \ mr600v2 | \ mr900 | \ @@ -581,6 +586,7 @@ platform_do_upgrade() { om2pv2 | \ om2p-hs | \ om2p-hsv2 | \ + om2p-hsv3 | \ om2p-lc | \ om5p | \ om5p-an | \ |