OpenWrt Forum Archive

Topic: Buildroot problems from CVS

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

Howdy,

I seem to be having more difficulty than I should surrounding building a custom firmware for a WRT54G. By making use of the references at http://downloads.openwrt.org/docs/build … ation.html, I have downloaded the CVS tree. On different attempts, I have tried to make use of both the experimental and the stable. No, I did not merge the two, I would purge or move the directory for what I had been working on and, when I needed to re-download the source, started fresh.

Now, looking at the documentation, it seems like a very simple and easy process of 'make menuconfig', pick your options, and 'make' to build it all up. In theory it looks good, it picks required libraries, it does the whole process, and takes quite some time to build the toolchain, and then work on the image. However, I get several failures through the process. One such failure is:

for file in c crypt dl m nsl resolv rt uClibc util; do \
        cp /root/openwrt/staging_dir_mipsel/lib/lib$file*.so.* /root/openwrt/build_mipsel/base-files/uclibc/lib/; \
done
cp: cannot stat `/root/openwrt/staging_dir_mipsel/lib/libuClibc*.so.*': No such file or directory

Now, I'm not sure if this is a bad thing or not. It seems like it would be, but it doesn't fail here, it just continues on. I had to generate a log of the build to see this particular error. Other errors I've had:

cp /root/openwrt/build_mipsel/nvram/*.so /root/openwrt/staging_dir_mipsel/usr/lib
cp: cannot stat `/root/openwrt/build_mipsel/nvram/*.so': No such file or directory
make[2]: *** [install-dev] Error 1
make[2]: Leaving directory `/root/openwrt/package/nvram'
make[1]: *** [nvram-compile] Error 2
make[1]: Leaving directory `/root/openwrt/package'
make: *** [package/compile] Error 2

This one generates an error and fails, stopping the build. I looked into it, and for some reason, that nvram shared object does not build. In tracing it further, I see that the include file <shutils.h> is not found anywhere. Doing a find on the buildroot, I get the following:

[root@localhost openwrt]# find . -name shutils.h
./target/linux/package/openwrt/include/shutils.h

Well, ok. I can follow this somehow. I go into the Makefile in openwrt/build_mipsel/nvram and change the EXTRA_CFLAGS to this:

EXTRA_CFLAGS := -c -I. -I../include -I/root/openwrt/target/linux/package/openwrt/include

At this point, it will find the header file and build successfully. Unfortunately for my first run, and since I had to build it in that directory by hand, it assumed 'gcc' (not the cross-compiler) was to be used. Adding a line...

CC=mipsel-linux-uclibc-gcc

...found the right compiler, assuming I included the staging_dir_mipsel/bin directory to my path.

The next error kicked off around the iptables package with the following lines:

kernelconfig.mk:1: /root/openwrt/build_mipsel/linux/.config: No such file or directory
make[2]: *** No rule to make target `/root/openwrt/build_mipsel/linux/.config'.  Stop.
make[2]: Leaving directory `/root/openwrt/package/iptables'
make[1]: *** [iptables-prepare] Error 2
make[1]: Leaving directory `/root/openwrt/package'
make: *** [package/compile] Error 2

Now, I did some research and found the topic make fails on iptables from around July, '05. Unfortunately, there is no resolution in that post, but I fumbled one up myself. It seems like it's asking for the kernel configuration file (since IPTables is fairly kernel-centric). I hunted for a .config file and got this:

[root@localhost openwrt]# find . -name .config
./.config
./toolchain_build_mipsel/linux-2.4.30/.config
./toolchain_build_mipsel/uClibc-0.9.27/.config

Looks like the one I'm looking for is in the linux-2.4.30 directory, so I make a symbolic link from build_mipsel/linux over to there so that, not only can it find the .config file, but any header files it might need as well. For that problem, that takes care of things.

To my dismay, I wound up having one issue that was wholly related to my environment. Autoconf needed to be version 2.59 in order to build the package for Libnet-1.0.2a. I upgraded and continued my build, only to hit yet another issue surrounding something that didn't build:

cp -a /root/openwrt/build_mipsel/wireless_tools.28/libiw.so* /root/openwrt/staging_dir_mipsel/usr/lib/
cp: cannot stat `/root/openwrt/build_mipsel/wireless_tools.28/libiw.so*': No such file or directory
make[2]: *** [install-dev] Error 1
make[2]: Leaving directory `/root/openwrt/package/wireless-tools'
make[1]: *** [wireless-tools-compile] Error 2
make[1]: Leaving directory `/root/openwrt/package'
make: *** [package/compile] Error 2

Well, go into the build_mipsel/wireless_tools.28/ directory and check things out and find that, first, the Makefile needs to be adjusted. Wants to use the normal CC variable for the compiler, and notes in the Makefile that it needs to be changed for cross-compilation. So, I change it to the following and run a 'make' in that directory:

## Compiler to use (modify this for cross compile)
CC = mipsel-linux-uclibc-gcc
## Other tools you need to modify for cross compile (static lib only)
AR = mipsel-linux-uclibc-ar
RANLIB = mipsel-linux-uclibc-ranlib

Once that's built using the proper compiler, I go back to the openwrt directory, do yet another 'make', and let it run it's pace again. This time, everything seems to be ok, it kicks through all steps that it knows about, does a few things, and then ends out. However, this is where I am stuck at. I do not see an image file. I do not see the options to tell the make file to build the image. In fact, notations such as 'the target root directory is in build_mipsel/root' is inaccurate, since it seems like they're found in build_mipsel/base-files/base-files/. This seems to be the same for both the stable (whiterussian) buildroot and the current experimental (as of 9/27/05).

Other pertinent information:

Build environment: RedHat Linux 9.0
User account: root (this is a test system only, but I figured this would just be easier)
Make version: not sure, whatever is standard
Autoconf version: 2.59 (per upgrade required)
Other software: 99% (save for autoconf) default versions for RedHat 9.0. This is pretty much a clean install of the OS, with very little customization done on it.

Any help with this would be appreciated. I am very interested in getting a custom firmware built, but it seems like I've hit a brick wall. Assistance on the experimental is prefered (it has bind as a package, which I use for nsupdate), but I'll take help on the stable if that's all that is available.

Thanks.

show us exactly what cvs command you have used to checkout the source. I do daily builds and do not get the errors. Your linux distro is missing something. What is the version of your host compiler?

The commands I used were copy/pasted from http://downloads.openwrt.org/docs/build … l#download. I did not retype them.

As for the other information you requested (these are all RedHat RPM package notations):

gcc-3.2.2-5
libgcc-3.2.2-5
compat-gcc-c++-7.3-2.96.118
gcc-g77-3.2.2-5
gcc-java-3.2.2-5
gcc-c++-3.2.2-5
compat-gcc-7.3-2.96.118
gcc-gnat-3.2.2-5

binutils-2.13.90.0.18-9

autoconf-2.59 (built from scratch, not rpm format)
automake-1.6.3-5
automake15-1.5-6
automake14-1.4p6-5.1

And, if it matters, is running kernel 2.4.20-8

Anything else you would like to know? I am perfectly willing to upgrade anything on this particular machine. It's basically a scratch machine for me.

do you have the following packages also installed ?
- bison
- flex
- zlib-devel

bison-1.35-6
zlib-devel-1.1.4-8
flex-2.5.4a-29

Can you "rm -rf *_mipsel" and make again ?
(Supplying a full build log would be ideal...and maybe your .config too...)

(Last edited by Nico on 28 Sep 2005, 23:36)

I did one better. I started from scratch. Basically wiped out the CVS tree I was using and downloaded a new, just to make sure all steps were done right. I also included in the log environment vars. Only the first section down now (error up to the nvram failure). Located here:

http://www.kittyfox.net/openwrt_build_part_1.log

.config file located:

http://www.kittyfox.net/openwrt.config

I will continue the build, fixing the steps and logging it to get fully through the process.

Twanfox wrote:

The commands I used were copy/pasted from http://downloads.openwrt.org/docs/build … l#download. I did not retype them.

Which version?? HEAD or whiterussian?

Use whiterussian, begin from scratch and install flex/bison and a new gnu make. See FAQ.

(Last edited by wbx on 29 Sep 2005, 11:33)

My appologies for not being specific. I was using the HEAD branch of the CVS tree. I mentioned my preference for that, since bind was being included in it and I use nsupdate for my DNS management. However, if the only thing you'll help me on is the stable (whiterussian) branch, then I will take that. Fortunately for me, the failures I'm seeing happen In Both Branches that I try and build. So, if you help me with one, odds are good that it will fix both builds for me.

I do begin from scratch. It still fails.

I do have flex/bison installed. However, I will seek out the very latest versions to ensure that all the functionality that may be needed is present. I will do this for gnu make as well.

I mentioned this in my original post, and followups, what software packages I have installed, and what branches I was having problems with.

If I may ask, what build environment does this typically work on? Linux? BSD? Windows?

Since more packages are listed as being required, I'm listing here all the packages in that list that are installed, for reference.

gcc-3.2.2-5
libgcc-3.2.2-5
compat-gcc-c++-7.3-2.96.118
gcc-g77-3.2.2-5
gcc-java-3.2.2-5
gcc-c++-3.2.2-5
compat-gcc-7.3-2.96.118
gcc-gnat-3.2.2-5
binutils-2.13.90.0.18-9
patchutils-0.2.19-1
patch-2.5.4-16
bzip2-libs-1.0.2-8
bzip2-1.0.2-8
bison-1.35-6
zlib-devel-1.1.4-8
flex-2.5.4a-29
automake-1.6.3-5
make-3.79.1-17
automake15-1.5-6
automake14-1.4p6-5.1
gettext-0.11.4-7
unzip-5.50-7

Twanfox wrote:

make-3.79.1-17

That's the problem. Your make version is too old.

Checkout the OpenWrtFaq on the wiki which version of make is required.

And once again, if you like something working please use the White Russian CVS tree.

Nico's packages (build of CVS HEAD) from here will also run on the latest White Russian release.

(Last edited by olli_04 on 29 Sep 2005, 18:06)

You guys are too cool. Having an old version of make was indeed my problem, and I now have spiffy new image files for my router. Thanks!

The discussion might have continued from here.