Hi,

I just want to give some feedback how far I'm with this. The base system
is quite minimal, only busybox, uclibc, and baselayout-2 is used.
Installation of every dependency of baselayout-2 is "blocked" in
/etc/portage/profile/package.provided. The system is booting quite fast
even with slow bios (did not use stop watch, but it is below 10 secs
including bios, which takes more than 3 secs). I use now busybox init
with special boot script to get it running with gentoo runlevels. There
seems to be a bug with bb init and PPID of processes (I will post this
on bb list), but it is not serious (at least I think so). As I wrote
earlier, a correct entry in fstab for rootfs is important (option
noauto), otherwise there will be an error message or even a broken
double mount on /. Consolefont and keymap is set with bb tools (keymap
file was created with bb dumpkmap). One error I overlooked up until 3
days ago was with checking the file systems. baselayout-2 expects
fsck.ext2 (e.g. for my boot partition), but bb provides e2fsck. There
seems also to be a bug with bb grep, which I will post on bb list, too
(try busybox grep -Fow usbfs /proc/filesystems). I'm using now a modular
kernel, because I plan to use lirc in the future, which provides kernel
modules. To be sure to have correct configuration files for modules
(e.g. /etc/modules.d/*), you have to run update-modules from
module-init-tools, which is a bash script. This command is also called
by the modules init script. Since I do not have bash in my embedded
system, calling this script results in an error. Therefore I have to run
it in my build system (linked my embedded /etc to my build /etc).

One thing I'm still working on is proper use of mdev. Thanks to
alpine-baselayout from Natanael, I have now a better idea how to do this.

@ Natanael: I have a problem with usbdev, which seems to be made for
kernel 2.4, doesn't it? Do you have a version for kernel 2.6?

OK, that's it so far. I post below inittab, start, and stop script for
bb init with baselayout-2. These scripts are based on Gentoo BSD
scripts. As always, if there are questions, just ask :-)

Marc




(build) hive mediamachine # cat devroot/etc/inittab
#
# System initialization, mount local filesystems, etc.
#si::sysinit:/sbin/rc sysinit
#::sysinit:/sbin/rc sysinit
::sysinit:/sbin/rc.init

# TERMINALS
tty1::respawn:/sbin/getty 38400 tty1
tty2::respawn:/sbin/getty 38400 tty2
tty3::respawn:/sbin/getty 38400 tty3
tty4::respawn:/sbin/getty 38400 tty4
tty5::respawn:/sbin/getty 38400 tty5
tty6::respawn:/sbin/getty 38400 tty6

# What to do at the "Three Finger Salute".
#ca:12345:ctrlaltdel:/sbin/shutdown -r now
#::ctrlaltdel:/sbin/rc reboot
::ctrlaltdel:/sbin/reboot

#l0:0:wait:/sbin/rc shutdown
#::shutdown:/sbin/rc.shutdown shutdown
::shutdown:/sbin/rc.single


(build) hive mediamachine # cat devroot/sbin/rc.init
#!/bin/sh
# Copyright 2006-2007 Gentoo Foundation
# Distributed under the terms of the GNU General Public License v2

# Ensure we are called by init
echo "PPID = $PPID"
#[ "$PPID" == "1" ] || exit 0
# Problem with bb PPID?!

# If $TERM is not set then assume default of cons25
# This gives us a nice colour boot :)
[ -z "$TERM" -o "$TERM" = "dumb" ] && export TERM="cons25"

# Handle interupts
trap : SIGINT
trap "echo 'Boot interrupted'; exit 1" SIGQUIT

# BSD's init works somewhat differently to sysvinit.
# This block should 'translate' from the way init calls it to the way it
would
# be called by sysvinit on linux.
RUNLEVEL="1" /sbin/rc sysinit || exit 1
RUNLEVEL="1" /sbin/rc boot || exit 1
PREVLEVEL="1" /sbin/rc default

# We don't actually care if rc default worked or not, we should exit 0
# to allow logins
exit 0



(build) hive mediamachine # cat devroot/sbin/rc.single
#!/bin/sh
# Copyright 2006-2007 Gentoo Foundation
# Distributed under the terms of the GNU General Public License v2

# Ensure we are called by init
echo "PPID = $PPID"
#[ "$PPID" = "1" ] || exit 0

# Handle interupts
#trap : SIGINT SIGQUIT

# Try and use stuff in /lib over anywhere else so we can shutdown
# local mounts correctly.
export LD_LIBRARY_PATH="/lib${LD_LIBRARY_PATH:+:}${LDLIBRARY_PATH}"

# If $TERM is not set then assume default of cons25
# This gives us a nice colour boot :)
[ -z "$TERM" -o "$TERM" = "dumb" ] && export TERM="cons25"

# BSD's init works somewhat differently to sysvinit.
# This block should 'translate' from the way init calls it to the way it
would
# be called by sysvinit on linux.
#case "$1" in
#    reboot)    echo "reboot"; export RUNLEVEL=6;;
#    shutdown)  echo "shutdwon"; export RUNLEVEL=0;;
#    single)    echo "single"; export RUNLEVEL=S;;
#esac
#exec /sbin/rc single

# since I use bb init, I only go to single user (remove sulogin!)
# reboot or shutdown is done by bb commands
RUNLEVEL="S" /sbin/rc single
exit 0




-- 
[EMAIL PROTECTED] mailing list

Reply via email to