[PATCH 1/2] octeon: rename erlite to ubnt,erlite
Adrian Schmutzler
mail at adrianschmutzler.de
Fri Jan 8 07:29:23 EST 2021
Hi,
> -----Original Message-----
> From: openwrt-devel [mailto:openwrt-devel-bounces at lists.openwrt.org]
> On Behalf Of Stijn Segers
> Sent: Freitag, 8. Januar 2021 11:28
> To: openwrt-devel at lists.openwrt.org
> Subject: [PATCH 1/2] octeon: rename erlite to ubnt,erlite
>
> 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.
If we touch this, please use ubnt,edgerouter-lite to match the devices in other targets.
I always wanted to do this but never did it because I don't have the device to test and breaking sysupgrade was not an option for me here.
However, with BOARD_NAME in place I'm not sure whether sysupgrade would still break if you also add SUPPORTED_DEVICES properly.
Additional comments below.
>
> Signed-off-by: Stijn Segers <foss at 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
What's the purpose of this change? If it just "adds a friendly name" it should probably be separate, as the rest is about changing the board_name.
Best
Adrian
> }
>
> 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 at lists.openwrt.org
> https://lists.openwrt.org/mailman/listinfo/openwrt-devel
-------------- next part --------------
A non-text attachment was scrubbed...
Name: openpgp-digital-signature.asc
Type: application/pgp-signature
Size: 834 bytes
Desc: not available
URL: <http://lists.openwrt.org/pipermail/openwrt-devel/attachments/20210108/a1c95066/attachment-0001.sig>
More information about the openwrt-devel
mailing list