OpenWrt Forum Archive

Topic: Building packages -vs- ipkg. Boot-time config -vs- manual config.

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

I'm working with the experimental version of software.

Is there an overall plan for how we're supposed to work with OpenWRT and configuration and packages?

The way I see it, there are two methods, with possible subsets:

Manual technique:
0.  Download and build OpenWRT
1.  Install OpenWRT on router.
2.  SSH to the router
3.  Use ipkg to install any packages not in firmware
4.  Use "nvram set" to configure all the bridge/ip address/etc stuff.
5.  Use nvram commit to store them.
6.  reboot to get the router running in correct configuration

Automated technique:
0.  Download OpenWRT
1.  Download additional packages in source, merge them into OpenWrt build tree
2.  Write configuration script to adjust all nvram variables before interfaces come up, etc.
3.  Compile OpenWRT and all packages, build filesystem with extra pacakges and scripts
4.  Install OpenWRT on router.
5.  Router software configures everything automatically.

I'm sure there are advantages and disadvantages to both methods.  But is one of the methods preferred or recommended?
I know that not all packages are available in source code.  And maybe it's possible to have ipkg store the package executables in the filesystem image on the PC, so you can create a download image with the packages built it?

For example, if you were programming twenty routers, what would be the technique?

Narrowband

some tricks that may help -

1) In experimental, there's a menuconfig interface that pops up when you compile the source, using this you get to select which packages are compiled. More importantly, you get to decide if the package is to be compiled into the firmawre or just simply compiled. (Anyone who's built a kernel will be familiar with the menuconfig interface - the "m/y/n" options have been mapped to "build&install, build ipkg only, don't build" for the packages)

2) You can do "dd /dev/mtdblock/1 of=/tmp/image" and get a dump of the kernel & filesystems in flash. You won't be able to reflash this with the web interface but you will be able to use a command like "mtd -r write /tmp/image linux" to dump it to another device.

Be careful copying nvram configurations between routers; some variables are model specific and will cause issues if set on other models.

Actually, I admit that I _don't_ get the m/y/n options in menuconfig.

I mean, why compile a package and not put it in the firmware, unless you're doing some SERIOUS testing around with different configurations, such that you don't want all those utilities in the firmware at once?

But let me see if I understand building packages, because some of the ones I want aren't in menuconfig.  (it's no secret that I'm obsessed with getting the WRT54GS to use WPA and serve as its own Radius server.)

I download the source for a package, if it's available.  I build it.  I tell ipkg that my PC has some packages available.  And then I use ipkg to install that package on my WRT.

Is there any way to merge that into the experimental software build, just like the other apps and packages in menuconfig?

It's OK if that's "future work", but if the ability is there I might as well use it.

nb

I think that what you describe is already available. By choosing "y" you get the package being installed on the firmware you have in the bin/ directory.

PS : press the Y key and you get something like :
<*> iptables

Press  the M key, and you get something like :
<M>   extra modules

Some packages are not yet being official such as freeradius for instance, so let's add it to the buildroot if you find the makefile somewhere like on Nico's website ( http://nthill.free.fr/openwrt/ )

(Last edited by RItalMan on 10 May 2005, 15:06)

RitalMan, I'm not following.

Yes, if you press Y you get <*>, and the package goes in the firmware.

But what does <M> _mean_?  Does it mean that the package goes into the firmware but it becomes a kernal loadable module rather than a part of the kernel?  Does it mean that it gets built and you have to get it to the WRT yourself?

Oh well.  If I put an * on it, I know it goes in.  The rest is nice for those who understand it, I suppose.

nb

The discussion might have continued from here.