how to build root filesystem for ixp425

M. Warner Losh imp at bsdimp.com
Tue Aug 19 14:20:25 UTC 2008


In message: <1219154042.6821.27.camel at Hellboy>
            Stavros Markou <stma at antcor.com> writes:
: Hi,
: First of all thanks for your help.
: I don't have setenv (BTW do you know what package do i have to install
: in order to have it)

setenv is a builtin for /bin/tcsh.  If you are using /bin/sh, then you
are correct that you need export.

: installed on my freebsd system so i followed your
: advice and did :
: export TARGET=arm
: export TARGET_BIG_ENDIAN=t
: export TARGET_CPUTYPE=xscale
: (I am using bash shell)
: Target Arch is set correctly (arm) and BUILD_ARCH is i386, so i get the
: error about cross-build and the TARGET_ARCH set.

That is odd.  What does your environment look like?

: What release are you using for your build?

I'm using the head of the FreeBSD development branch (aka
FreeBSD-current).  I've also done this on 7.x stable at least once.
And did it all the time on 6.x for a little endian ARM processor.

: If i am building a distro on
: an i386 machine for ixp425 (arm) what are the values for TARGET,
: TARGET_ARCH BUILD_ARCH and why can't i build the distro with the values
: i am setting (TARGET=arm, TARGET_ARCH=arm, TARGET?

What does the output of 'sh' say?  Do you set any of these variables
in /etc/make.conf?

Warner


: Best Regards,
: 
: Stavros.
: 
: On Tue, 2008-08-19 at 07:24 -0600, M. Warner Losh wrote:
: 
: > In message: <1219135149.6821.5.camel at Hellboy>
: >             Stavros Markou <stma at antcor.com> writes:
: > : Hi,
: > : Is there anyone form the developers-authors of the Makefile.inc1 file
: > : who can explain to me the below :
: > : 
: > : I don't understand the check about BUILD_ARCH and TARGET_ARCH or for
: > : that matter MACHINE_ARCH.
: > : I think, and let me know if i am wrong, that BUILD_ARCH must be whatever
: > : is the ARCH of the Host system. If i am right on this then why there is
: > : this check inside Makefile.inc1 :
: > : 
: > : if ${MACHINE_ARCH) != ${BUILD_ARCH}
: > : .error To cross-build, set TARGET_ARCH.
: > : .endif
: > : 
: > : In my case BUILD_ARCH is i386 and as it is supposed to be (?)
: > : TARGET_ARCH=arm.
: > : -mbig-endian option does not apply to i386 gcc only to arm cross
: > : compiler.
: > 
: > setenv TARGET arm
: > setenv TARGET_BIG_ENDIAN t
: > 
: > is all you need.  MACHINE_ARCH is the machine you are building on very
: > early in the build.  It is soon set to TARGET_ARCH.  BUILD_ARCH
: > retains the initial value of MACHINE_ARCH.  This check makes sure that
: > you set TARGET correctly (which causes TARGET_ARCH to be set to the
: > right value).
: > 
: > You can see my blog for complete instructions that work back on both
: > 7.x and -current (except for the NSLU part):
: > 
: > http://bsdimp.blogspot.com/2008/08/nslu2-support-committed-to-freebsdarm.html
: > 
: > This was how I built NFS root for my NSLU2.  Earlier posts talk about
: > how to build root on a CF.  I made one small correction...
: > 
: > Warner
: > 
: > 
: > : Best Regards,
: > : 
: > : Stavros.
: > : 
: > : On Mon, 2008-08-18 at 17:37 +0200, John Hay wrote:
: > : 
: > : > On Mon, Aug 18, 2008 at 03:54:03PM +0300, Stavros Markou wrote:
: > : > > Hi,
: > : > > 
: > : > > You are using this script with which release of FreeBSD ? In order to
: > : > > use this script do you set as tools the cross tools or native i386 (or
: > : > > any other host arch) ?
: > : > 
: > : > I do not need to set anything else for it to work. I do sometimes
: > : > set things like NO_PROFILE, but that is only to speed things up. It
: > : > will build the crosstools by itself as needed. You only need a checked
: > : > out /usr/src tree. The box(es) I run this on are i386 boxes.
: > : > 
: > : > Just to check, I started the buildworld line (the first one) on my
: > : > home box, which is running 7-stable from Aug 17, and it fired up
: > : > without a problem... It will take a while to finish though, but I do
: > : > not forsee a problem. I'll send you an email if it does not finish.
: > : > 
: > : > > I am using currently 7.0 release p2 and i cannot pass the error with
: > : > > cross build (keeps telling me to set TARGET_ARCH but it is already set
: > : > > by me as a command-line option of the make)
: > : > 
: > : > I mostly do this on 7-stable, sorry I rarely run releases and never pX
: > : > releases. I also often do it on current and it has been a while since
: > : > I have done it on 6-stable.
: > : > 
: > : > Thinking about it, maybe you should remove all your env settings,
: > : > and then try just that buildworld line of mine. If that does not work,
: > : > clean out your /usr/obj and usr/src directories and get a new copy of
: > : > /usr/src and try again. If it then still do not work, show us the
: > : > error message.
: > : > 
: > : > > On Mon, 2008-08-18 at 14:49 +0200, John Hay wrote:
: > : > > 
: > : > > > On Mon, Aug 18, 2008 at 11:42:26AM +0300, Stavros Markou wrote:
: > : > > > > Hi,
: > : > > > > 
: > : > > > > I am trying to build a root filesystem using the mini guide at
: > : > > > > http://people.freebsd.org/~cognet/freebsd_arm.txt but with no luck for
: > : > > > > IXP425. Just to clarify some things :
: > : > > > > 
: > : > > > > When i am doing a buildworld inside /usr/src all these env variables
: > : > > > > inside the mini guide must be exported ? 
: > : > > > > What about BUILD_ARCH ? By default i am building a filesystem at a i386
: > : > > > > machine so BUILD_ARCH has the i386 value.
: > : > > > > 
: > : > > > > I am using Freebsd 7.0 and i also have seen the wiki for AVILA but i got
: > : > > > > the same Makefile.inc1 error for setting TARGET_ARCH (even though i am
: > : > > > > setting TARGET_ARCH=arm)
: > : > > > > I have build the kernel which is loaded fine but when the root
: > : > > > > filesystem is mounted via NFS i get : exec /sbin/init : error 8 , so i
: > : > > > > think that maybe the root filesystem i 've built is not right.
: > : > > > 
: > : > > > My script do this:
: > : > > > 
: > : > > > rm -rf /armdist
: > : > > > chflags -R 0 /armdist
: > : > > > rm -rf /armdist
: > : > > > mkdir /armdist
: > : > > > make TARGET_ARCH=arm TARGET_CPUTYPE=xscale TARGET_BIG_ENDIAN=true buildworld
: > : > > > make TARGET_ARCH=arm TARGET_CPUTYPE=xscale TARGET_BIG_ENDIAN=true DESTDIR=/armdist installworld
: > : > > > make TARGET_ARCH=arm TARGET_CPUTYPE=xscale TARGET_BIG_ENDIAN=true DESTDIR=/armdist distribution
: > : > > > 
: > : > > > John
: > : > 
: > : > John
: > : 
: > : Stavros Markou 
: > : Senior Software Engineer
: > : ANTCOR S.A.
: > : Email: mailto:stma at antcor.com
: > : Phone: +30 210 52 22 290 
: > : Fax: +30 210 52 22 254 
: > : Address: 52 Ag. Konstantinou, Athens 10437, GREECE
: > : 
: 
: Stavros Markou 
: Senior Software Engineer
: ANTCOR S.A.
: Email: mailto:stma at antcor.com
: Phone: +30 210 52 22 290 
: Fax: +30 210 52 22 254 
: Address: 52 Ag. Konstantinou, Athens 10437, GREECE
: 


More information about the freebsd-arm mailing list