Login prompt from embedded boot image

I am using a M-Systems disk on chip as my boot device. We have a rather
large boot image so we can have more than base functionality if there is a
problem. I am trying to add the login prompt to the startup script. We
need to have some security in place.

I get 2 errors:

First:

login: root
No home directory
Logging in with home = “/”.

Error number 2 happens after I have used the file system for a little
while, for example, copying a directory. I get this:

cp: read ( filename #1 ): not enough memory
cp: can’t get file status ( filename #2 ): Too many open files in
system.

If I exit our programs, the cp command works again.

The offending lines:
-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=
-=-

Start the main shell

reopen /dev/con1
[+session] TERM=qansi-m login -p &

Start the software

[+session] TERM=qansi ksh -c /doc.start &

-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=
-=-

Several questions:

What is the best way to start our programs from the boot image?
How do I specify the home directory for users?
If I login once, and then logout, the login command is not recycled. Do I
use tinit to get the login prompt to repeat?

Thanks,
Mark

-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=
-=-
Entire boot image:

[+compress]
[virtual=x86,bios] .bootstrap = {
startup-bios -NController
PATH=/proc/boot:/bin:/sbin:/usr/bin:/usr/sbin:/usr/local/bin:.
LD_LIBRARY_PATH=/proc/boot:/dev/shmem:/lib:/lib/dll:/usr/lib procnto
}
[+script] .script = {

Start up some consoles

devc-con -n9 &
waitfor /dev/con1 10
reopen /dev/con1

display_msg " "
display_msg " "
display_msg Booting from Disk On Chip
display_msg " "

Start the pci server

seedres
pci-bios &
waitfor /dev/pci

DiskOnChip driver

devb-doc doc addr=0xd8000 blk automount=hd0t77:/ &
waitfor /bin 30

Start the floppy disk driver

devb-fdc cam quiet blk auto=partition,cache=100k &

Start the RAM disk driver, init the disk & mount it (cap in 512 blocks)

devb-ram ram capacity=131072
waitfor /dev/hd1t77 10
mount /dev/hd1t77 /ram

eide driver for the compact flash card

devb-eide eide noslave nobios ioport=ff00 &
waitfor /dev/hd2t11 5
mount -t dos /dev/hd2t11 /flash

SYSTEM=nto
TERM=qansi-m
TZ=EST05

Some common servers

pipe &
mqueue &
devc-pty &

Serial port driver

devc-ser8250 &
waitfor /dev/ser1 5
waitfor /dev/ser2 5

Start the network drivers

io-net -ptcpip -v &
waitfor /dev/io-net 15

mount -Tio-net -opci=0,vid=0x100b,did=0x0020 /lib/dll/devn-ns83815.so

waitfor /dev/io-net/en0 5
waitfor /dev/socket 10
waitfor /dev/io-net/ip0 10

ifconfig en0 192.168.1.1 netmask 255.255.255.0
inetd &

Start the main shell

reopen /dev/con1
[+session] TERM=qansi-m login -p &

Start the software

[+session] TERM=qansi ksh -c /doc.start &

}

Cheat and make the /tmp point to the shared memory area…

[type=link] /tmp=/dev/shmem

Programs require the runtime linker (ldqnx.so) to be at a fixed location

[type=link] /usr/lib/ldqnx.so.2=/proc/boot/libc.so

We use the “c” shared lib (which also contains the runtime linker)

libc.so

Include the socket library

libsocket.so

Include the disk files so we can access files on DiskOnChip

libcam.so
io-blk.so

filesystem required shared libs

cam-disk.so
fs-qnx4.so
fs-dos.so

include the ram disk driver

devb-ram

Floppy disk driver

devb-fdc

Include DiskOnChip driver

/sbin/devb-doc

Include pci server

pci-bios
seedres

files that need to be in a particular location

/etc/passwd=/etc/passwd
/etc/termcap=/etc/termcap
/etc/config/ttys=/etc/config/ttys
/etc/group=/etc/group
/etc/shadow=/etc/shadow
/etc/services=/etc/services
/etc/default/login=/etc/default/login
/usr/lib/terminfo=/usr/lib/terminfo
/.profile=/boot/build/doc.profile

files to copy to the /proc/boot dir → they will always be available

[data=copy]

Console driver

devc-con

Std QNX commands

cp
ls
pidin
sin
mkdir
cksum
cat
more
rm
ping

Network / NIC drivers

/lib/dll/devn-ns83815.so
/lib/dll/npm-tcpip-v4.so
/lib/dll/npm-tcpip.so
/bin/netmanager
/sbin/ifconfig
/sbin/io-net
/usr/sbin/inetd
/usr/sbin/bootpd
/usr/sbin/ftpd
/usr/sbin/telnetd

needed libraries

/usr/lib/libph.so.2
/usr/lib/libph.so.3
/usr/lib/libphexlib.so.2
/lib/libm.so.2