Performing a sysupgrade on a Ubiquiti Unifi AP AC Lite causes the device to operate erratically as, on reboot, it keeps the previous kernel while using the newly flashed rootfs.
This problem might be related to the way LEDE/OpenWrt must be flashed from the stock firmware, as detailed in [[https://wiki.openwrt.org/toh/ubiquiti/unifiac#unifi_ap_ac_lite_devices|OpenWrt's wiki]]. Flashing the image to kernel0 or kernel1 does not work; both partitions must be flashed with the same image.
====Steps to reproduce it====
Revert to stock firmware (e.g. via Ubiquiti's TFTP recovery procedure)
Flash LEDE image (e.g. 17.01.0 stable) from stock firmware as described in [[https://wiki.openwrt.org/toh/ubiquiti/unifiac#unifi_ap_ac_lite_devices|OpenWrt's wiki]] (writing both to kernel0 and kernel1 partitions)
On reboot, check kernel version (dmesg | head -n1)
Sysupgrade to LEDE snapshot (sysupgrade -v -n lede-ar71xx-generic...)
Check kernel version again (dmesg | head -n1)
Both kernel versions will be the same. Actually, it's the same kernel, only the rootfs has been upgraded.
It seems Ubiquiti's bootloader implements some mechanism to fallback to an older firmware/kernel/rootfs/image/whatever, or maybe the partitioning scheme has been updated in the stock firmware.
If instead of running sysupgrade, the LEDE image is dd'ed to both the "firmware" (mtd2) and the "ubnt-airos" (mtd6) partitions (mtd write /tmp/lede-ar71xx...lite.bin firmware && mtd -r write /tmp/lede-ar71xx...lite.bin ubnt-airos), the new image is booted (including the new kernel). However, the "ubnt-airos" partition is read-only so a LEDE image having this partition set to rw must be first compiled and flashed from the stock firmware.
The text was updated successfully, but these errors were encountered:
I believe there are 3 minor issues that should be fixed here:
LEDE images should make both firmware partitions writeable by default, as well as the "bs" partition
Initial installation instructions should describe the "bs" partition and provide a way to make sure it points to the firmware partition where LEDE is installed (which must be "kernel0" with the current images)
the sysupgrade script should verify the "bs" partition content, making sure that the newly installed image is used on the next boot
The first point is currently the most critical, as any device booting LEDE from "kernel1" is currently impossible to upgrade without using the mtd_rw trick/hack or a serial console.
this issue also affects sysupgrades on similar devices like Unifi AC Mesh and Unifi AC Mesh Pro. (AC Mesh is similar to Unifi AP AC Lite and AC Mesh Pro similar to AP AC Pro)
there's also a downstream issue at the Gluon project: freifunk-gluon/gluon#1301
I'm sorry to bring back this topic but I've found myself in this exact situation after updating [[https://forum.openwrt.org/t/upgraded-from-18-06-1-to-18-06-2-no-wifi/30648|from 18.06.1 to 18.06.2]] and I don't really know how to proceed.
I'm on 18.06.2 filesystem with the 18.06.1 kernel.
Would the command dd if=/dev/zero bs=1 count=1 of=/dev/mtd7 force booting the newer kernel?
Thank you in advance!
Update: Yes, that command forced booting from the new kernel.