openwrt-pf/package/boot
Andrii Kuiukoff 417ccfed43
mediatek: comfast cf-wr632ax: add all-in-UBI layout
This commit introduces OpenWrt U-Boot UBI layout support
for the COMFAST CF-WR632AX, enabling:
- Prolonged device lifetime by allocating most of the flash
  to UBI (which takes care of wear-leveling)
- Maximum available storage space for OpenWrt
- Fully-featured U-Boot
- Effective recovery mechanisms

OpenWrt U-Boot UBI flash instructions
-------------------------------------

A device running stock firmware should be upgraded to the
latest standard OpenWrt firmware
(https://firmware-selector.openwrt.org/?target=mediatek%2Ffilogic&id=comfast_cf-wr632ax).

Back up critical data
---------------------

Console:
1. While the device is running OpenWrt with stock MTD partitions:
   mtd dump BL2 > /tmp/BL2.bin
   mtd dump u-boot-env > /tmp/u-boot-env.bin
   mtd dump Factory > /tmp/Factory.bin
   mtd dump FIP > /tmp/FIP.bin
2. Copy the backup files to your PC via SCP.

LuCI Web-UI:
"System" -> "Backup / Flash Firmware" -> "Save mtdblock contents"
Save mtdblock:
   BL2
   u-boot-env
   Factory
   FIP
Make sure the files were successfully downloaded to your downloads directory,
especially the Factory file.

Using the installer image
-------------------------
To simplify the installation process, this method uses a fork
of Daniel Golle's (@dangowrt) UBI Installer
https://github.com/dangowrt/owrt-ubi-installer

1. Ensure your router is running the latest generic OpenWrt firmware.
   Upgrade it if necessary.
2. Obtain the installer image:
   Build the installer from source
   https://github.com/andros-ua/owrt-ubi-installer/tree/cf-wr632ax
   or download a prebuilt image from the
   https://github.com/andros-ua/owrt-ubi-installer/releases
3. Flash the openwrt*-ubi-initramfs-recovery-installer.itb
   image using sysupgrade.
4. Wait for installation: the green status LED will blink rapidly,
   indicating that the all-in-UBI installer is running.
5. Once the installation finishes,
   the status LED will turn solid amber for 5 seconds.
6. After the device reboots, perform a final sysupgrade using the
   openwrt*-ubi-squashfs-sysupgrade.itb image.

Return to stock MTD
-------------------
1. Flash openwrt*comfast_cf-wr632ax-initramfs-kernel.bin
   via sysupgrade
2. Copy files to /tmp on the device via SCP:
   BL2.bin
   u-boot-env.bin
   Factory.bin
   FIP.bin
   openwrt*-squashfs-sysupgrade.bin
3. Restore stock MTD partitions:
   apk add kmod-mtd-rw
   insmod mtd-rw i_want_a_brick=1
   mtd write /tmp/BL2.bin BL2
   mtd write /tmp/u-boot-env.bin u-boot-env
   mtd write /tmp/Factory.bin Factory
   mtd write /tmp/FIP.bin FIP
4. Install the system:
   sysupgrade /tmp/*sysupgrade.bin

BL2 and FIP Recovery
--------------------
Use mtk_uartboot to recover corrupted BL2 or FIP via UART:
https://github.com/981213/mtk_uartboot

Stock layout
----------------------------------------
| dev:    size   erasesize  name       |
| mtd0: 00100000 00020000 "BL2"        |
| mtd1: 00080000 00020000 "u-boot-env" |
| mtd2: 00200000 00020000 "Factory"    |
| mtd3: 00200000 00020000 "FIP"        |
| mtd4: 07000000 00020000 "ubi"        |
----------------------------------------

OpenWrt U-Boot UBI layout
----------------------------------
| dev:    size   erasesize  name |
| mtd0: 00100000 00020000 "bl2"  |
| mtd1: 07f00000 00020000 "ubi"  |
----------------------------------

Signed-off-by: Andrii Kuiukoff <andros.ua@gmail.com>
Link: https://github.com/openwrt/openwrt/pull/23981
Signed-off-by: Jonas Jelonek <jelonek.jonas@gmail.com>
2026-07-30 21:42:33 +02:00
..
apboot-aruba-ipq806x ipq806x: add apboot package for AP-32x 2026-06-16 16:08:11 +02:00
apex
arm-trusted-firmware-bcm63xx treewide: remove references for obsolete binutils versions 2026-04-18 19:34:21 +02:00
arm-trusted-firmware-imx arm-trusted-firmware-imx: add new package 2026-06-01 17:49:36 +02:00
arm-trusted-firmware-mediatek arm-trusted-firmware-mediatek: cudy-ddr3: reduce ram speed to 1866 MT/s 2026-07-01 09:32:35 +02:00
arm-trusted-firmware-microchipsw boot: arm-trusted-firmware-microchipsw: depend on host Ruby 2026-01-12 18:01:17 +01:00
arm-trusted-firmware-mvebu arm-trusted-firmware-mvebu: bump to 2.14 2026-04-11 12:23:36 +02:00
arm-trusted-firmware-rockchip arm-trusted-firmware-rockchip: bump to 2.14.0 2026-01-15 16:33:26 +02:00
arm-trusted-firmware-stm32 arm-trusted-firmware-stm32: bump to v2.14 2026-02-26 23:34:10 +01:00
arm-trusted-firmware-sunxi arm-trusted-firmware-sunxi: bump to 2.14 2026-02-08 00:56:16 +01:00
arm-trusted-firmware-tools package: arm-trusted-firmware-tools: add proper patch header 2026-06-23 12:17:00 +02:00
at91bootstrap at91bootstrap: put at91bootstrap images into image staging directory 2025-04-04 14:39:00 +02:00
fconfig
grub2 treewide: use HTTPS URL for GNU websites 2026-01-02 18:07:02 +01:00
imx-bootlets treewide: use HTTPS for PKG_SOURCE_URL where possible 2026-04-20 11:58:37 +08:00
kexec-tools kexec-tools: add zstd to package dependencies 2026-01-28 23:56:15 +01:00
kobs-ng treewide: use HTTPS for PKG_SOURCE_URL where possible 2026-04-20 11:58:37 +08:00
mt7623n-preloader
opensbi opensbi: update tarball hash compressed by the zstd 1.5.7 2025-07-13 16:24:10 +02:00
optee-os-stm32 optee-os-stm32: bump to 4.9.0 2026-02-26 23:34:10 +01:00
rkbin rkbin: pack rk3528 atf/tpl blobs 2025-11-15 19:56:27 +01:00
tfa-layerscape tfa-layerscape: bump to lf-6.18.2-1.0.0 2026-06-26 18:50:56 +02:00
uboot-airoha uboot-airoha: fix ethernet on Gemtek W1700K 2026-07-28 09:46:24 +02:00
uboot-armsr boot: uboot-armsr: update to U-Boot 2025.04 2025-05-22 18:50:24 +02:00
uboot-at91 uboot-at91: fix build failure with GCC 14.4 2026-07-03 22:14:17 +02:00
uboot-ath79 uboot-ath79: update to v2026.04 2026-05-25 22:06:34 +02:00
uboot-bcm53xx uboot-bcm53xx: bump U-Boot to 2025.10 2026-01-06 01:15:46 +01:00
uboot-bcm4908 uboot-bcm4908: fix build with GCC14 2025-05-23 00:10:23 +02:00
uboot-bmips uboot-bmips: drop usage of AUTORELEASE 2025-10-29 21:09:56 +01:00
uboot-d1 uboot-d1: update to 2024.01 2026-01-23 10:35:35 +01:00
uboot-fritz4040 uboot-fritz4040: update to Git HEAD (2026-03-08) 2026-03-14 21:46:31 +01:00
uboot-imx uboot-imx: do not build efimkcapsule tool 2026-06-04 00:47:20 +02:00
uboot-kirkwood kirkwood: add support for D-Link DNS-325 A1 2025-11-25 15:41:38 +01:00
uboot-lantiq uboot-lantiq: fix C-style comments in AWK scripts 2026-03-23 01:23:33 +01:00
uboot-layerscape uboot-layerscape: bump to lf-6.18.2-1.0.0 2026-06-26 18:50:56 +02:00
uboot-mediatek mediatek: comfast cf-wr632ax: add all-in-UBI layout 2026-07-30 21:42:33 +02:00
uboot-microchipsw uboot-microchipsw: add FIP update flashing shortcut 2026-01-23 11:07:23 +01:00
uboot-mvebu mvebu: MikroTik: add support for RB5009UPr+S+IN 2026-07-01 17:03:40 +02:00
uboot-mxs
uboot-omap uboot-omap: update to 2024.07 2026-06-07 11:45:36 +02:00
uboot-qoriq package: uboot-qoriq: fix T4240RDB u-boot selection 2026-01-12 13:59:30 +01:00
uboot-rockchip uboot-rockchip: update to v2026.07 2026-07-28 09:26:17 +02:00
uboot-sifiveu uboot-sifiveu: fix build with swig 4.3.0 2025-10-25 22:33:53 +02:00
uboot-stm32 uboot-stm32: bump to 2026.01 2026-02-26 23:34:10 +01:00
uboot-sunxi uboot-sunxi: bump to 2026.04 2026-05-29 08:23:24 +02:00
uboot-tegra uboot-tegra: disable mkeficapsule build 2025-07-13 17:18:15 +02:00
uboot-tools mediatek: comfast cf-wr632ax: add all-in-UBI layout 2026-07-30 21:42:33 +02:00
uboot-zynq zynq: add Bitmain Antminer S9 control board support 2026-06-16 20:19:24 +02:00