OpenWrt Forum Archive

Topic: Custom image question

The content of this topic has been archived on 5 Apr 2018. There are no obvious gaps in this topic, but there may still be some posts missing at the end.

Hey; i've successfully installed openwrt kamikaze  on a buffalo WHR-HP-G54

then i made some changes to /etc/config/network and /etc/config/wireless

everything works well.

next i followed a couple different guides and getting the source from SVN, and compiled my own image with any issues


My goal is to create a customized image to flash onto a bunch more of these routers. the configuration and changes are identical i just need a customized firmware that makes these changes:

1. different /etc/config/network and /etc/config/wireless
2. add/change root password


I'm at a loss as to where i should change or create the two modified config files
this article seems to mention it:
http://downloads.openwrt.org/docs/build … m_targetfs
but the make target_install doesn't work...

and i've not seen any mention of how i would go about giving root a password before creating the image..

can someone point me in the right direction?


thank you!

Ey,

I've tried to configure the etc/config/network file before doing the "make" command.

The file I've modified is /openwrt/package/base-files/files/etc/config/network, as it is said in your link this has to be the mother file.

After compilation, if I go to build_dir/linux-atheros/base-files/ipkg/base-files-atheros/etc/config/network, this file is identical so I guess that the final network file is modified in the compiled firmware.

I have also changed the root password, in the same directories, editing the /etc/passwd (changing the "!" for the line that I get from another /etc/passwd of another openwrt, I've seen that the same password taken from a ubuntu passwd file is different than the one taken from an openwrt passwd file). If then I go to the build_dir equivalent file, I see it already changed (after compilation), so I guess that again the changes have been sucessful.

However, I was doing this for a specific reason and I have failed, so perhaps (or probably) I am wrong in what I've said.

that worked well for changing the root password, thank you!

also as you mentioned i changed package/base-files/files/etc/config/network

this didn't work

though in this same directory i created a "wireless" file

that did work!

so something's overwriting my network config file..

i went as far as placing the file in the build_dir path to no avail...

:\

mmeija:

Various packages have both pre and postinstall scripts. If your settings are being overwritten, then a package postinstall script is the culprit.

In general, the way around this problem is not to modify the installed source files as you have been doing, but to put the config files that work on your router in a new directory called /files in the top level of your /openwrt build directory. Modifying the files that way will be difficult to maintain as you update from SVN. For example, in mine, I have:

/Users/marca56/openwrt/files/etc/config/

and for a custom banner, it put it in /etc and for the custom network, ddns, wireless, and other configs, they go in /config.

This way, when I build, all these get included by default.

The other thing to look at is in the main make menuconfig menu, there is an option for Image configuration. I set a custom DNS server and a custom LAN domain there.

Hope this helps.

marc.

that worked perfectly, thank you very much marca56


i can add in case anyone runs into this; if you've used this command to get the branch
svn co svn://svn.openwrt.org/openwrt/branches/8.09

then you can simply create the "files" folder under 8.09/

YAY thank you again


one last question i think

i understand this command improves the wifi range/power:

nvram set boardflags=0x3758
nvram commit

what's the best approach to add this setting to the firmware image permanently? should i just put this in /etc/firewall.user ?

thanks again

matt

mmeija wrote:

what's the best approach to add this setting to the firmware image permanently? should i just put this in /etc/firewall.user ?

It's not good to set this parameter on every boot. Especially from firewall.user. Put to init.d a script that will check this parameter and change it if needed.

marca56, and what if your config/network file is different from the Image configuration of the make menuconfig option? Which prevails?

Because if I have two ethernet ports instead of one, and I only configure the Image configuration option, what is configured? What can I expect?

thanks everyone for your help

ggerard: i believe if you use the /files folder, it'll overwrite whatever you configure in menuconfig for network settings...  as this seems to trump all of the packaging scripts and makefiles and the like

Matt

ggerard:

That's the point of the /files configs... the opkg spec is sort of loose in that it doesn't require or forbid the use of a post install script. /files helps smooth things out if necessary.

marc.

But, I've create the /files directory. If in /files/etc/config I put the network file, when I go to the build_dir after the compilation and I find my file there. Ok.

But If I add the file dropbear in /etc/init.d, and I add a symbolic link of that dropbear in /etc/rc.d, after compilation I cannot see them in the build_dir directory.

What am I missing here?

(Any comment about my previous question?)

ggerard,

Do you use a relative path of the target file ? If you don't do,it will be wrong. I think.

cliusn wrote:

ggerard,

Do you use a relative path of the target file ? If you don't do,it will be wrong. I think.

Are you sure, that you have to specify an relative path?

The discussion might have continued from here.