diff options
author | Daniel Golle <daniel@makrotopia.org> | 2022-08-28 20:20:31 +0100 |
---|---|---|
committer | Daniel Golle <daniel@makrotopia.org> | 2022-09-03 02:00:16 +0100 |
commit | 8ff8a4dc9efba78966c9d2f1ace2b38e1bf28779 (patch) | |
tree | 43ae5a60df7d0ea93110e72984623e4e8845a8d1 /package/boot/uboot-mediatek/patches/410-add-linksys-e8450.patch | |
parent | aebb19d34bf615310e9fa762dd6d9658ae6845a3 (diff) | |
download | upstream-8ff8a4dc9efba78966c9d2f1ace2b38e1bf28779.tar.gz upstream-8ff8a4dc9efba78966c9d2f1ace2b38e1bf28779.tar.bz2 upstream-8ff8a4dc9efba78966c9d2f1ace2b38e1bf28779.zip |
uboot-mediatek: fix factory reset on UBI
Truncating a UBI volume using `ubi write 0x0 volname 0x0` results in
segfault on newer U-Boot. Write 1MB of 0s instead.
Signed-off-by: Daniel Golle <daniel@makrotopia.org>
(cherry picked from commit d118cbdfece181994a96d1bcb1868bd807d481bf)
Diffstat (limited to 'package/boot/uboot-mediatek/patches/410-add-linksys-e8450.patch')
-rw-r--r-- | package/boot/uboot-mediatek/patches/410-add-linksys-e8450.patch | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/package/boot/uboot-mediatek/patches/410-add-linksys-e8450.patch b/package/boot/uboot-mediatek/patches/410-add-linksys-e8450.patch index fde679f386..329b2f3d8b 100644 --- a/package/boot/uboot-mediatek/patches/410-add-linksys-e8450.patch +++ b/package/boot/uboot-mediatek/patches/410-add-linksys-e8450.patch @@ -392,7 +392,7 @@ +boot_write_bl2=mtd erase bl2 && mtd write spi-nand0 $loadaddr 0x0 0x20000 && mtd write spi-nand0 $loadaddr 0x20000 0x20000 && mtd write spi-nand0 $loadaddr 0x40000 0x20000 && mtd write spi-nand0 $loadaddr 0x60000 0x20000 +boot_write_fip=mtd erase fip && mtd write fip $loadaddr +check_ubi=ubi part ubi || run ubi_format -+reset_factory=ubi part ubi ; ubi write 0x0 ubootenv 0x0 ; ubi write 0x0 ubootenv2 0x0 ; ubi remove rootfs_data ++reset_factory=mw $loadaddr 0x0 0x100000 ; ubi part ubi ; ubi write $loadaddr ubootenv 0x100000 ; ubi write $loadaddr ubootenv2 0x100000 ; ubi remove rootfs_data +ubi_format=ubi detach ; mtd erase ubi && ubi part ubi ; reset +ubi_prepare_rootfs=if ubi check rootfs_data ; then else if env exists rootfs_data_max ; then ubi create rootfs_data $rootfs_data_max dynamic || ubi create rootfs_data - dynamic ; else ubi create rootfs_data - dynamic ; fi ; fi +ubi_read_production=ubi read $loadaddr fit && iminfo $loadaddr && run ubi_prepare_rootfs |