OpenWrt Forum Archive

Topic: Couple of issues with current buildroot

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

I am new to BuildRoot but I think I have come across a couple of potential bugs during my learning:



First, I noticed the 'tc' package installs the ip binary, not tc binary from the iproute2 source. It looks like its an incorrect Makefile. Here is a patch that fixes the issue:

*** package/iproute2/Makefile.orig      Sat Jun  4 16:55:16 2005
--- package/iproute2/Makefile   Sat Jun  4 16:53:38 2005
***************
*** 41,47 ****

  $(IPKG_IPROUTE2_TC):
        mkdir -p $(IDIR_IPROUTE2_TC)/usr/sbin
!       cp $(PKG_BUILD_DIR)/ip/ip $(IDIR_IPROUTE2_TC)/usr/sbin/
        $(STRIP) $(IDIR_IPROUTE2_TC)/usr/sbin/*
        $(IPKG_BUILD) $(IDIR_IPROUTE2_TC) $(PACKAGE_DIR)

--- 41,47 ----

  $(IPKG_IPROUTE2_TC):
        mkdir -p $(IDIR_IPROUTE2_TC)/usr/sbin
!       cp $(PKG_BUILD_DIR)/tc/tc $(IDIR_IPROUTE2_TC)/usr/sbin/
        $(STRIP) $(IDIR_IPROUTE2_TC)/usr/sbin/*
        $(IPKG_BUILD) $(IDIR_IPROUTE2_TC) $(PACKAGE_DIR)



Second, during the package creation process, I noticed some tar errors, and it looks to be a problem with the order of options passed to tar. This could just be my version of tar running from current debian unstable. Here is the error:

PATH="/home/mike/projects/surfintown/wrt54gs/experimental/openwrt/staging_dir_mipsel/usr/bin:/home/mike/projects/surfintown/wrt54gs/experimental/openwrt/staging_dir_mipsel/bin:/bin:/sbin:/usr/bin:/usr/sbin" ipkg-build -c -o root -g root /home/mike/projects/surfintown/wrt54gs/experimental/openwrt/build_mipsel/lzo-1.08/ipkg/liblzo /home/mike/projects/surfintown/wrt54gs/experimental/openwrt/bin/packages
tar: -X: Cannot stat: No such file or directory
tar: Removing leading `/' from member names
tar: Error exit delayed from previous errors
Packaged contents of /home/mike/projects/surfintown/wrt54gs/experimental/openwrt/build_mipsel/lzo-1.08/ipkg/liblzo into /home/mike/projects/surfintown/wrt54gs/experimental/openwrt/bin/packages/liblzo_1.08-1_mipsel.ipk


This is just from one package, but all of them have the same problem. Its related to the fact that the -X option is at the end of the tar  command that ipkg-build is calling. Here is staging_dir/mipsel/usr/bin/ipkg-build line 246 before and after:

before:

( cd $pkg_dir && tar $ogargs -czf $tmp_dir/data.tar.gz . -X $tmp_dir/tarX )

after:

( cd $pkg_dir && tar $ogargs -X $tmp_dir/tarX -czf $tmp_dir/data.tar.gz . )


Another side affect of this problem is that the CONTROL files and the tarX file were being added to every package created by ipkg-build. Also note that if you fix your local ipkg-script, if you make distclean, it will redownload the ipkg-utils package and you have this problem all over again.

Hello,

I got the same problem, so I made a small patch fixing this issue. Put the following lines in a new file openwrt/toolchain/ipkg-utils/1.7/ipkg-utils-1.7-ipkg_build_tar.patch
Next time you will make distclean, the file will be automagically patched.

--- ipkg-utils-1.7/ipkg-build 2004-04-24 11:43:51.000000000 +0200
+++ ipkg-utils-1.7-patched/ipkg-build 2005-06-14 20:04:41.000000000 +0200
@@ -226,7 +226,7 @@
 mkdir $tmp_dir
 
 echo $CONTROL > $tmp_dir/tarX
-( cd $pkg_dir && tar $ogargs -czf $tmp_dir/data.tar.gz . -X $tmp_dir/tarX )
+( cd $pkg_dir && tar $ogargs -X $tmp_dir/tarX -czf $tmp_dir/data.tar.gz . )
 ( cd $pkg_dir/$CONTROL && tar $ogargs -czf $tmp_dir/control.tar.gz . )
 rm $tmp_dir/tarX

Maybe someone should commit this file in CVS.

aorlinsk wrote:

Maybe someone should commit this file in CVS.

Almost done !

Thanks for the patch

Hello,
this is a patch for ipkg-build, that removes .svn directories like the build_clean patch
does with CVS directories. It allows (me) to use a svn repository for own changes...

Can somebody add it to the openwrt CVS? :
toolchain/ipkg-utils/1.7/ipkg-utils-1.7-ipkg_build_clean_svn.patch

--- ipkg-utils-1.7/ipkg-build
+++ ipkg-utils-1.7/ipkg-build   2005-07-10 17:46:39.000000000 +0200
@@ -60,6 +60,19 @@
            fi
        fi
 
+       svn_dirs=`find . -type d -name '.svn'`
+       if [ -n "$svn_dirs" ]; then
+           if [ "$noclean" = "1" ]; then
+               echo "*** Warning: The following .svn directories where found.
+You probably want to remove them: " >&2
+               ls -ld $svn_dirs
+               echo >&2
+           else
+               echo "*** Removing the following files: $svn_dirs"
+               rm -rf "$svn_dirs"
+           fi
+       fi
+
        tilde_files=`find . -name '*~'`
        if [ -n "$tilde_files" ]; then
            if [ "$noclean" = "1" ]; then

The discussion might have continued from here.