2009-11-25 19:40:07 +01:00
|
|
|
# vim: set ft=sh:
|
|
|
|
. /etc/rc.conf
|
|
|
|
. /etc/rc.d/functions
|
|
|
|
|
2009-11-29 22:12:39 +01:00
|
|
|
do_locale_gen ()
|
|
|
|
{
|
2011-07-02 02:31:16 +02:00
|
|
|
if [[ ${LOCALE} != "en_US.UTF-8" ]]; then
|
|
|
|
stat_busy "Generating locales..."
|
|
|
|
sed -i "s/#\(${LOCALE/[@.]*}\)/\1/" /etc/locale.gen
|
|
|
|
/usr/sbin/locale-gen > /dev/null
|
|
|
|
stat_done
|
|
|
|
fi
|
2009-11-29 22:12:39 +01:00
|
|
|
}
|
|
|
|
|
2011-03-03 11:53:02 +01:00
|
|
|
# If an alternate console was specified on the kernel command line,
|
|
|
|
# start agetty on it too.
|
|
|
|
do_special_console()
|
|
|
|
{
|
2011-08-16 00:42:28 +02:00
|
|
|
local cmdline_console
|
|
|
|
if cmdline_console=$(kernel_cmdline console); then
|
|
|
|
stat_busy "Starting agetty on console: ${cmdline_console}"
|
|
|
|
local port options baud rts
|
|
|
|
port=${cmdline_console%%,*}
|
|
|
|
options=${cmdline_console#${port}}
|
|
|
|
options=${options#,}
|
|
|
|
baud=${options%%[neo]*}
|
|
|
|
[[ ${options} =~ r$ ]] && rts="-h"
|
|
|
|
if ! grep -q "^${port}" /etc/securetty; then
|
|
|
|
echo ${port} >> /etc/securetty
|
|
|
|
fi
|
|
|
|
if ! grep -q "^z0:" /etc/inittab; then
|
|
|
|
echo "z0:2345:respawn:/sbin/agetty -8 -s ${rts} ${baud:-9600} ${port} linux" >> /etc/inittab
|
|
|
|
fi
|
|
|
|
/sbin/telinit q
|
|
|
|
stat_done
|
|
|
|
fi
|
2011-03-03 11:53:02 +01:00
|
|
|
}
|
|
|
|
|
2009-11-29 22:12:39 +01:00
|
|
|
case "$1" in
|
|
|
|
start)
|
|
|
|
do_locale_gen
|
2011-03-03 11:53:02 +01:00
|
|
|
do_special_console
|
2009-11-29 22:12:39 +01:00
|
|
|
;;
|
|
|
|
esac
|
|
|
|
exit 0
|