In my busybox /etc/init.d/rcS file:
proc=`mount|grep "proc"`
if [ -z "proc" ]; then
mount -t procfs none /proc
fi
if [ -f /proc/cmdline ]; then
# grab console from cmdline and use it..
tty=`cat /proc/cmdline|sed -e "s/ /\n/g"|grep console|cut -d '=' -f2|cut -d ',' -f1`
if [ -z "tty" ]; then
echo `cat /proc/cmdline` "does'nt have console?"
else
# remove my previous one if it exists
rm -f /dev/tty-bd
ln -s /dev/$tty /dev/tty-bd
echo "/dev/$tty linked to /dev/tty-bd - using as console"
fi
else
echo "cmdline not found - no console?"
fi
In my inittab:
tty-bd::askfirst:-/bin/sh
1 comment:
Yes, good one. Me too tired of ttyS* and ttyO* - Wonder if all the non-busybox shells and applications should have such logic :)
Post a Comment