Subject: Re: Exec Format error. Wrong Architecture / After doing a nativ i386
To: Oliver Egginger <Oliver.Egginger@dvz.fh-giessen.de>
From: Greywolf <greywolf@starwolf.com>
List: port-i386
Date: 08/22/2003 11:26:15
Thus spake Oliver Egginger ("OE> ") sometime Today...

OE> Hello,
OE>
OE> I'am completly new to NetBSD.
OE> I used a bootable iso image (downloaded from the NetBSD side) to install
OE> NetBSD 1.6.1 on a pentium4 system. Also I found a security hint about a
OE> vulnerability in conjunction with realpath on the NetBSD side, thus I
OE> want to update my libc. For doing this I downloaded the complete source
OE> distribution from the NetBSD CVS tree and stored is under /usr/src.
OE> I had some problems with the Makefile but I found a script,
OE> namely build.sh, which works fine for a newbie like me.
OE>
OE> I  created a /etc/mk.conf file with the following entries:
OE> BSDOBJDIR=/pub/release/obj
OE> MKOBJ=YES
OE> OBJMACHINE=YES
OE>
OE> Then I executed:
OE> cd /usr/src
OE> /usr/src/build.sh -m i386 -D /pub/release/i386 build
OE>
OE> After one hour the build process ends with success, left a full release
OE> in /pub/release/i386. :-)
OE> So far so good. But now the problem:
OE>
OE> When I try to execute /pub/release/i386/bin/ls (for example) the shell
OE> say's:
OE>
OE> ls: Exec Format error. Wrong Architecture
OE>
OE> This happens with all executables
OE>
OE> When I do the build without the "m" switch (auto architecture detection)
OE> it's the same. So I'am afraid to install something from this build,
OE> cause it could crash my system. Can you tell me what I'am doing wrong?
OE> Why I can't execute the binarys from this build?

Part of this is that the build of -current has dynamically linked binaries
in /bin and /sbin.

You might try, for grins, "chroot /pub/release/i386" and see what happens;
alternately, you might try installing the stuff into a partition that
you could use as an alternate root file system and boot from that.

The other thing you could do is to rebuild your system with
MK_DYNAMIC_ROOT=no

[I have verified that the resulting binaries mostly work.]

OE> - oliver

				--*greywolf;
--
NetBSD:  We come in peace.  We offer reliability.