]> git.ipfire.org Git - thirdparty/openwrt.git/commitdiff
uboot-mediatek: add USB bootmenu for Zyxel EX5601 18949/head
authorPaweł Owoc <frut3k7@gmail.com>
Wed, 28 May 2025 15:18:24 +0000 (17:18 +0200)
committerHauke Mehrtens <hauke@hauke-m.de>
Sun, 13 Jul 2025 14:54:10 +0000 (16:54 +0200)
Add new option to bootmenu which allows to boot the system from USB.
You can use dd to prepare USB with initramfs:
- dd bs=1M if=openwrt-mediatek-filogic-zyxel_ex5601-t0-ubootmod-initramfs-factory.ubi of=/dev/sdX

Signed-off-by: Paweł Owoc <frut3k7@gmail.com>
Link: https://github.com/openwrt/openwrt/pull/18949
Signed-off-by: Hauke Mehrtens <hauke@hauke-m.de>
package/boot/uboot-mediatek/patches/439-add-zyxel_ex5601-t0.patch

index 141121518a47c3afbe4766e81a4109ea562f31c5..b731563815421c323adfc48403ed6a0bd9e9ca58 100644 (file)
 +
 --- /dev/null
 +++ b/defenvs/zyxel_ex5601-t0_env
-@@ -0,0 +1,55 @@
+@@ -0,0 +1,57 @@
 +ethaddr_factory=mtd read Factory 0x40080000 0x0 0x20000 && env readmem -b ethaddr 0x4008002A 0x6 ; setenv ethaddr_factory
 +ipaddr=192.168.1.1
 +serverip=192.168.1.254
 +bootmenu_0=Initialize environment.=run _firstboot
 +bootmenu_0d=Run default boot command.=run boot_default
 +bootmenu_1=Boot system via TFTP.=run boot_tftp ; run bootmenu_confirm_return
-+bootmenu_2=Boot production system from NAND.=run boot_production ; run bootmenu_confirm_return
-+bootmenu_3=Boot recovery system from NAND.=run boot_recovery ; run bootmenu_confirm_return
-+bootmenu_4=Load production system via TFTP then write to NAND.=setenv noboot 1 ; setenv replacevol 1 ; run boot_tftp_production ; setenv noboot ; setenv replacevol ; run bootmenu_confirm_return
-+bootmenu_5=Load recovery system via TFTP then write to NAND.=setenv noboot 1 ; setenv replacevol 1 ; run boot_tftp_recovery ; setenv noboot ; setenv replacevol ; run bootmenu_confirm_return
-+bootmenu_6=\e[31mLoad BL31+U-Boot FIP via TFTP then write to NAND.\e[0m=run boot_tftp_write_fip ; run bootmenu_confirm_return
-+bootmenu_7=\e[31mLoad BL2 preloader via TFTP then write to NAND.\e[0m=run boot_tftp_write_bl2 ; run bootmenu_confirm_return
-+bootmenu_8=Reboot.=reset
-+bootmenu_9=Reset all settings to factory defaults.=run reset_factory ; reset
++bootmenu_2=Boot system from USB.=run boot_usb ; run bootmenu_confirm_return
++bootmenu_3=Boot production system from NAND.=run boot_production ; run bootmenu_confirm_return
++bootmenu_4=Boot recovery system from NAND.=run boot_recovery ; run bootmenu_confirm_return
++bootmenu_5=Load production system via TFTP then write to NAND.=setenv noboot 1 ; setenv replacevol 1 ; run boot_tftp_production ; setenv noboot ; setenv replacevol ; run bootmenu_confirm_return
++bootmenu_6=Load recovery system via TFTP then write to NAND.=setenv noboot 1 ; setenv replacevol 1 ; run boot_tftp_recovery ; setenv noboot ; setenv replacevol ; run bootmenu_confirm_return
++bootmenu_7=\e[31mLoad BL31+U-Boot FIP via TFTP then write to NAND.\e[0m=run boot_tftp_write_fip ; run bootmenu_confirm_return
++bootmenu_8=\e[31mLoad BL2 preloader via TFTP then write to NAND.\e[0m=run boot_tftp_write_bl2 ; run bootmenu_confirm_return
++bootmenu_9=Reboot.=reset
++bootmenu_10=Reset all settings to factory defaults.=run reset_factory ; reset
 +boot_first=if button reset ; then run boot_tftp_recovery ; setenv flag_recover 1 ; run boot_default ; fi ; bootmenu
 +boot_default=if env exists flag_recover ; then else run bootcmd ; fi ; run boot_recovery ; setenv replacevol 1 ; run boot_tftp_forever
 +boot_production=run ubi_read_production && bootm $loadaddr#$bootconf
 +boot_tftp=tftpboot $loadaddr $bootfile && bootm $loadaddr#$bootconf
 +boot_tftp_write_fip=tftpboot $loadaddr $bootfile_fip && run mtd_write_fip && run reset_factory
 +boot_tftp_write_bl2=tftpboot $loadaddr $bootfile_bl2 && run mtd_write_bl2
++boot_usb=usb start && usbboot $loadaddr 0 && bootm $loadaddr#$bootconf
 +part_fit=fit
 +reset_factory=ubi part ubi ; mw $loadaddr 0x0 0x800 ; ubi write $loadaddr ubootenv 0x800 ; ubi write $loadaddr ubootenv2 0x800
 +mtd_write_fip=mtd erase fip && mtd write fip $loadaddr