[PATCH v2] octeon: rename erlite to ubnt,edgerouter-lite

Adrian Schmutzler mail at adrianschmutzler.de
Sun May 23 02:58:12 PDT 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 22:08
> To: openwrt-devel at lists.openwrt.org
> Subject: [PATCH v2] octeon: rename erlite to ubnt,edgerouter-lite
> 
> 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.

Just found this "old" patch on patchwork. Comments below.

> 
> Signed-off-by: Stijn Segers <foss at 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
> +		;;

This needs to be rebased due to my recent patch.

>  	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

This can be simplified to
SUPPORTED_DEVICES += erlite
since the other value is the global default now. Note that indent is broken here as well.

If this is properly tested, I'm inclined to merge an updated version. Consider combining this into a patchset with the ethX patch for which I will write comments in just a minute.

Best

Adrian

>  endef
>  TARGET_DEVICES += ubnt_edgerouter-lite
> 
> --
> 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/20210523/f4c109c1/attachment.sig>


More information about the openwrt-devel mailing list