the currently submitted partition layout is just as d-link used it & I guess all they needed
the backup firmware is just that a backup controlled by the boot loader
this will correct a corrupted openwrt kernel tho on a checksum error
but with the stock boot loader your stuck with it at lest to the size of the kernel "uboot partition size"
but for what you want I have done this & recovered a lot of space
I have only allocated unused partition space I found to be blank on my DIR-1960
but I can't say it's the same for the other models for the shared DTS
you or anyone else can take or submit this if they like
as my pull requests just seem to sit there for months & go nowhere
just a note for concat
if the last partition ends at address 0x8000000 then if fails to work
so it's a page short to avoid this
also you have to flash the factory image so UBI gets formated
as openwrt will fail if the UBI partition size changes as in a sysupgrade
I also found DLink DIR-853 A3 - #74 by kar200, which gives some insight in how the dlink-dual-firmware-partitions work:
So it is not like Linksys WRT, instead the bootloader will manage both partitions fully on its own, the user cannot interfer and unlike Linksys the user cannot have 2 different firmware versions deployed at the same time or alternate at will between them:
On every device boot, before loading the firmware, the boot loader automatically does some sanity checksum tests on both firmware partitions. If one partitions turns out defective, it will automatically be overwritten with the stuff from the other partition
If both partitions are sane, but differ in content, the image from the first partition gets automatically copied over to the second partition, such that the backup partition is in sync with firmware updates
then the regular boot process continues (always on the first firmware partition)
So the 2nd firmware partition cannot be reclaimed, but has some good purpose, it's not a complete waste.
Now I also seem to understand why some users report about failed flash processes, but still that router was able to boot back into the previous image. And probably I also understand, why this auto recovery did not work for some users, as the 853-thread mentions that the checksum test is not an indepth know-it-all check.
Unfortunately compiling or changing code of OpenWRT feels way beyond my current brain evolution level. As of now, I am glad to at least be somehow able, to keep up with how OpenWRT works and how new devices fit in. And it's the first time, I deal with an owned device that does not have a device page yet.
But still regarding 1960-partitions, does that mean:
the firmware partitions have to retain in offset and size as predefined by D-Link? (as otherwise the boot loader would not be able to do its sanity magic anymore or break something?)
if the space of several extra partitions in between is reclaimed as you suggest, how would those extra partition spaces be used by OpenWRT? Would these then become extra mount points?
if you look at the DTSI file I sent you
it has reclaimed some of space from the backup copy
is only copys the partition size stated in the uboot header
this is the kernel only in openwrt
so separation the kernel allocation allows the other room to be reallocated
& as the UBI has checking for NAND you don't need to back this up ether
you do have to work withing the constrains of the boot loader
so the start of the kernel & it's backup are fixed
and you will only be able to make an image as big as the boot loader can work with
but at lest the extra room can be available after the flashed image use just not for an all inclusive image file
the concat just gabs all the allocated areas & pools then into one new UBI partition
witch is the size of all of them combined
they are all concatenated together into one
@Lucky1 I wonder if there is a way to get this implemented with devices that are already using openwrt (change the layout through a sysupgrade).
The other inconvenience with Openwrt is that the kernel alone is not enough to recover from the other partition. so for example if you erase the main partition uboot will only recover the kernel part and would not be able to boot (or even use the rescue mode with the reset button while it boots openwrt). I think it needs rootfs as well otherwise there is a kernel panic IIRC and bootloop after that.
We need to retain the locations of both firmware as they get checked and overwritten. At the moment we are using a kernel size of 4mb so anything after that can be used and what @Lucky1 did is very useful as it uses nearly all the other unused partitions which in openwrt are seen as a single partition.
I'm not sure how it all works in the background
but if the size of the UBI partition is different
then maybe you just can't keeps settings
but would sill let you update & start of with factory default
I do think there is work need there
maybe even if it failes 10 times then it factory defaults
so it would at lest boot
or at lest able to enter a recover of sorts
I've just installed OpenWRT of my DIR-1960. This is my first ever encounter with OpenWRT. I don't know the correct terminology yet, so forgive me for that.
I've configured the router, and I like the experience very much. But I struggle with the free space for packages (overlay partition?) you discussed above. I don't understand much of what you've said above about the DTSI file, but I assume this is used during the image build and cannot be configured during runtime?
My question is - Is there a way to get some of the unused storage for OpenWRT? Even if I have to reinstall the OpenWRT.
I need just a few MBs. I want to run the SMB share and the DLNA server, but they don't seem to fit the partition as currently I have 8 MB free after setting up the SMB and the DLNA requires 9,5 MB. I am afraid To run the installation because I don't know what will happen after the space on the partition depletes.
I tried to find some packages that I could (and am willing to) remove, but I found only the PPPoE, which should be only around 200 kB which is not enough.
Thanks a lot, @Lucky1! I downloaded the file. I am still a little bit conscious about this flashing procedure, but I guess I will give it a try if I don't find a way to save some space within the current install.
I have just a few more questions:
Will this change in partition structure somehow prevent me from going back to the original D-Link firmware if anything goes wrong?
What will happen if new version of OpenWrt (let's say 21.02.2) will be published, I'll do the sysupgrade using the LuCI - will it still work? Or do I lose this ability to do an upgrade once I flash custom build?
Is there a Pull request for this change? Is there any chance this partition enlargement will make its way to the standard release?
It changes what Openwrt's layout is so sysupgrade won't work it will just crash
& you have to flash with a factory file from the recovery interface this erases UBI
the partitions I have added to the available room where it's not used by my DIR-1960
you can go back to the dlink firmware yes
but just in case backup your MTD partitions so you can restore them later if needed
If you change back to default openwrt you will need to use it's factory image
no pull request
it's mixed up in the other models that share it's DTS
and due to the fact that openwrt crashes if the layup changes via sysupgrade
makes it complicated
@oookoook - can you report back if you were able to successfully use the image posted by @lucky? was it simply uploading the correct .bin file into the D-link recovery admin?
I'm very confused ?
it's the file I last used to go back to stock
I admin i have not used for for a while
but can't see why I would want to go back to dlink firmware
I'll take it down then
you can make a page if you want
I'm not sure why you are telling me abou tyour untested decripted file
i'll just keep mine as for me i know it works if i ever want to go back
I decided not to use that firmware because of the inability to do future upgrades. Instead, I ditched the idea to run both SMB a DLNA on the router. I use only SMB, I've bought the Chromecast, and stream to the TV without the DLNA from my laptop or Android phone using the VLC app (interestingly, I am not able to stream from iPhone, as the iOS VLC is not able to login to SMB share - but that's a completely different issue - Samba + NTFS + VLC (Question))
Hi there @Lucky1 Thank you for the work your doing! I just got this router on eBay for $25! Been wanting an openWRT router for while and you made this so easy! I'll be using your image above for tinkering and if you could point me in the direction of how I can make a backup first as per suggested by you? Very new to the openWRT community so I'll be learning on it. I am going to be trying to using it to connect to public wifi with a capture login webpage and rebroadcast it under my own name through openWRT. If your familiar with Xfinity and it's free Xfinitywifi hotspots, I have a login and password for it but it only works in one part of my house and hopefully this can free my shackles of internet access and give me some range.
Hi Blueyezboi
it depends on where you are & if you have a serial interface hooked up
if you have already use a release edition of openwrt you can just save all the MTD's as is
save each item in the drop down list at
System > Backup/Flash Firmware > Save mtdblock contents
if you still have the dlink firmware & want to back that up as well "openwrt has not over written it yet"
you can load the "dlink_dir-1960-a1-initramfs-kernel.bin"
directly into ram via the menu in the serial interface
can't remember the menu or prompt atm but it's something like hit 3 to upload tftp image into ram
the do the same save each item in the drop down list at
System > Backuo/Flash Firmware > Save mtdblock contents
I hope this is enough to get you started if not let me know
Hi @Lucky1 I'm installing the base firmware you created at this moment. I'm Attempting to do everything I said in the previous posts. I had to bust out an older laptop because my newer one didnt have a network port! I'm not exactly wet behind the ears so i got this baby up in a few minutes. just got in today and finally have time to tinker!
I was able to get OpenWRT installed and almost working reliably (it boots, and runs mostly, but randomly reboots at least once per day, sometimes a lot more than once).
I have not had any luck with V21
I think it needs a minimum version of kernel after V21
to fix lots of problems with the switch
and there was just an update for the wifi that fixes
slow speed on DFS channels just added to V22 & master
so I think at the moment the best version is V22 but after rc4
depend on what addon's you use as the firewall is changing
but use the V22 snapshot "luci is in there" unlike the master one's https://downloads.openwrt.org/releases/22.03-SNAPSHOT/