Git

240 views
Skip to first unread message

GabrieleV

unread,
Sep 15, 2011, 6:35:54 PM9/15/11
to al...@googlegroups.com
Just entered the Alt-F world ... and i NEED Git to manage my scripts.
Tried opwtare repository, but got
 can't resolve symbol '__stdout'
I've read a post on dsm-g600 forum about incopatibility with optware packages  :(
Is there a brief howto on rebuilding a package from sources ?
I can manage compiling packages, but patching is outside my coding skills ...
Git could be my first contribution.

Joao Sousa Cardoso

unread,
Sep 16, 2011, 3:08:50 PM9/16/11
to al...@googlegroups.com
On Thursday, September 15, 2011 23:35:54 GabrieleV wrote:
> Just entered the Alt-F world ... and i NEED Git to manage my scripts.
> Tried opwtare repository, but got
>
> can't resolve symbol '__stdout'
>
> I've read a post on dsm-g600 forum about incopatibility with optware
> packages :(

I think it is now sorted-out for the next snapshot release. But I only did
very light tests.

> Is there a brief howto on rebuilding a package from sources ?
> I can manage compiling packages, but patching is outside my coding skills

Yes, read the "HowToCreatePackages" wiki. But start with the "HowToBuild" one.
I can try making a git package, wait a week or so (and remember me again if
the I forgot)

> ...
> Git could be my first contribution.

It would be welcome.

The repository, that is not updated since march!, has two sets of config
files,
.config-base and .config-pkgs. I do the following to configure/create
packages:

cp .config-pkgs .config

export BLDDIR=~/Alt-F/build-base; export
ROOTFS=$BLDDIR/project_build_arm/dns323/root/; export
STAGING=$BLDDIR//build_arm/staging_dir/; export PATH=$PATH:
$BLDDIR/build_arm/staging_dir/usr/bin:~/Alt-F/alt-f/bin; export
BINARIES=$BLDDIR/binaries/dns323

make O=$BLDDIR menuconfig # exit without changes
make O=$BLDDIR

GabrieleV

unread,
Sep 16, 2011, 7:07:48 PM9/16/11
to al...@googlegroups.com
Tried to build with a lot of fantasy, but got stuck at the error:
 checking for suffix of object files... configure: error: cannot compute suffix of object files: cannot compile

Here is the summary of what I've tried ...

#http://buildroot.net/downloads/buildroot.html

sudo apt-get install libgmp3-dev libmpfr-dev
# to avoid error
# configure: error: Building GCC requires GMP 4.1+ and MPFR 2.3.0+.

mkdir -p /home/diesis/Alt-F/build-base/toolchain_build_arm/uClibc_dev//usr/include
# to avoid the error
# The directory that should contain system headers does not exist:
#  /home/diesis/Alt-F/build-base/toolchain_build_arm/uClibc_dev//usr/include

$ sudo apt-get install libmpc-dev
# trying to avoid error
# checking for suffix of object files... configure: error: cannot compute suffix of object files: cannot compile

sudo apt-get install build-essential subversion libncurses5-dev zlib1g-dev gawk flex
# http://wiki.openwrt.org/doc/howto/buildroot.exigence

svn checkout http://alt-f.googlecode.com/svn/trunk/ alt-f-read-only
cd alt-f-read-only/alt-f/
cp -f .config-pkgs .config

export BLDDIR=~/Alt-F/build-base
export ROOTFS=$BLDDIR/project_build_arm/dns323/root/
export STAGING=$BLDDIR//build_arm/staging_dir/
export PATH=$PATH:$BLDDIR/build_arm/staging_dir/usr/bin:~/Alt-F/alt-f/bin
export BINARIES=$BLDDIR/binaries/dns323

scripts/add_new_package.wizard
# deps are expat curl zlib openssl as per git website

make O=$BLDDIR menuconfig
make O=$BLDDIR git

No more cheers left :-(
Gabriele

Joao Cardoso

unread,
Sep 17, 2011, 10:30:55 AM9/17/11
to Alt-F


On Sep 17, 12:07 am, GabrieleV <gabriele.vivine...@gmail.com> wrote:
> Tried to build with a lot of fantasy,

Yes, that was the problem :-)

Just follow the HowToBuild instructions, you don't need to install
Buildroot, Alt-F has its own modified Buildroot.
You only have to install development packages on your host such as
gcc and some autotools.

The mkprepare.sh script asks for a non-existent mklibs -- it is not
needed for now, just edit the script and near the end comment the
mklibs build.

After you have successfully build the base firmware, you know that you
can do it, and you can build the default Alt-F packages packages.
You have to build all packages for a start, only after that you can
try to compile a new package; this is because the new package might
need other packages (looks like git needs expat curl zlib openssl, but
expat might need other package as well, etc).
You are cross-compiling, you don't need those packages installed on
your host, but on the buildroot tree -- in the STAGING directory.

So,

cd alt-f-read-only
cp -f .config-pkgs .config
export BLDDIR=~/Alt-F/build-pkgs ...
make O=$BLDDIR menuconfig
make O=$BLDDIR

This will take a few hours... after that, you can try to create your
new package. To understand how to create packages, read the
HowToCreatePackages wiki.

Yes, not an easy task.

Joao

GabrieleV

unread,
Sep 18, 2011, 4:07:30 PM9/18/11
to al...@googlegroups.com
Ok.
Cleaned all the source tree.
Followed exactly your instructions (sorry, I missed the mkprepare step :-( )
No strange errors, but a lot of 404 not found errors in downloading sources !!!
Done a bunch of googling finding a lot of them ...  tried  to check the sources urls
 make O=$BLDDIR source-check
died on gdb.... immediatly :-(
Tried to download all the sources available:
 make O=$BLDDIR source
Died on aufs2-util-20090926.tgz
Desperately restarted with
 make O=$BLDDIR
and died at not finding uClibc-locale-20081111-32-el.tgz
Where are these files ???? How did you solved all these broken links problems ?

Cheers,
Gabriele

GabrieleV

unread,
Sep 18, 2011, 4:39:10 PM9/18/11
to al...@googlegroups.com
Restarted again from scratch ...
Stuck at
 could not find gperf
Issued
 sudo apt-get install gperf
And continued:
 make -O=$BLDDIR
I'ts an hard life ;) ...

Noe stuck again at 404 of
 http://kylek.is-a-geek.org:31337/files//automatic-0.6.4-src.tar.gz or http://buildroot.net/downloads/sources//automatic-0.6.4-src.tar.gz

There's something wrong out there ...
Huston, we have a problem ;)

Joao Cardoso

unread,
Sep 18, 2011, 5:10:43 PM9/18/11
to al...@googlegroups.com
On Sunday, September 18, 2011 21:39:10 GabrieleV wrote:
> Restarted again from scratch ...
> Stuck at
> could not find gperf
> Issued
> sudo apt-get install gperf

Right, some host packages need to be installed

> And continued:
> make -O=$BLDDIR

hmmm, the '-' should not be in '-O', but if you started that way, continue.

Looks like Kylek has now released a 0.6.6 version. It also looks like the site
is down, or the site hierarchy has changed.
Anyway, as you don't need Automatic, just unconfigure it:

make O=$BLDDIR menuconfig

select "Package Selection for the target"

Go to the page end, select "Networking", uncheck "automatic", exit, save, and
restart the build.

As you are now building packages, the cross-toolchain is built, you can
deselect most packages that dont seems to be needed by git, e.g. hplip, gs,
foomatic, avahi, samba, netatalk... But be aware of sub-dependencies.



> There's something wrong out there ...
> Huston, we have a problem ;)

You have to override the computer and drive by eye-sighting :-)

Joao Cardoso

unread,
Sep 19, 2011, 12:29:01 PM9/19/11
to al...@googlegroups.com

I only download what I want to compile, there are many non Alt-F packages
available under buildroot, and some url are outdated. Have you svn checkout
0.1B7, haven't you?

A normal "make" should only download what is needed; if building a package
fails, you can manually download the source tar ball and put it in the "dl"
sub-directory -- if found there it will not be downloaded.

Notice also that kernel.org is down for a couple of weeks, and the default
sourceforge mirror, "easynews", is not being used by sourceforge anymore; to
fix it, do a menuconfig->Build Options->Mirrors and Download locations-
>Sourceforge mirror site, and set a mirror near you, I'm using 'kent', from
England -- use http://sourceforge.net/apps/trac/sourceforge/wiki/Mirrors to
see the shortname of a mirror near you and use it.

Don't give-up!

> Cheers,
> Gabriele

GabrieleV

unread,
Sep 19, 2011, 1:22:18 PM9/19/11
to al...@googlegroups.com
Hy,
i didn't give up !
Prior to your suggestions I made all the changes, and finally finished the make :)
Tried to autogenerate the package config files with
 scripts/add_new_package.wizard
Then tried to build with
 make O=$BLDDIR git
but failed miserably ...
make O=$BLDDIR git
...
checking whether system succeeds to read fopen'ed directory... configure: error: in `/home/diesis/Alt-F/build-base/build_arm/git-1.7.6.1':
configure: error: cannot run test program while cross compiling
...
In any case, I have a brief doc to reach a succesfull make under ubuntu 11.04. I'll post it after a cleanup :D

Joao Cardoso

unread,
Sep 21, 2011, 7:57:37 AM9/21/11
to Alt-F


On Sep 19, 6:22 pm, GabrieleV <gabriele.vivine...@gmail.com> wrote:
> Hy,
> i didn't give up !
> Prior to your suggestions I made all the changes, and finally finished the
> make :)
> Tried to autogenerate the package config files with
>  scripts/add_new_package.wizard
> Then tried to build with
>  make O=$BLDDIR git
> but failed miserably ...
> make O=$BLDDIR git
> ...
> checking whether system succeeds to read fopen'ed directory... configure:
> error: in `/home/diesis/Alt-F/build-base/build_arm/git-1.7.6.1':
> configure: error: cannot run test program while cross compiling

To solve those kind of errors one has to patch configure.in or
configure.ac and rebuild 'configure', or supply an environment
variable telling 'configure' to not do the test.

> In any case, I have a brief doc to reach a succesfull make under ubuntu
> 11.04. I'll post it after a cleanup :D

It will be welcome.

GabrieleV

unread,
Sep 21, 2011, 3:22:47 PM9/21/11
to al...@googlegroups.com
Hy,

> checking whether system succeeds to read fopen'ed directory... configure:
> error: in `/home/diesis/Alt-F/build-base/build_arm/git-1.7.6.1':
> configure: error: cannot run test program while cross compiling

To solve those kind of errors one has to patch configure.in or
configure.ac and rebuild 'configure', or supply an environment
variable telling 'configure' to not do the test.

Mmmh, i know pretty nothing about autotools :-(
Looked for a --disable-tests in ./configure, but it is not present.
Tried to parse configure, and tried to fake the routine that generate the error, but another one failed with the same error:
checking whether snprintf() and/or vsnprintf() return bogus value... configure: error: in `/home/diesis/Alt-F/build-base/build_arm/git-1.7.6.1':

configure: error: cannot run test program while cross compiling


Cheers,
Gabriele

GabrieleV

unread,
Sep 21, 2011, 4:02:41 PM9/21/11
to al...@googlegroups.com
Hy,

> In any case, I have a brief doc to reach a succesfull make under ubuntu
> 11.04. I'll post it after a cleanup :D

It will be welcome.

Here is my notes.

HOW TO BUILD ALT-F PACKAGES UNDER UBUNTU 11.04

If you want to know more about the envirnment used to build Alt-F, look at this page:
http://buildroot.net/downloads/buildroot.html

If you run Ubuntu 11.04, you have to install these packages, that are needed to build the cross-compiling environment:

 sudo apt-get install build-essential subversion libncurses5-dev zlib1g-dev gawk flex gperf
# See http://wiki.openwrt.org/doc/howto/buildroot.exigence

And these:

 sudo apt-get install libgmp3-dev libmpfr-dev
# to avoid error
# configure: error: Building GCC requires GMP 4.1+ and MPFR 2.3.0+.

And these:

 sudo apt-get install libmpc-dev
# trying to avoid error
# checking for suffix of object files... configure: error: cannot compute suffix of object files: cannot compile

Then, make the directory used to hold the downloaded archives, unpacked sources and compiled binaries:
 mkdir -p ~/Alt-F

And this one:
 mkdir -p ~/Alt-F/build-base/toolchain_build_arm/uClibc_dev//usr/include

# to avoid the error
# The directory that should contain system headers does not exist:
#  ~/Alt-F/build-base/toolchain_build_arm/uClibc_dev//usr/include

After this, checkout the latest svn sources into your homedir:
 cd ~

 svn checkout http://alt-f.googlecode.com/svn/trunk/ alt-f-read-only

Enter the source tree:
 cd alt-f-read-only/alt-f/

Setup the configuration neede to build packages and not the firmware itself:
 cp -f .config-pkgs .config

Setup the environment variables needed:

 export BLDDIR=~/Alt-F/build-base
 export ROOTFS=$BLDDIR/project_build_arm/dns323/root/
 export STAGING=$BLDDIR//build_arm/staging_dir/
 export PATH=$PATH:$BLDDIR/build_arm/staging_dir/usr/bin:~/Alt-F/alt-f/bin
 export BINARIES=$BLDDIR/binaries/dns323

Patch the mkprepare script to download the updated version of mklibs:
 sed -i -e 's/0.1.31/0.1.33/' ./mkprepare.sh

Run the mkprepare script:
 ./mkprepare.sh

Enter the configuration routine and exit it:
 make O=$BLDDIR menuconfig
 < Exit >

Change the default sourceforge mirror:
 vi .config
 
 BR2_SOURCEFORGE_MIRROR="switch"

Download these packages manually, because some urls are broken:

cd ~/Alt-F/build-base/dl
wget http://ftp.linux.org.uk/pub/linux/linux-2.6/linux-2.6.30.6.tar.bz2
wget http://switch.dl.sourceforge.net/sourceforge/libpng/zlib-1.2.5.tar.bz2
wget http://mirror.be.gbxs.net/pub/software/network/ethtool/ethtool-2.6.36.tar.gz
wget http://ftp.pardus.org.tr/pub/source/2011/foomatic-db-engine-4.0.4.tar.gz
wget http://ftp.pardus.org.tr/pub/source/2011/foomatic-db-4.0-20100914.tar.gz
wget http://ftp.pardus.org.tr/pub/source/2011/foomatic-filters-4.0.4.tar.gz
wget http://downloads.ghostscript.com/public/ghostscript-8.71.tar.gz
wget http://switch.dl.sourceforge.net/project/net-snmp/net-snmp/5.4.3/net-snmp-5.4.3.tar.gz
wget http://switch.dl.sourceforge.net/sourceforge/libexif/libexif-0.6.19.tar.bz2
wget http://mirror.anl.gov/pub/gnu/libiconv/libiconv-1.13.1.tar.gz
wget http://mirror.anl.gov/pub/linux/utils/raid/mdadm/mdadm-3.1.5.tar.gz
wget http://ftp.gwdg.de/pub/cert.dfn/tools/net/vsftpd/vsftpd-2.3.4.tar.gz

Before start compiling, beware of these tips:

* CUPS: if you get this error:
 configure: error: The default system groups cannot contain the default CUPS group!
To fix, remove lpadmin from your /etc/group

* If you can't get vsftp compiling, deselect it from the "Net" packages with
 make O=$BLDDIR menuconfig

* Same for fuppes in audio-video and unrar in compressors

Start compiling:
 make O=$BLDDIR

Have a cup of tea. A big one :)

Joao Cardoso

unread,
Sep 24, 2011, 8:25:13 PM9/24/11
to al...@googlegroups.com

I'm not an autotools expert.
Instead of patching 'configure.ac' and rebuild 'configure' using the command
'autoconf', we should first to do the right thing.

If you look at configure.ac there are three tests of that kind:

jcard@silver:~/tmp/git-1.7.3.4> grep RUN configure.ac
AC_RUN_IFELSE(
AC_RUN_IFELSE(
AC_RUN_IFELSE(

each one has a 'ac_cv' variable that can be set as an environment variable to
'configure', setting the correct value for the target machine.
You need to copy/paste and cross-compile the small test program that follows
the 'ac_cv' variable and run it in the dns, then call configure with the
correct value.

To cross-compile the three small programs, you must have the staging dir in
your path, as in

export PATH=$PATH:$BLDDIR/build_arm/staging_dir/usr/bin

and than use 'arm-linux-uclibcgnueabi-gcc' as the compiler:

arm-linux-uclibcgnueabi-gcc test.c -o test

copy and run the test program to the dns, watch the result and set the
variables accordingly. If you are using the buildroot autotools, and your
package is called GIT, define in git.mk

GIT_CONF_ENV = ac_cv_c_c99_format=yes ac_cv_fread_reads_directories=no
ac_cv_snprintf_returns_bogus=yes # use the correct values

If your 'git.mk' explicitly calls 'configure', then do

ac_cv_c_c99_format=yes ac_cv_fread_reads_directories=no
ac_cv_snprintf_returns_bogus=yes ./configure ...

Hope this helps. If yes, please contribute-back.

Thanks,
Joao

PS-To avoid doing all the work, you can start setting the variables with dummy
values, just to see if configure succeeds; if yes, then follow the procedure
above.

PS-2- I apologize if you are skilled enought to find some directions I gave
above insulting, but I really don't know your level of expertise :-)

Reply all
Reply to author
Forward
0 new messages