Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Closed
openwrt-bot opened this issue Jul 27, 2020 · 2 comments
Labels

Comments

@openwrt-bot
Copy link

vasekj:

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

@openwrt-bot
Copy link
Author

adrianschmutzler:

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:
9a11f88

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.

@openwrt-bot
Copy link
Author

DarkCraz:

"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."

Without this "ugly" hack, the stock image is useless because it is impossible to install the minimum required packages to go to extroot or extoverlay. Extoverlay minimum instalation require such packets as block-mount, e2fsprogs, kmod-fs-ext4, kmod-usb-storage. Free space ends already after the installation of e2fsprogs&kmod-fs-ext4. Thats why this hack need to be reimplemented. Stock flash layot Is suitable for use with stock firmware, but not with openwrt.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

1 participant