OpenWrt Forum Archive

Topic: how can I include certain packages in rootfs ?

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

Hi,

I tried to read the wiki but can't find it. I can change PACKAGES to control which package would be built but can't find where to specify what to include in the squashfs rootfs. For some of the packages(like dnsmasq, iptables) they do appear in it but I want to include dropbear without success.

I understand this may not be the design philosophy of openwrt(minimalist rootfs with writable jffs2 for additional stuff) but  sometimes it is easier this way.

Long:

See my Howto http://openwrt.org/forum/viewtopic.php?t=56

Short:

You have to make sure, that the binaries are getting copied to build_mipsel/root (either lib or usr/sbin or bin or /usr/sbin; you know what I know).

Yup, I can hand copy those under *-ipk to root then make on the parent to have them packed into .bin.

However, I am wondering if there is a 'standard' mechanism in the master Makefile such that I can specify which ipkg should also be 'installed' in the process in addition to just building the ipkg file that is good for later 'install'.

What puzzle me is, some package does go to root automatically, some don't even though the .ipkg was built in the same process.

have a look into buildroot/make/*.mk files.

They copy them to the build_mipsel/root directory.

Also take a look at buildroot/make/customize.mk.

I am trying to build customized firmware and am including openssh, olsrd & tcpdump. openssh and olsrd compiles at least.

I found a olsrd-Makefile somewhere in this wiki which needed to be edited or rather updated. I changed the following and first line in the makefile:

UOLSR_SOURCE:=olsrd-0.4.7.tar.bz2

The problem for me was that the tcpdump- and libpcap-binaries were not included in build_mipsel/root. Reviewing build_mipsel/root I got aware of the fact that I have been misleaded by the targets used in the master-makefile buildroot/Makefile.

I have put the customize-target just before the openwrt-code.bin-target:

TARGETS:=host-sed gcc3_3 ipkg-utils openwrt-base zlib openssl openssh uolsrd pppoecd customize openwrt-code.bin

Now I will add Blackvels makefiles.

Here's my customize.mk:

CUST_DIR:=$(SOURCE_DIR)/customize
ROOT_DIR:=$(BUILD_DIR)/root

customize:
        # Running Customization!!!
        rm $(ROOT_DIR)/etc/init.d/S*
        rm $(ROOT_DIR)/etc/init.d/rcS
        cp -af $(CUST_DIR)/etc/init.d/* $(ROOT_DIR)/etc/init.d/
        cp $(BUILD_DIR)/WRT54GS/release/src/router/mipsel-uclibc/install/nas/usr/sbin/nas $(ROOT_DIR)/usr/sbin/nas
        cp $(BUILD_DIR)/WRT54GS/release/src/router/mipsel-uclibc/install/utils/usr/sbin/wl $(ROOT_DIR)/usr/sbin/wl

thanks for the hint. However, not all of the packages in the buildroot can be customized this way.

The reason is that many of them only has a *-ipk target in the .mk file which needs to be invoked with "make packages". I have changed a few of them so that it can be invoked from the TARGETS build.

Why don't you simply copy the binaries made by the*-ipk targets to the root-target directory using the customize target before building the images?

This way you can leave the makefiles untouched. Editing makefiles can cause conflicts someday I think. Not that I would not edit them myself. wink

Another hint: I recommend to add a preconfigure.mk file in buildroot/make/ to add preconfiguration targets as modifying makefiles, etc. for different targets. A good example would be to copy makefiles for a patched iproute2 sofware or to replace files as done in Blackvel's iptables-p2p howto: http://openwrt.org/forum/viewtopic.php?t=56

What u think?

The discussion might have continued from here.