mirror of
https://github.com/lucaspalomodevelop/opnsense-core.git
synced 2026-03-13 00:07:27 +00:00
etc: gettytab is critical
This commit is contained in:
parent
d44f8e3476
commit
16e2a04842
235
etc/gettytab
235
etc/gettytab
@ -1,235 +0,0 @@
|
||||
# $FreeBSD: stable/10/etc/gettytab 241708 2012-10-18 22:20:02Z peterj $
|
||||
# from: @(#)gettytab 5.14 (Berkeley) 3/27/91
|
||||
#
|
||||
# Most of the table entries here are just copies of the old getty table,
|
||||
# it is by no means certain, or even likely, that any of them are optimal
|
||||
# for any purpose whatever. Nor is it likely that more than a couple are
|
||||
# even correct.
|
||||
#
|
||||
# The default gettytab entry, used to set defaults for all other
|
||||
# entries, and in cases where getty is called with no table name.
|
||||
#
|
||||
# cb, ce and ck are desirable on most crt's. The non-crt entries need to
|
||||
# be changed to turn them off (:cb@:ce@:ck@:).
|
||||
#
|
||||
# lc should always be on; it's a remainder of some stone age when there
|
||||
# have been terminals around not being able of handling lower-case
|
||||
# characters. Those terminals aren't supported any longer, but getty is
|
||||
# `smart' about them by default.
|
||||
#
|
||||
# Parity defaults to even, but the Pc entry and all the `std' entries
|
||||
# specify no parity. The different parities are:
|
||||
# (none): same as ep for getty. login will use terminal as is.
|
||||
# ep: getty will use raw mode (cs8 -parenb) (unless rw is set) and
|
||||
# fake parity. login will use even parity (cs7 parenb -parodd).
|
||||
# op: same as ep except odd parity (cs7 parenb parodd) for login.
|
||||
# getty will fake odd parity as well.
|
||||
# ap: same as ep except -inpck instead of inpck for login.
|
||||
# ap overrides op and ep.
|
||||
# np: 1. don't fake parity in getty. The fake parity garbles
|
||||
# characters on non-terminals (like pccons) that don't
|
||||
# support parity. It would probably better for getty not to
|
||||
# try to fake parity. It could just use cbreak mode so as
|
||||
# not to force cs8 and let the hardware handle the parity.
|
||||
# login has to be rely on the hardware anyway.
|
||||
# 2. set cs8 -parenb -istrip -inpck.
|
||||
# ep:op: same as ap.
|
||||
#
|
||||
default:\
|
||||
:cb:ce:ck:lc:fd#1000:im=\r\n%s/%m (%h) (%t)\r\n\r\n:sp#1200:\
|
||||
:if=/etc/issue:
|
||||
|
||||
#
|
||||
# Fixed speed entries
|
||||
#
|
||||
# The "std.NNN" names are known to the special case
|
||||
# portselector code in getty, however they can
|
||||
# be assigned to any table desired.
|
||||
# The "NNN-baud" names are known to the special case
|
||||
# autobaud code in getty, and likewise can
|
||||
# be assigned to any table desired (hopefully the same speed).
|
||||
#
|
||||
a|std.110|110-baud:\
|
||||
:np:nd#1:cd#1:uc:sp#110:
|
||||
b|std.134|134.5-baud:\
|
||||
:np:nd#1:cd#2:ff#1:td#1:sp#134:ht:nl:
|
||||
1|std.150|150-baud:\
|
||||
:np:nd#1:cd#2:td#1:fd#1:sp#150:ht:nl:lm=\E\72\6\6\17login\72 :
|
||||
c|std.300|300-baud:\
|
||||
:np:nd#1:cd#1:sp#300:
|
||||
d|std.600|600-baud:\
|
||||
:np:nd#1:cd#1:sp#600:
|
||||
f|std.1200|1200-baud:\
|
||||
:np:fd#1:sp#1200:
|
||||
6|std.2400|2400-baud:\
|
||||
:np:sp#2400:
|
||||
7|std.4800|4800-baud:\
|
||||
:np:sp#4800:
|
||||
2|std.9600|9600-baud:\
|
||||
:np:sp#9600:
|
||||
g|std.19200|19200-baud:\
|
||||
:np:sp#19200:
|
||||
std.38400|38400-baud:\
|
||||
:np:sp#38400:
|
||||
std.57600|57600-baud:\
|
||||
:np:sp#57600:
|
||||
std.115200|115200-baud:\
|
||||
:np:sp#115200:
|
||||
std.230400|230400-baud:\
|
||||
:np:sp#230400:
|
||||
|
||||
#
|
||||
# Entry specifying explicit device settings. See termios(4) and
|
||||
# /usr/include/termios.h, too. The entry forces the tty into
|
||||
# CLOCAL mode (so no DCD is required), and uses Xon/Xoff flow control.
|
||||
#
|
||||
# cflags: CLOCAL | HUPCL | CREAD | CS8
|
||||
# oflags: OPOST | ONLCR | OXTABS
|
||||
# iflags: IXOFF | IXON | ICRNL | IGNPAR
|
||||
# lflags: IEXTEN | ICANON | ISIG | ECHOCTL | ECHO | ECHOK | ECHOE | ECHOKE
|
||||
#
|
||||
# The `0' flags don't have input enabled. The `1' flags don't echo.
|
||||
# (Echoing is done inside getty itself.)
|
||||
#
|
||||
local.9600|CLOCAL tty @ 9600 Bd:\
|
||||
:c0#0x0000c300:c1#0x0000cb00:c2#0x0000cb00:\
|
||||
:o0#0x00000007:o1#0x00000002:o2#0x00000007:\
|
||||
:i0#0x00000704:i1#0x00000000:i2#0x00000704:\
|
||||
:l0#0x000005cf:l1#0x00000000:l2#0x000005cf:\
|
||||
:sp#9600:np:
|
||||
|
||||
#
|
||||
# Dial in rotary tables, speed selection via 'break'
|
||||
#
|
||||
0|d300|Dial-300:\
|
||||
:nx=d1200:cd#2:sp#300:
|
||||
d1200|Dial-1200:\
|
||||
:nx=d150:fd#1:sp#1200:
|
||||
d150|Dial-150:\
|
||||
:nx=d110:lm@:tc=150-baud:
|
||||
d110|Dial-110:\
|
||||
:nx=d300:tc=300-baud:
|
||||
|
||||
#
|
||||
# Fast dialup terminals, 2400/1200/300 rotary (can start either way)
|
||||
#
|
||||
D2400|d2400|Fast-Dial-2400:\
|
||||
:nx=D1200:tc=2400-baud:
|
||||
3|D1200|Fast-Dial-1200:\
|
||||
:nx=D300:tc=1200-baud:
|
||||
5|D300|Fast-Dial-300:\
|
||||
:nx=D2400:tc=300-baud:
|
||||
|
||||
#
|
||||
#telebit (19200)
|
||||
#
|
||||
t19200:\
|
||||
:nx=t2400:tc=19200-baud:
|
||||
t2400:\
|
||||
:nx=t1200:tc=2400-baud:
|
||||
t1200:\
|
||||
:nx=t19200:tc=1200-baud:
|
||||
|
||||
#
|
||||
#telebit (9600)
|
||||
#
|
||||
t9600:\
|
||||
:nx=t2400a:tc=9600-baud:
|
||||
t2400a:\
|
||||
:nx=t1200a:tc=2400-baud:
|
||||
t1200a:\
|
||||
:nx=t9600:tc=1200-baud:
|
||||
|
||||
#
|
||||
# Odd special case terminals
|
||||
#
|
||||
-|tty33|asr33|Pity the poor user of this beast:\
|
||||
:tc=110-baud:
|
||||
|
||||
4|Console|Console Decwriter II:\
|
||||
:nd@:cd@:rw:tc=300-baud:
|
||||
|
||||
e|Console-1200|Console Decwriter III:\
|
||||
:fd@:nd@:cd@:rw:tc=1200-baud:
|
||||
|
||||
i|Interdata console:\
|
||||
:uc:sp#0:
|
||||
|
||||
l|lsi chess terminal:\
|
||||
:sp#300:
|
||||
|
||||
X|Xwindow|X window system:\
|
||||
:fd@:nd@:cd@:rw:sp#9600:
|
||||
|
||||
P|Pc|Pc console:\
|
||||
:ht:np:sp#9600:
|
||||
|
||||
al.Pc:\
|
||||
:ht:np:sp#9600:al=root:
|
||||
|
||||
# Weirdo special case for fast crt's with hardcopy devices
|
||||
#
|
||||
8|T9600|CRT with hardcopy:\
|
||||
:nx=T300:tc=9600-baud:
|
||||
9|T300|CRT with hardcopy (300):\
|
||||
:nx=T9600:tc=300-baud:
|
||||
|
||||
#
|
||||
# Plugboard, and misc other terminals
|
||||
#
|
||||
plug-9600|Plugboard-9600:\
|
||||
:pf#1:tc=9600-baud:
|
||||
p|P9600|Plugboard-9600-rotary:\
|
||||
:pf#1:nx=P300:tc=9600-baud:
|
||||
q|P300|Plugboard-300:\
|
||||
:pf#1:nx=P1200:tc=300-baud:
|
||||
r|P1200|Plugboard-1200:\
|
||||
:pf#1:nx=P9600:tc=1200-baud:
|
||||
|
||||
#
|
||||
# XXXX Port selector
|
||||
#
|
||||
s|DSW|Port Selector:\
|
||||
:ps:sp#2400:
|
||||
|
||||
#
|
||||
# Auto-baud speed detect entry for Micom 600.
|
||||
# Special code in getty will switch this out
|
||||
# to one of the NNN-baud entries.
|
||||
#
|
||||
A|Auto-baud:\
|
||||
:ab:sp#2400:f0#040:
|
||||
|
||||
#
|
||||
# autologin - automatically log in as root
|
||||
#
|
||||
|
||||
autologin|al.9600:\
|
||||
:al=root:tc=std.9600:
|
||||
al.19200:\
|
||||
:al=root:tc=std.19200:
|
||||
al.38400:\
|
||||
:al=root:tc=std.38400:
|
||||
al.57600:\
|
||||
:al=root:tc=std.57600:
|
||||
al.115200:\
|
||||
:al=root:tc=std.115200:
|
||||
al.230400:\
|
||||
:al=root:tc=std.230400:
|
||||
|
||||
#
|
||||
# Entries for 3-wire serial terminals. These don't supply carrier, so
|
||||
# clocal needs to be set, and crtscts needs to be unset.
|
||||
#
|
||||
3wire.9600|9600-3wire:\
|
||||
:np:nc:sp#9600:
|
||||
3wire.19200|19200-3wire:\
|
||||
:np:nc:sp#19200:
|
||||
3wire.38400|38400-3wire:\
|
||||
:np:nc:sp#38400:
|
||||
3wire.57600|57600-3wire:\
|
||||
:np:nc:sp#57600:
|
||||
3wire.115200|115200-3wire:\
|
||||
:np:nc:sp#115200:
|
||||
3wire.230400|230400-3wire:\
|
||||
:np:nc:sp#230400:
|
||||
@ -14,12 +14,7 @@ for i in tmp varmfs etcmfs; do
|
||||
fi
|
||||
done
|
||||
|
||||
# Start PFI
|
||||
/bin/sh /usr/local/installer/pfi start
|
||||
|
||||
# If PFI did not find a config, we should create
|
||||
# a tiny mfs under /conf and populate with stock
|
||||
# configuration.
|
||||
# Add /conf and populate with stock configuration.
|
||||
if [ ! -f /conf/config.xml ]; then
|
||||
echo -n "Generating a MFS /conf partition... "
|
||||
device=$(mdconfig -a -t malloc -s ${partsize})
|
||||
|
||||
@ -1,252 +0,0 @@
|
||||
#!/bin/sh
|
||||
|
||||
# $Id$
|
||||
# $DragonFly: src/nrelease/installer/etc/rc.d/pfi,v 1.2 2004/07/11 18:55:20 cpressey Exp $
|
||||
#
|
||||
|
||||
# PROVIDE: pfi
|
||||
# REQUIRE: mountoptional
|
||||
# KEYWORD: FreeBSD
|
||||
|
||||
. /etc/rc.subr
|
||||
|
||||
name=pfi
|
||||
start_cmd="pfi_start"
|
||||
stop_cmd=":"
|
||||
thttpd_location="/scripts/thttpd"
|
||||
|
||||
touch /etc/rc.conf
|
||||
|
||||
get_config_xml()
|
||||
{
|
||||
if [ -r $1/conf/config.xml ]; then
|
||||
echo -n "[config.xml on $1]"
|
||||
# Now that we have found config.xml lets mount
|
||||
# the device in nullfs under /cf/conf and /conf
|
||||
mount_nullfs /tmp/mnt/cf /cf
|
||||
mount_nullfs /tmp/mnt/cf/conf /conf
|
||||
if [ ! -r /cf/conf/config.xml ]; then
|
||||
echo
|
||||
echo "Something went wrong. Launching shell!";
|
||||
/bin/sh
|
||||
fi
|
||||
echo
|
||||
return 0
|
||||
else
|
||||
return 1
|
||||
fi
|
||||
}
|
||||
|
||||
look_for_config_xml_config_msdos()
|
||||
{
|
||||
mkdir -p /tmp/mnt/cf
|
||||
echo -n "Looking for config.xml on "
|
||||
for try_device in da0 da0s1 da1 da1s1 da2 da2s1 da3 da3s1 da4 da4s1 da5 da5s1 fd0 fd1; do
|
||||
if [ ! -e /dev/${try_device} ]; then
|
||||
continue
|
||||
fi
|
||||
echo -n "$try_device "
|
||||
if mount -t msdos /dev/$try_device /tmp/mnt/cf 2>/dev/null ; then
|
||||
echo -n "[found msdos] "
|
||||
# Note for later that this device is capable
|
||||
# of having config.xml on it for perm. storage
|
||||
/bin/mkdir -p /var/db/pfi/
|
||||
/usr/bin/touch /var/db/pfi/capable_${try_device}
|
||||
# look for config.xml, if its found return 0
|
||||
if get_config_xml /tmp/mnt/cf /dev/$try_device; then
|
||||
return 0
|
||||
fi
|
||||
fi
|
||||
done
|
||||
echo "done."
|
||||
return 1
|
||||
}
|
||||
|
||||
get_pfi_config()
|
||||
{
|
||||
[ -r /etc/pfi.conf ] && return 0
|
||||
|
||||
if [ -r $1/pfi.conf ]; then
|
||||
echo -n "Found pfi.conf on $1"
|
||||
tr -d "\r" < $1/pfi.conf > /etc/pfi.conf
|
||||
echo "pfi_found_on_device='$2'" >> /etc/pfi.conf
|
||||
echo "#@@@@@" >>/etc/rc.conf
|
||||
cat /etc/pfi.conf >>/etc/rc.conf
|
||||
if [ -r /etc/defaults/pfi.conf ]; then
|
||||
. /etc/defaults/pfi.conf
|
||||
fi
|
||||
. /etc/pfi.conf
|
||||
if [ "$pfi_script" != "" -a -x "$1/$pfi_script" ]; then
|
||||
$1/$pfi_script
|
||||
fi
|
||||
return 0
|
||||
else
|
||||
return 1
|
||||
fi
|
||||
}
|
||||
|
||||
get_authorized_hosts()
|
||||
{
|
||||
[ -r /root/authorized_hosts ] && return 0
|
||||
if [ -r $1/authorized_hosts ]; then
|
||||
echo "Authorized_hosts found on $1"
|
||||
mkdir -p ~root/.ssh/
|
||||
tr -d "\r" < $1/authorized_hosts > /root/.ssh/authorized_hosts
|
||||
fi
|
||||
}
|
||||
|
||||
look_for_pfi_config_msdos()
|
||||
{
|
||||
[ -r /etc/pfi.conf ] && return 0
|
||||
echo -n "Looking for pfi.conf on "
|
||||
for try_device in da0 da1 da0s1 da1s1 fd0 fd1; do
|
||||
if [ ! -e /dev/${try_device} ]; then
|
||||
continue
|
||||
fi
|
||||
echo -n "${try_device} "
|
||||
if mount -t msdos -o rdonly /dev/$try_device /tmp/mnt 2>/dev/null ; then
|
||||
echo -n "[found] "
|
||||
get_authorized_hosts
|
||||
if get_pfi_config /tmp/mnt /dev/$try_device; then
|
||||
umount /tmp/mnt
|
||||
echo -n "[found] "
|
||||
return 0
|
||||
fi
|
||||
umount /tmp/mnt
|
||||
fi
|
||||
done
|
||||
echo "done. "
|
||||
return 1
|
||||
}
|
||||
|
||||
look_for_pfi_config_cd9660()
|
||||
{
|
||||
[ -r /etc/pfi.conf ] && return 0
|
||||
echo -n "Looking for pfi.conf on "
|
||||
for try_device in acd0c; do
|
||||
echo -n "${try_device} "
|
||||
if [ ! -e /dev/${try_device} ]; then
|
||||
echo "done. "
|
||||
return 1
|
||||
#( cd /dev && ./MAKEDEV ${try_device} )
|
||||
fi
|
||||
if mount_cd9660 /dev/$try_device /tmp/mnt ; then
|
||||
echo -n "[found] "
|
||||
get_authorized_hosts
|
||||
if get_pfi_config /tmp/mnt /dev/$try_device; then
|
||||
umount /tmp/mnt
|
||||
echo -n "[found]"
|
||||
return 0
|
||||
fi
|
||||
umount /tmp/mnt
|
||||
fi
|
||||
done
|
||||
return 1
|
||||
}
|
||||
|
||||
pfi_start()
|
||||
{
|
||||
|
||||
# Get the pfi.conf file off the pfi media and into /etc/pfi.conf.
|
||||
|
||||
look_for_pfi_config_cd9660
|
||||
look_for_pfi_config_msdos
|
||||
look_for_config_xml_config_msdos # look for pfsense config.xml
|
||||
|
||||
if [ ! -r /etc/pfi.conf ]; then
|
||||
echo '' >/etc/pfi.conf
|
||||
fi
|
||||
|
||||
if [ -r /etc/defaults/pfi.conf ]; then
|
||||
. /etc/defaults/pfi.conf
|
||||
fi
|
||||
. /etc/pfi.conf
|
||||
|
||||
# We can perform any pre-install tasks here by
|
||||
# examining the contents of pfi_* variables.
|
||||
|
||||
# Interpret pfi_sshd_* options. These basically add settings
|
||||
# to /etc/ssh/sshd_config; it is assumed "sshd" will appear
|
||||
# in pfi_rc_actions to restart sshd.
|
||||
|
||||
case ${pfi_sshd_permit_root_login} in
|
||||
YES)
|
||||
echo "PermitRootLogin yes" >> /etc/ssh/sshd_config
|
||||
;;
|
||||
without-password)
|
||||
echo "PermitRootLogin without-password" >> /etc/ssh/sshd_config
|
||||
;;
|
||||
forced-commands-only)
|
||||
echo "PermitRootLogin forced-commands-only" >> /etc/ssh/sshd_config
|
||||
;;
|
||||
*)
|
||||
;;
|
||||
esac
|
||||
|
||||
case ${pfi_sshd_permit_empty_passwords} in
|
||||
YES)
|
||||
echo "PermitEmptyPasswords yes" >> /etc/ssh/sshd_config
|
||||
;;
|
||||
*)
|
||||
;;
|
||||
esac
|
||||
|
||||
# Interpret pfi_set_root_password. If it is not empty, use
|
||||
# it to set root's LiveCD password.
|
||||
|
||||
if [ "X$pfi_set_root_password" != "X" ]; then
|
||||
echo "$pfi_set_root_password" | \
|
||||
/usr/sbin/pw usermod root -h 0
|
||||
fi
|
||||
|
||||
# The most important pre-install task is to restart
|
||||
# any RCNG scripts listed in pfi_rc_actions with any new
|
||||
# settings that might have been set up by pfi.conf.
|
||||
|
||||
if [ "X$pfi_rc_actions" != "X" ]; then
|
||||
rev_actions=`reverse_list $pfi_rc_actions`
|
||||
|
||||
for _rc_elem in ${rev_actions}; do
|
||||
echo "Stopping ${_rc_elem}..."
|
||||
/etc/rc.d/${_rc_elem} stop
|
||||
#rcstop ${_rc_elem}
|
||||
done
|
||||
for _rc_elem in ${pfi_rc_actions}; do
|
||||
echo "Starting ${_rc_elem}..."
|
||||
/etc/rc.d/${_rc_elem} start
|
||||
#rcstart ${_rc_elem}
|
||||
done
|
||||
fi
|
||||
|
||||
# Now remove the copy of pfi.conf that we tacked onto
|
||||
# the end of rc.conf so the above would work
|
||||
|
||||
awk '$1=="#@@@@@" || cut { cut = 1 } !cut { print $0 }' \
|
||||
</etc/rc.conf >/etc/rc.conf.new
|
||||
mv /etc/rc.conf.new /etc/rc.conf
|
||||
|
||||
# Set up auto-login if requested.
|
||||
|
||||
if [ "X$pfi_autologin" != "XNONE" ]; then
|
||||
echo 'autologin|al.9600:\' >> /etc/gettytab
|
||||
echo " :al=${pfi_autologin}:tc=std.9600:" >> /etc/gettytab
|
||||
sed -i '' 's/^ttyv0=.*/ttyv0 "\/usr\/libexec\/getty Al" cons25 on secure/' /etc/ttys
|
||||
fi
|
||||
|
||||
# Finally, start thttpd if the user wants to use
|
||||
# the cgi frontend.
|
||||
|
||||
if [ "X$pfi_frontend" = "Xcgi" ]; then
|
||||
echo "Starting thttpd..."
|
||||
echo dir=/usr/local/www > /tmp/thttpd.conf
|
||||
echo user=root >> /tmp/thttpd.conf
|
||||
echo cgipat=*.cgi >> /tmp/thttpd.conf
|
||||
echo logfile=/var/log/thttpd.log >> /tmp/thttpd.conf
|
||||
echo pidfile=/var/run/thttpd.pid >> /tmp/thttpd.conf
|
||||
$thttpd_location -C /tmp/thttpd.conf
|
||||
fi
|
||||
}
|
||||
|
||||
load_rc_config $name
|
||||
run_rc_command "$1"
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user