PDA

Bekijk de volledige versie : Recompiling with different defaults



coderash
09-10-2005, 03:35
I'd like some help on changing a few of the default settings for the WL-HDD. I'm quite proficient in Windows programming, but 1 week new to Linux and it's still a bit confusing.

How do I change the default settings for the root account from "Admin/Admin" to something else? I realize this can be done on the web page after the router boots, but I'd like to prevent someone from being able to hold the 'reset' button and reverting back to the default login.

I'm also interested in setting up the SSID permantly as well. I found a few places where I've changed the SSID from "Broadcom" in a few source files, but after recompiling and installing the new firmware, the SSID is set to "default". Is there someplace I can change this?

I'm running Debian and have successfuly recompiled with Oleg's firmware (for which I am grateful, thank you Oleg) using the createchain-0.5.sh script. A few depedencies were needed by Debian, but was able to use apt-get to install zlibc, zip, unzip, and others that were missing. Basically what I am saying is that I'm becoming comfortable with recompiling, but would love to know the secret on making permenant modifications that don't rely on the flashfs partition and the post-boot script. From what I understand, the flashfs partition is disabled if a hard reset is performed.

Thanks in advance for any help in this area.

- coderash

coderash
19-10-2005, 03:35
:cool: Whew! This linux stuff can be tough when you're going from knowing nothing to recompiling firmware. I scrapped Debian for Fedora Core 4. In the post above, I thought it was working and it wasn't. My bad. So then I was tripped up for days trying to figure out why I was having strange compile errors around the .config file. Come to find out that Fedora 4 uses gcc 4 by default, which won't work at this time. Ok, this might not be a problem for most people, but it took me days to figure out how to revert back to gcc 3.2. Everybody seemed to have an opinion on how this should be done, but little instructions were given. I pieced together these instructions and it seemed to compile fine afterwards:

yum remove gcc
yum install compat-gcc-32
ln -s /usr/bin/gcc32 gcc
ln -s /usr/bin/g++32 g++

Now on to the good stuff. My original plan was to change some of the defaults before compiling, like the username/password and SSID. I found many places in the source files where these are defined, but found the only one that mattered was the flash.default file. Makes sense now :D

Ok, so the way you do this is to run through the steps to compile up to the point where the gateway folder is created, just before the final "make" and "make image-WLHDD" steps. Then jump in and edit this file:

/root/broadcom/src/gateway/shared/flash.default

First 2 lines by default should be:

{"http_username", "admin", 0}

{"http_passwd", "admin", 0}

Change "admin" to whatever you like and viola! new default username and password. Careful though, holding reset to get back to defaults now will want this username and password, so remember it.

Another neat trick is the SSID. Same file, line 299:

{"wl_ssid", "default", 0}

change "default" to whatever ssid you want.

**********************************

And this little gem here allows you to move your admin pages off port 80 and throw your own busybox one there instead.

/root/broadcom/src/gateway/httpd/httpd.c
line 69
#define SERVER_PORT 80

If you change port 80 to something else, remember that port number so you can reach the admin pages later. Once this new firmware is placed on the box, you'll need to reference the port in your URL. For example if you changed 80 to 8010:

192.168.1.6:8010

After this, I put the busybox web server on port 80 and pointed it to a www folder I created on the hard drive. To do this, make sure your post-boot is mounting the hard drive as /opt, then add the line for the busybox web server:

mount /dev/discs/disc0/part1 /opt
busybox_httpd -p 80 -h /opt/www

Now I'm trying to figure out how to configure iptables so I can access both port 80 and port 8010 from the internet. Can someone provide this info? :)

I also made a /www/cgi-bin directory and dropped in the script from this thread http://www.wl500g.info/showthread.php?t=788 which gives some cool system info.

Now you're ready to finish compiling by running "make" and "make image-WLHDD". Then upload and watch the magic.

***********************************

Ok, So I got this far, but I have a few things I still want to do. After reading this post: http://wl500g.info/archive/index.php/t-359.html I'm concerned about the syslog file being written to the ramfs partition on the chip. My project requirements will have the router rebooting quite a bit and I'm worried about the life of the flash chip and having it burn out due to how much writing to it will be done. And if the syslog file grows to a point of failure, this will surely happen in my case.

So if there is any way to change the source to have the ramfs moved to the hard drive, I'd sure like to know the secret. The link to the posting above looks like it deals with older firmware and a usb drive. If anyone could shed some light on how this might be accomplished with the newer firmware model and the ide hard drive, I would be forever grateful.

Also, I could sure use a simple explanation of how to remove packages from the source before building, as well as how to add new packages to the source. I found that by going into "make menuconfig", I can disable some features, but it doesn't seem to save very much space and it looks like some of the packages are incorporated, but just not activated. Is this just a matter of removing a folder? or do I need to go through makefiles and find and delete references to these files as well? I feel like such a noob, but I am learning quickly and willing to share any results.

And lastly, I'm after some source code examples for changing the button operation on the WL-HDD. Undead seems to have created some source modifications for this here in this post: http://wl500g.info/archive/index.php/t-1966.html and I've tried to contact him to see if he can help, but have not heard anything yet.

In the post, he says:


I change button keypress in Oleg's firmware 1.9.2.7-3 (file rc/watchdog.c) with some other functionality:
- reboot 3 sec, power led flashs shortly
- power down 5 sec, power led flashs longly
- reset to factory settings 15 sec, power led flashs too longly
- and super feathure - short press (0.25-2 sec) watchdog counting short keypresses, power led flashs too quickly, and than run script
/usr/local/sbin/button-pressed <count> where <count> - counts of press, and you can change button processing at any time and add any counts of functions :D ;

I'm especially interested in his "super feature" about having the button run a particular script. Can anyone provide any insight on how this could be done? I can vaguely decipher C code, but not yet the expert coder I inspire to be :D

I really enjoy this forum and appreciate the sharing of knowledge that it provides. I'd also like to extend my appreciation to Oleg for all the hard work he has put into his firmware and his unselfishness when it comes to sharing his knowledge in these forums.

Thanks in advance for any information anyone can provide.

- coderash