[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 <vmlinuz386@yahoo.com.ar>
This commit is contained in:
parent
b16088ba7e
commit
a9c02d9488
@ -30,4 +30,4 @@ USELVM="no"
|
|||||||
|
|
||||||
HOSTNAME="archiso"
|
HOSTNAME="archiso"
|
||||||
|
|
||||||
DAEMONS=(hwclock syslog-ng archiso)
|
DAEMONS=(hwclock syslog-ng)
|
||||||
|
@ -1,5 +1,3 @@
|
|||||||
. /etc/archiso/functions
|
|
||||||
|
|
||||||
automated_script ()
|
automated_script ()
|
||||||
{
|
{
|
||||||
script="$(kernel_cmdline script)"
|
script="$(kernel_cmdline script)"
|
||||||
|
@ -0,0 +1,11 @@
|
|||||||
|
prepare_locale_gen ()
|
||||||
|
{
|
||||||
|
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
|
||||||
|
}
|
||||||
|
|
||||||
|
add_hook sysinit_postmount prepare_locale_gen
|
26
configs/releng/root-image/etc/rc.d/archiso → configs/releng/root-image/etc/rc.d/functions.d/setup_special_console
Executable file → Normal file
26
configs/releng/root-image/etc/rc.d/archiso → configs/releng/root-image/etc/rc.d/functions.d/setup_special_console
Executable file → Normal file
@ -1,20 +1,6 @@
|
|||||||
# vim: set ft=sh:
|
|
||||||
. /etc/rc.conf
|
|
||||||
. /etc/rc.d/functions
|
|
||||||
|
|
||||||
do_locale_gen ()
|
|
||||||
{
|
|
||||||
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
|
|
||||||
}
|
|
||||||
|
|
||||||
# If an alternate console was specified on the kernel command line,
|
# If an alternate console was specified on the kernel command line,
|
||||||
# start agetty on it too.
|
# start agetty on it too.
|
||||||
do_special_console()
|
setup_special_console()
|
||||||
{
|
{
|
||||||
local cmdline_console
|
local cmdline_console
|
||||||
if cmdline_console=$(kernel_cmdline console); then
|
if cmdline_console=$(kernel_cmdline console); then
|
||||||
@ -24,7 +10,7 @@ do_special_console()
|
|||||||
options=${cmdline_console#${port}}
|
options=${cmdline_console#${port}}
|
||||||
options=${options#,}
|
options=${options#,}
|
||||||
baud=${options%%[neo]*}
|
baud=${options%%[neo]*}
|
||||||
[[ ${options} =~ r$ ]] && rts="-h"
|
[[ ${options} == *r ]] && rts="-h"
|
||||||
if ! grep -q "^${port}" /etc/securetty; then
|
if ! grep -q "^${port}" /etc/securetty; then
|
||||||
echo ${port} >> /etc/securetty
|
echo ${port} >> /etc/securetty
|
||||||
fi
|
fi
|
||||||
@ -36,10 +22,4 @@ do_special_console()
|
|||||||
fi
|
fi
|
||||||
}
|
}
|
||||||
|
|
||||||
case "$1" in
|
add_hook sysinit_end setup_special_console
|
||||||
start)
|
|
||||||
do_locale_gen
|
|
||||||
do_special_console
|
|
||||||
;;
|
|
||||||
esac
|
|
||||||
exit 0
|
|
Loading…
Reference in New Issue
Block a user