diff mbox series

[v2] mt7621: move uboot-envtools to DEFAULT_PACKAGES

Message ID 20230227123819.3842071-1-bjorn@mork.no
State Superseded
Delegated to: Hauke Mehrtens
Headers show
Series [v2] mt7621: move uboot-envtools to DEFAULT_PACKAGES | expand

Commit Message

Bjørn Mork Feb. 27, 2023, 12:38 p.m. UTC
Several devices depend on fw_printenv during sysupgrade.  Make sure
it always is present in all images, including initramfs images built
by the buildbots.

Fixes: 2449a632084b ("ramips: mt7621: Add support for ZyXEL NR7101")
Signed-off-by: Bjørn Mork <bjorn@mork.no>
---
Changes since v1:
 - rebased onto current master

 target/linux/ramips/image/mt7621.mk  | 68 ++++++++++++----------------
 target/linux/ramips/mt7621/target.mk |  2 +-
 2 files changed, 29 insertions(+), 41 deletions(-)

Comments

Hauke Mehrtens Feb. 27, 2023, 10:23 p.m. UTC | #1
On 2/27/23 13:38, Bjørn Mork wrote:
> Several devices depend on fw_printenv during sysupgrade.  Make sure
> it always is present in all images, including initramfs images built
> by the buildbots.
> 
> Fixes: 2449a632084b ("ramips: mt7621: Add support for ZyXEL NR7101")
> Signed-off-by: Bjørn Mork <bjorn@mork.no>
> ---
> Changes since v1:
>   - rebased onto current master
> 
>   target/linux/ramips/image/mt7621.mk  | 68 ++++++++++++----------------
>   target/linux/ramips/mt7621/target.mk |  2 +-
>   2 files changed, 29 insertions(+), 41 deletions(-)
> 
.....
> diff --git a/target/linux/ramips/mt7621/target.mk b/target/linux/ramips/mt7621/target.mk
> index cfb798e35852..153ff08421d6 100644
> --- a/target/linux/ramips/mt7621/target.mk
> +++ b/target/linux/ramips/mt7621/target.mk
> @@ -10,7 +10,7 @@ KERNELNAME:=vmlinux vmlinuz
>   # make Kernel/CopyImage use $LINUX_DIR/vmlinuz
>   IMAGES_DIR:=../../..
>   
> -DEFAULT_PACKAGES += wpad-basic-mbedtls
> +DEFAULT_PACKAGES += wpad-basic-mbedtls uboot-envtools
>   
>   define Target/Description
>   	Build firmware images for Ralink MT7621 based boards.

This will add uboot-envtools to all devices. uboot-envtools is not 
included in all DEVICE_PACKAGES now, should we explicitly remove it from 
device definitions which do not had it before?

The Device/adslr_g7 for example does not add uboot-envtools in its 
DEVICE_PACKAGES.

Hauke
Peter Naulls Feb. 27, 2023, 10:37 p.m. UTC | #2
On 2/27/23 17:23, Hauke Mehrtens wrote:
       Build firmware images for Ralink MT7621 based boards.
> 
> This will add uboot-envtools to all devices. uboot-envtools is not included in 
> all DEVICE_PACKAGES now, should we explicitly remove it from device definitions 
> which do not had it before?
> 
> The Device/adslr_g7 for example does not add uboot-envtools in its DEVICE_PACKAGES.
> 

Same comment for NAND support. Only 1/3rd or so of the mt7621 systems use the 
nand feature.
Bjørn Mork Feb. 28, 2023, 7:05 a.m. UTC | #3
Hauke Mehrtens <hauke@hauke-m.de> writes:

> On 2/27/23 13:38, Bjørn Mork wrote:
>> Several devices depend on fw_printenv during sysupgrade.  Make sure
>> it always is present in all images, including initramfs images built
>> by the buildbots.
>> Fixes: 2449a632084b ("ramips: mt7621: Add support for ZyXEL NR7101")
>> Signed-off-by: Bjørn Mork <bjorn@mork.no>
>> ---
>> Changes since v1:
>>   - rebased onto current master
>>   target/linux/ramips/image/mt7621.mk  | 68
>> ++++++++++++----------------
>>   target/linux/ramips/mt7621/target.mk |  2 +-
>>   2 files changed, 29 insertions(+), 41 deletions(-)
>> 
> .....
>> diff --git a/target/linux/ramips/mt7621/target.mk b/target/linux/ramips/mt7621/target.mk
>> index cfb798e35852..153ff08421d6 100644
>> --- a/target/linux/ramips/mt7621/target.mk
>> +++ b/target/linux/ramips/mt7621/target.mk
>> @@ -10,7 +10,7 @@ KERNELNAME:=vmlinux vmlinuz
>>   # make Kernel/CopyImage use $LINUX_DIR/vmlinuz
>>   IMAGES_DIR:=../../..
>>   -DEFAULT_PACKAGES += wpad-basic-mbedtls
>> +DEFAULT_PACKAGES += wpad-basic-mbedtls uboot-envtools
>>     define Target/Description
>>   	Build firmware images for Ralink MT7621 based boards.
>
> This will add uboot-envtools to all devices. uboot-envtools is not
> included in all DEVICE_PACKAGES now, should we explicitly remove it
> from device definitions which do not had it before?
>
> The Device/adslr_g7 for example does not add uboot-envtools in its
> DEVICE_PACKAGES.

Good point.  I'll update the patch


Bjørn
Bjørn Mork Feb. 28, 2023, 11:46 a.m. UTC | #4
Peter Naulls <peter@chocky.org> writes:
> On 2/27/23 17:23, Hauke Mehrtens wrote:
>
>> This will add uboot-envtools to all devices. uboot-envtools is not
>> included in all DEVICE_PACKAGES now, should we explicitly remove it
>> from device definitions which do not had it before?
>> The Device/adslr_g7 for example does not add uboot-envtools in its
>> DEVICE_PACKAGES.
>> 
>
> Same comment for NAND support. Only 1/3rd or so of the mt7621 systems
> use the nand feature.

This is a difficult problem for any feature which is required by one or
more device during boot or upgrade.  Using a shared rootfs per target
means that all such features must be included on all devices.

The alternatives are AFAICS
1) splitting targets by feature sets
2) always use a per-device rootfs

I believe 2) is non-trivial.  1) might be easier and could make some sense
for huge targets like mt7621?


Bjørn
Peter Naulls Feb. 28, 2023, 12:45 p.m. UTC | #5
On 2/28/23 06:46, Bjørn Mork wrote:
> Peter Naulls <peter@chocky.org> writes:
>> On 2/27/23 17:23, Hauke Mehrtens wrote:
>>
>>> This will add uboot-envtools to all devices. uboot-envtools is not
>>> included in all DEVICE_PACKAGES now, should we explicitly remove it
>>> from device definitions which do not had it before?
>>> The Device/adslr_g7 for example does not add uboot-envtools in its
>>> DEVICE_PACKAGES.
>>>
>>
>> Same comment for NAND support. Only 1/3rd or so of the mt7621 systems
>> use the nand feature.
> 
> This is a difficult problem for any feature which is required by one or
> more device during boot or upgrade.  Using a shared rootfs per target
> means that all such features must be included on all devices.
> 
> The alternatives are AFAICS
> 1) splitting targets by feature sets
> 2) always use a per-device rootfs
> 
> I believe 2) is non-trivial.  1) might be easier and could make some sense
> for huge targets like mt7621?

Well, I certainly agree. I have this situation. I have a separate build
system, which setups an overlay per device (3x mt7621 boards) in files and then 
also  does some post-processing to the rootfs via a change I put in the end
of the OpenWrt scripts. But one solution here might be per-target
package selection - I can imagine this getting messy though.
Felix Baumann Feb. 28, 2023, 2:07 p.m. UTC | #6
Am 28. Februar 2023 12:46:44 MEZ schrieb "Bjørn Mork" <bjorn@mork.no>:
>Peter Naulls <peter@chocky.org> writes:
>> On 2/27/23 17:23, Hauke Mehrtens wrote:
>>
>>> This will add uboot-envtools to all devices. uboot-envtools is not
>>> included in all DEVICE_PACKAGES now, should we explicitly remove it
>>> from device definitions which do not had it before?
>>> The Device/adslr_g7 for example does not add uboot-envtools in its
>>> DEVICE_PACKAGES.
>>> 
>>
>> Same comment for NAND support. Only 1/3rd or so of the mt7621 systems
>> use the nand feature.
>
>This is a difficult problem for any feature which is required by one or
>more device during boot or upgrade.  Using a shared rootfs per target
>means that all such features must be included on all devices.
>
>The alternatives are AFAICS
>1) splitting targets by feature sets
>2) always use a per-device rootfs
>
>I believe 2) is non-trivial.  1) might be easier and could make some sense
>for huge targets like mt7621?
>
>
>Bjørn
>
>_______________________________________________
>openwrt-devel mailing list
>openwrt-devel@lists.openwrt.org
>https://lists.openwrt.org/mailman/listinfo/openwrt-devel

Hi,

one issue I see here is that there are MT7621 devices like the Asus RT-AX53U that don't save their environment to their u-boot-env partition by default.
You still need to execute saveenv while connected via serial.
Note: the device doesn't have a u-boot-env partition in stock rom. The environment is saved to the second half of the original u-boot partition.
We added uboot-envtools support by splitting the u-boot partition in half.

Some ideas for uboot-envtools if it gets build by default on ramips:
Would it make sense to find a way to extract default config from uboot and introduce a way to (re)set env to default if it can't be read? Or is that impossible?
(Can't be read: empty partition or bad crc)

Right now fw_printenv can't distinguish between empty u-boot-env partitions and ones whose CRC is bad.
Both cases error: "Warning: Bad CRC, using default environment"
Which is misleading since this is a kind of environment that will brick any device you don't have serial access to.

What should fw_printenv/fw_setenv error, when there is no definition for the device in package/boot/uboot-envtools/files/ramips, yet? Right now it's:
"Cannot parse config file '/etc/fw_env.config': No such file or directory
Failed to find NVMEM device"
Or is that error message enough?

I'm not sure whether it's possible to autodetect these offsets, but if we build every device with this package, then it might make sense to add them to dts, so they can be set more easily on a per partition basis? (some devices have two environments, see sys_config)


Regards
Felix Baumann
Peter Naulls Feb. 28, 2023, 5:33 p.m. UTC | #7
On 2/28/23 09:07, Felix Baumann wrote:

> one issue I see here is that there are MT7621 devices like the Asus RT-AX53U that don't save their environment to their u-boot-env partition by default.
> You still need to execute saveenv while connected via serial.
> Note: the device doesn't have a u-boot-env partition in stock rom. The environment is saved to the second half of the original u-boot partition.
> We added uboot-envtools support by splitting the u-boot partition in half.

What problem are you trying to solve here?  Are you relying upon the u-boot 
values for MAC address or something?

On one of my boards, so I do fix up the u-boot values, just so it's correct, but 
the actual MAC values are stored elsewhere in both binary and ASCII values.

If you just care about reading the values, it's not required to use u-boot-env
tools - you can parse yourself or use the OpenWrt functions, which are basically
a "strings" operation.

But I think the bottom line here is mt7621 is a very diverse platform, and 
there's no one-size-fits-all with package selection or anything.
diff mbox series

Patch

diff --git a/target/linux/ramips/image/mt7621.mk b/target/linux/ramips/image/mt7621.mk
index 28f6fef68173..44fe7c106cd7 100644
--- a/target/linux/ramips/image/mt7621.mk
+++ b/target/linux/ramips/image/mt7621.mk
@@ -154,7 +154,7 @@  define Device/alfa-network_quad-e4g
   IMAGE_SIZE := 16064k
   DEVICE_VENDOR := ALFA Network
   DEVICE_MODEL := Quad-E4G
-  DEVICE_PACKAGES := kmod-ata-ahci kmod-sdhci-mt7620 kmod-usb3 uboot-envtools \
+  DEVICE_PACKAGES := kmod-ata-ahci kmod-sdhci-mt7620 kmod-usb3 \
 	-wpad-basic-mbedtls
   SUPPORTED_DEVICES += quad-e4g
 endef
@@ -163,7 +163,7 @@  TARGET_DEVICES += alfa-network_quad-e4g
 define Device/ampedwireless_ally_common
   $(Device/dsa-migration)
   DEVICE_VENDOR := Amped Wireless
-  DEVICE_PACKAGES := kmod-mt7615-firmware uboot-envtools
+  DEVICE_PACKAGES := kmod-mt7615-firmware
   IMAGE_SIZE := 32768k
   KERNEL_SIZE := 4096k
   BLOCKSIZE := 128k
@@ -285,7 +285,7 @@  define Device/asus_rt-ac65p
   IMAGE/sysupgrade.bin := sysupgrade-tar | append-metadata
   IMAGE/factory.bin := append-kernel | pad-to $$(KERNEL_SIZE) | append-ubi | \
 	check-size
-  DEVICE_PACKAGES := kmod-usb3 kmod-mt7615-firmware uboot-envtools
+  DEVICE_PACKAGES := kmod-usb3 kmod-mt7615-firmware
 endef
 TARGET_DEVICES += asus_rt-ac65p
 
@@ -302,7 +302,7 @@  define Device/asus_rt-ac85p
   IMAGE/sysupgrade.bin := sysupgrade-tar | append-metadata
   IMAGE/factory.bin := append-kernel | pad-to $$(KERNEL_SIZE) | append-ubi | \
 	check-size
-  DEVICE_PACKAGES := kmod-usb3 kmod-mt7615-firmware uboot-envtools
+  DEVICE_PACKAGES := kmod-usb3 kmod-mt7615-firmware
 endef
 TARGET_DEVICES += asus_rt-ac85p
 
@@ -333,8 +333,7 @@  define Device/asus_rt-ax53u
   IMAGE/sysupgrade.bin := sysupgrade-tar | append-metadata
   IMAGE/factory.bin := append-kernel | pad-to $$(KERNEL_SIZE) | append-ubi | \
 	check-size
-  DEVICE_PACKAGES := kmod-mt7915-firmware kmod-usb3 uboot-envtools \
-	kmod-usb-ledtrig-usbport
+  DEVICE_PACKAGES := kmod-mt7915-firmware kmod-usb3 kmod-usb-ledtrig-usbport
 endef
 TARGET_DEVICES += asus_rt-ax53u
 
@@ -357,7 +356,7 @@  define Device/asus_rt-ax54
   IMAGE/sysupgrade.bin := sysupgrade-tar | append-metadata
   IMAGE/factory.bin := append-kernel | pad-to $$(KERNEL_SIZE) | append-ubi | \
 	check-size
-  DEVICE_PACKAGES := kmod-mt7915-firmware uboot-envtools 
+  DEVICE_PACKAGES := kmod-mt7915-firmware
 endef
 TARGET_DEVICES += asus_rt-ax54
 
@@ -378,8 +377,7 @@  define Device/beeline_smartbox-flash
   IMAGES += factory.trx
   IMAGE/factory.trx := append-kernel | append-ubi | check-size
   IMAGE/sysupgrade.bin := sysupgrade-tar | append-metadata
-  DEVICE_PACKAGES := kmod-usb3 kmod-mt7615-firmware \
-	uboot-envtools uencrypt
+  DEVICE_PACKAGES := kmod-usb3 kmod-mt7615-firmware uencrypt
 endef
 TARGET_DEVICES += beeline_smartbox-flash
 
@@ -392,7 +390,7 @@  define Device/beeline_smartbox-giga
   DEVICE_VENDOR := Beeline
   DEVICE_MODEL := SmartBox GIGA
   DEVICE_PACKAGES := kmod-mt7603 kmod-mt7615e kmod-mt7663-firmware-ap \
-	kmod-usb3 uboot-envtools
+	kmod-usb3
 endef
 TARGET_DEVICES += beeline_smartbox-giga
 
@@ -404,8 +402,7 @@  define Device/beeline_smartbox-turbo
   SERCOMM_SWVER := 1004
   DEVICE_VENDOR := Beeline
   DEVICE_MODEL := SmartBox TURBO
-  DEVICE_PACKAGES := kmod-mt7603 kmod-mt7615-firmware \
-	kmod-usb3 uboot-envtools
+  DEVICE_PACKAGES := kmod-mt7603 kmod-mt7615-firmware kmod-usb3
 endef
 TARGET_DEVICES += beeline_smartbox-turbo
 
@@ -417,7 +414,7 @@  define Device/belkin_rt1800
   IMAGE_SIZE := 49152k
   DEVICE_VENDOR := Belkin
   DEVICE_MODEL := RT1800
-  DEVICE_PACKAGES := kmod-mt7915-firmware kmod-usb3 uboot-envtools
+  DEVICE_PACKAGES := kmod-mt7915-firmware kmod-usb3
   UBINIZE_OPTS := -E 5
   KERNEL_LOADADDR := 0x82000000
   KERNEL := kernel-bin | relocate-kernel 0x80001000 | lzma | \
@@ -471,7 +468,7 @@  define Device/bolt_arion
   IMAGE_SIZE := 32448k
   DEVICE_VENDOR := BOLT
   DEVICE_MODEL := Arion
-  DEVICE_PACKAGES := kmod-mt7603 kmod-mt76x2 uboot-envtools
+  DEVICE_PACKAGES := kmod-mt7603 kmod-mt76x2
 endef
 TARGET_DEVICES += bolt_arion
 
@@ -907,8 +904,7 @@  define Device/etisalat_s3
   SERCOMM_SWVER := 4009
   DEVICE_VENDOR := Etisalat
   DEVICE_MODEL := S3
-  DEVICE_PACKAGES := kmod-mt7603 kmod-mt7615-firmware \
-	kmod-usb3 uboot-envtools
+  DEVICE_PACKAGES := kmod-mt7603 kmod-mt7615-firmware kmod-usb3
 endef
 TARGET_DEVICES += etisalat_s3
 
@@ -974,7 +970,7 @@  define Device/h3c_tx180x
   KERNEL := $$(KERNEL_INITRAMFS) | h3c-blank-header
   IMAGE/sysupgrade.bin := sysupgrade-tar | append-metadata
   DEVICE_VENDOR := H3C
-  DEVICE_PACKAGES := kmod-mt7915-firmware uboot-envtools
+  DEVICE_PACKAGES := kmod-mt7915-firmware
 endef
 
 define Device/h3c_tx1800-plus
@@ -1011,7 +1007,7 @@  ifneq ($(CONFIG_TARGET_ROOTFS_INITRAMFS),)
 	haier-sim_wr1800k-factory
 endif
   IMAGE/sysupgrade.bin := sysupgrade-tar | append-metadata
-  DEVICE_PACKAGES := kmod-mt7915-firmware uboot-envtools
+  DEVICE_PACKAGES := kmod-mt7915-firmware
 endef
 
 define Device/haier_har-20s2u1
@@ -1312,7 +1308,7 @@  define Device/jcg_q20
 	check-size
   DEVICE_VENDOR := JCG
   DEVICE_MODEL := Q20
-  DEVICE_PACKAGES := kmod-mt7915-firmware uboot-envtools
+  DEVICE_PACKAGES := kmod-mt7915-firmware
 endef
 TARGET_DEVICES += jcg_q20
 
@@ -1364,8 +1360,7 @@  define Device/linksys_e5600
   IMAGE_SIZE := 26624k
   DEVICE_VENDOR := Linksys
   DEVICE_MODEL := E5600
-  DEVICE_PACKAGES := kmod-mt7603 kmod-mt7615e kmod-mt7663-firmware-ap \
-	uboot-envtools
+  DEVICE_PACKAGES := kmod-mt7603 kmod-mt7615e kmod-mt7663-firmware-ap
   UBINIZE_OPTS := -E 5
   IMAGES += factory.bin
   IMAGE/sysupgrade.bin := sysupgrade-tar | check-size | append-metadata
@@ -1391,8 +1386,7 @@  define Device/linksys_ea7xxx
   KERNEL_SIZE := 4096k
   IMAGE_SIZE := 36864k
   DEVICE_VENDOR := Linksys
-  DEVICE_PACKAGES := kmod-usb3 kmod-mt7615-firmware \
-	uboot-envtools
+  DEVICE_PACKAGES := kmod-usb3 kmod-mt7615-firmware
   UBINIZE_OPTS := -E 5
   IMAGES := sysupgrade.bin factory.bin
   IMAGE/sysupgrade.bin := sysupgrade-tar | check-size | append-metadata
@@ -1573,7 +1567,7 @@  define Device/mts_wg430223
   IMAGES += factory.trx
   IMAGE/factory.trx := append-kernel | append-ubi | check-size
   IMAGE/sysupgrade.bin := sysupgrade-tar | append-metadata
-  DEVICE_PACKAGES := kmod-mt7615-firmware uboot-envtools uencrypt
+  DEVICE_PACKAGES := kmod-mt7615-firmware uencrypt
 endef
 TARGET_DEVICES += mts_wg430223
 
@@ -1859,8 +1853,7 @@  define Device/raisecom_msg1500-x-00
   DEVICE_VARIANT := X.00
   DEVICE_ALT0_VENDOR := Nokia
   DEVICE_ALT0_MODEL := A-040W-Q
-  DEVICE_PACKAGES := kmod-mt7615-firmware kmod-usb3 \
-	kmod-usb-ledtrig-usbport uboot-envtools
+  DEVICE_PACKAGES := kmod-mt7615-firmware kmod-usb3 kmod-usb-ledtrig-usbport
 endef
 TARGET_DEVICES += raisecom_msg1500-x-00
 
@@ -1883,8 +1876,7 @@  define Device/rostelecom_rt-sf-1
   SERCOMM_SWVER := 1026
   DEVICE_VENDOR := Rostelecom
   DEVICE_MODEL := RT-SF-1
-  DEVICE_PACKAGES := kmod-mt7603 kmod-mt7615-firmware \
-	kmod-usb3 uboot-envtools
+  DEVICE_PACKAGES := kmod-mt7603 kmod-mt7615-firmware kmod-usb3
 endef
 TARGET_DEVICES += rostelecom_rt-sf-1
 
@@ -1895,7 +1887,7 @@  define Device/samknows_whitebox-v8
   DEVICE_VENDOR := SamKnows
   DEVICE_MODEL := Whitebox 8
   DEVICE_PACKAGES := kmod-mt7603 kmod-mt76x2 kmod-usb3 \
-	kmod-usb-ledtrig-usbport uboot-envtools
+	kmod-usb-ledtrig-usbport
   SUPPORTED_DEVICES += sk-wb8
 endef
 TARGET_DEVICES += samknows_whitebox-v8
@@ -2100,8 +2092,7 @@  define Device/tplink_ec330-g5u-v1
   DEVICE_ALT0_VENDOR := TP-Link
   DEVICE_ALT0_MODEL := Archer C9ERT
   DEVICE_VARIANT := v1
-  DEVICE_PACKAGES := kmod-mt7615-firmware kmod-usb-ledtrig-usbport \
-	kmod-usb3 uboot-envtools
+  DEVICE_PACKAGES := kmod-mt7615-firmware kmod-usb-ledtrig-usbport kmod-usb3
   KERNEL := kernel-bin | append-dtb | lzma | loader-kernel | \
 	uImage-tplink-c9 standalone '$(call toupper,$(LINUX_KARCH)) \
 		$(VERSION_DIST) Linux-$(LINUX_VERSION)' | \
@@ -2402,7 +2393,6 @@  define Device/xiaomi_nand_separate
   $(Device/dsa-migration)
   $(Device/uimage-lzma-loader)
   DEVICE_VENDOR := Xiaomi
-  DEVICE_PACKAGES := uboot-envtools
   BLOCKSIZE := 128k
   PAGESIZE := 2048
   KERNEL_SIZE := 4096k
@@ -2449,8 +2439,7 @@  define Device/xiaomi_mi-router-3-pro
   IMAGE/sysupgrade.bin := sysupgrade-tar | append-metadata
   IMAGE/factory.bin := append-kernel | pad-to $$(KERNEL_SIZE) | append-ubi | \
 	check-size
-  DEVICE_PACKAGES := kmod-mt7615-firmware kmod-usb3 \
-	kmod-usb-ledtrig-usbport uboot-envtools
+  DEVICE_PACKAGES := kmod-mt7615-firmware kmod-usb3 kmod-usb-ledtrig-usbport
   SUPPORTED_DEVICES += xiaomi,mir3p
 endef
 TARGET_DEVICES += xiaomi_mi-router-3-pro
@@ -2506,7 +2495,7 @@  define Device/xiaomi_mi-router-cr660x
   IMAGE/sysupgrade.bin := sysupgrade-tar | append-metadata
   IMAGE/firmware.bin := append-kernel | pad-to $$(KERNEL_SIZE) | append-ubi | \
 	check-size
-  DEVICE_PACKAGES += kmod-mt7915-firmware uboot-envtools
+  DEVICE_PACKAGES += kmod-mt7915-firmware
 endef
 
 define Device/xiaomi_mi-router-cr6606
@@ -2732,9 +2721,8 @@  define Device/zyxel_lte3301-plus
   UBINIZE_OPTS := -E 5
   DEVICE_VENDOR := ZyXEL
   DEVICE_MODEL := LTE3301-PLUS
-  DEVICE_PACKAGES := kmod-mt7615-firmware kmod-usb3 \
-	uboot-envtools kmod-usb-ledtrig-usbport kmod-usb-net-qmi-wwan \
-	kmod-usb-serial-option uqmi
+  DEVICE_PACKAGES := kmod-mt7615-firmware kmod-usb3 kmod-usb-ledtrig-usbport \
+	kmod-usb-net-qmi-wwan kmod-usb-serial-option uqmi
   KERNEL := $(KERNEL_DTB) | uImage lzma | \
 	zytrx-header $$(DEVICE_MODEL) $$(VERSION_DIST)-$$(REVISION)
   KERNEL_INITRAMFS := $(KERNEL_DTB) | uImage lzma | \
@@ -2751,7 +2739,7 @@  define Device/zyxel_nr7101
   UBINIZE_OPTS := -E 5
   DEVICE_VENDOR := ZyXEL
   DEVICE_MODEL := NR7101
-  DEVICE_PACKAGES := kmod-mt7603 kmod-usb3 uboot-envtools kmod-usb-net-qmi-wwan kmod-usb-serial-option uqmi
+  DEVICE_PACKAGES := kmod-mt7603 kmod-usb3 kmod-usb-net-qmi-wwan kmod-usb-serial-option uqmi
   KERNEL := $(KERNEL_DTB) | uImage lzma | zytrx-header $$(DEVICE_MODEL) $$(VERSION_DIST)-$$(REVISION)
   KERNEL_INITRAMFS := $(KERNEL_DTB) | uImage lzma | zytrx-header $$(DEVICE_MODEL) 9.99(ABUV.9)$$(VERSION_DIST)-recovery
   KERNEL_INITRAMFS_SUFFIX := -recovery.bin
@@ -2766,7 +2754,7 @@  define Device/zyxel_nwa-ax
   PAGESIZE := 2048
   KERNEL_SIZE := 8192k
   UBINIZE_OPTS := -E 5
-  DEVICE_PACKAGES := kmod-mt7915-firmware uboot-envtools zyxel-bootconfig
+  DEVICE_PACKAGES := kmod-mt7915-firmware zyxel-bootconfig
   KERNEL := kernel-bin | lzma | fit lzma $$(KDIR)/image-$$(firstword $$(DEVICE_DTS)).dtb
   IMAGES += factory.bin ramboot-factory.bin
   IMAGE/factory.bin := append-kernel | pad-to $$(KERNEL_SIZE) | append-ubi | zyxel-nwa-fit
diff --git a/target/linux/ramips/mt7621/target.mk b/target/linux/ramips/mt7621/target.mk
index cfb798e35852..153ff08421d6 100644
--- a/target/linux/ramips/mt7621/target.mk
+++ b/target/linux/ramips/mt7621/target.mk
@@ -10,7 +10,7 @@  KERNELNAME:=vmlinux vmlinuz
 # make Kernel/CopyImage use $LINUX_DIR/vmlinuz
 IMAGES_DIR:=../../..
 
-DEFAULT_PACKAGES += wpad-basic-mbedtls
+DEFAULT_PACKAGES += wpad-basic-mbedtls uboot-envtools
 
 define Target/Description
 	Build firmware images for Ralink MT7621 based boards.