Subject: Exec format error on minimal system
To: None <netbsd-help@netbsd.org>
From: Gale, Jeremy <Jeremy.Gale@gdcanada.com>
List: netbsd-help
Date: 08/26/2004 14:42:50
Hi all,

I'm trying to build a very minimal NetBSD 1.6.2 system. I'm roughly =
following Brian Rose's tutorial located here:
http://www.bsdnewsletter.com/2003/09/Features102b.html

The exception is that I'm not using a ramdisk kernel. I'm trying to put =
it all onto a small Compact Flash card. I haven't started using =
crunchgen yet, I'm just trying to get a minimal multi-user system =
booting.

I can boot in single user mode, it works fine. Whenever I boot into =
multi-user mode the kernel boots, /etc/rc starts running, then I =
continually get these errors:

init: can't exec getty '/usr/libexec/getty' for port /dev/console: Exec =
format error
init: can't exec getty '/usr/libexec/getty' for port /dev/ttyE1: Exec =
format error
init: can't exec getty '/usr/libexec/getty' for port /dev/ttyE2: Exec =
format error
init: can't exec getty '/usr/libexec/getty' for port /dev/ttyE3: Exec =
format error

When I boot a normal working system and run this command:
/usr/libexec/getty Pc ttyE1
It seems to reset the terminal properly and takes me to the login =
prompt.

When I boot in single user mode on my minimal system and try the same =
command I get the error:
/usr/libexec/getty: 1: Syntax error: "(" expected

I was also seeing syntax errors like this when MAKEDEV was trying to run =
chown and chgrp (after creating a mfs /dev and letting init run =
MAKEDEV.) I decided to manually make the device special files to get =
around this but the problem seems to persist.

I assume I'm just missing a file or shell or something along those =
lines. It just doesn't seem to be exec()ing properly. The filesystem =
looks to be mounting OK.

Some possibly relevant files (mostly copied from a normal NetBSD 1.6.2 =
installation):

I'm using the /usr/src/distrib/i386/floppies/common/termcap.mini as my =
/usr/share/misc/termcap
I'm using a default /etc/gettytab and /etc/ttyaction
I'm using a getty and init
I'm using a default /etc/ttys with the relevant lines listed here:
console	"/usr/libexec/getty Pc"		vt100	on secure
ttyE0	"/usr/libexec/getty Pc"		vt220	off secure
ttyE1	"/usr/libexec/getty Pc"		vt220	on secure
ttyE2	"/usr/libexec/getty Pc"		vt220	on secure
ttyE3	"/usr/libexec/getty Pc"		vt220	on secure

My /etc/rc looks like this:
#!/bin/sh
echo Initializing system...
export PATH=3D/sbin:/bin:/usr/sbin:/usr/bin
mount -ua
ttyflags -a
exit 0

Any help would be appreciated. Thanks.
Jeremy Gale