to see if you have bot linux and linux2 partitons telnet to your router and issue:
Code:
cat /proc/mtd
This will show all partitions.
To see which partition is used issue:
Code:
ubootenv get boot_part
This will get either 1 or 2.
DDWRT usually writes to Linux2
To set t0 boot partition 1:
Code:
ubootenv set boot_part 1
If you interrupt the boot process by swithcing off 3 times during booting then the alternative bootpartition is also used.
You can also write a build manually from command prompt:
Code:
cd /tmp
wget http://www.desipro.de/ddwrt/K3-AC-Arm/dd-wrt.v24-K3_AC_ARM_STD.bin
mtd write fw.bin linux (or linux2 if that is where you want to write)
reboot
Reset from the gui, erase nvram from the command prompt is not safe if you are not on XVortex's CFE (which is btw recommended)
@egc
Thanks so much I was finally able to update to latest BS build using
Code:
mtd write fw.bin linux
But...
I would very much like to see my active boot partition and switch between them using the
Code:
ubootenv get boot_part
and
Code:
ubootenv set boot_part 1
commands.
They do not work when I telnet in on busybox v1.27.2 I get -sh: ubootenv: not found ?
One last thing can you tell me why I have a ddwrt partition on mtd6 and what it does?
ubootenv is probably not present any longer in linksys firmware because they try to lock everything down
The DDWRT partition is present on all DDWRT builds probably to keep some variables. The only thing that is different is that you have 2 Linux partitions (hence the dual boot)
Thanks so much for the reply.
Currently I am flashed to the latest BS build and ubootenv is not found.
Do I need to install uboot-envtools from OpenWRT in order to set my boot partition?
Joined: 18 Mar 2014 Posts: 12915 Location: Netherlands
Posted: Sun Dec 31, 2017 10:58 Post subject:
You can try to install uboot-envtools from OpenWRT, but it is not necessary, you can flash to any partiton you like with the command line.
Flashing from the GUI will always flash to linux2 partition, you can leave the linux partition alone or also flash a DDWRT build to that partition with the command line.
What you can do is flash from the GUI and if that build is working and stable then flash that same build to linux partition, and then just flash the newer build from the GUI which then sits again on linux2.
Joined: 18 Mar 2014 Posts: 12915 Location: Netherlands
Posted: Tue Jan 02, 2018 11:17 Post subject:
Partitions should be recreated when you boot by the CFE, so if you have not altered the CFE the partitons should be recreated.
The Xvortex CFE (which I am using) does not make a linux2 partition.
I have an orginal CFE, from backup when I started using the Xvortex CFE but you have to hack your own MAC address into it. I am not sure if the CFEedit tool from XVortex also works on stock CFE, and if you do anything wrong you will brick your router.
My advice in this stage: follow instructions from Cybernook/Xvortex to use the Xvortex CFE (but set MAC addresses according to my instructions if you want to use DDWRT)
@raximus:
i did not think that the EA6900 uses a u-boot scheme. broadcom CFE is a different bootloader.
i think you want to use the nvram set / commit to alter the
bootpartition variable before rebooting.
@raximus:
i did not think that the EA6900 uses a u-boot scheme. broadcom CFE is a different bootloader.
i think you want to use the nvram set / commit to alter the
bootpartition variable before rebooting.
Partitions should be recreated when you boot by the CFE, so if you have not altered the CFE the partitons should be recreated.
The Xvortex CFE (which I am using) does not make a linux2 partition.
I have an orginal CFE, from backup when I started using the Xvortex CFE but you have to hack your own MAC address into it. I am not sure if the CFEedit tool from XVortex also works on stock CFE, and if you do anything wrong you will brick your router.
My advice in this stage: follow instructions from Cybernook/Xvortex to use the Xvortex CFE (but set MAC addresses according to my instructions if you want to use DDWRT)
On the first page of the Merlin/XVortex post Xvortex posts a link to a stock CFE file and says that it does not matter about the MAC for recovery. So any stock CFE file should resolve my issue. However I downloaded his stock CFE and compared it with my (broken) backup and there was one difference in the CFEedit tool.
I compared my CFE backup to your CFE 1.1 using Beyond Compare hex mode and they were different. I found another CFE 1.1 from another EA6900 thread on here and that CFE and your CFE were identical.
I am assuming that something went wrong with my CFE and I flashed the CFE you provided to my router. After I cleared NVRAM and did a 30 30 30 I still didn't have my partition structure restored. I made a CFE backup from my EA6900 to compare with the one you provided and those were identical so I know the CFE flash worked.
I wanted to share this next information so that it might help someone else.
At this point I decided to flash the original stock firmware to my only linux partition. I did a mtd write stock.bin linux and it bricked the router.
I couldn't see any way back to the partition structure that I wanted without going back to the original firmware so I had to go for it. I tried for some time to reset, reboot blah blah nothing worked.
However if I ping 192.168.1.1 w 2 I got a TLS=100 reply. I tried a few different tftp methods and then I found this from the official Linksys site which I have never seen posted anywhere before:
I STRONGLY recommend this little tftp recovery program. I turned my router off. I got the original firmware file ready in the program. I turned the router on, waited 5 seconds, and hit the upload button in the tftp program. After a little bit it uploaded the original firmware to the EA6900 and after I did a reboot and NVRAM clear my original partition structure both linux and linux2 was recovered.
The trick to getting the dual boot back is to flash the router back to the original firmware. I have learned that the partition structure is based on the firmware that you flash and not on the CFE file.
Thanks for all of the help everyone and I hope this little bit of info helps someone else in the future.
Posted: Mon Mar 19, 2018 9:58 Post subject: Amazing discovery
Quote:
I compared my CFE backup to your CFE 1.1 using Beyond Compare hex mode and they were different. I found another CFE 1.1 from another EA6900 thread on here and that CFE and your CFE were identical.
I am assuming that something went wrong with my CFE and I flashed the CFE you provided to my router. After I cleared NVRAM and did a 30 30 30 I still didn't have my partition structure restored. I made a CFE backup from my EA6900 to compare with the one you provided and those were identical so I know the CFE flash worked.
I wanted to share this next information so that it might help someone else.
At this point I decided to flash the original stock firmware to my only linux partition. I did a mtd write stock.bin linux and it bricked the router.
I couldn't see any way back to the partition structure that I wanted without going back to the original firmware so I had to go for it. I tried for some time to reset, reboot blah blah nothing worked.
However if I ping 192.168.1.1 w 2 I got a TLS=100 reply. I tried a few different tftp methods and then I found this from the official Linksys site which I have never seen posted anywhere before:
I STRONGLY recommend this little tftp recovery program. I turned my router off. I got the original firmware file ready in the program. I turned the router on, waited 5 seconds, and hit the upload button in the tftp program. After a little bit it uploaded the original firmware to the EA6900 and after I did a reboot and NVRAM clear my original partition structure both linux and linux2 was recovered.
The trick to getting the dual boot back is to flash the router back to the original firmware. I have learned that the partition structure is based on the firmware that you flash and not on the CFE file.
Thanks for all of the help everyone and I hope this little bit of info helps someone else in the future. 8)
Is that mean we can revert to stock after flashing the Xvortex CFE and installing XWRT Vortex, which require NVRAM clear? All of the guides said that we couldn't revert after NVRAM clear. I will try to do this soon and make a revert guide if its a success.