2002-09-05 20:29:18 +00:00
|
|
|
#!/bin/sh
|
|
|
|
#
|
|
|
|
# $FreeBSD$
|
|
|
|
#
|
|
|
|
|
|
|
|
# PROVIDE: archdep
|
|
|
|
# REQUIRE: LOGIN
|
|
|
|
# BEFORE: abi
|
2004-10-07 13:55:26 +00:00
|
|
|
# KEYWORD: nojail
|
2002-09-05 20:29:18 +00:00
|
|
|
|
|
|
|
. /etc/rc.subr
|
|
|
|
|
|
|
|
name=archdep
|
2005-09-28 16:24:47 +00:00
|
|
|
start_cmd="archdep_start"
|
|
|
|
stop_cmd=":"
|
2002-09-05 20:29:18 +00:00
|
|
|
|
|
|
|
# should we print out unaligned access warnings?
|
|
|
|
#
|
|
|
|
unaligned_warnings()
|
|
|
|
{
|
2002-10-12 10:31:31 +00:00
|
|
|
if ! checkyesno unaligned_print; then
|
2002-09-05 20:29:18 +00:00
|
|
|
sysctl machdep.unaligned_print=0
|
|
|
|
fi
|
|
|
|
}
|
|
|
|
|
|
|
|
# Alpha OSF/1 binary emulation
|
|
|
|
#
|
|
|
|
osf1_compat()
|
|
|
|
{
|
2002-10-12 10:31:31 +00:00
|
|
|
if checkyesno osf1_enable; then
|
2002-09-05 20:29:18 +00:00
|
|
|
echo -n ' OSF/1'
|
|
|
|
if ! kldstat -v | grep osf1_ecoff > /dev/null; then
|
|
|
|
kldload osf1 > /dev/null 2>&1
|
|
|
|
fi
|
|
|
|
fi
|
|
|
|
}
|
|
|
|
|
|
|
|
# SCO binary emulation
|
|
|
|
#
|
|
|
|
ibcs2_compat()
|
|
|
|
{
|
2002-10-12 10:31:31 +00:00
|
|
|
if checkyesno ibcs2_enable; then
|
2002-09-05 20:29:18 +00:00
|
|
|
echo -n ' ibcs2'
|
|
|
|
kldload ibcs2 > /dev/null 2>&1
|
|
|
|
case ${ibcs2_loaders} in
|
|
|
|
[Nn][Oo])
|
|
|
|
;;
|
|
|
|
*)
|
|
|
|
for i in ${ibcs2_loaders}; do
|
|
|
|
kldload ibcs2_$i > /dev/null 2>&1
|
|
|
|
done
|
|
|
|
;;
|
|
|
|
esac
|
|
|
|
fi
|
|
|
|
}
|
|
|
|
|
2005-09-28 16:24:47 +00:00
|
|
|
archdep_start()
|
|
|
|
{
|
2005-09-30 13:27:36 +00:00
|
|
|
_arch=`${SYSCTL_N} hw.machine_arch`
|
2005-09-28 16:24:47 +00:00
|
|
|
echo -n "Initial $_arch initialization:"
|
|
|
|
case $_arch in
|
|
|
|
i386)
|
|
|
|
ibcs2_compat
|
|
|
|
;;
|
|
|
|
alpha)
|
|
|
|
osf1_compat
|
|
|
|
unaligned_warnings
|
|
|
|
;;
|
|
|
|
esac
|
|
|
|
echo '.'
|
|
|
|
}
|
|
|
|
|
|
|
|
load_rc_config $name
|
|
|
|
run_rc_command "$1"
|