Just to make sure - but I have to run sysupgrade (or flash image to nand some other way?) before setting variables, right? Besides that, which specific variables I have to set?
I probably will order hardware next week, so I can not brick it just yet Sorry for probably stupid questions above - although I am not afraid to use serial console (if it's will be necessary to proceed) I just hope to get it done without opening up the case.
If you have serial access, I think the current safest way it to follow the instructions from the commit on @robimarko repo, which supports single-slot for the time being.
That should enable sysupgrade to the same slot until something else is developed and tested.
Opening the case is not hard at all, just 4 screws.
The challenging part is probably the connector.
I have not tested the script from @clayface to support multi-slot and recovery from TFTP (it might miss some scenarios).
I'm not fully sure what are the steps to flash OpenWrt with this approach, and they might change with the "usbinitramfs" I gave as an example on my previous post.
I'm trying to develop something similar, that ideally won't require serial access, but it needs review, changes, and more testing before recommending it.
Oh, it's seems like I missed that @clayface script not only flash OpenWRT but also implement additional features, so for simple loading uImage from flash drive something much simpler should be sufficient?
If loading uImage from flash drive works out, following sequence should flash OpenWRT (and enable sysupgrade for future updates) even without serial access, right? Theoretically speaking, at least.
cat /proc/mtd
ubiformat /dev/mtdXY -y -f /path_to/factory_image
fw_setenv bootcmd "setenv bootargs console=ttyMSM0,115200n8 ubi.mtd=rootfs root=mtd:rootfs rootfstype=squashfs rootwait; ubi part fs; ubi read 0x44000000 kernel; bootm 0x44000000#config@rt5010w-d350-rev0"
(I replaced partition number with XY intentionally.)
You also need to set mtdids and mtdparts.
Give me a couple of days to test a method that should install to a single-partition (same as current commit).
Note: I'm also working on multi-partition support with recovery, but that requires more developent.
I wanted to share some simple tests I just run out of curiosity.
Everything looks good.
I have 500/100 Mbits and I'm also running these:
https-dns-proxy
addblock
statistics with additional cpufreq and thermal (5 sec. collection)
htop
There is also one wifi user that I didn't disconnect to run the tests.
Latency results are specif to my ISP and location, but CPU load is related to my max 500/100 speed and to the router CPU and configuration. Max router freq. is 2.2Ghz, but it was running at 1Ghz with only 2 or 3 occasional spikes at 1.3Ghz and 1.6Ghz.
There's also the load from netperf running inside the router.
After several tests I was able to come up with a process to install OpenWrt from OEM SSH (without serial access).
I split the instructions into booting initramfs (serial or OEM SSH), and installing from initramfs.
@RussianNeuroMancer, please try it once your device arrives. I tested it with both OEM slots, so it should be safe.
@robimarko, can the instructions on commit "ipq807x: add Dynalink DL-WRX36" from your repo include this instead?
They are just instructions (no code change required).
I still plan to work on multi-partition support, but we can review that part later.
Instructions are:
[rest of the commit message]
...
Notes:
- Serial is completely deactivated in the stock firmware image.
- This commit adds only single partition support, that means
sysupgrade is upgrading the current rootfs partition.
- Installation can be done by serial connection or
SSH access on OEM firmware
Installation Instructions:
Most part of the installation is performed from an initramfs image
running OpenWrt, and there are two options to boot it.
Boot initramfs option 1: Using serial connection (3.3V)
1. Stop auto boot to get to U-boot shell
2. Transfer initramfs image to device
(openwrt-ipq807x-generic-dynalink_dl-wrx36-initramfs-uImage.itb)
Tested using TFTP and a FAT-formatted USB flash drive.
3. Boot the initramfs image
# bootm
Boot initramfs option 2: From SSH access on OEM firmware
1. Copy the initramfs image to a FAT-formatted flash drive
(tested on single-partition drive) and connect it to device USB port.
2. Change boot command so it loads the initramfs image on next boot
Fallback to OEM firmware is provided.
# fw_setenv bootcmd 'usb start && fatload usb 0:1 0x44000000 openwrt-ipq807x-generic-dynalink_dl-wrx36-initramfs-uImage.itb && bootm 0x44000000; bootipq'
3. Reboot the device to boot the initramfs
# reboot
Install OpenWrt from initramfs image:
1. Use SCP (or other way) to transfer OpenWrt factory image
2. Connect to device using SSH (on a LAN port)
3. Check MTD partition table.
rootfs and rootfs_1 should be mtd18 and mtd20
depending on current OEM slot.
# cat /proc/mtd
4. Do a ubiformat to both rootfs partitions:
# ubiformat /dev/mtd18 -y -f /path_to/factory_image
# ubiformat /dev/mtd20 -y -f /path_to/factory_image
5. Set U-boot env variable: mtdids
# fw_setenv mtdids 'nand0=nand0'
6. Get offset of mtd18 to determine current OEM slot
- If current OEM slot is 1, offset is 16777216 (0x1000000)
- If current OEM slot is 2, offset is 127926272 (0x7a00000)
# cat /sys/class/mtd/mtd18/offset
7. Set U-boot env variable: mtdparts
If current OEM slot is 1, run:
# fw_setenv mtdparts 'mtdparts=nand0:0x6100000@0x1000000(fs),0x6100000@0x7a00000(fs_1)'
If current OEM slot is 2, run:
# fw_setenv mtdparts 'mtdparts=nand0:0x6100000@0x7a00000(fs),0x6100000@0x1000000(fs_1)'
8. Set U-boot env variable: bootcmd
# fw_setenv bootcmd 'setenv bootargs console=ttyMSM0,115200n8 ubi.mtd=rootfs rootfstype=squashfs rootwait; ubi part fs; ubi read 0x44000000 kernel; bootm 0x44000000#config@rt5010w-d350-rev0'
9. Reboot the device
# reboot
@luaraneda
Thank you so much for the ssh (stock firmware) and openwrt install instructions. There were some minor issues I faced that I was able to overcome.
SSH in the stock firmware seems to use some older algorithm. The ssh utility in my Arch Linux x86_64 system initially refused to connect to it.
% pacman -Qi openssh
Name : openssh
Version : 9.1p1-3
% pacman -Qi openssl
Name : openssl
Version : 3.0.7-4
% ssh -V
OpenSSH_9.1p1, OpenSSL 3.0.7 1 Nov 2022
I had to add the following to ~/.ssh/config to connect to the DL-WRX36.
Host 192.168.216.1
User admin
PubkeyAcceptedAlgorithms +ssh-rsa
HostkeyAlgorithms +ssh-rsa
After loading OpenWrt Initramfs image, I again faced some issue trying to scp the factory.ubi image. SCP man page has the following text "Since OpenSSH 9.0, scp has used the SFTP protocol for transfers by default". I had to pass the "-O" parameter to scp to make it use the older SCP protocol.
Everything seemed to work fine. I later replaced the IPQ8074 firmware in the image with the latest from kvalo's ath11k-firmware github repo
and
and then rebooted. Now, the DL-WRX36 turns ON but neither LAN ports nor WiFI SSID seem to work. WiFi, I can understand, may be the IPQ8074 firmware 2.7.0.1 might have issues. But why do the LAN ports not work?
Thank you, the reset button worked. I loaded back initramfs image and reflashed (ubiformat) latest factory.ubi from https://github.com/robimarko/openwrt/releases/tag/ipq807x-2023-01-02-1602 . I had to change some of the config files as the network names changed from eth{0,1,2,3,4) to wan, lan{1,2,3,4}.
@robimarko Do you think it is possible for me to do a build from your gibhub files that would work on the Linksys Atlas Max MX8300? Chipset is similar, but this has 6E/6Ghz capability.It has IPQ8072A-000 application processor, three WiFi radio solutions: #QCN5024-007, #QCN5054-007, #QCN9024-001 and power management IC #PMP8074-000-01. Application processor is supported by 1 GB of DDR3 SDRAM in two #D2516ECMDXGJD packages from Kingston and 512 MB of NAND flash memory#FMND4G08S3J-ID manufactured by Fidelix.