• March 28, 2024, 02:55:11 PM
  • Welcome, Guest
Please login or register.

Login with username, password and session length
Advanced search  

News:

This Forum Beta is ONLY for registered owners of D-Link products in the USA for which we have created boards at this time.

Author Topic: Adventures with the GPL firmware  (Read 7517 times)

terminlman

  • Level 1 Member
  • *
  • Posts: 18
Adventures with the GPL firmware
« on: May 05, 2014, 10:12:31 AM »

I've made a few other posts regarding issues with my DIR-651 - all of which pointed me to the need to be able to get the GPL released firmware working, so I could modify it, as it looks like none of the other open source router systems support this particular model.  (Please let me know if I'm wrong.)  Anyway, I downloaded the GPL firmware from the link FurryNutz has provided in several other threads (http://tsd.dlink.com.tw/GPL.asp).  I also found an older post by Fatman suggesting http://support.dlink.com/GPL.asp for US GPL code, but this seems to point only to the main DLink support page.)  At this point, I have successfully compiled the FW but not yet tested it.  I'd like to use this topic to ask a few more questions,  describe what I had to do to make it work in case it might help anyone else, and perhaps start a discussion about commonly desired enhancements for this FW.

First question:  what is the difference between the NA (or any other region specific) and WW firmware, preferably in general terms?  I would have loved to see that the version I compiled is the same as the official release, but I have the NA and the GPL is for the WW.

Major issue:  as released, the GPL code needs to be compiled on a 32 bit system.  I suspect I'll eventually figure out how to do it on a 64 bit system, but there are too many places where it seems to try linking 32 and 64 bit libraries together, and that just won't work.  My initial guess is that the released code includes a toolchain already built in 32 bits, but the full build process tried to rebuild some of the toolchain, thus mixing arches.

Minor confusion:  the package I downloaded contains both a toolchain and a firmware package which also includes a toolchain.  I don't know if this is just an oddity in the way they created the package, or if there is some reason for two copies of the toolchain.  My successful run was ignoring the separate toolchain, and just using the package that contained both.  Does anyone know anything about this apparent duplication?

Another minor issue:  all the components are very old.  I've seen this pointed out elsewhere, especially as a reason to use one of the fully open source router firmwares.  I'm not sure if I'm going to try to slowly upgrade each of the packages (such as kernel, binutils, ssh, ....) or perhaps try to migrate the router specific parts into a framework from dd-wrt or another such project.  I'd love to hear if anyone else has tried this.

Actually, aside from needing to install the rcs package, there was only one change I absolutely needed to make to get the build to complete.  This is because the current version of make no longer allows mixing implicit and normal rules, so there were two sections in one Makefile (for busybox) where I had to duplicate a few lines, one copy for each type of rule.

Current plans:  I need to find a time I can be without Internet for a while, in case things don't go well (yes, I do have other routers I can use if necessary) so I can apply the newly compiled FW.  Hopefully, this version should be identical the the 1.10 I'm running now (except for any NA -> WW differences.)  Next, I'll make one or two cosmetic changes, such as in a page title, just to convince myself it works.    After that, my next two gols are figuring out why applying daylight savings time makes the router  keep jumping back to the login page and updating the library (SSL?) so it can use TLS to send email to an SMTP server which requires it.
Logged

FurryNutz

  • Poweruser
  •   ▲
    ▲ ▲
  • *****
  • Posts: 49923
  • D-Link Global Forum Moderator
    • Router Troubleshooting
Re: Adventures with the GPL firmware
« Reply #1 on: May 05, 2014, 01:06:45 PM »

Even though this product is EOL and not much activity, you may want to see if you can get in touch with one or two of these users and see if they are still around and able to provide some feed back and help:
http://forums.dlink.com/index.php?topic=52930.0

I've asked a couple others to chime in if they can.
Logged
Cable: 1Gb/50Mb>NetGear CM1200>DIR-882>HP 24pt Gb Switch. COVR-1202/2202/3902,DIR-2660/80,3xDGL-4500s,DIR-LX1870,857,835,827,815,890L,880L,868L,836L,810L,685,657,3x655s,645,628,601,DNR-202L,DNS-345,DCS-933L,936L,960L and 8000LH.

ambercap

  • Level 2 Member
  • **
  • Posts: 67
Re: Adventures with the GPL firmware
« Reply #2 on: May 05, 2014, 01:21:18 PM »

It's been a while since I worked on this. First of all I installed Oracle's free VirtualBox VM and installed the specific (old) distro of Fedora that DLink use. So while my machine is 64-bit, this VM is 32-bit. Therefore everything built without any problems. The changes I made were in the php scripts so I did not have to recompile the kernel and therefore stuck with the original, so I never got to try making any changes that went too deep.
Logged

FurryNutz

  • Poweruser
  •   ▲
    ▲ ▲
  • *****
  • Posts: 49923
  • D-Link Global Forum Moderator
    • Router Troubleshooting
Re: Adventures with the GPL firmware
« Reply #3 on: May 05, 2014, 01:25:42 PM »

Hi Amber.  ;) Good to see your still around. Thanks for posting.

It's been a while since I worked on this. First of all I installed Oracle's free VirtualBox VM and installed the specific (old) distro of Fedora that DLink use. So while my machine is 64-bit, this VM is 32-bit. Therefore everything built without any problems. The changes I made were in the php scripts so I did not have to recompile the kernel and therefore stuck with the original, so I never got to try making any changes that went too deep.
Logged
Cable: 1Gb/50Mb>NetGear CM1200>DIR-882>HP 24pt Gb Switch. COVR-1202/2202/3902,DIR-2660/80,3xDGL-4500s,DIR-LX1870,857,835,827,815,890L,880L,868L,836L,810L,685,657,3x655s,645,628,601,DNR-202L,DNS-345,DCS-933L,936L,960L and 8000LH.

terminlman

  • Level 1 Member
  • *
  • Posts: 18
Re: Adventures with the GPL firmware
« Reply #4 on: May 05, 2014, 02:38:02 PM »

Ambercap - thanks for the feedback.  I've only barely gotten to actually identifying the files that make up the router web GUI, so I'm not actually sure what I'll have to change.

As I noted, there are two tar archives within the RAR file.  One is the toolchain alone, the other is the complete sdk, which includes the toolchain.  One of them suggests a Fedora system, the other suggests CentOS.  I actually did install (the current) CentOS within a VirtualBox environment, but I chose the 64 bit version before I realized the issue.  I did the successful build on a separate box I have running 32 bit ArchLinux.  Since I'm doing this partly to modify the router and partly to learn how the entire build system works, I'll continue (slowly) to try to get it to work in the 64 bit environment.
Logged

terminlman

  • Level 1 Member
  • *
  • Posts: 18
Re: Adventures with the GPL firmware
« Reply #5 on: May 09, 2014, 03:18:01 PM »

Well, good news/bad news.  I've started digging through the code, and it's almost impenetrable.  I can figure out most of the pieces, but not all.  I've gotten two versions to compile without apparent error - one changing only the date, just so I can tell, and the other version dropping one library that I don't need.  However, in both cases, both the official 1.10 and 1.11 claim the new FW is not valid, so I'm a bit stumped right now.   I suppose I"ll have to hunt more carefully through the logs (I rigged up the top level command to capture all the output) to see if there is some subtle problem.  I also think I found the program that runs on the router to accept the FW - maybe I'll compile it to run on the host to see what it doesn't like.  However, I have not yet figured out how this actually gets called by the web server (or what that actually is) running on the router.
Logged

terminlman

  • Level 1 Member
  • *
  • Posts: 18
Re: Adventures with the GPL firmware
« Reply #6 on: October 20, 2014, 02:34:41 PM »

It's been a while, but thought I'd follow up - although it's only to say I never got any further with this.  I was never able to get the router to load any of the firmware I compiled, and I was unable to figure out why.  As this model is not supported by any of the other router firmware projects I have been able to find, I may just keep it as a backup, and find another router where I can play with the firmware.

Thanks for all the  help - and any info if anyone else has had any success in this area.
Logged

FurryNutz

  • Poweruser
  •   ▲
    ▲ ▲
  • *****
  • Posts: 49923
  • D-Link Global Forum Moderator
    • Router Troubleshooting
Re: Adventures with the GPL firmware
« Reply #7 on: October 24, 2014, 06:57:22 AM »

I wonder if it may have to do with CRC check code...I know we have compiled some FW code with another user however he's only made some adjustments to the QoS code and that was it. If the CRC code doesn't match, it may not work...
Logged
Cable: 1Gb/50Mb>NetGear CM1200>DIR-882>HP 24pt Gb Switch. COVR-1202/2202/3902,DIR-2660/80,3xDGL-4500s,DIR-LX1870,857,835,827,815,890L,880L,868L,836L,810L,685,657,3x655s,645,628,601,DNR-202L,DNS-345,DCS-933L,936L,960L and 8000LH.

terminlman

  • Level 1 Member
  • *
  • Posts: 18
Re: Adventures with the GPL firmware
« Reply #8 on: October 24, 2014, 07:40:17 AM »

That is certainly a possibility.  However, I would assume that compiling the FW would create both the bin file and the CRC and the upload would then need both to compare (or is the CRC itself embedded in the .bin file?)   If they don't match, then 1) something changed during the upload, or 2) the package creation and the upload code are calculating the CRC differently.

I'll have to hunt through the source to see if I can find that stuff, and then see if a manually calculated CRC matches.
Logged

FurryNutz

  • Poweruser
  •   ▲
    ▲ ▲
  • *****
  • Posts: 49923
  • D-Link Global Forum Moderator
    • Router Troubleshooting
Re: Adventures with the GPL firmware
« Reply #9 on: October 24, 2014, 08:31:44 AM »

You might PM ambercap or shm0. I worked with shm0 on doing some FW mods for the DIR-827 and 857 routers a while back.

I worked with ambercap on this one:
http://forums.dlink.com/index.php?topic=52082.0

Keep us posted...
« Last Edit: October 24, 2014, 08:35:20 AM by FurryNutz »
Logged
Cable: 1Gb/50Mb>NetGear CM1200>DIR-882>HP 24pt Gb Switch. COVR-1202/2202/3902,DIR-2660/80,3xDGL-4500s,DIR-LX1870,857,835,827,815,890L,880L,868L,836L,810L,685,657,3x655s,645,628,601,DNR-202L,DNS-345,DCS-933L,936L,960L and 8000LH.