From a9c02d94881fdf542ffc6ea0525c4726f66f0870 Mon Sep 17 00:00:00 2001 From: Gerardo Exequiel Pozzi Date: Wed, 17 Aug 2011 20:26:17 -0300 Subject: [configs/releng] Replace rc.d/archiso with initscripts hooks. In this way: * Prepare locales requested by boot param mostly early possible. * Setup special console at end of rc.sysinit Remove unneded include from automated_script (already included by rc.conf) Signed-off-by: Gerardo Exequiel Pozzi --- .../etc/rc.d/functions.d/setup_special_console | 25 ++++++++++++++++++++++ 1 file changed, 25 insertions(+) create mode 100644 configs/releng/root-image/etc/rc.d/functions.d/setup_special_console (limited to 'configs/releng/root-image/etc/rc.d/functions.d/setup_special_console') diff --git a/configs/releng/root-image/etc/rc.d/functions.d/setup_special_console b/configs/releng/root-image/etc/rc.d/functions.d/setup_special_console new file mode 100644 index 0000000..7badfe3 --- /dev/null +++ b/configs/releng/root-image/etc/rc.d/functions.d/setup_special_console @@ -0,0 +1,25 @@ +# If an alternate console was specified on the kernel command line, +# start agetty on it too. +setup_special_console() +{ + 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 +} + +add_hook sysinit_end setup_special_console -- cgit v1.2.3-54-g00ecf