OpenWrt Forum Archive

Topic: Adding files to OpenWRT base-file package

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

Hello everybody,
this is just a quick question from a n00b, i've created my own OpenWRT image, added and customized packages with OpenWRT development environment, cross-compiled SD module and so on.

Now there's just a quick question:
I want to add some simple files, change something and so on into /etc directory (on final WRT image), maded this by issuing these commands:

- make clean
- edited files, added and so on...
- make world

Is there a quick way to do this ? i just want to recompile the base-files package and add only files modified inside its ./package/base-files/default/etc dir, in this way compiling takes ages.

Thank you in advance for your reply
Regards

Ben

If you just want to replace particular files in the final image then you only need the ImageBuilder. Nothing gets recompiled - it just assembles a firmware image file containing the set of packages which you choose plus the override files you choose.

I know about ImageBuilder, but i've installed Devel Environment 'cause i want to add some extra features to OpenWRT custom image, i've built the MMC module for my buffalo and inserted some custom programs (gpio but also something for my own) i personally built for making it act as some sort of ethernet applicance, is it possible to use only development environment instead of installing also ImageBuilder ? i need to make the work twice in this way.

Cheers
Ben

Well, the easiest way is the ImageBuilder. To use the WhiteRussian buildroot do:

cd ~/whiterussian
touch package/base-files/default/test-file.txt
make image_clean package/base-files-clean world

This rebuilds the base-files package and recreates the images. That takes about 5 minutes.

check to see if the file is included in the image and in the package

ll build_mipsel/linux-2.4-brcm/root/test-file.txt
-rw-r--r-- 1 ubuntu ubuntu 0 2006-12-20 19:38 build_mipsel/linux-2.4-brcm/root/test-file.txt

ll build_mipsel/base-files/base-files/test-file.txt
-rw-r--r-- 1 ubuntu ubuntu 0 2006-12-20 19:38 build_mipsel/base-files/base-files/test-file.txt

Maybe they're backporting the changeset 5685 to WhiteRussian (ticket #1079).

(Last edited by forum2006 on 20 Dec 2006, 19:44)

ben72 wrote:

I know about ImageBuilder, but i've installed Devel Environment 'cause i want to add some extra features to OpenWRT custom image, i've built the MMC module for my buffalo and inserted some custom programs (gpio but also something for my own) i personally built for making it act as some sort of ethernet applicance

I have a similar requirement. What I do is to use the SDK to build my custom ipkg's, and then the ImageBuilder to assemble a custom firmware image comprising some stock OpenWRT ipkg's, my custom ones, and some custom startup scripts and config files.

I don't see a need for using BuildRoot, unless you're actually modifying the source of existing packages, or hacking the kernel. As for the 'MMC module' you refer to, I don't know if it's a kernel module or not. If it is, then maybe it needs to be built within the BuildRoot environment. But even then, once you've done it once and created your kmod-buffalo-mmc.ipkg or whatever, then you can just copy it over to ImageBuilder and use that in future.

HTH, Brian.

OK,
thanks a lot guys, i've tried what forum2006 reported and worked fine.
For Brian: i'll give ImageBuilder a try, but as you noticed i need to hack the kernel, MMC module needs to be supported into the kernel, i've also added some nice features (ext2 support, some busybox mods, NFS and others) so my buffalo can use an external SD (studied the linksys hack to port to Buffalo WHRs), i don't need external IPKGs so my only needs is to customize the original kernel.
Maybe it's stupid to report but i'm using this AP as an ethernet appliance and for my needs wifi card is not necessary, i'm using it 'cause the hardware is the cheapest i've ever found for this task.
OpenWRT really rocks, stable and robust linux distro, keep it simple as it is, this is the real advantage of it.

Cheers
Ben

The discussion might have continued from here.