Rename EdgeRouter Lite board_name value and prefix it with vendor abbreviation
UBNT, as done for other Ubiquiti devices in the tree. Ensure backward sysupgrade
compatibility as well.

Signed-off-by: Stijn Segers <f...@volatilesystems.org>
---
 .../octeon/base-files/lib/preinit/01_sysinfo     |  2 +-
 .../octeon/base-files/lib/preinit/79_move_config |  2 +-
 .../octeon/base-files/lib/upgrade/platform.sh    | 16 ++++++++--------
 target/linux/octeon/image/Makefile               |  1 +
 4 files changed, 11 insertions(+), 10 deletions(-)

diff --git a/target/linux/octeon/base-files/lib/preinit/01_sysinfo 
b/target/linux/octeon/base-files/lib/preinit/01_sysinfo
index d66618b0cf..3512bd7321 100644
--- a/target/linux/octeon/base-files/lib/preinit/01_sysinfo
+++ b/target/linux/octeon/base-files/lib/preinit/01_sysinfo
@@ -6,7 +6,7 @@ do_sysinfo_octeon() {
 
        case "$machine" in
        "UBNT_E100"*)
-               name="erlite"
+               name="ubnt,edgerouter-lite"
                ;;
 
        "UBNT_E200"*)
diff --git a/target/linux/octeon/base-files/lib/preinit/79_move_config 
b/target/linux/octeon/base-files/lib/preinit/79_move_config
index 5a84e6f18a..07b6585470 100644
--- a/target/linux/octeon/base-files/lib/preinit/79_move_config
+++ b/target/linux/octeon/base-files/lib/preinit/79_move_config
@@ -15,7 +15,7 @@ octeon_move_config() {
        . /lib/functions.sh
 
        case "$(board_name)" in
-               erlite)
+               ubnt,edgerouter-lite)
                        move_config "/dev/sda1"
                        ;;
                itus,shield-router)
diff --git a/target/linux/octeon/base-files/lib/upgrade/platform.sh 
b/target/linux/octeon/base-files/lib/upgrade/platform.sh
index ad5baef4a1..11e598c10b 100755
--- a/target/linux/octeon/base-files/lib/upgrade/platform.sh
+++ b/target/linux/octeon/base-files/lib/upgrade/platform.sh
@@ -19,11 +19,6 @@ platform_get_rootfs() {
 
 platform_copy_config() {
        case "$(board_name)" in
-       erlite)
-               mount -t vfat /dev/sda1 /mnt
-               cp -af "$UPGRADE_BACKUP" "/mnt/$BACKUP_FILE"
-               umount /mnt
-               ;;
        itus,shield-router)
                mount -t vfat /dev/mmcblk1p1 /mnt
                cp -af "$UPGRADE_BACKUP" "/mnt/$BACKUP_FILE"
@@ -34,6 +29,11 @@ platform_copy_config() {
                cp -af "$UPGRADE_BACKUP" "/mnt/$BACKUP_FILE"
                umount /mnt
                ;;
+       ubnt,edgerouter-lite)
+               mount -t vfat /dev/sda1 /mnt
+               cp -af "$UPGRADE_BACKUP" "/mnt/$BACKUP_FILE"
+               umount /mnt
+               ;;
        esac
 }
 
@@ -87,7 +87,7 @@ platform_do_upgrade() {
        ubnt,edgerouter-4)
                kernel=mmcblk0p1
                ;;
-       erlite)
+       ubnt,edgerouter-lite)
                kernel=sda1
                ;;
        itus,shield-router)
@@ -112,9 +112,9 @@ platform_check_image() {
 
        case "$board" in
        er | \
-       erlite | \
        itus,shield-router | \
-       ubnt,edgerouter-4)
+       ubnt,edgerouter-4 | \
+       ubnt,edgerouter-lite)
                local kernel_length=$(tar xf $tar_file $board_dir/kernel -O | 
wc -c 2> /dev/null)
                local rootfs_length=$(tar xf $tar_file $board_dir/root -O | wc 
-c 2> /dev/null)
                [ "$kernel_length" = 0 -o "$rootfs_length" = 0 ] && {
diff --git a/target/linux/octeon/image/Makefile 
b/target/linux/octeon/image/Makefile
index b91c262447..83a3274587 100644
--- a/target/linux/octeon/image/Makefile
+++ b/target/linux/octeon/image/Makefile
@@ -71,6 +71,7 @@ define Device/ubnt_edgerouter-lite
   DEVICE_MODEL := EdgeRouter Lite
   BOARD_NAME := erlite
   CMDLINE := $(ERLITE_CMDLINE)
+SUPPORTED_DEVICES := erlite ubnt,edgerouter-lite
 endef
 TARGET_DEVICES += ubnt_edgerouter-lite
 
-- 
2.20.1


_______________________________________________
openwrt-devel mailing list
openwrt-devel@lists.openwrt.org
https://lists.openwrt.org/mailman/listinfo/openwrt-devel

Reply via email to