init

hinko.kocevar at cetrtapot.si hinko.kocevar at cetrtapot.si
Tue Nov 29 15:44:47 UTC 2005


Hi,

I'm trying to use busybox init applet and appropriate inittab on our 
cris arch platform. I need to mount /etc before init is called (since it 
is on separate partition). This is my linuxrc:
#!/bin/sh
#
# This is the first script run in the system (started by the kernel).
#
MOUNT=
[ -z "$MOUNT" ] && MOUNT="mount -t jffs2 /dev/flash2 /mnt/flash"

echo -n "$0: Mounting /mnt/flash... "
if $MOUNT; then
	echo "done"
else
	echo "failed!"
fi

echo "$0: Starting init."

# Unset variable exported by sh.
unset PWD

# Try the same paths as the kernel would.
PATH=/sbin:/etc:/bin
exec init "$@"

----8<-------

My inittab:
# This is run first except when booting in single-user mode.
#
#::sysinit:/etc/init.d/rcS

# /bin/sh invocations on selected ttys
#
# Start an "askfirst" shell on the console (whatever that may be)
#::askfirst:-/bin/sh
# Start an "askfirst" shell on /dev/tty2-4
#tty2::askfirst:-/bin/sh
#tty3::askfirst:-/bin/sh
#tty4::askfirst:-/bin/sh

# Stuff to do when restarting the init process
::restart:/sbin/init

# Stuff to do before rebooting
::shutdown:/bin/umount -a -r
::shutdown:/sbin/swapoff -a

::respawn:/bin/sh

----8<-------

And my rcS:
#!/bin/sh

mount /proc
mount /sys

----8<-------

The problem is - when I try to run /etc/init.d/rcS (sysinit line) the 
system executes rcS and then hangs there - no shell is started. If I 
comment out corresponding sysinit line shell is started (respawn line). 
I would like to stuff all needed initialization commands in one shell 
script and call it from rcS (preferably).

Has anyone done similar?

regards,
hinko



More information about the busybox mailing list