OpenWrt/LEDE Project

  • Status Closed
  • Percent Complete
    0%
  • Task Type Bug Report
  • Category Base system
  • Assigned To No-one
  • Operating System All
  • Severity Low
  • Priority Very Low
  • Reported Version Trunk
  • Due in Version Undecided
  • Due Date Undecided
  • Private
Attached to Project: OpenWrt/LEDE Project
Opened by Vaclav Juza - 27.07.2020
Last edited by Adrian Schmutzler - 30.07.2020

FS#3251 - No fat image built for DLINK DIR-825 B1 after ar71xx to ath79 migration

Rationale: build image with more features (WPA enterprise, openvpn) - fat image is the only possibility

Device problem occurs on:

DLINK DIR-825 B1

Software versions of OpenWrt/LEDE release, packages, etc:

For 18.06.8 (and earlier) target ar71xx the following images were build:
  dir-825-b1-squashfs-sysupgrade.bin
  dir-825-b1-squashfs-backup-loader.bin
  dir-825-b1-squashfs-factory.bin
  dir-825-b1-fat-squashfs-sysupgrade.bin
For 19.07.3 target ar71xx:
  the *-factory.bin image is missing from openwrt download page but still built using image builder
For ath79 (both 19.07.3 and current snapshot):
  Only dlink_dir-825-b1-squashfs-sysupgrade.bin is built

Steps to reproduce:

 make image PROFILE=dlink_dir-825-b1 # for ath79
 # make image PROFILE=DIR825B1 # for ar71xx


Closed by  Adrian Schmutzler
30.07.2020 12:25
Reason for closing:  Won't implement
Additional comments about closing:  

The hack to increase firmware partition won't be ported into ath79. A manual option to repair an existing "fat" installation is available.
For the missing factory image, a separate report should be opened, as that's a separate issue.

Project Manager
Adrian Schmutzler commented on 30.07.2020 12:23

Based on my research, it appears the "fat" image was the result of a hack to make use of the entire flash for this device, since the vendor put the caldata at 0x660000 and therefore limited the size of the firmware image.

cameo_ap94_mtdlayout=mtdparts=spi0.0:256k(uboot)ro,64k(config)ro,6208k(firmware),64k(caldata)ro,1600k(unknown)ro,64k@0x7f0000(caldata_copy)
cameo_ap94_mtdlayout_fat=mtdparts=spi0.0:256k(uboot)ro,64k(config)ro,7808k(firmware),64k(caldata)ro,64k@0x660000(caldata_orig),6208k@0x50000(firmware_orig)

This was accompanied by providing a whole set of images to flash from one variant to another, which was dropped again here:
https://github.com/openwrt/openwrt/commit/9a11f882d765a8ca31b151f6d9e20c8062b115cf

From my perspective, this is an ugly hack that has been abandoned when adding this device to ath79 for a good reason, where only the "correct" vendor partitioning was implemented.

Since the copied caldata of the previous "fat" image appears to be in the read-only region of the flash for the new image, it should be relatively simple to migrate to ath79:
1. flash the ath79 image
2. install kmod-mtd-rw via opkg (or built it into the image directly)
3. enable kmod-mtd-rw
4. remove ro for the "real" caldata partition and copy the contents from the previously copied partition at 0x7f0000 back to their proper location
5. reboot the device, put ro back, and remove kmod-mtd-rw

Regarding the factory image:
I took a quick dive into that terribly image/legacy.mk code, and as it appears, the factory image is created by just appending "00AP94-AR7161-RT-080619-00" to the sysupgrade image after padding:

		( \
			dd if=$(call sysupname,$(1),$(2)) bs=4096k conv=sync; \
			echo -n "$(7)"; \
		) > $(call factoryname,$(1),$(2)); \

$(7) should be the string given above here.

For ath79, I can tell that no factory image has been set up in the first place. If that's required for factory flashing, somebody would need to add it, though that might be relatively trivial based on the information above.

Loading...

Available keyboard shortcuts

Tasklist

Task Details

Task Editing