Prefix EdgeRouter Lite board_name value with vendor abbreviation UBNT, as other 
Ubiquiti
devices do, and use full name "Ubiquiti EdgeRouter Lite" as model value.

Signed-off-by: Stijn Segers <f...@volatilesystems.org>
---
 .../octeon/base-files/lib/preinit/01_sysinfo     | 10 ++++++++--
 .../octeon/base-files/lib/preinit/79_move_config |  2 +-
 .../octeon/base-files/lib/upgrade/platform.sh    | 16 ++++++++--------
 3 files changed, 17 insertions(+), 11 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..497116b2c7 100644
--- a/target/linux/octeon/base-files/lib/preinit/01_sysinfo
+++ b/target/linux/octeon/base-files/lib/preinit/01_sysinfo
@@ -6,7 +6,8 @@ do_sysinfo_octeon() {
 
        case "$machine" in
        "UBNT_E100"*)
-               name="erlite"
+               name="ubnt,erlite"
+               model="Ubiquiti EdgeRouter Lite"
                ;;
 
        "UBNT_E200"*)
@@ -34,7 +35,12 @@ do_sysinfo_octeon() {
        [ -e "/tmp/sysinfo/" ] || mkdir -p "/tmp/sysinfo/"
 
        echo "$name" > /tmp/sysinfo/board_name
-       echo "$machine" > /tmp/sysinfo/model
+       if [ -z "$model" ]
+       then
+               echo "$machine" > /tmp/sysinfo/model
+       else
+               echo "$model" > /tmp/sysinfo/model
+       fi
 }
 
 boot_hook_add preinit_main do_sysinfo_octeon
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..fb917ec39e 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,erlite)
                        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..5e5f33b719 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,erlite)
+               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,erlite)
                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,erlite)
                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 ] && {
-- 
2.20.1


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

Reply via email to