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#3320 - Ubiquiti Routerstation compilation produces no sysupgrade image anymore #8364
Comments
adrianschmutzler: sysupgrade on these devices is broken, so the images have been removed in 0cc87b3 |
wwortel: Thanks. By now the kernel that gets compiled is 5.4.63 |
adrianschmutzler: You can try to contact Tomasz (the patch author) about that. Personally, I only know what I read in the commit message. From that perspective it looks to me like something nobody is interested in and which will probably stay that way until somebody feels enough pain to fix it. |
wwortel: experimented under kernel 5 with the previous sysupgrade code and indeed ended up bricking the Routerstation. |
wwortel: Further experimentation and contact with the patch' author has confirmed that a fix has already been proposed but has not been introduced yet. Experimintally have verified that it works fine. The sysupgrade works on the Routerstation under kernel 5 when pending kernel patch #411 |
acoul: Greetings, is it safe to use [[https://patchwork.ozlabs.org/project/openwrt/patch/20200805211354.3922-1-git@johnthomson.fastmail.com.au/|this patch]] on current trunk ? is this going to properly work on both RouterStations & RouterStations Pro ? remote sysupgrade feature is quite valuable, but I am afraid to test this as I don't have access to Jtag tools for unbricking the devices |
acoul: it looks like this BUG has been resolved in commit [[https://git.openwrt.org/?p=openwrt/openwrt.git;a=commitdiff;h=760952ad022561931846b02ddfe69c21afead0fe|760952ad022561931846b02ddfe69c21afead0fe]] and this ticket can now close |
wwortel: Careful! Another thing is to know whether the old firmware currently on your RS(pro), who's sysupgrade function you are going to use to install the fresh OpenWrt, has the mtd kernel bug or not. |
acoul: Hello william, thank you for the warning. in my understanding, this is a kernel BUG that appeared in kernel >=4.19 & is still in kernel 5.4.x thereof, any device with an openwrt snapshot older than let's say October 2020 ([[https://git.openwrt.org/?p=openwrt/openwrt.git;a=commit;h=bf2870c1d9e1|to be safe]]) is vulnerable using sysupgrade. upgrading sysupgrade itself will not do, as this is a kernel BUG. openwrt-19.x (with kernel 4.14.x) or openwrt-shapshot >=October 2020, should be safe to use sysupgrade am I correct on this ? |
wwortel: Cannot confirm or deny the exact start moment of the problem. Did not look into it as I went the trial and error way, before starting to understand what the underlying issues were. Much older firmwares will be OK. So the risk is in those of in-between when the problem existed but had not been discovered yet. To go a safe way I recommend the one-time factory upgrade. |
acoul: Hello William, //In case the RS(pro) is difficult to physically access but the power supply can be accessed there is a trick. A pin hole opening in the power supply and pressing a miniature switch behind it with a pin and connecting power will bring the RS in tftp upload mode// so this is the way to enable tftp in case you do not have serial access to the devices right ? I am attaching pictures of the RouterStation & RouterStation Pro with those mini switches circled in red. but if I understand correctly, if you brick your box, these switches are useless. You will need a jtag to restore a backup bootloader on the device, correct ? thank you for the feedback |
wwortel: "so this is the way to enable tftp in case you do not have serial access to the devices right ?" No. Please read again; I write physically access, i.e. touch, and refer to the power supply, the rectangular black 24V supply. These power supplies from some date onwards have on one side this pin hole. The side opposite the LED, near the RJ45 connectors. So e.g. the device sits in a box in a mast, and the supply is accessible at the ground. "but if I understand correctly, if you brick your box, these switches are useless. You will need a jtag to restore a backup bootloader on the device, correct ?" I think in this case it is the bootloader configuration that mtd damages, but am not sure. |
acoul: //No. Please read again; I write physically access, i.e. touch, and refer to the power supply, the rectangular black 24V supply. These power supplies from some date onwards have on one side this pin hole. The side opposite the LED, near the RJ45 connectors. So e.g. the device sits in a box in a mast, and the supply is accessible at the ground. amazing. I was totally unaware of this remote reset capability through PoE on ubiquiti devices I guess ubiquiti has a similar to the following circuitry [[https://forum.mikrotik.com/viewtopic.php?t=124781|discussed on this thread]] build-in their devices: //Add a photocoupler, like 4N35, and a resistor. Connected near the reset button to command it remotely with two wire by a voltage, for example the power voltage.// great input William, thank you |
wwortel: well, not sure that all ubiquiti devices support this, but the RS(pro) do. Technically it works not as you think. Clever use is made of the fact that the two data pairs are terminated on the RS, as generally the case with ethernet, in a transformer. |
wwortel:
OpenWrt SNAPSHOT, r14382+7-ad0f0df909
When compiling e.g. for another Ubiquiti device like Bullet XW, factory and sysupgrade images appear.
Compiling for Routerstation only the factory image.
Looking into target/linux/ath79/image/generic-ubnt.mk noticed that under
Device/ubnt there is IMAGES += factory.bin
and under
Device/ubnt_routerstation_common there is IMAGES := factory.bin
Just changing the := into +: produces a ...sysupgrade.bin but it is not accepted by sysupgrade.
Not hindered by knowledge just copied what it was in the times of ar71xx and it produces a working sysupgrade image:
define Device/ubnt_routerstation_common
DEVICE_PACKAGES := -kmod-ath9k -wpad-basic-wolfssl -uboot-envtools kmod-usb-ohci
kmod-usb2 fconfig
DEVICE_VENDOR := Ubiquiti
SOC := ar7161
IMAGE_SIZE := 16128k
IMAGES := sysupgrade.bin factory.bin
IMAGE/factory.bin := append-rootfs | pad-rootfs | mkubntimage |
check-size
IMAGE/sysupgrade.bin := append-rootfs | pad-rootfs | combined-image | check-size $$$$(IMAGE_SIZE)
KERNEL := kernel-bin | append-dtb | lzma | pad-to $$(BLOCKSIZE)
KERNEL_INITRAMFS := kernel-bin | append-dtb
endef
define Device/ubnt_routerstation
$(Device/ubnt_routerstation_common)
DEVICE_MODEL := RouterStation
DEVICE_TITLE := Ubiquiti RouterStation
BOARDNAME := UBNT-RS
UBNT_BOARD := RS
UBNT_TYPE := RSx
UBNT_CHIP := ar7100
DEVICE_PACKAGES += -swconfig
SUPPORTED_DEVICES += routerstation
endef
TARGET_DEVICES += ubnt_routerstation
The text was updated successfully, but these errors were encountered: