changeset 209:b7812d60bbcd

More small than SMALL_ profile :)
author ray@terran.dlink.ua
date Sat, 15 Oct 2011 02:31:07 +0300
parents ad5a3376d2a6
children e2ecd60d215f
files profiles/xSMALL_/files/etc/auth.conf profiles/xSMALL_/files/etc/bin/update profiles/xSMALL_/files/etc/buttons/WDS.sh profiles/xSMALL_/files/etc/cdevd.conf profiles/xSMALL_/files/etc/crontab profiles/xSMALL_/files/etc/defaults/devfs.rules profiles/xSMALL_/files/etc/defaults/periodic.conf profiles/xSMALL_/files/etc/defaults/rc.conf profiles/xSMALL_/files/etc/devfs.conf profiles/xSMALL_/files/etc/dhclient-script profiles/xSMALL_/files/etc/dhclient.conf profiles/xSMALL_/files/etc/dumpdates profiles/xSMALL_/files/etc/fbtab profiles/xSMALL_/files/etc/ftpusers profiles/xSMALL_/files/etc/gettytab profiles/xSMALL_/files/etc/group profiles/xSMALL_/files/etc/host.conf profiles/xSMALL_/files/etc/hosts profiles/xSMALL_/files/etc/hosts.allow profiles/xSMALL_/files/etc/hosts.equiv profiles/xSMALL_/files/etc/hosts.lpd profiles/xSMALL_/files/etc/inetd.conf profiles/xSMALL_/files/etc/libalias.conf profiles/xSMALL_/files/etc/login.access profiles/xSMALL_/files/etc/login.conf profiles/xSMALL_/files/etc/login.conf.db profiles/xSMALL_/files/etc/master.passwd profiles/xSMALL_/files/etc/motd profiles/xSMALL_/files/etc/netconfig profiles/xSMALL_/files/etc/netstart profiles/xSMALL_/files/etc/network.subr profiles/xSMALL_/files/etc/networks profiles/xSMALL_/files/etc/nsswitch.conf profiles/xSMALL_/files/etc/pam.d/login profiles/xSMALL_/files/etc/pam.d/passwd profiles/xSMALL_/files/etc/pam.d/system profiles/xSMALL_/files/etc/pam.d/telnetd profiles/xSMALL_/files/etc/periodic/daily/420.status-network profiles/xSMALL_/files/etc/printcap profiles/xSMALL_/files/etc/profile profiles/xSMALL_/files/etc/protocols profiles/xSMALL_/files/etc/pwd.db profiles/xSMALL_/files/etc/rc profiles/xSMALL_/files/etc/rc.conf profiles/xSMALL_/files/etc/rc.d/MAIN profiles/xSMALL_/files/etc/rc.firewall profiles/xSMALL_/files/etc/rc.shutdown profiles/xSMALL_/files/etc/rc.subr profiles/xSMALL_/files/etc/reboot.sh profiles/xSMALL_/files/etc/remote profiles/xSMALL_/files/etc/resolv.conf profiles/xSMALL_/files/etc/rpc profiles/xSMALL_/files/etc/save_etc profiles/xSMALL_/files/etc/services profiles/xSMALL_/files/etc/shells profiles/xSMALL_/files/etc/snmpd.config profiles/xSMALL_/files/etc/spwd.db profiles/xSMALL_/files/etc/sysctl.conf profiles/xSMALL_/files/etc/syslog.conf profiles/xSMALL_/files/etc/ttys profiles/xSMALL_/files/etc/upgrade profiles/xSMALL_/files/usr/share/misc/termcap profiles/xSMALL_/files/usr/share/misc/termcap.db profiles/xSMALL_/profile.mk
diffstat 58 files changed, 5125 insertions(+), 0 deletions(-) [+]
line wrap: on
line diff
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/profiles/xSMALL_/files/etc/bin/update	Sat Oct 15 02:31:07 2011 +0300
@@ -0,0 +1,73 @@
+#!/bin/sh
+
+. /etc/rc.conf
+. /default/version.sh
+
+
+get_int_version()
+{
+
+	VERMJ=`echo "$1" | sed -E 's/([[:digit:]]+)\.([[:digit:]]+)\.([[:digit:]]+)/\1/'`
+	VERMN=`echo "$1" | sed -E 's/([[:digit:]]+)\.([[:digit:]]+)\.([[:digit:]]+)/\2/'`
+	VERBL=`echo "$1" | sed -E 's/([[:digit:]]+)\.([[:digit:]]+)\.([[:digit:]]+)/\3/'`
+	VERINT=$(( ${VERMJ} * 256 ))
+	VERINT=$(( ${VERINT} + ${VERMN} ))
+	VERINT=$(( ${VERINT} * 65536 ))
+	VERINT=$(( ${VERINT} + ${VERBL} ))
+
+}
+
+
+get_int_version "${IMAGE_VERSION}"
+IMAGE_VERSIONINT=${VERINT}
+
+UPDATE_PROFILE=${2-${IMAGE_PROFILE-'ipsec-router'}}
+UPDATE_TYPE=${1-FreeBSD}
+UPDATE_URL=${update_freebsd_url}
+
+case ${UPDATE_TYPE} in
+
+[Ff][Rr][Ee][Ee][Bb][Ss][Dd])
+	UPDATE_TYPE="FreeBSD"
+	UPDATE_URL=${update_freebsd_url}
+	;;
+[Ll][Ii][Nn][Uu][Xx])
+	UPDATE_TYPE="Linux"
+	UPDATE_URL=${update_linux_url}
+	;;
+*)
+	echo "Unsupported update type"
+	echo "Usage: $0 [FreeBSD|Linux] [profile_name]"
+	echo "       profile_name - default ipsec-router"
+	exit 1
+	;;
+esac
+
+echo "UPDATE_TYPE=\"${UPDATE_TYPE}\""
+echo "UPDATE_PROFILE=\"${UPDATE_PROFILE}\""
+echo "UPDATE_URL=\"${UPDATE_URL}\""
+cd /tmp
+fetch -o /tmp/fwinfo "${UPDATE_URL}?profile=${UPDATE_PROFILE}"
+. /tmp/fwinfo
+
+get_int_version "${fwExternal}.${fwInternal}"
+NEWEST_VERSION=${VERINT}
+
+if [ ${UPDATE_TYPE} = "FreeBSD" ]; then
+	if [ ${NEWEST_VERSION} -gt ${IMAGE_VERSIONINT} ]; then
+		echo "Site ${fwExternal}.${fwInternal} version newest than my ${IMAGE_VERSION},"
+	else
+		fwURL=
+		echo "System have newest version, no updating."
+	fi
+
+fi
+
+if [ "x${fwURL}" != "x" ];  then
+	echo "Updating system image to type ${UPDATE_TYPE}, version ${fwExternal}.${fwInternal}"
+	fetch -o /tmp/fw.img "${fwURL}" || exit 1
+	upgrade -f /tmp/fw.img 
+fi
+
+
+
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/profiles/xSMALL_/files/etc/buttons/WDS.sh	Sat Oct 15 02:31:07 2011 +0300
@@ -0,0 +1,13 @@
+#!/bin/sh
+
+echo f1 > /dev/led/status
+
+cd /tmp
+echo "Dumping etc to tar.gz"
+/usr/bin/tar cv --exclude '*pwd.db' -zf /tmp/etc.tar.gz etc/* -C /tmp
+echo "Saving /etc"
+/bin/dd if=/tmp/etc.tar.gz of=/dev/map/rgdb bs=64k count=1 conv=sync
+echo '.'
+
+echo f9 > /dev/led/status
+
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/profiles/xSMALL_/files/etc/cdevd.conf	Sat Oct 15 02:31:07 2011 +0300
@@ -0,0 +1,3 @@
+/!system=GPIO subsystem=pin07 type=PIN_HIGH period=[[:digit:]]+/	/default/reset_button_handler.sh
+/!system=GPIO subsystem=pin06 type=PIN_HIGH period=/			/etc/buttons/WDS.sh
+
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/profiles/xSMALL_/files/etc/crontab	Sat Oct 15 02:31:07 2011 +0300
@@ -0,0 +1,9 @@
+SHELL=/bin/sh
+PATH=/etc:/bin:/sbin:/usr/bin:/usr/sbin
+*/5	*	*	*	*	root	/usr/libexec/atrun
+*/11	*	*	*	*	operator /usr/libexec/save-entropy
+0	*	*	*	*	root	newsyslog
+1	3	*	*	*	root	periodic daily
+15	4	*	*	6	root	periodic weekly
+30	5	1	*	*	root	periodic monthly
+1,31	0-5	*	*	*	root	adjkerntz -a
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/profiles/xSMALL_/files/etc/defaults/devfs.rules	Sat Oct 15 02:31:07 2011 +0300
@@ -0,0 +1,53 @@
+[devfsrules_hide_all=1]
+add hide
+[devfsrules_unhide_basic=2]
+add path null unhide
+add path zero unhide
+add path crypto unhide
+add path random unhide
+add path urandom unhide
+[devfsrules_unhide_login=3]
+add path 'ptyp*' unhide
+add path 'ptyq*' unhide
+add path 'ptyr*' unhide
+add path 'ptys*' unhide
+add path 'ptyP*' unhide
+add path 'ptyQ*' unhide
+add path 'ptyR*' unhide
+add path 'ptyS*' unhide
+add path 'ptyl*' unhide
+add path 'ptym*' unhide
+add path 'ptyn*' unhide
+add path 'ptyo*' unhide
+add path 'ptyL*' unhide
+add path 'ptyM*' unhide
+add path 'ptyN*' unhide
+add path 'ptyO*' unhide
+add path 'ttyp*' unhide
+add path 'ttyq*' unhide
+add path 'ttyr*' unhide
+add path 'ttys*' unhide
+add path 'ttyP*' unhide
+add path 'ttyQ*' unhide
+add path 'ttyR*' unhide
+add path 'ttyS*' unhide
+add path 'ttyl*' unhide
+add path 'ttym*' unhide
+add path 'ttyn*' unhide
+add path 'ttyo*' unhide
+add path 'ttyL*' unhide
+add path 'ttyM*' unhide
+add path 'ttyN*' unhide
+add path 'ttyO*' unhide
+add path ptmx unhide
+add path pts unhide
+add path 'pts/*' unhide
+add path fd unhide
+add path 'fd/*' unhide
+add path stdin unhide
+add path stdout unhide
+add path stderr unhide
+[devfsrules_jail=4]
+add include $devfsrules_hide_all
+add include $devfsrules_unhide_basic
+add include $devfsrules_unhide_login
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/profiles/xSMALL_/files/etc/defaults/periodic.conf	Sat Oct 15 02:31:07 2011 +0300
@@ -0,0 +1,24 @@
+periodic_conf_files="/etc/periodic.conf /etc/periodic.conf.local"
+
+local_periodic="/usr/local/etc/periodic"
+
+pkg_version=pkg_version
+pkg_version_index=/usr/ports/INDEX-9
+
+
+if [ -z "${source_periodic_confs_defined}" ]; then
+        source_periodic_confs_defined=yes
+        source_periodic_confs () {
+                local i sourced_files
+                for i in ${periodic_conf_files}; do
+                        case ${sourced_files} in
+                        *:$i:*)
+                                ;;
+                        *)
+                                sourced_files="${sourced_files}:$i:"
+                                [ -r $i ] && . $i
+                                ;;
+                        esac
+                done
+        }
+fi
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/profiles/xSMALL_/files/etc/defaults/rc.conf	Sat Oct 15 02:31:07 2011 +0300
@@ -0,0 +1,384 @@
+rc_debug="NO"		
+rc_info="NO"		
+rc_startmsgs="YES" 	
+rcshutdown_timeout="30" 
+early_late_divider="FILESYSTEMS"	
+swapfile="NO"		
+apm_enable="NO"		
+apmd_enable="NO"	
+apmd_flags=""		
+ddb_enable="NO"		
+ddb_config="/etc/ddb.conf"	
+cdevd_enable="YES" 	
+cdevd_flags=""		
+buttons_pins=""
+buttons_gpioc_dev="/dev/gpioc0"
+kldxref_enable="NO"	
+kldxref_clobber="NO"	
+kldxref_module_path=""	
+powerd_enable="NO" 	
+powerd_flags=""		
+tmpmfs="AUTO"		
+tmpsize="20m"		
+tmpmfs_flags="-S"	
+varmfs="AUTO"		
+varsize="32m"		
+varmfs_flags="-S"	
+populate_var="AUTO"	
+cleanvar_enable="YES" 	
+local_startup="/usr/local/etc/rc.d" 
+script_name_sep=" "	
+rc_conf_files="/etc/rc.conf /etc/rc.conf.local"
+zfs_enable="NO"		
+gbde_autoattach_all="NO" 
+gbde_devices="NO" 	
+gbde_attach_attempts="3" 
+gbde_lockdir="/etc"	
+geli_devices=""		
+geli_tries=""		
+geli_default_flags=""	
+geli_autodetach="YES"	
+geli_swap_flags="-e aes -l 256 -s 4096 -d"	
+root_rw_mount="YES"	
+fsck_y_enable="NO"	
+fsck_y_flags=""		
+background_fsck="YES"	
+background_fsck_delay="60" 
+netfs_types="nfs:NFS nfs4:NFS4 smbfs:SMB portalfs:PORTAL nwfs:NWFS" 
+extra_netfs_types="NO"	
+hostname=""			
+hostid_enable="YES"		
+hostid_file="/etc/hostid"	
+nisdomainname="NO"		
+dhclient_program="/sbin/dhclient"	
+dhclient_flags=""		
+background_dhclient="NO"	
+synchronous_dhclient="NO"	
+defaultroute_delay="30"		
+wpa_supplicant_program="/usr/sbin/wpa_supplicant"
+wpa_supplicant_flags="-s"	
+wpa_supplicant_conf_file="/etc/wpa_supplicant.conf"
+firewall_enable="NO"		
+firewall_script="/etc/rc.firewall" 
+firewall_type="UNKNOWN"		
+firewall_quiet="NO"		
+firewall_logging="NO"		
+firewall_flags=""		
+firewall_client_net="192.0.2.0/24" 
+firewall_simple_iif="ed1"	
+firewall_simple_inet="192.0.2.16/28" 
+firewall_simple_oif="ed0"	
+firewall_simple_onet="192.0.2.0/28" 
+firewall_myservices=""		
+firewall_allowservices=""	
+firewall_trusted=""		
+firewall_logdeny="NO"		
+firewall_nologports="135-139,445 1026,1027 1433,1434" 
+firewall_nat_enable="NO"	
+firewall_nat_interface=""	
+firewall_nat_flags=""		
+dummynet_enable="NO"		
+ip_portrange_first="NO"		
+ip_portrange_last="NO"		
+ike_enable="NO"			
+ike_program="/usr/local/sbin/isakmpd"	
+ike_flags=""			
+ipsec_enable="NO"		
+ipsec_file="/etc/ipsec.conf"	
+natd_program="/sbin/natd"	
+natd_enable="NO"		
+natd_interface=""		
+natd_flags=""			
+ipfilter_enable="NO"		
+ipfilter_program="/sbin/ipf"	
+ipfilter_rules="/etc/ipf.rules"	
+ipfilter_flags=""		
+ipnat_enable="NO"		
+ipnat_program="/sbin/ipnat"	
+ipnat_rules="/etc/ipnat.rules"	
+ipnat_flags=""			
+ipmon_enable="NO"		
+ipmon_program="/sbin/ipmon"	
+ipmon_flags="-Ds"		
+ipfs_enable="NO"		
+ipfs_program="/sbin/ipfs"	
+ipfs_flags=""			
+pf_enable="NO"			
+pf_rules="/etc/pf.conf"		
+pf_program="/sbin/pfctl"	
+pf_flags=""			
+pflog_enable="NO"		
+pflog_logfile="/var/log/pflog"	
+pflog_program="/sbin/pflogd"	
+pflog_flags=""			
+ftpproxy_enable="NO"		
+ftpproxy_flags=""		
+pfsync_enable="NO"		
+pfsync_syncdev=""		
+pfsync_syncpeer=""		
+pfsync_ifconfig=""		
+tcp_extensions="YES"		
+log_in_vain="0"			
+tcp_keepalive="YES"		
+tcp_drop_synfin="NO"		
+icmp_drop_redirect="NO" 	
+icmp_log_redirect="NO"		
+network_interfaces="auto"	
+cloned_interfaces=""		
+ifconfig_lo0="inet 127.0.0.1"	
+sppp_interfaces=""		
+gif_interfaces=""		
+fec_interfaces=""		
+ppp_enable="NO"		
+ppp_program="/usr/sbin/ppp"	
+ppp_mode="auto"		
+ppp_nat="YES"		
+ppp_profile="papchap"	
+ppp_user="root"		
+hostapd_enable="NO"		
+syslogd_enable="YES"		
+syslogd_program="/usr/sbin/syslogd" 
+syslogd_flags="-s"		
+inetd_enable="NO"		
+inetd_program="/usr/sbin/inetd"	
+inetd_flags="-wW -C 60"		
+named_enable="NO"		
+named_program="/usr/sbin/named" 
+named_conf="/etc/namedb/named.conf" 	
+named_pidfile="/var/run/named/pid" 
+named_uid="bind" 		
+named_chrootdir="/var/named"	
+named_chroot_autoupdate="YES"	
+named_symlink_enable="YES"	
+named_wait="NO" 		
+named_wait_host="localhost" 	
+named_auto_forward="NO" 	
+named_auto_forward_only="NO" 	
+kerberos5_server_enable="NO"	
+kerberos5_server="/usr/libexec/kdc"	
+kerberos5_server_flags="--detach"	
+kadmind5_server_enable="NO"	
+kadmind5_server="/usr/libexec/kadmind"	
+kpasswdd_server_enable="NO"	
+kpasswdd_server="/usr/libexec/kpasswdd"	
+gssd_enable="NO"		
+gssd_flags=""			
+rwhod_enable="NO"		
+rwhod_flags=""			
+rarpd_enable="NO"		
+rarpd_flags="-a"		
+bootparamd_enable="NO"		
+bootparamd_flags=""		
+pppoed_enable="NO"		
+pppoed_provider="*"		
+pppoed_flags="-P /var/run/pppoed.pid"	
+pppoed_interface="fxp0"		
+sshd_enable="NO"		
+sshd_program="/usr/sbin/sshd"	
+sshd_flags=""			
+ftpd_enable="NO"		
+ftpd_program="/usr/libexec/ftpd" 
+ftpd_flags=""			
+amd_enable="NO"			
+amd_program="/usr/sbin/amd"	
+amd_flags="-a /.amd_mnt -l syslog /host /etc/amd.map /net /etc/amd.map"
+amd_map_program="NO"		
+nfs_client_enable="NO"		
+nfs_access_cache="60"		
+nfs_server_enable="NO"		
+nfs_server_flags="-u -t -n 4"	
+mountd_enable="NO"		
+mountd_flags="-r"		
+weak_mountd_authentication="NO"	
+nfs_reserved_port_only="NO"	
+nfs_bufpackets=""		
+rpc_lockd_enable="NO"		
+rpc_lockd_flags=""		
+rpc_statd_enable="NO"		
+rpc_statd_flags=""		
+rpcbind_enable="NO"		
+rpcbind_program="/usr/sbin/rpcbind"	
+rpcbind_flags=""		
+rpc_ypupdated_enable="NO"	
+keyserv_enable="NO"		
+keyserv_flags=""		
+nfsv4_server_enable="NO"	
+nfscbd_enable="NO"		
+nfscbd_flags=""			
+nfsuserd_enable="NO"		
+nfsuserd_flags=""		
+timed_enable="NO"		
+timed_flags=""			
+ntpdate_enable="NO"		
+ntpdate_program="/usr/sbin/ntpdate"	
+ntpdate_flags="-b"		
+ntpdate_config="/etc/ntp.conf"	
+ntpdate_hosts=""		
+ntpd_enable="NO"		
+ntpd_program="/usr/sbin/ntpd"	
+ntpd_config="/etc/ntp.conf"	
+ntpd_sync_on_start="NO"		
+ntpd_flags="-p /var/run/ntpd.pid -f /var/db/ntpd.drift"
+nis_client_enable="NO"		
+nis_client_flags=""		
+nis_ypset_enable="NO"		
+nis_ypset_flags=""		
+nis_server_enable="NO"		
+nis_server_flags=""		
+nis_ypxfrd_enable="NO"		
+nis_ypxfrd_flags=""		
+nis_yppasswdd_enable="NO"	
+nis_yppasswdd_flags=""		
+bsnmpd_enable="NO"		
+bsnmpd_flags=""			
+defaultrouter="NO"		
+static_arp_pairs=""		
+static_routes=""		
+natm_static_routes=""		
+gateway_enable="NO"		
+routed_enable="NO"		
+routed_program="/sbin/routed"	
+routed_flags="-q"		
+mrouted_enable="NO"		
+mrouted_program="/usr/local/sbin/mrouted"	
+mrouted_flags=""		
+ipxgateway_enable="NO"		
+ipxrouted_enable="NO"		
+ipxrouted_flags=""		
+arpproxy_all="NO"		
+forward_sourceroute="NO"	
+accept_sourceroute="NO"		
+atm_enable="NO"			
+atm_pvcs=""			
+atm_arps=""			
+hcsecd_enable="NO"		
+hcsecd_config="/etc/bluetooth/hcsecd.conf" 
+sdpd_enable="NO"		
+sdpd_control="/var/run/sdp"	
+sdpd_groupname="nobody"		
+sdpd_username="nobody"		
+bthidd_enable="NO"		
+bthidd_config="/etc/bluetooth/bthidd.conf" 
+bthidd_hids="/var/db/bthidd.hids" 
+rfcomm_pppd_server_enable="NO"	
+rfcomm_pppd_server_profile="one two"	
+rfcomm_pppd_server_one_channel="1"	
+rfcomm_pppd_server_two_channel="3"	
+icmp_bmcastecho="NO"	
+keyboard=""		
+keymap="NO"		
+keyrate="NO"		
+keybell="NO" 		
+keychange="NO"		
+cursor="NO"		
+scrnmap="NO"		
+font8x16="NO"		
+font8x14="NO"		
+font8x8="NO"		
+blanktime="300"		
+saver="NO"		
+moused_nondefault_enable="YES" 
+moused_enable="NO"	
+moused_type="auto"	
+moused_port="/dev/psm0"	
+moused_flags=""		
+mousechar_start="NO"	
+allscreens_flags=""	
+allscreens_kbdflags=""	
+mta_start_script="/etc/rc.sendmail"
+sendmail_enable="NO"	
+sendmail_pidfile="/var/run/sendmail.pid"	
+sendmail_procname="/usr/sbin/sendmail"		
+sendmail_flags="-L sm-mta -bd -q30m" 
+sendmail_submit_enable="YES"	
+sendmail_submit_flags="-L sm-mta -bd -q30m -ODaemonPortOptions=Addr=localhost"
+sendmail_outbound_enable="YES"	
+sendmail_outbound_flags="-L sm-queue -q30m" 
+sendmail_msp_queue_enable="YES"	
+sendmail_msp_queue_flags="-L sm-msp-queue -Ac -q30m"
+sendmail_rebuild_aliases="NO"	
+auditd_enable="NO"	
+auditd_program="/usr/sbin/auditd"	
+auditd_flags=""		
+cron_enable="YES"	
+cron_program="/usr/sbin/cron"	
+cron_dst="YES"		
+cron_flags=""		
+lpd_enable="NO"		
+lpd_program="/usr/sbin/lpd"	
+lpd_flags=""		
+nscd_enable="NO"	
+chkprintcap_enable="NO"	
+chkprintcap_flags="-d"	
+dumpdev="AUTO"		
+dumpdir="/var/crash"	
+savecore_flags=""	
+crashinfo_enable="YES"	
+crashinfo_program="/usr/sbin/crashinfo"	
+quota_enable="NO"	
+check_quotas="YES"	
+quotaon_flags="-a"	
+quotaoff_flags="-a"	
+quotacheck_flags="-a"	
+accounting_enable="NO"	
+ibcs2_enable="NO"	
+ibcs2_loaders="coff"	
+sysvipc_enable="NO"	
+linux_enable="NO"	
+svr4_enable="NO"	
+clear_tmp_enable="NO"	
+clear_tmp_X="YES" 	
+ldconfig_insecure="NO"	
+ldconfig_paths="/usr/lib/compat /usr/local/lib /usr/local/lib/compat/pkg"
+ldconfig32_paths="/usr/lib32" 
+ldconfig_paths_aout="/usr/lib/compat/aout /usr/local/lib/aout"
+ldconfig_local_dirs="/usr/local/libdata/ldconfig"
+ldconfig_local32_dirs="/usr/local/libdata/ldconfig32"
+kern_securelevel_enable="NO"	
+kern_securelevel="-1"	
+update_motd="YES"	
+entropy_file="/entropy"	
+entropy_dir="/var/db/entropy" 
+entropy_save_sz="2048"	
+entropy_save_num="8"	
+harvest_interrupt="YES"	
+harvest_ethernet="YES"	
+harvest_p_to_p="YES"	
+dmesg_enable="YES"	
+watchdogd_enable="NO"	
+watchdogd_flags=""	
+devfs_rulesets="/etc/defaults/devfs.rules /etc/devfs.rules" 
+devfs_system_ruleset=""	
+devfs_set_rulesets=""	
+performance_cx_lowest="HIGH"	
+performance_cpu_freq="NONE"	
+economy_cx_lowest="HIGH"	
+economy_cpu_freq="NONE"		
+virecover_enable="YES"	
+ugidfw_enable="NO"	
+newsyslog_enable="YES"	
+newsyslog_flags="-CN"	
+mixer_enable="YES"	
+jail_enable="NO"	
+jail_list=""		
+jail_set_hostname_allow="YES" 
+jail_socket_unixiproute_only="YES" 
+jail_sysvipc_allow="NO"	
+if [ -z "${source_rc_confs_defined}" ]; then
+	source_rc_confs_defined=yes
+	source_rc_confs () {
+		local i sourced_files
+		for i in ${rc_conf_files}; do
+			case ${sourced_files} in
+			*:$i:*)
+				;;
+			*)
+				sourced_files="${sourced_files}:$i:"
+				if [ -r $i ]; then
+					. $i
+				fi
+				;;
+			esac
+		done
+	}
+fi
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/profiles/xSMALL_/files/etc/dhclient-script	Sat Oct 15 02:31:07 2011 +0300
@@ -0,0 +1,1 @@
+/sbin/dhclient-script
\ No newline at end of file
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/profiles/xSMALL_/files/etc/fbtab	Sat Oct 15 02:31:07 2011 +0300
@@ -0,0 +1,4 @@
+# $FreeBSD$
+#
+#/dev/ttyv0	0600	/dev/console
+#/dev/ttyv0	0600	/dev/pcaudio:/dev/pcaudioctl
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/profiles/xSMALL_/files/etc/ftpusers	Sat Oct 15 02:31:07 2011 +0300
@@ -0,0 +1,25 @@
+# $FreeBSD$
+#
+# list of users disallowed any ftp access.
+# read by ftpd(8).
+root
+toor
+daemon
+operator
+bin
+tty
+kmem
+games
+news
+man
+sshd
+bind
+proxy
+_pflogd
+_dhcp
+uucp
+pop
+www
+nobody
+mailnull
+smmsp
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/profiles/xSMALL_/files/etc/gettytab	Sat Oct 15 02:31:07 2011 +0300
@@ -0,0 +1,49 @@
+default:\
+	:cb:ce:ck:lc:fd
+	:if=/etc/issue:
+c|std.300|300-baud:\
+	:np:nd
+f|std.1200|1200-baud:\
+	:np:fd
+6|std.2400|2400-baud:\
+	:np:sp
+7|std.4800|4800-baud:\
+	:np:sp
+2|std.9600|9600-baud:\
+	:np:sp
+g|std.19200|19200-baud:\
+	:np:sp
+std.38400|38400-baud:\
+	:np:sp
+std.57600|57600-baud:\
+	:np:sp
+std.115200|115200-baud:\
+	:np:sp
+std.230400|230400-baud:\
+	:np:sp
+local.9600|CLOCAL tty @ 9600 Bd:\
+	:c0
+	:o0
+	:i0
+	:l0
+	:sp
+P|Pc|Pc console:\
+	:ht:np:sp
+8|T9600|CRT with hardcopy:\
+	:nx=T300:tc=9600-baud:
+9|T300|CRT with hardcopy (300):\
+	:nx=T9600:tc=300-baud:
+A|Auto-baud:\
+	:ab:sp
+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:
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/profiles/xSMALL_/files/etc/group	Sat Oct 15 02:31:07 2011 +0300
@@ -0,0 +1,31 @@
+# $FreeBSD$
+#
+wheel:*:0:root
+daemon:*:1:
+kmem:*:2:
+sys:*:3:
+tty:*:4:
+operator:*:5:root
+mail:*:6:
+bin:*:7:
+news:*:8:
+man:*:9:
+games:*:13:
+ftp:*:14:
+staff:*:20:
+sshd:*:22:
+smmsp:*:25:
+mailnull:*:26:
+guest:*:31:
+bind:*:53:
+proxy:*:62:
+authpf:*:63:
+_pflogd:*:64:
+_dhcp:*:65:
+uucp:*:66:
+dialer:*:68:
+network:*:69:
+audit:*:77:
+www:*:80:
+nogroup:*:65533:
+nobody:*:65534:
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/profiles/xSMALL_/files/etc/host.conf	Sat Oct 15 02:31:07 2011 +0300
@@ -0,0 +1,3 @@
+# Auto-generated from nsswitch.conf
+hosts
+dns
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/profiles/xSMALL_/files/etc/hosts	Sat Oct 15 02:31:07 2011 +0300
@@ -0,0 +1,2 @@
+::1			localhost localhost.my.domain
+127.0.0.1		localhost localhost.my.domain
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/profiles/xSMALL_/files/etc/hosts.allow	Sat Oct 15 02:31:07 2011 +0300
@@ -0,0 +1,20 @@
+ALL : ALL : allow
+ALL : PARANOID : RFC931 20 : deny
+ALL : localhost 127.0.0.1 : allow
+ALL : [::1] : allow
+sendmail : localhost : allow
+sendmail : ALL : allow
+exim : localhost : allow
+exim : ALL : allow
+rpcbind : ALL : deny
+ypserv : localhost : allow
+ypserv : ALL : deny
+ftpd : localhost : allow
+ftpd : ALL : allow
+fingerd : ALL \
+	: spawn (echo Finger. | \
+	 /usr/bin/mail -s "tcpd\: %[email protected]%h[%a] fingered me!" root) & \
+	: deny
+ALL : ALL \
+	: severity auth.info \
+	: twist /bin/echo "You are not welcome to use %d from %h."
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/profiles/xSMALL_/files/etc/hosts.equiv	Sat Oct 15 02:31:07 2011 +0300
@@ -0,0 +1,4 @@
+# $FreeBSD$
+#
+#localhost
+#my_very_good_friend.domain
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/profiles/xSMALL_/files/etc/hosts.lpd	Sat Oct 15 02:31:07 2011 +0300
@@ -0,0 +1,4 @@
+# $FreeBSD$
+#
+# See lpd(8)
+#machine.domain
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/profiles/xSMALL_/files/etc/inetd.conf	Sat Oct 15 02:31:07 2011 +0300
@@ -0,0 +1,59 @@
+# $FreeBSD$
+#
+# Internet server configuration database
+#
+# Define *both* IPv4 and IPv6 entries for dual-stack support.
+# To disable a service, comment it out by prefixing the line with '#'.
+# To enable a service, remove the '#' at the beginning of the line.
+#
+#ftp	stream	tcp	nowait	root	/mnt/usr/libexec/ftpd	ftpd -l -A
+ssh	stream	tcp	nowait	root	/usr/sbin/sshd		sshd -i -4
+telnet	stream	tcp	nowait	root	/usr/libexec/telnetd	telnetd
+#shell	stream	tcp	nowait	root	/usr/libexec/rshd	rshd
+#login	stream	tcp	nowait	root	/usr/libexec/rlogind	rlogind
+#finger	stream	tcp	nowait/3/10 nobody /usr/libexec/fingerd	fingerd -s
+#
+# run comsat as root to be able to print partial mailbox contents w/ biff,
+# or use the safer tty:tty to just print that new mail has been received.
+#comsat	dgram	udp	wait	tty:tty	/usr/libexec/comsat	comsat
+#
+# ntalk is required for the 'talk' utility to work correctly
+#ntalk	dgram	udp	wait	tty:tty	/usr/libexec/ntalkd	ntalkd
+#tftp	dgram	udp	wait	root	/usr/libexec/tftpd	tftpd -l -s /tftpboot
+#bootps	dgram	udp	wait	root	/usr/libexec/bootpd	bootpd
+#
+# "Small servers" -- used to be standard on, but we're more conservative
+# about things due to Internet security concerns.  Only turn on what you
+# need.
+#
+#daytime stream	tcp	nowait	root	internal
+#daytime dgram	udp	wait	root	internal
+#time	stream	tcp	nowait	root	internal
+#time	 dgram	udp	wait	root	internal
+#echo	stream	tcp	nowait	root	internal
+#echo	dgram	udp	wait	root	internal
+#discard stream	tcp	nowait	root	internal
+#discard dgram	udp	wait	root	internal
+#chargen stream	tcp	nowait	root	internal
+#chargen dgram	udp	wait	root	internal
+#
+# example entry for the optional pop3 server
+#
+#pop3	stream	tcp	nowait	root	/usr/local/libexec/popper	popper
+#
+# example entry for the optional imap4 server
+#
+#imap4	stream	tcp	nowait	root	/usr/local/libexec/imapd	imapd
+#
+# example entry for the optional nntp server
+#
+#nntp	stream	tcp	nowait	news	/usr/local/libexec/nntpd	nntpd
+#
+# Enable the following two entries to enable samba startup from inetd
+# (from the Samba documentation).  Enable the third entry to enable the swat
+# samba configuration tool.
+#
+#netbios-ssn stream tcp	nowait		root	/usr/local/sbin/smbd	smbd
+#netbios-ns dgram udp	wait		root	/usr/local/sbin/nmbd	nmbd
+#swat	stream	tcp	nowait/400	root	/usr/local/sbin/swat	swat
+
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/profiles/xSMALL_/files/etc/libalias.conf	Sat Oct 15 02:31:07 2011 +0300
@@ -0,0 +1,3 @@
+# $FreeBSD$
+/lib/libalias_ftp.so
+/lib/libalias_pptp.so
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/profiles/xSMALL_/files/etc/login.conf	Sat Oct 15 02:31:07 2011 +0300
@@ -0,0 +1,85 @@
+# login.conf - login class capabilities database.
+#
+# Remember to rebuild the database after each change to this file:
+#
+#	cap_mkdb /etc/login.conf
+#
+# This file controls resource limits, accounting limits and
+# default user environment settings.
+#
+# $FreeBSD$
+#
+
+# Default settings effectively disable resource limits, see the
+# examples below for a starting point to enable them.
+
+# defaults
+# These settings are used by login(1) by default for classless users
+# Note that entries like "cputime" set both "cputime-cur" and "cputime-max"
+#
+# Note that since a colon ':' is used to separate capability entries,
+# a \c escape sequence must be used to embed a literal colon in the
+# value or name of a capability (see the ``CGETNUM AND CGETSTR SYNTAX
+# AND SEMANTICS'' section of getcap(3) for more escape sequences).
+
+default:\
+	:passwd_format=md5:\
+	:copyright=/etc/COPYRIGHT:\
+	:welcome=/etc/motd:\
+	:setenv=BLOCKSIZE=K,FTP_PASSIVE_MODE=YES:\
+	:path=/sbin /bin /usr/sbin /usr/bin ~/bin:\
+	:nologin=/var/run/nologin:\
+	:cputime=unlimited:\
+	:datasize=unlimited:\
+	:stacksize=unlimited:\
+	:memorylocked=unlimited:\
+	:memoryuse=unlimited:\
+	:filesize=unlimited:\
+	:coredumpsize=0:\
+	:openfiles=unlimited:\
+	:maxproc=unlimited:\
+	:sbsize=unlimited:\
+	:vmemoryuse=unlimited:\
+	:swapuse=unlimited:\
+	:pseudoterminals=unlimited:\
+	:priority=0:\
+	:[email protected]:\
+	:umask=022:
+
+
+#
+# A collection of common class names - forward them all to 'default'
+# (login would normally do this anyway, but having a class name
+#  here suppresses the diagnostic)
+#
+standard:\
+	:tc=default:
+xuser:\
+	:tc=default:
+staff:\
+	:tc=default:
+daemon:\
+	:tc=default:
+news:\
+	:tc=default:
+dialer:\
+	:tc=default:
+
+#
+# Root can always login
+#
+# N.B.  login_getpwclass(3) will use this entry for the root account,
+#       in preference to 'default'.
+root:\
+	:ignorenologin:\
+	:tc=default:
+
+#
+# Russian Users Accounts. Setup proper environment variables.
+#
+russian|Russian Users Accounts:\
+	:charset=KOI8-R:\
+	:lang=ru_RU.KOI8-R:\
+	:tc=default:
+
+
Binary file profiles/xSMALL_/files/etc/login.conf.db has changed
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/profiles/xSMALL_/files/etc/master.passwd	Sat Oct 15 02:31:07 2011 +0300
@@ -0,0 +1,16 @@
+# $FreeBSD$
+#
+root:$1$z85gHT9g$Forx0Fu.1L/twcTcgMsTF/:0:0::0:0:Charlie &:/root:/bin/sh
+toor:*:0:0::0:0:Bourne-again Superuser:/root:
+daemon:*:1:1::0:0:Owner of many system processes:/root:/usr/sbin/nologin
+operator:*:2:5::0:0:System &:/:/usr/sbin/nologin
+bin:*:3:7::0:0:Binaries Commands and Source:/:/usr/sbin/nologin
+tty:*:4:65533::0:0:Tty Sandbox:/:/usr/sbin/nologin
+kmem:*:5:65533::0:0:KMem Sandbox:/:/usr/sbin/nologin
+ftp:*:14:5::0:0:Anonymous FTP Admin:/mnt:/nonexistent
+sshd:*:22:22::0:0:Secure Shell Daemon:/var/empty:/usr/sbin/nologin
+proxy:*:62:62::0:0:Packet Filter pseudo-user:/nonexistent:/usr/sbin/nologin
+_pflogd:*:64:64::0:0:pflogd privsep user:/var/empty:/usr/sbin/nologin
+_dhcp:*:65:65::0:0:dhcp programs:/var/empty:/usr/sbin/nologin
+www:*:80:80::0:0:World Wide Web Owner:/nonexistent:/usr/sbin/nologin
+nobody:*:65534:65534::0:0:Unprivileged user:/nonexistent:/usr/sbin/nologin
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/profiles/xSMALL_/files/etc/motd	Sat Oct 15 02:31:07 2011 +0300
@@ -0,0 +1,7 @@
+FreeBSD 9.0-CURRENT / ZRouter project
+Developed by Aleksandr Rybalko <[email protected]>
+under sponsorship from the Petri Consulting and
+D-Link International Pte Ltd Ukraine.
+
+Welcome to FreeBSD!
+
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/profiles/xSMALL_/files/etc/netconfig	Sat Oct 15 02:31:07 2011 +0300
@@ -0,0 +1,4 @@
+udp        tpi_clts      v     inet     udp     -       -
+tcp        tpi_cots_ord  v     inet     tcp     -       -
+rawip      tpi_raw       -     inet      -      -       -
+local      tpi_cots_ord  -     loopback  -      -       -
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/profiles/xSMALL_/files/etc/netstart	Sat Oct 15 02:31:07 2011 +0300
@@ -0,0 +1,20 @@
+#!/bin/sh
+. /etc/rc.subr
+load_rc_config 'XXX'
+_start=quietstart
+/etc/rc.d/cdevd ${_start}
+/etc/rc.d/hostid ${_start}
+/etc/rc.d/hostname ${_start}
+/etc/rc.d/ipmon ${_start}
+/etc/rc.d/ipfilter ${_start}
+/etc/rc.d/ipnat ${_start}
+/etc/rc.d/ipfs ${_start}
+/etc/rc.d/netif ${_start}
+/etc/rc.d/ipsec ${_start}
+/etc/rc.d/dhclient ${_start}
+/etc/rc.d/ppp ${_start}
+/etc/rc.d/ipfw ${_start}
+/etc/rc.d/routing ${_start}
+/etc/rc.d/mrouted ${_start}
+/etc/rc.d/routed ${_start}
+exit 0
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/profiles/xSMALL_/files/etc/network.subr	Sat Oct 15 02:31:07 2011 +0300
@@ -0,0 +1,1226 @@
+
+
+ifn_start()
+{
+	local ifn cfg
+	ifn="$1"
+	cfg=1
+
+	[ -z "$ifn" ] && err 1 "ifn_start called without an interface"
+
+	ifscript_up ${ifn} && cfg=0
+	ifconfig_up ${ifn} && cfg=0
+	ipv4_up ${ifn} && cfg=0
+	ipv6_up ${ifn} && cfg=0
+	ipx_up ${ifn} && cfg=0
+	childif_create ${ifn} && cfg=0
+
+	return $cfg
+}
+
+ifn_stop()
+{
+	local ifn cfg
+	ifn="$1"
+	cfg=1
+
+	[ -z "$ifn" ] && err 1 "ifn_stop called without an interface"
+
+	ipx_down ${ifn} && cfg=0
+	ipv6_down ${ifn} && cfg=0
+	ipv4_down ${ifn} && cfg=0
+	ifconfig_down ${ifn} && cfg=0
+	ifscript_down ${ifn} && cfg=0
+	childif_destroy ${ifn} && cfg=0
+
+	return $cfg
+}
+
+ifconfig_up()
+{
+	local _cfg _ipv6_opts ifconfig_args
+	_cfg=1
+
+	# ifconfig_IF
+	ifconfig_args=`ifconfig_getargs $1`
+	if [ -n "${ifconfig_args}" ]; then
+		ifconfig $1 ${ifconfig_args}
+		_cfg=0
+	fi
+
+	# inet6 specific
+	if afexists inet6; then
+		if ipv6if $1; then
+			if checkyesno ipv6_gateway_enable; then
+				_ipv6_opts="-accept_rtadv"
+			fi
+		else
+			if checkyesno ipv6_prefer; then
+				_ipv6_opts="-ifdisabled"
+			else
+				_ipv6_opts="ifdisabled"
+			fi
+
+			# backward compatibility: $ipv6_enable
+			case $ipv6_enable in
+			[Yy][Ee][Ss])
+				_ipv6_opts="${_ipv6_opts} accept_rtadv"
+				;;
+			esac
+		fi
+
+		if [ -n "${_ipv6_opts}" ]; then
+			ifconfig $1 inet6 ${_ipv6_opts}
+		fi
+
+		# ifconfig_IF_ipv6
+		ifconfig_args=`ifconfig_getargs $1 ipv6`
+		if [ -n "${ifconfig_args}" ]; then
+			ifconfig $1 inet6 -ifdisabled
+			ifconfig $1 ${ifconfig_args}
+			_cfg=0
+		fi
+
+		# backward compatiblity: $ipv6_ifconfig_IF
+		ifconfig_args=`get_if_var $1 ipv6_ifconfig_IF`
+		if [ -n "${ifconfig_args}" ]; then
+			warn "\$ipv6_ifconfig_$1 is obsolete." \
+			    "  Use ifconfig_$1_ipv6 instead."
+			ifconfig $1 inet6 -ifdisabled
+			ifconfig $1 inet6 ${ifconfig_args}
+			_cfg=0
+		fi
+	fi
+
+	if [ ${_cfg} -eq 0 ]; then
+		ifconfig $1 up
+	fi
+
+	if wpaif $1; then
+		/etc/rc.d/wpa_supplicant start $1
+		_cfg=0		# XXX: not sure this should count
+	fi
+
+	if dhcpif $1; then
+		if [ $_cfg -ne 0 ] ; then
+			ifconfig $1 up
+		fi
+		if syncdhcpif $1; then
+			/etc/rc.d/dhclient start $1
+		fi
+		_cfg=0
+	fi
+
+	return $_cfg
+}
+
+ifconfig_down()
+{
+	local _cfg
+	_cfg=1
+
+	if wpaif $1; then
+		/etc/rc.d/wpa_supplicant stop $1
+		_cfg=0
+	fi
+
+	if dhcpif $1; then
+		/etc/rc.d/dhclient stop $1
+		_cfg=0
+	fi
+
+	if ifexists $1; then
+		ifconfig $1 down
+		_cfg=0
+	fi
+
+	return $_cfg
+}
+
+get_if_var()
+{
+	local _if _punct _var _default prefix suffix
+
+	if [ $# -ne 2 -a $# -ne 3 ]; then
+		err 3 'USAGE: get_if_var name var [default]'
+	fi
+
+	_if=$1
+	_punct=". - / +"
+	for _punct_c in $_punct; do
+		_if=`ltr ${_if} ${_punct_c} '_'`
+	done
+	_var=$2
+	_default=$3
+
+	prefix=${_var%%IF*}
+	suffix=${_var##*IF}
+	eval echo \${${prefix}${_if}${suffix}-${_default}}
+}
+
+_ifconfig_getargs()
+{
+	local _ifn _af
+	_ifn=$1
+	_af=${2+_$2}
+
+	if [ -z "$_ifn" ]; then
+		return 1
+	fi
+
+	get_if_var $_ifn ifconfig_IF$_af "$ifconfig_DEFAULT"
+}
+
+ifconfig_getargs()
+{
+	local _tmpargs _arg _args
+	_tmpargs=`_ifconfig_getargs $1 $2`
+	if [ $? -eq 1 ]; then
+		return 1
+	fi
+	_args=
+
+	for _arg in $_tmpargs; do
+		case $_arg in
+		[Dd][Hh][Cc][Pp]) ;;
+		[Nn][Oo][Aa][Uu][Tt][Oo]) ;;
+		[Nn][Oo][Ss][Yy][Nn][Cc][Dd][Hh][Cc][Pp]) ;;
+		[Ss][Yy][Nn][Cc][Dd][Hh][Cc][Pp]) ;;
+		[Ww][Pp][Aa]) ;;
+		*)
+			_args="$_args $_arg"
+			;;
+		esac
+	done
+
+	echo $_args
+}
+
+autoif()
+{
+	local _tmpargs _arg
+	_tmpargs=`_ifconfig_getargs $1`
+
+	for _arg in $_tmpargs; do
+		case $_arg in
+		[Nn][Oo][Aa][Uu][Tt][Oo])
+			return 1
+			;;
+		esac
+	done
+
+	return 0
+}
+
+dhcpif()
+{
+	local _tmpargs _arg
+	_tmpargs=`_ifconfig_getargs $1`
+
+	for _arg in $_tmpargs; do
+		case $_arg in
+		[Dd][Hh][Cc][Pp])
+			return 0
+			;;
+		[Nn][Oo][Ss][Yy][Nn][Cc][Dd][Hh][Cc][Pp])
+			return 0
+			;;
+		[Ss][Yy][Nn][Cc][Dd][Hh][Cc][Pp])
+			return 0
+			;;
+		esac
+	done
+
+	return 1
+}
+
+syncdhcpif()
+{
+	local _tmpargs _arg
+	_tmpargs=`_ifconfig_getargs $1`
+
+	for _arg in $_tmpargs; do
+		case $_arg in
+		[Nn][Oo][Ss][Yy][Nn][Cc][Dd][Hh][Cc][Pp])
+			return 1
+			;;
+		[Ss][Yy][Nn][Cc][Dd][Hh][Cc][Pp])
+			return 0
+			;;
+		esac
+	done
+
+	checkyesno synchronous_dhclient
+}
+
+wpaif()
+{
+	local _tmpargs _arg
+	_tmpargs=`_ifconfig_getargs $1`
+
+	for _arg in $_tmpargs; do
+		case $_arg in
+		[Ww][Pp][Aa])
+			return 0
+			;;
+		esac
+	done
+
+	return 1
+}
+
+afexists()
+{
+	local _af
+	_af=$1
+
+	case ${_af} in
+	inet)
+		${SYSCTL_N} net.inet > /dev/null 2>&1
+		;;
+	inet6)
+		${SYSCTL_N} net.inet6 > /dev/null 2>&1
+		;;
+	ipx)
+		${SYSCTL_N} net.ipx > /dev/null 2>&1
+		;;
+	atm)
+		if [ -x /sbin/atmconfig ]; then
+			/sbin/atmconfig diag list > /dev/null 2>&1
+		else
+			return 1
+		fi
+		;;
+	*)
+		err 1 "afexists(): Unsupported address family: $_af"
+		;;
+	esac
+}
+
+noafif()
+{
+	local _if
+	_if=$1
+
+	case $_if in
+	pflog[0-9]*|\
+	pfsync[0-9]*|\
+	an[0-9]*|\
+	ath[0-9]*|\
+	ipw[0-9]*|\
+	iwi[0-9]*|\
+	iwn[0-9]*|\
+	ral[0-9]*|\
+	wi[0-9]*|\
+	wl[0-9]*|\
+	wpi[0-9]*)
+		return 0
+		;;
+	esac
+
+	return 1
+}
+
+ipv6if()
+{
+	local _if _tmpargs i
+	_if=$1
+
+	if ! afexists inet6; then
+		return 1
+	fi
+
+	# lo0 is always IPv6-enabled
+	case $_if in
+	lo0)
+		return 0
+		;;
+	esac
+
+	# True if $ifconfig_IF_ipv6 is defined.
+	_tmpargs=`_ifconfig_getargs $_if ipv6`
+	if [ -n "${_tmpargs}" ]; then
+		return 0
+	fi
+
+	# backward compatibility: True if $ipv6_ifconfig_IF is defined.
+	_tmpargs=`get_if_var $_if ipv6_ifconfig_IF`
+	if [ -n "${_tmpargs}" ]; then
+		return 0
+	fi
+
+	case "${ipv6_network_interfaces}" in
+	[Aa][Uu][Tt][Oo])
+		return 0
+		;;
+	''|[Nn][Oo][Nn][Ee])
+		return 1
+		;;
+	esac
+
+	for i in ${ipv6_network_interfaces}; do
+		if [ "$i" = "$_if" ]; then
+			return 0
+		fi
+	done
+
+	return 1
+}
+
+ipv6_autoconfif()
+{
+	local _if _tmpargs _arg
+	_if=$1
+
+	if ! ipv6if $_if; then
+		return 1
+	fi
+	if noafif $_if; then
+		return 1
+	fi
+	if checkyesno ipv6_gateway_enable; then
+		return 1
+	fi
+	_tmpargs=`get_if_var $_if ipv6_prefix_IF`
+	if [ -n "${_tmpargs}" ]; then
+		return 1
+	fi
+
+	case $_if in
+	lo0|\
+	stf[0-9]*|\
+	faith[0-9]*|\
+	lp[0-9]*|\
+	sl[0-9]*|\
+	pflog[0-9]*|\
+	pfsync[0-9]*)
+		return 1
+		;;
+	esac
+
+	# backward compatibility: $ipv6_enable
+	case $ipv6_enable in
+	[Yy][Ee][Ss])
+		return 0
+		;;
+	esac
+
+	_tmpargs=`_ifconfig_getargs $_if ipv6`
+	for _arg in $_tmpargs; do
+		case $_arg in
+		accept_rtadv)
+			return 0
+			;;
+		esac
+	done
+
+	# backward compatibility: $ipv6_ifconfig_IF
+	_tmpargs=`get_if_var $_if ipv6_ifconfig_IF`
+	for _arg in $_tmpargs; do
+		case $_arg in
+		accept_rtadv)
+			return 0
+			;;
+		esac
+	done
+
+	return 1
+}
+
+ifexists()
+{
+	[ -z "$1" ] && return 1
+	ifconfig -n $1 > /dev/null 2>&1
+}
+
+ipv4_up()
+{
+	local _if _ret
+	_if=$1
+	_ret=1
+
+	ifalias_up ${_if} inet && _ret=0
+	ipv4_addrs_common ${_if} alias && _ret=0
+
+	return $_ret
+}
+
+ipv6_up()
+{
+	local _if _ret
+	_if=$1
+	_ret=1
+
+	if ! ipv6if $_if; then
+		return 0
+	fi
+
+	ifalias_up ${_if} inet6 && _ret=0
+	ipv6_prefix_hostid_addr_up ${_if} && _ret=0
+	ipv6_accept_rtadv_up ${_if} && _ret=0
+
+	# wait for DAD
+	sleep `${SYSCTL_N} net.inet6.ip6.dad_count`
+	sleep 1
+
+	return $_ret
+}
+
+ipv4_down()
+{
+	local _if _ifs _ret inetList oldifs _inet
+	_if=$1
+	_ifs="^"
+	_ret=1
+
+	inetList="`ifconfig ${_if} | grep 'inet ' | tr "\n" "$_ifs"`"
+
+	oldifs="$IFS"
+	IFS="$_ifs"
+	for _inet in $inetList ; do
+		# get rid of extraneous line
+		[ -z "$_inet" ] && break
+
+		_inet=`expr "$_inet" : '.*\(inet \([0-9]\{1,3\}\.\)\{3\}[0-9]\{1,3\}\).*'`
+
+		IFS="$oldifs"
+		ifconfig ${_if} ${_inet} delete
+		IFS="$_ifs"
+		_ret=0
+	done
+	IFS="$oldifs"
+
+	ifalias_down ${_if} inet && _ret=0
+	ipv4_addrs_common ${_if} -alias && _ret=0
+
+	return $_ret
+}
+
+ipv6_down()
+{
+	local _if _ifs _ret inetList oldifs _inet6
+	_if=$1
+	_ifs="^"
+	_ret=1
+
+	if ! ipv6if $_if; then
+		return 0
+	fi
+
+	ipv6_accept_rtadv_down ${_if} && _ret=0
+	ifalias_down ${_if} inet6 && _ret=0
+
+	inetList="`ifconfig ${_if} | grep 'inet6 ' | tr "\n" "$_ifs"`"
+
+	oldifs="$IFS"
+	IFS="$_ifs"
+	for _inet6 in $inetList ; do
+		# get rid of extraneous line
+		[ -z "$_inet6" ] && break
+
+		_inet6=`expr "$_inet6" : '.*\(inet6 \([0-9a-f:]*\)\).*'`
+
+		IFS="$oldifs"
+		ifconfig ${_if} ${_inet6} -alias
+		IFS="$_ifs"
+		_ret=0
+	done
+	IFS="$oldifs"
+
+	return $_ret
+}
+
+ipv4_addrs_common()
+{
+	local _ret _if _action _cidr _cidr_addr
+	local _ipaddr _netmask _range _ipnet _iplow _iphigh _ipcount 
+	_ret=1
+	_if=$1
+	_action=$2
+    
+	# get ipv4-addresses
+	cidr_addr=`get_if_var $_if ipv4_addrs_IF`
+    
+	for _cidr in ${cidr_addr}; do
+		_ipaddr=${_cidr%%/*}
+		_netmask="/"${_cidr##*/}
+		_range=${_ipaddr##*.}
+		_ipnet=${_ipaddr%.*}
+		_iplow=${_range%-*}
+		_iphigh=${_range#*-}
+
+		# clear netmask when removing aliases
+		if [ "${_action}" = "-alias" ]; then
+			_netmask=""
+		fi
+        
+		_ipcount=${_iplow}
+		while [ "${_ipcount}" -le "${_iphigh}" ]; do
+			eval "ifconfig ${_if} ${_action} ${_ipnet}.${_ipcount}${_netmask}"
+			_ipcount=$((${_ipcount}+1))
+			_ret=0
+
+			# only the first ipaddr in a subnet need the real netmask
+			if [ "${_action}" != "-alias" ]; then
+				_netmask="/32"
+			fi
+		done
+	done
+
+	return $_ret
+}
+
+ifalias_up()
+{
+	local _ret
+	_ret=1
+
+	case "$2" in
+	inet)
+		_ret=`ifalias_ipv4_up "$1"`
+		;;
+	inet6)
+		_ret=`ifalias_ipv6_up "$1"`
+		;;
+	esac
+
+	return $_ret
+}
+
+ifalias_ipv4_up()
+{
+	local _ret alias ifconfig_args
+	_ret=1
+
+	# ifconfig_IF_aliasN which starts with "inet"
+	alias=0
+	while : ; do
+		ifconfig_args=`get_if_var $1 ifconfig_IF_alias${alias}`
+		case "${ifconfig_args}" in
+		inet\ *)
+			ifconfig $1 ${ifconfig_args} alias && _ret=0
+			;;
+		"")
+			break
+			;;
+		esac
+		alias=$((${alias} + 1))
+	done
+
+	return $_ret
+}
+
+ifalias_ipv6_up()
+{
+	local _ret alias ifconfig_args
+	_ret=1
+
+	# ifconfig_IF_aliasN which starts with "inet6"
+	alias=0
+	while : ; do
+		ifconfig_args=`get_if_var $1 ifconfig_IF_alias${alias}`
+		case "${ifconfig_args}" in
+		inet6\ *)
+			ifconfig $1 ${ifconfig_args} alias && _ret=0
+			;;
+		"")
+			break
+			;;
+		esac
+		alias=$((${alias} + 1))
+	done
+
+	# backward compatibility: ipv6_ifconfig_IF_aliasN.
+	alias=0
+	while : ; do
+		ifconfig_args=`get_if_var $1 ipv6_ifconfig_IF_alias${alias}`
+		case "${ifconfig_args}" in
+		"")
+			break
+			;;
+		*)
+			ifconfig $1 inet6 ${ifconfig_args} alias && _ret=0
+			warn "\$ipv6_ifconfig_$1_alias${alias} is obsolete." \
+			    "  Use ifconfig_$1_aliasN instead."
+			;;
+		esac
+		alias=$((${alias} + 1))
+	done
+
+	return $_ret
+}
+
+ifalias_down()
+{
+	local _ret
+	_ret=1
+
+	case "$2" in
+	inet)
+		_ret=`ifalias_ipv4_down "$1"`
+		;;
+	inet6)
+		_ret=`ifalias_ipv6_down "$1"`
+		;;
+	esac
+
+	return $_ret
+}
+
+ifalias_ipv4_down()
+{
+	local _ret alias ifconfig_args
+	_ret=1
+
+	# ifconfig_IF_aliasN which starts with "inet"
+	alias=0
+	while : ; do
+		ifconfig_args=`get_if_var $1 ifconfig_IF_alias${alias}`
+		case "${ifconfig_args}" in
+		inet\ *)
+			ifconfig $1 ${ifconfig_args} -alias && _ret=0
+			;;
+		"")
+			break
+			;;
+		esac
+		alias=$((${alias} + 1))
+	done
+
+	return $_ret
+}
+
+ifalias_ipv6_down()
+{
+	local _ret alias ifconfig_args
+	_ret=1
+
+	# ifconfig_IF_aliasN which starts with "inet6"
+	alias=0
+	while : ; do
+		ifconfig_args=`get_if_var $1 ifconfig_IF_alias${alias}`
+		case "${ifconfig_args}" in
+		inet6\ *)
+			ifconfig $1 ${ifconfig_args} -alias && _ret=0
+			;;
+		"")
+			break
+			;;
+		esac
+		alias=$((${alias} + 1))
+	done
+
+	# backward compatibility: ipv6_ifconfig_IF_aliasN.
+	alias=0
+	while : ; do
+		ifconfig_args=`get_if_var $1 ipv6_ifconfig_IF_alias${alias}`
+		case "${ifconfig_args}" in
+		"")
+			break
+			;;
+		*)
+			ifconfig $1 inet6 ${ifconfig_args} -alias && _ret=0
+			warn "\$ipv6_ifconfig_$1_alias${alias} is obsolete." \
+			    "  Use ifconfig_$1_aliasN instead."
+			;;
+		esac
+		alias=$((${alias} + 1))
+	done
+
+	return $_ret
+}
+
+ipv6_prefix_hostid_addr_up()
+{
+	local _if prefix laddr hostid j address
+	_if=$1
+	prefix=`get_if_var ${_if} ipv6_prefix_IF`
+
+	if [ -n "${prefix}" ]; then
+		laddr=`network6_getladdr ${_if}`
+		hostid=${laddr#fe80::}
+		hostid=${hostid%\%*}
+
+		for j in ${prefix}; do
+			address=$j\:${hostid}
+			ifconfig ${_if} inet6 ${address} prefixlen 64 alias
+
+			# if I am a router, add subnet router
+			# anycast address (RFC 2373).
+			if checkyesno ipv6_gateway_enable; then
+				ifconfig ${_if} inet6 $j:: prefixlen 64 \
+					alias anycast
+			fi
+		done
+	fi
+}
+
+ipv6_accept_rtadv_up()
+{
+	if ipv6_autoconfif $1; then
+		ifconfig $1 inet6 accept_rtadv up
+		rtsol ${rtsol_flags} $1
+	fi
+}
+
+ipv6_accept_rtadv_down()
+{
+	if ipv6_autoconfif $1; then
+		ifconfig $1 inet6 -accept_rtadv
+	fi
+}
+
+ifscript_up()
+{
+	if [ -r /etc/start_if.$1 ]; then
+		. /etc/start_if.$1
+		return 0
+	else
+		return 1
+	fi
+}
+
+ifscript_down()
+{
+	if [ -r /etc/stop_if.$1 ]; then
+		. /etc/stop_if.$1
+		return 0
+	else
+		return 1
+	fi
+}
+
+clone_up()
+{
+	local _prefix _list ifn
+	_prefix=
+	_list=
+
+	# create_args_IF
+	for ifn in ${cloned_interfaces}; do
+		ifconfig ${ifn} create `get_if_var ${ifn} create_args_IF`
+		if [ $? -eq 0 ]; then
+			_list="${_list}${_prefix}${ifn}"
+			[ -z "$_prefix" ] && _prefix=' '
+		fi
+	done
+	debug "Cloned: ${_list}"
+}
+
+clone_down()
+{
+	local _prefix _list ifn
+	_prefix=
+	_list=
+
+	for ifn in ${cloned_interfaces}; do
+		ifconfig ${ifn} destroy
+		if [ $? -eq 0 ]; then
+			_list="${_list}${_prefix}${ifn}"
+			[ -z "$_prefix" ] && _prefix=' '
+		fi
+	done
+	debug "Destroyed clones: ${_list}"
+}
+
+childif_create()
+{
+	local cfg child child_vlans child_wlans create_args debug_flags ifn i
+	cfg=1
+	ifn=$1
+
+	# Create wireless interfaces
+	child_wlans=`get_if_var $ifn wlans_IF`
+
+	for child in ${child_wlans}; do
+		create_args="wlandev $ifn `get_if_var $child create_args_IF`"
+		debug_flags="`get_if_var $child wlandebug_IF`"
+
+		if expr $child : 'wlan[0-9][0-9]*$' >/dev/null 2>&1; then
+			ifconfig $child create ${create_args} && cfg=0
+			if [ -n "${debug_flags}" ]; then
+				wlandebug -i $child ${debug_flags}
+			fi
+		else
+			i=`ifconfig wlan create ${create_args}`
+			if [ -n "${debug_flags}" ]; then
+				wlandebug -i $i ${debug_flags}
+			fi
+			ifconfig $i name $child && cfg=0
+		fi
+		if autoif $child; then
+			ifn_start $child
+		fi
+	done
+
+	# Create vlan interfaces
+	child_vlans=`get_if_var $ifn vlans_IF`
+
+	if [ -n "${child_vlans}" ]; then
+		load_kld if_vlan
+	fi
+
+	for child in ${child_vlans}; do
+		if expr $child : '[1-9][0-9]*$' >/dev/null 2>&1; then
+			child="${ifn}.${child}"
+			create_args=`get_if_var $child create_args_IF`
+			ifconfig $child create ${create_args} && cfg=0
+		else
+			create_args="vlandev $ifn `get_if_var $child create_args_IF`"
+			if expr $child : 'vlan[0-9][0-9]*$' >/dev/null 2>&1; then
+				ifconfig $child create ${create_args} && cfg=0
+			else
+				i=`ifconfig vlan create ${create_args}`
+				ifconfig $i name $child && cfg=0
+			fi
+		fi
+		if autoif $child; then
+			ifn_start $child
+		fi
+	done
+
+	return ${cfg}
+}
+
+childif_destroy()
+{
+	local cfg child child_vlans child_wlans ifn
+	cfg=1
+
+	child_wlans=`get_if_var $ifn wlans_IF`
+	for child in ${child_wlans}; do
+		if ! ifexists $child; then
+			continue
+		fi
+		if autoif $child; then
+			ifn_stop $child
+		fi
+		ifconfig $child destroy && cfg=0
+	done
+
+	child_vlans=`get_if_var $ifn vlans_IF`
+	for child in ${child_vlans}; do
+		if expr $child : '[1-9][0-9]*$' >/dev/null 2>&1; then
+			child="${ifn}.${child}"
+		fi
+		if ! ifexists $child; then
+			continue
+		fi
+		if autoif $child; then
+			ifn_stop $child
+		fi
+		ifconfig $child destroy && cfg=0
+	done
+
+	return ${cfg}
+}
+
+ng_mkpeer()
+{
+	ngctl -f - 2> /dev/null <<EOF
+mkpeer $*
+msg dummy nodeinfo
+EOF
+}
+
+ng_create_one()
+{
+	local t
+
+	ng_mkpeer $* | while read line; do
+		t=`expr "${line}" : '.* name="\([a-z]*[0-9]*\)" .*'`
+		if [ -n "${t}" ]; then
+			echo ${t}
+			return
+		fi
+	done
+}
+
+gif_up()
+{
+	local i peers
+
+	for i in ${gif_interfaces}; do
+		peers=`get_if_var $i gifconfig_IF`
+		case ${peers} in
+		'')
+			continue
+			;;
+		*)
+			if expr $i : 'gif[0-9][0-9]*$' >/dev/null 2>&1; then
+				ifconfig $i create >/dev/null 2>&1
+			else
+				gif=`ifconfig gif create`
+				ifconfig $gif name $i
+			fi
+			ifconfig $i tunnel ${peers}
+			ifconfig $i up
+			;;
+		esac
+	done
+}
+
+ng_fec_create()
+{
+	 local req_iface iface bogus
+	 req_iface="$1"
+
+	 ngctl shutdown ${req_iface}: > /dev/null 2>&1
+
+	 bogus=""
+	 while true; do
+		 iface=`ng_create_one fec dummy fec`
+		 if [ -z "${iface}" ]; then
+			 exit 2
+		 fi
+		 if [ "${iface}" = "${req_iface}" ]; then
+			 break
+		 fi
+		 bogus="${bogus} ${iface}"
+	 done
+
+	 for iface in ${bogus}; do
+		 ngctl shutdown ${iface}:
+	 done
+}
+
+fec_up()
+{
+	local i j
+
+	for i in ${fec_interfaces}; do
+		ng_fec_create $i
+		for j in `get_if_var $i fecconfig_IF`; do
+			case ${j} in
+			'')
+				continue
+				;;
+			*)
+				ngctl msg ${i}: add_iface "\"${j}\""
+				;;
+			esac
+		done
+	done
+}
+
+ipx_up()
+{
+	local ifn
+	ifn="$1"
+
+	# ifconfig_IF_ipx
+	ifconfig_args=`_ifconfig_getargs $ifn ipx`
+	if [ -n "${ifconfig_args}" ]; then
+		ifconfig ${ifn} ${ifconfig_args}
+		return 0
+	fi
+
+	return 1
+}
+
+ipx_down()
+{
+	local _if _ifs _ret ipxList oldifs _ipx
+	_if=$1
+	_ifs="^"
+	_ret=1
+	ipxList="`ifconfig ${_if} | grep 'ipx ' | tr "\n" "$_ifs"`"
+	oldifs="$IFS"
+
+	IFS="$_ifs"
+	for _ipx in $ipxList ; do
+		# get rid of extraneous line
+		[ -z "$_ipx" ] && break
+
+		_ipx=`expr "$_ipx" : '.*\(ipx [0-9a-h]\{1,8\}H*\.[0-9a-h]\{1,12\}\).*'`
+
+		IFS="$oldifs"
+		ifconfig ${_if} ${_ipx} delete
+		IFS="$_ifs"
+		_ret=0
+	done
+	IFS="$oldifs"
+
+	return $_ret
+}
+
+ifnet_rename()
+{
+	local _if _ifname
+
+	# ifconfig_IF_name
+	for _if in `ifconfig -l`; do
+		_ifname=`get_if_var $_if ifconfig_IF_name`
+		if [ ! -z "$_ifname" ]; then
+			ifconfig $_if name $_ifname
+		fi
+	done
+
+	return 0
+}
+
+list_net_interfaces()
+{
+	local type _tmplist _list _autolist _lo _if
+	type=$1
+
+	# Get a list of ALL the interfaces and make lo0 first if it's there.
+	#
+	_tmplist=
+	case ${network_interfaces} in
+	[Aa][Uu][Tt][Oo])
+		_autolist="`ifconfig -l`"
+		_lo=
+		for _if in ${_autolist} ; do
+			if autoif $_if; then
+				if [ "$_if" = "lo0" ]; then
+					_lo="lo0 "
+				else
+					_tmplist="${_tmplist} ${_if}"
+				fi
+			fi
+		done
+		_tmplist="${_lo}${_tmplist# }"
+		;;
+	*)
+		_tmplist="${network_interfaces} ${cloned_interfaces}"
+
+		# lo0 is effectively mandatory, so help prevent foot-shooting
+		#
+		case "$_tmplist" in
+		lo0|'lo0 '*|*' lo0'|*' lo0 '*) ;; # This is fine, do nothing
+		*)	_tmplist="lo0 ${_tmplist}" ;;
+		esac
+		;;
+	esac
+
+	_list=
+	case "$type" in
+	nodhcp)
+		for _if in ${_tmplist} ; do
+			if ! dhcpif $_if && \
+			   [ -n "`_ifconfig_getargs $_if`" ]; then
+				_list="${_list# } ${_if}"
+			fi
+		done
+		;;
+	dhcp)
+		for _if in ${_tmplist} ; do
+			if dhcpif $_if; then
+				_list="${_list# } ${_if}"
+			fi
+		done
+		;;
+	noautoconf)
+		for _if in ${_tmplist} ; do
+			if ! ipv6_autoconfif $_if && \
+			   [ -n "`_ifconfig_getargs $_if ipv6`" ]; then
+				_list="${_list# } ${_if}"
+			fi
+		done
+		;;
+	autoconf)
+		for _if in ${_tmplist} ; do
+			if ipv6_autoconfif $_if; then
+				_list="${_list# } ${_if}"
+			fi
+		done
+		;;
+	*)
+		_list=${_tmplist}
+		;;
+	esac
+
+	echo $_list
+
+	return 0
+}
+
+get_default_if()
+{
+	local routeget oldifs defif line
+	defif=
+	oldifs="$IFS"
+	IFS="
+"
+	for line in `route -n get $1 default 2>/dev/null`; do
+		case $line in
+		*interface:*)
+			defif=${line##*: }
+			;;
+		esac
+	done
+	IFS=${oldifs}
+
+	echo $defif
+}
+
+hexdigit()
+{
+	if [ $1 -lt 10 ]; then
+		echo $1
+	else
+		case $1 in
+		10)	echo a ;;
+		11)	echo b ;;
+		12)	echo c ;;
+		13)	echo d ;;
+		14)	echo e ;;
+		15)	echo f ;;
+		esac
+	fi
+}
+
+hexprint()
+{
+	local val str dig
+	val=$1
+	str=''
+	dig=`hexdigit $((${val} & 15))`
+	str=${dig}${str}
+	val=$((${val} >> 4))
+
+	while [ ${val} -gt 0 ]; do
+		dig=`hexdigit $((${val} & 15))`
+		str=${dig}${str}
+		val=$((${val} >> 4))
+	done
+
+	echo ${str}
+}
+
+is_wired_interface()
+{
+	local media
+
+	case `ifconfig $1 2>/dev/null` in
+	*media:?Ethernet*) media=Ethernet ;;
+	esac
+
+	test "$media" = "Ethernet"
+}
+
+network6_getladdr()
+{
+	local proto addr rest
+	ifconfig $1 2>/dev/null | while read proto addr rest; do
+		case ${proto} in
+		inet6)
+			case ${addr} in
+			fe80::*)
+				if [ -z "$2" ]; then
+					echo ${addr}
+					return
+				fi
+				case ${rest} in
+				*tentative*)
+					continue
+					;;
+				*)
+					echo ${addr}
+					return
+				esac
+			esac
+		esac
+	done
+}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/profiles/xSMALL_/files/etc/networks	Sat Oct 15 02:31:07 2011 +0300
@@ -0,0 +1,4 @@
+your-net	127				
+your-netmask	255.255.255			
+subnet1		127.0.1		alias1		
+subnet2		127.0.2		alias2		
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/profiles/xSMALL_/files/etc/nsswitch.conf	Sat Oct 15 02:31:07 2011 +0300
@@ -0,0 +1,11 @@
+group: compat
+group_compat: nis
+hosts: files dns
+networks: files
+passwd: compat
+passwd_compat: nis
+shells: files
+services: compat
+services_compat: nis
+protocols: files
+rpc: files
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/profiles/xSMALL_/files/etc/pam.d/login	Sat Oct 15 02:31:07 2011 +0300
@@ -0,0 +1,17 @@
+# PAM configuration for the "login" service
+#
+
+# auth
+#auth		sufficient	pam_self.so		no_warn
+auth		include		system
+
+# account
+#account		requisite	pam_securetty.so
+#account		required	pam_nologin.so
+account		include		system
+
+# session
+session		include		system
+
+# password
+password	include		system
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/profiles/xSMALL_/files/etc/pam.d/passwd	Sat Oct 15 02:31:07 2011 +0300
@@ -0,0 +1,3 @@
+# password
+#password	requisite	pam_passwdqc.so		enforce=users
+password	required	pam_unix.so		no_warn try_first_pass nullok
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/profiles/xSMALL_/files/etc/pam.d/system	Sat Oct 15 02:31:07 2011 +0300
@@ -0,0 +1,16 @@
+# System-wide defaults
+#
+
+# auth
+#auth		sufficient	pam_ssh.so		no_warn try_first_pass
+auth		required	pam_unix.so		no_warn try_first_pass nullok
+
+# account
+#account	required	pam_login_access.so
+account		required	pam_unix.so
+
+# session
+#session	required	pam_lastlog.so		no_fail
+
+# password
+password	required	pam_unix.so		no_warn try_first_pass
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/profiles/xSMALL_/files/etc/pam.d/telnetd	Sat Oct 15 02:31:07 2011 +0300
@@ -0,0 +1,18 @@
+# PAM configuration for the "telnetd" service
+#
+
+# auth
+#auth		sufficient	pam_ssh.so		no_warn try_first_pass
+auth		required	pam_unix.so		no_warn try_first_pass
+
+# account
+#account		required	pam_nologin.so
+#account		required	pam_login_access.so
+account		required	pam_unix.so
+
+# session
+#session 	optional	pam_ssh.so
+#session		required	pam_lastlog.so		no_fail
+
+# password
+password	required	pam_unix.so		no_warn try_first_pass
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/profiles/xSMALL_/files/etc/periodic/daily/420.status-network	Sat Oct 15 02:31:07 2011 +0300
@@ -0,0 +1,29 @@
+#!/bin/sh
+#
+# $FreeBSD$
+#
+
+# If there is a global system configuration file, suck it in.
+#
+if [ -r /etc/defaults/periodic.conf ]
+then
+    . /etc/defaults/periodic.conf
+    source_periodic_confs
+fi
+
+case "$daily_status_network_enable" in
+    [Yy][Ee][Ss])
+	echo ""
+	echo "Network interface status:"
+
+	case "$daily_status_network_usedns" in
+	    [Yy][Ee][Ss])
+		netstat -i && rc=0 || rc=3;;
+	    *)
+		netstat -in && rc=0 || rc=3;;
+	esac;;
+
+    *)  rc=0;;
+esac
+
+exit $rc
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/profiles/xSMALL_/files/etc/profile	Sat Oct 15 02:31:07 2011 +0300
@@ -0,0 +1,5 @@
+
+set -o emacs 2>/dev/null
+
+
+
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/profiles/xSMALL_/files/etc/protocols	Sat Oct 15 02:31:07 2011 +0300
@@ -0,0 +1,135 @@
+ip	0	IP		
+icmp	1	ICMP		
+igmp	2	IGMP		
+ggp	3	GGP		
+ipencap	4	IP-ENCAP	
+st2	5	ST2		
+tcp	6	TCP		
+cbt	7	CBT		
+egp	8	EGP		
+igp	9	IGP		
+bbn-rcc	10	BBN-RCC-MON	
+nvp	11	NVP-II		
+pup	12	PUP		
+argus	13	ARGUS		
+emcon	14	EMCON		
+xnet	15	XNET		
+chaos	16	CHAOS		
+udp	17	UDP		
+mux	18	MUX		
+dcn	19	DCN-MEAS	
+hmp	20	HMP		
+prm	21	PRM		
+xns-idp	22	XNS-IDP		
+trunk-1	23	TRUNK-1		
+trunk-2	24	TRUNK-2		
+leaf-1	25	LEAF-1		
+leaf-2	26	LEAF-2		
+rdp	27	RDP		
+irtp	28	IRTP		
+iso-tp4	29	ISO-TP4		
+netblt	30	NETBLT		
+mfe-nsp	31	MFE-NSP		
+merit-inp	32	MERIT-INP	
+dccp	33	DCCP		
+3pc	34	3PC		
+idpr	35	IDPR		
+xtp	36	XTP		
+ddp	37	DDP		
+idpr-cmtp	38	IDPR-CMTP	
+tp++	39	TP++		
+il	40	IL		
+ipv6	41	IPV6		
+sdrp	42	SDRP		
+ipv6-route	43	IPV6-ROUTE	
+ipv6-frag	44	IPV6-FRAG	
+idrp	45	IDRP		
+rsvp	46	RSVP		
+gre	47	GRE		
+dsr	48	DSR		
+bna	49	BNA		
+esp	50	ESP		
+ah	51	AH		
+i-nlsp	52	I-NLSP		
+swipe	53	SWIPE		
+narp	54	NARP		
+mobile	55	MOBILE		
+tlsp	56	TLSP		
+skip	57	SKIP		
+ipv6-icmp	58	IPV6-ICMP	icmp6	
+ipv6-nonxt	59	IPV6-NONXT	
+ipv6-opts	60	IPV6-OPTS	
+cftp	62	CFTP		
+sat-expak	64	SAT-EXPAK	
+kryptolan	65	KRYPTOLAN	
+rvd	66	RVD		
+ippc	67	IPPC		
+sat-mon	69	SAT-MON		
+visa	70	VISA		
+ipcv	71	IPCV		
+cpnx	72	CPNX		
+cphb	73	CPHB		
+wsn	74	WSN		
+pvp	75	PVP		
+br-sat-mon	76	BR-SAT-MON	
+sun-nd	77	SUN-ND		
+wb-mon	78	WB-MON		
+wb-expak	79	WB-EXPAK	
+iso-ip	80	ISO-IP		
+vmtp	81	VMTP		
+secure-vmtp	82	SECURE-VMTP	
+vines	83	VINES		
+ttp	84	TTP		
+nsfnet-igp	85	NSFNET-IGP	
+dgp	86	DGP		
+tcf	87	TCF		
+eigrp	88	EIGRP		
+ospf	89	OSPFIGP		
+sprite-rpc	90	Sprite-RPC	
+larp	91	LARP		
+mtp	92	MTP		
+ax.25	93	AX.25		
+ipip	94	IPIP		
+micp	95	MICP		
+scc-sp	96	SCC-SP		
+etherip	97	ETHERIP		
+encap	98	ENCAP		
+gmtp	100	GMTP		
+ifmp	101	IFMP		
+pnni	102	PNNI		
+pim	103	PIM		
+aris	104	ARIS		
+scps	105	SCPS		
+qnx	106	QNX		
+a/n	107	A/N		
+ipcomp	108	IPComp		
+snp	109	SNP		
+compaq-peer	110	Compaq-Peer	
+ipx-in-ip	111	IPX-in-IP	
+carp	112	CARP	vrrp		
+pgm	113	PGM		
+l2tp	115	L2TP		
+ddx	116	DDX		
+iatp	117	IATP		
+stp	118	STP		
+srp	119	SRP		
+uti	120	UTI		
+smp	121	SMP		
+sm	122	SM		
+ptp	123	PTP		
+isis	124	ISIS		
+fire	125	FIRE
+crtp	126	CRTP		
+crudp	127	CRUDP		
+sscopmce	128	SSCOPMCE
+iplt	129	IPLT
+sps	130	SPS		
+pipe	131	PIPE		
+sctp	132	SCTP		
+fc	133	FC		
+rsvp-e2e-ignore	134	RSVP-E2E-IGNORE	
+mobility-header	135	Mobility-Header	
+udplite	136	UDPLite		
+mpls-in-ip	137	MPLS-IN-IP	
+pfsync	240	PFSYNC		
+divert	258	DIVERT		
Binary file profiles/xSMALL_/files/etc/pwd.db has changed
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/profiles/xSMALL_/files/etc/rc	Sat Oct 15 02:31:07 2011 +0300
@@ -0,0 +1,53 @@
+#!/bin/sh
+
+stty status '^T'
+trap : 2
+trap "echo 'Boot interrupted'; exit 1" 3
+HOME=/
+PATH=/sbin:/bin:/usr/sbin:/usr/bin
+export HOME PATH
+
+echo f1 > /dev/led/status
+
+if [ "$1" = autoboot ]; then
+	autoboot=yes
+	_boot="faststart"
+	rc_fast=yes
+else
+	autoboot=no
+	_boot="quietstart"
+fi
+. /etc/rc.subr
+load_rc_config 'XXX'
+skip="-s nostart"
+files=`rcorder ${skip} /etc/rc.d/* 2>/dev/null`
+for _rc_elem in ${files}; do
+	run_rc_script ${_rc_elem} ${_boot}
+	case "$_rc_elem" in
+	*/${early_late_divider})	break ;;
+	esac
+done
+unset files local_rc
+case ${local_startup} in
+[Nn][Oo] | '') ;;
+*)	find_local_scripts_new ;;
+esac
+files=`rcorder ${skip} /etc/rc.d/* ${local_rc} 2>/dev/null`
+_skip_early=1
+for _rc_elem in ${files}; do
+	case "$_skip_early" in
+	1)	case "$_rc_elem" in
+		*/${early_late_divider})	_skip_early=0 ;;
+		esac
+		continue
+		;;
+	esac
+	run_rc_script ${_rc_elem} ${_boot}
+done
+echo ''
+
+date
+
+echo f9 > /dev/led/status
+
+exit 0
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/profiles/xSMALL_/files/etc/rc.conf	Sat Oct 15 02:31:07 2011 +0300
@@ -0,0 +1,46 @@
+
+
+update_freebsd_url="http://www.dlink.ua/files/products/ftp/pub/Router/dir320_freebsd_last.php"
+update_linux_url="http://www.dlink.ua/files/products/ftp/pub/Router/dir320.php"
+
+#ppp_umodule="umodem"
+#ppp_enable="YES"
+#ppp_mode="ddial"
+#ppp_nat="YES"
+#ppp_profile="papchap"
+
+buttons_enable="YES"
+buttons_pins="6 7"
+buttons_gpioc_dev="/dev/gpioc0"
+
+
+#ntpdate_enable="YES"
+#ntpdate_hosts="213.130.12.2"
+
+
+#firewall_enable="YES"
+firewall_type="OPEN"
+
+
+cloned_interfaces="vlan2"
+gateway_enable="YES"
+hostname="freebsd-dir-320.dlink.ua"
+ifconfig_bfe0="192.168.0.1/24"
+ifconfig_vlan2="DHCP vlan 2 vlandev bfe0"
+#defaultrouter="192.168.90.2"
+
+
+#sshd_enable="YES"
+inetd_enable="YES"
+inetd_flags="-wW -C 60 -a 192.168.0.1"
+#lpd_enable="YES"
+racoon_enable="YES"
+
+dumpdev="NO"
+sendmail_enable="NONE"
+
+harvest_interrupt="NO"
+harvest_ethernet="NO"
+harvest_p_to_p="NO"
+
+
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/profiles/xSMALL_/files/etc/rc.d/MAIN	Sat Oct 15 02:31:07 2011 +0300
@@ -0,0 +1,72 @@
+#!/bin/sh
+
+# PROVIDE: MAIN
+# REQUIRE: ADAPTATION
+
+. /etc/rc.subr
+. /etc/network.subr
+
+name="MAIN"
+start_cmd="main_start"
+start_precmd="main_prestart"
+start_postcmd="main_poststart"
+stop_cmd="main_stop"
+
+main_prestart()
+{
+	stty status '^T'
+	sysctl kern.coredump=0
+	sysctl net.inet.ip.forwarding=1
+	kldload random
+
+	md=`/sbin/mdconfig -a -t malloc -s 10m`
+	newfs -b 4096 -f 512 -n -o space /dev/${md} > /dev/null
+	mount /dev/${md} /tmp
+
+	mkdir -p /tmp/etc
+	mkdir -p /tmp/var/empty
+	mkdir -p /tmp/var/log
+	mkdir -p /tmp/var/run
+	mkdir -p /tmp/var/spool/lock
+	touch /tmp/var/log/all.log
+
+	syslogd -s
+
+	mount_unionfs /tmp/etc /etc
+
+	if [ -c /dev/map/config ]; then 
+		dd if=/dev/map/config of=/tmp/etc.tar.gz;
+		cd /tmp/ && tar xvzf /tmp/etc.tar.gz
+	fi
+
+	kldload ipfw
+	ipfw add 65000 allow all from any to any
+	ifconfig lo0 127.0.0.1/8
+	#ifconfig rt0 192.168.0.28/24
+	mpd  --background
+
+	inetd -wW
+
+}
+
+main_start()
+{
+}
+
+main_poststart()
+{
+}
+
+main_stop()
+{
+	if [ -c /dev/map/config ]; then 
+		cd /tmp/ && tar cvzf /tmp/etc.tar.gz etc/* ;
+		sysctl hw.cfi.rdonly=0
+		dd if=/tmp/etc.tar.gz of=/dev/map/config bs=64k conv=sync ;
+		sysctl hw.cfi.rdonly=1
+	fi
+}
+
+load_rc_config $name
+
+run_rc_command $*
\ No newline at end of file
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/profiles/xSMALL_/files/etc/rc.firewall	Sat Oct 15 02:31:07 2011 +0300
@@ -0,0 +1,157 @@
+#!/bin/sh
+if [ -z "${source_rc_confs_defined}" ]; then
+	if [ -r /etc/defaults/rc.conf ]; then
+		. /etc/defaults/rc.conf
+		source_rc_confs
+	elif [ -r /etc/rc.conf ]; then
+		. /etc/rc.conf
+	fi
+fi
+setup_loopback () {
+	${fwcmd} add 100 pass all from any to any via lo0
+	${fwcmd} add 200 deny all from any to 127.0.0.0/8
+	${fwcmd} add 300 deny ip from 127.0.0.0/8 to any
+}
+if [ -n "${1}" ]; then
+	firewall_type="${1}"
+fi
+. /etc/rc.subr
+. /etc/network.subr
+case ${firewall_quiet} in
+[Yy][Ee][Ss])
+	fwcmd="/sbin/ipfw -q"
+	;;
+*)
+	fwcmd="/sbin/ipfw"
+	;;
+esac
+${fwcmd} -f flush
+setup_loopback
+case ${firewall_type} in
+[Oo][Pp][Ee][Nn]|[Cc][Ll][Ii][Ee][Nn][Tt])
+	case ${natd_enable} in
+	[Yy][Ee][Ss])
+		if [ -n "${natd_interface}" ]; then
+			${fwcmd} add 50 divert natd ip4 from any to any via ${natd_interface}
+		fi
+		;;
+	esac
+	case ${firewall_nat_enable} in
+	[Yy][Ee][Ss])
+		if [ -n "${firewall_nat_interface}" ]; then
+			if echo "${firewall_nat_interface}" | \
+				grep -q -E '^[0-9]+(\.[0-9]+){0,3}$'; then
+				firewall_nat_flags="ip ${firewall_nat_interface} ${firewall_nat_flags}"
+			else
+				firewall_nat_flags="if ${firewall_nat_interface} ${firewall_nat_flags}"
+			fi
+			${fwcmd} nat 123 config log ${firewall_nat_flags}
+			${fwcmd} add 50 nat 123 ip4 from any to any via ${firewall_nat_interface}
+		fi
+		;;
+	esac
+esac
+case ${firewall_type} in
+[Oo][Pp][Ee][Nn])
+	${fwcmd} add 65000 pass all from any to any
+	;;
+[Cc][Ll][Ii][Ee][Nn][Tt])
+	net="$firewall_client_net"
+	${fwcmd} add pass all from ${net} to 255.255.255.255
+	${fwcmd} add pass all from me to ${net}
+	${fwcmd} add pass all from ${net} to me
+	${fwcmd} add pass tcp from any to any established
+	${fwcmd} add pass all from any to any frag
+	${fwcmd} add pass tcp from any to me 25 setup
+	${fwcmd} add pass tcp from me to any setup
+	${fwcmd} add deny tcp from any to any setup
+	${fwcmd} add pass udp from me to any 53 keep-state
+	${fwcmd} add pass udp from me to any 123 keep-state
+	;;
+[Ss][Ii][Mm][Pp][Ll][Ee])
+	oif="$firewall_simple_oif"
+	onet="$firewall_simple_onet"
+	iif="$firewall_simple_iif"
+	inet="$firewall_simple_inet"
+	${fwcmd} add deny all from ${inet} to any in via ${oif}
+	${fwcmd} add deny all from ${onet} to any in via ${iif}
+	${fwcmd} add deny all from any to 10.0.0.0/8 via ${oif}
+	${fwcmd} add deny all from any to 172.16.0.0/12 via ${oif}
+	${fwcmd} add deny all from any to 192.168.0.0/16 via ${oif}
+	${fwcmd} add deny all from any to 0.0.0.0/8 via ${oif}
+	${fwcmd} add deny all from any to 169.254.0.0/16 via ${oif}
+	${fwcmd} add deny all from any to 192.0.2.0/24 via ${oif}
+	${fwcmd} add deny all from any to 224.0.0.0/4 via ${oif}
+	${fwcmd} add deny all from any to 240.0.0.0/4 via ${oif}
+	case ${natd_enable} in
+	[Yy][Ee][Ss])
+		if [ -n "${natd_interface}" ]; then
+			${fwcmd} add divert natd ip4 from any to any via ${natd_interface}
+		fi
+		;;
+	esac
+	${fwcmd} add deny all from 10.0.0.0/8 to any via ${oif}
+	${fwcmd} add deny all from 172.16.0.0/12 to any via ${oif}
+	${fwcmd} add deny all from 192.168.0.0/16 to any via ${oif}
+	${fwcmd} add deny all from 0.0.0.0/8 to any via ${oif}
+	${fwcmd} add deny all from 169.254.0.0/16 to any via ${oif}
+	${fwcmd} add deny all from 192.0.2.0/24 to any via ${oif}
+	${fwcmd} add deny all from 224.0.0.0/4 to any via ${oif}
+	${fwcmd} add deny all from 240.0.0.0/4 to any via ${oif}
+	${fwcmd} add pass tcp from any to any established
+	${fwcmd} add pass all from any to any frag
+	${fwcmd} add pass tcp from any to me 25 setup
+	${fwcmd} add pass tcp from any to me 53 setup
+	${fwcmd} add pass udp from any to me 53
+	${fwcmd} add pass udp from me 53 to any
+	${fwcmd} add pass tcp from any to me 80 setup
+	${fwcmd} add deny log ip4 from any to any in via ${oif} setup proto tcp
+	${fwcmd} add pass tcp from any to any setup
+	${fwcmd} add pass udp from me to any 53 keep-state
+	${fwcmd} add pass udp from me to any 123 keep-state
+	;;
+[Ww][Oo][Rr][Kk][Ss][Tt][Aa][Tt][Ii][Oo][Nn])
+	${fwcmd} add check-state
+	${fwcmd} add pass tcp  from me to any established
+	${fwcmd} add pass tcp  from me to any setup keep-state
+	${fwcmd} add pass udp  from me to any       keep-state
+	${fwcmd} add pass icmp from me to any       keep-state
+	${fwcmd} add pass udp  from 0.0.0.0 68 to 255.255.255.255 67 out
+	${fwcmd} add pass udp  from any 67     to me 68 in
+	${fwcmd} add pass udp  from any 67     to 255.255.255.255 68 in
+	${fwcmd} add pass icmp from any to any icmptype 8
+	${fwcmd} add pass icmp from any to any icmptype 3,4,11
+	for i in ${firewall_allowservices} ; do
+	  for j in ${firewall_myservices} ; do
+	    ${fwcmd} add pass tcp from $i to me $j
+	  done
+	done
+	for i in ${firewall_trusted} ; do
+	  ${fwcmd} add pass ip from $i to me
+	done
+	${fwcmd} add 65000 count ip from any to any
+	for i in ${firewall_nologports} ; do
+	  ${fwcmd} add deny { tcp or udp } from any to any $i in
+	done
+	${fwcmd} add deny ip  from any to 255.255.255.255
+	${fwcmd} add deny ip  from any to 224.0.0.0/24 in	
+	${fwcmd} add deny udp from any to any 520 in
+	${fwcmd} add deny tcp from any 80,443 to any 1024-65535 in
+	log=""
+	if [ ${firewall_logdeny:-x} = "YES" -o ${firewall_logdeny:-x} = "yes" ] ; then
+	  log="log logamount 500"	
+	  sysctl net.inet.ip.fw.verbose=1 >/dev/null
+	fi
+	${fwcmd} add deny $log ip from any to any
+	;;
+[Cc][Ll][Oo][Ss][Ee][Dd])
+	${fwcmd} add 65000 deny ip from any to any
+	;;
+[Uu][Nn][Kk][Nn][Oo][Ww][Nn])
+	;;
+*)
+	if [ -r "${firewall_type}" ]; then
+		${fwcmd} ${firewall_flags} ${firewall_type}
+	fi
+	;;
+esac
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/profiles/xSMALL_/files/etc/rc.shutdown	Sat Oct 15 02:31:07 2011 +0300
@@ -0,0 +1,62 @@
+#!/bin/sh
+stty status '^T'
+trap : 2
+trap : 3	
+HOME=/
+PATH=/sbin:/bin:/usr/sbin:/usr/bin:/usr/local/sbin
+export HOME PATH
+. /etc/rc.subr
+load_rc_config 'XXX'
+reverse_list()
+{
+	_revlist=
+	for _revfile in $*; do
+		_revlist="$_revfile${script_name_sep}$_revlist"
+	done
+	echo $_revlist
+}
+_rcshutdown_watchdog=
+if [ -n "$rcshutdown_timeout" ]; then
+	debug "Initiating watchdog timer."
+	sleep $rcshutdown_timeout && (
+		_msg="$rcshutdown_timeout second watchdog"
+		_msg="$_msg timeout expired. Shutdown terminated."
+		logger -t rc.shutdown "$_msg"
+		echo "$_msg"
+		date
+		kill -KILL $$ >/dev/null 2>&1
+	) &
+	_rcshutdown_watchdog=$!
+fi
+rcorder_opts="-k shutdown"
+[ `/sbin/sysctl -n security.jail.jailed` -eq 1 ] && rcorder_opts="$rcorder_opts -s nojail"
+case ${local_startup} in
+[Nn][Oo] | '') ;;
+*)     find_local_scripts_new ;;
+esac
+files=`rcorder ${rcorder_opts} /etc/rc.d/* ${local_rc} 2>/dev/null`
+for _rc_elem in `reverse_list $files`; do
+	debug "run_rc_script $_rc_elem faststop"
+	run_rc_script $_rc_elem faststop
+done
+if [ -n "$_rcshutdown_watchdog" ]; then
+	pkill -TERM -P $_rcshutdown_watchdog >/dev/null 2>&1
+fi
+
+/bin/rm -f /etc/pwd.db
+/bin/rm -f /etc/spwd.db
+/usr/bin/tar czf /tmp/etc.tar.gz etc/* -C /tmp
+#dd if=/dev/mtd/rgdb /tmp/rgdb bs=65536 count=1
+#md5etc=`md5 /tmp/etc.tar.gz`
+#md5mtdetc=`md5 /tmp/rgdb`
+#if [ ${md5etc} != ${md5mtdetc}]; then
+echo "Saving /etc"
+/bin/dd if=/tmp/etc.tar.gz of=/dev/mtd/rgdb bs=64k count=1 conv=sync
+echo '.'
+#fi
+
+
+echo '.'
+# Kill unbreakable oinit
+kill -INT 1
+exit 0
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/profiles/xSMALL_/files/etc/rc.subr	Sat Oct 15 02:31:07 2011 +0300
@@ -0,0 +1,1271 @@
+
+: ${rcvar_manpage:='rc.conf(5)'}
+: ${RC_PID:=$$}; export RC_PID
+
+
+if [ -z "${_rc_subr_loaded}" ]; then
+
+_rc_subr_loaded="YES"
+
+SYSCTL="/sbin/sysctl"
+SYSCTL_N="${SYSCTL} -n"
+SYSCTL_W="${SYSCTL}"
+ID="/usr/bin/id"
+IDCMD="if [ -x $ID ]; then $ID -un; fi"
+PS="/bin/ps -ww"
+JID=`$PS -p $$ -o jid=`
+
+set_rcvar()
+{
+	case $# in
+	0)
+		echo ${name}_enable
+		;;
+	1)
+		echo ${1}_enable
+		;;
+	*)
+		debug "rcvar_define: \$$1=$2 is added" \
+		    " as a rc.conf(5) variable."
+
+		local _var
+		_var=$1
+		rcvars="${rcvars# } $_var"
+		eval ${_var}_defval=\"$2\"
+		shift 2
+		# encode multiple lines of _desc
+		for l in "[email protected]"; do
+			eval ${_var}_desc=\"\${${_var}_desc#^^}^^$l\"
+		done
+		eval ${_var}_desc=\"\${${_var}_desc#^^}\"
+		;;
+	esac
+}
+
+set_rcvar_obsolete()
+{
+	local _var
+	_var=$1
+	debug "rcvar_obsolete: \$$1(old) -> \$$2(new) is defined"
+
+	rcvars_obsolete="${rcvars_obsolete# } $1"
+	eval ${1}_newvar=\"$2\"
+	shift 2
+	eval ${_var}_obsolete_msg=\"$*\"
+}
+
+force_depend()
+{
+	_depend="$1"
+
+	info "${name} depends on ${_depend}, which will be forced to start."
+	if ! /etc/rc.d/${_depend} forcestart; then
+		warn "Unable to force ${_depend}. It may already be running."
+		return 1
+	fi
+	return 0
+}
+
+checkyesno()
+{
+	eval _value=\$${1}
+	debug "checkyesno: $1 is set to $_value."
+	case $_value in
+
+		#	"yes", "true", "on", or "1"
+	[Yy][Ee][Ss]|[Tt][Rr][Uu][Ee]|[Oo][Nn]|1)
+		return 0
+		;;
+
+		#	"no", "false", "off", or "0"
+	[Nn][Oo]|[Ff][Aa][Ll][Ss][Ee]|[Oo][Ff][Ff]|0)
+		return 1
+		;;
+	*)
+		warn "\$${1} is not set properly - see ${rcvar_manpage}."
+		return 1
+		;;
+	esac
+}
+
+reverse_list()
+{
+	_revlist=
+	for _revfile; do
+		_revlist="$_revfile $_revlist"
+	done
+	echo $_revlist
+}
+
+stop_boot()
+{
+	local always
+
+	case $1 in
+		#	"yes", "true", "on", or "1"
+        [Yy][Ee][Ss]|[Tt][Rr][Uu][Ee]|[Oo][Nn]|1)
+		always=true
+		;;
+	*)
+		always=false
+		;;
+	esac
+	if [ "$autoboot" = yes -o "$always" = true ]; then
+		echo "ERROR: ABORTING BOOT (sending SIGTERM to parent)!"
+		kill -TERM ${RC_PID}
+	fi
+	exit 1
+}
+
+mount_critical_filesystems()
+{
+	eval _fslist=\$critical_filesystems_${1}
+	for _fs in $_fslist; do
+		mount | (
+			_ismounted=false
+			while read what _on on _type type; do
+				if [ $on = $_fs ]; then
+					_ismounted=true
+				fi
+			done
+			if $_ismounted; then
+				:
+			else
+				mount $_fs >/dev/null 2>&1
+			fi
+		)
+	done
+}
+
+check_pidfile()
+{
+	_pidfile=$1
+	_procname=$2
+	_interpreter=$3
+	if [ -z "$_pidfile" -o -z "$_procname" ]; then
+		err 3 'USAGE: check_pidfile pidfile procname [interpreter]'
+	fi
+	if [ ! -f $_pidfile ]; then
+		debug "pid file ($_pidfile): not readable."
+		return
+	fi
+	read _pid _junk < $_pidfile
+	if [ -z "$_pid" ]; then
+		debug "pid file ($_pidfile): no pid in file."
+		return
+	fi
+	_find_processes $_procname ${_interpreter:-.} '-p '"$_pid"
+}
+
+check_process()
+{
+	_procname=$1
+	_interpreter=$2
+	if [ -z "$_procname" ]; then
+		err 3 'USAGE: check_process procname [interpreter]'
+	fi
+	_find_processes $_procname ${_interpreter:-.} '-ax'
+}
+
+_find_processes()
+{
+	if [ $# -ne 3 ]; then
+		err 3 'USAGE: _find_processes procname interpreter psargs'
+	fi
+	_procname=$1
+	_interpreter=$2
+	_psargs=$3
+
+	_pref=
+	if [ $_interpreter != "." ]; then	# an interpreted script
+		_script=${_chroot}${_chroot:+"/"}$_procname
+		if [ -r $_script ]; then
+			read _interp < $_script	# read interpreter name
+			case "$_interp" in
+			\#!*)
+				_interp=${_interp#\#!}	# strip #!
+				set -- $_interp
+				case $1 in
+				*/bin/env)
+					shift	# drop env to get real name
+					;;
+				esac
+				if [ $_interpreter != $1 ]; then
+					warn "\$command_interpreter $_interpreter != $1"
+				fi
+				;;
+			*)
+				warn "no shebang line in $_script"
+				set -- $_interpreter
+				;;
+			esac
+		else
+			warn "cannot read shebang line from $_script"
+			set -- $_interpreter
+		fi
+		_interp="$* $_procname"		# cleanup spaces, add _procname
+		_interpbn=${1##*/}
+		_fp_args='_argv'
+		_fp_match='case "$_argv" in
+		    ${_interp}|"${_interp} "*|"${_interpbn}: ${_procname}"*)'
+	else					# a normal daemon
+		_procnamebn=${_procname##*/}
+		_fp_args='_arg0 _argv'
+		_fp_match='case "$_arg0" in
+		    $_procname|$_procnamebn|${_procnamebn}:|"(${_procnamebn})"|"[${_procnamebn}]")'
+	fi
+
+	_proccheck="\
+		$PS 2>/dev/null -o pid= -o jid= -o command= $_psargs"' |
+		while read _npid _jid '"$_fp_args"'; do
+			'"$_fp_match"'
+				if [ "$JID" -eq "$_jid" ];
+				then echo -n "$_pref$_npid";
+				_pref=" ";
+				fi
+				;;
+			esac
+		done'
+
+	eval $_proccheck
+}
+
+wait_for_pids()
+{
+	_list="[email protected]"
+	if [ -z "$_list" ]; then
+		return
+	fi
+	_prefix=
+	while true; do
+		_nlist="";
+		for _j in $_list; do
+			if kill -0 $_j 2>/dev/null; then
+				_nlist="${_nlist}${_nlist:+ }$_j"
+			fi
+		done
+		if [ -z "$_nlist" ]; then
+			break
+		fi
+		_list=$_nlist
+		echo -n ${_prefix:-"Waiting for PIDS: "}$_list
+		_prefix=", "
+		pwait $_list 2>/dev/null || sleep 2
+	done
+	if [ -n "$_prefix" ]; then
+		echo "."
+	fi
+}
+
+check_startmsgs()
+{
+	if [ -n "$rc_quiet" ]; then
+		checkyesno rc_startmsgs
+	else
+		return 0
+	fi
+}
+
+run_rc_command()
+{
+	_return=0
+	rc_arg=$1
+	if [ -z "$name" ]; then
+		err 3 'run_rc_command: $name is not set.'
+	fi
+
+	# Don't repeat the first argument when passing additional command-
+	# line arguments to the command subroutines.
+	#
+	shift 1
+	rc_extra_args="$*"
+
+	_rc_prefix=
+	case "$rc_arg" in
+	fast*)				# "fast" prefix; don't check pid
+		rc_arg=${rc_arg#fast}
+		rc_fast=yes
+		rc_quiet=yes
+		;;
+	force*)				# "force" prefix; always run
+		rc_force=yes
+		_rc_prefix=force
+		rc_arg=${rc_arg#${_rc_prefix}}
+		if [ -n "${rcvar}" ]; then
+			eval ${rcvar}=YES
+		fi
+		;;
+	one*)				# "one" prefix; set ${rcvar}=yes
+		_rc_prefix=one
+		rc_arg=${rc_arg#${_rc_prefix}}
+		if [ -n "${rcvar}" ]; then
+			eval ${rcvar}=YES
+		fi
+		;;
+	quiet*)				# "quiet" prefix; omit some messages
+		_rc_prefix=quiet
+		rc_arg=${rc_arg#${_rc_prefix}}
+		rc_quiet=yes
+		;;
+	esac
+
+	eval _override_command=\$${name}_program
+	command=${_override_command:-$command}
+
+	_keywords="start stop restart rcvar $extra_commands"
+	rc_pid=
+	_pidcmd=
+	_procname=${procname:-${command}}
+
+					# setup pid check command
+	if [ -n "$_procname" ]; then
+		if [ -n "$pidfile" ]; then
+			_pidcmd='rc_pid=$(check_pidfile '"$pidfile $_procname $command_interpreter"')'
+		else
+			_pidcmd='rc_pid=$(check_process '"$_procname $command_interpreter"')'
+		fi
+		if [ -n "$_pidcmd" ]; then
+			_keywords="${_keywords} status poll"
+		fi
+	fi
+
+	if [ -z "$rc_arg" ]; then
+		rc_usage $_keywords
+	fi
+
+	if [ -n "$flags" ]; then	# allow override from environment
+		rc_flags=$flags
+	else
+		eval rc_flags=\$${name}_flags
+	fi
+	eval _chdir=\$${name}_chdir	_chroot=\$${name}_chroot \
+	    _nice=\$${name}_nice	_user=\$${name}_user \
+	    _group=\$${name}_group	_groups=\$${name}_groups
+
+	if [ -n "$_user" ]; then	# unset $_user if running as that user
+		if [ "$_user" = "$(eval $IDCMD)" ]; then
+			unset _user
+		fi
+	fi
+
+	eval $_pidcmd			# determine the pid if necessary
+
+	for _elem in $_keywords; do
+		if [ "$_elem" != "$rc_arg" ]; then
+			continue
+		fi
+					# if ${rcvar} is set, and $1 is not
+					# "rcvar", then run
+					#	checkyesno ${rcvar}
+					# and return if that failed
+					#
+		if [ -n "${rcvar}" -a "$rc_arg" != "rcvar" ]; then
+			if ! checkyesno ${rcvar}; then
+				if [ -n "${rc_quiet}" ]; then
+					return 0
+				fi
+				echo -n "Cannot '${rc_arg}' $name. Set ${rcvar} to "
+				echo -n "YES in /etc/rc.conf or use 'one${rc_arg}' "
+				echo "instead of '${rc_arg}'."
+				return 0
+			fi
+		fi
+
+					# if there's a custom ${XXX_cmd},
+					# run that instead of the default
+					#
+		eval _cmd=\$${rc_arg}_cmd \
+		     _precmd=\$${rc_arg}_precmd \
+		     _postcmd=\$${rc_arg}_postcmd
+
+		if [ -n "$_cmd" ]; then
+			_run_rc_precmd || return 1
+			_run_rc_doit "$_cmd $rc_extra_args" || return 1
+			_run_rc_postcmd
+			return $_return
+		fi
+
+		case "$rc_arg" in	# default operations...
+
+		status)
+			_run_rc_precmd || return 1
+			if [ -n "$rc_pid" ]; then
+				echo "${name} is running as pid $rc_pid."
+			else
+				echo "${name} is not running."
+				return 1
+			fi
+			_run_rc_postcmd
+			;;
+
+		start)
+			if [ -z "$rc_fast" -a -n "$rc_pid" ]; then
+				echo 1>&2 "${name} already running? (pid=$rc_pid)."
+				return 1
+			fi
+
+			if [ ! -x ${_chroot}${_chroot:+"/"}${command} ]; then
+				warn "run_rc_command: cannot run $command"
+				return 1
+			fi
+
+			if ! _run_rc_precmd; then
+				warn "failed precmd routine for ${name}"
+				return 1
+			fi
+
+					# setup the full command to run
+					#
+			check_startmsgs && echo "Starting ${name}."
+			if [ -n "$_chroot" ]; then
+				_doit="\
+${_nice:+nice -n $_nice }\
+chroot ${_user:+-u $_user }${_group:+-g $_group }${_groups:+-G $_groups }\
+$_chroot $command $rc_flags $command_args"
+			else
+				_doit="\
+${_chdir:+cd $_chdir && }\
+$command $rc_flags $command_args"
+				if [ -n "$_user" ]; then
+				    _doit="su -m $_user -c 'sh -c \"$_doit\"'"
+				fi
+				if [ -n "$_nice" ]; then
+					if [ -z "$_user" ]; then
+						_doit="sh -c \"$_doit\""
+					fi
+					_doit="nice -n $_nice $_doit"
+				fi
+			fi
+
+					# run the full command
+					#
+			if ! _run_rc_doit "$_doit"; then
+				warn "failed to start ${name}"
+				return 1
+			fi
+
+					# finally, run postcmd
+					#
+			_run_rc_postcmd
+			;;
+
+		stop)
+			if [ -z "$rc_pid" ]; then
+				[ -n "$rc_fast" ] && return 0
+				_run_rc_notrunning
+				return 1
+			fi
+
+			_run_rc_precmd || return 1
+
+					# send the signal to stop
+					#
+			echo "Stopping ${name}."
+			_doit=$(_run_rc_killcmd "${sig_stop:-TERM}")
+			_run_rc_doit "$_doit" || return 1
+
+					# wait for the command to exit,
+					# and run postcmd.
+			wait_for_pids $rc_pid
+
+			_run_rc_postcmd
+			;;
+
+		reload)
+			if [ -z "$rc_pid" ]; then
+				_run_rc_notrunning
+				return 1
+			fi
+
+			_run_rc_precmd || return 1
+
+			_doit=$(_run_rc_killcmd "${sig_reload:-HUP}")
+			_run_rc_doit "$_doit" || return 1
+
+			_run_rc_postcmd
+			;;
+
+		restart)
+					# prevent restart being called more
+					# than once by any given script
+					#
+			if ${_rc_restart_done:-false}; then
+				return 0
+			fi
+			_rc_restart_done=true
+
+			_run_rc_precmd || return 1
+
+			# run those in a subshell to keep global variables
+			( run_rc_command ${_rc_prefix}stop $rc_extra_args )
+			( run_rc_command ${_rc_prefix}start $rc_extra_args )
+			_return=$?
+			[ $_return -ne 0 ] && [ -z "$rc_force" ] && return 1
+
+			_run_rc_postcmd
+			;;
+
+		poll)
+			_run_rc_precmd || return 1
+			if [ -n "$rc_pid" ]; then
+				wait_for_pids $rc_pid
+			fi
+			_run_rc_postcmd
+			;;
+
+		rcvar)
+			echo -n "# $name"
+			if [ -n "$desc" ]; then
+				echo " : $desc"
+			else
+				echo ""
+			fi
+			echo "#"
+			# Get unique vars in $rcvar $rcvars
+			for _v in $rcvar $rcvars; do
+				case $v in
+				$_v\ *|\ *$_v|*\ $_v\ *) ;;
+				*)	v="${v# } $_v" ;;
+				esac
+			done
+
+			# Display variables.
+			for _v in $v; do
+				if [ -z "$_v" ]; then
+					continue
+				fi
+
+				eval _desc=\$${_v}_desc
+				eval _defval=\$${_v}_defval
+				_h="-"
+
+				eval echo \"$_v=\\\"\$$_v\\\"\"
+				# decode multiple lines of _desc
+				while [ -n "$_desc" ]; do
+					case $_desc in
+					*^^*)
+						echo "# $_h ${_desc%%^^*}"
+						_desc=${_desc#*^^}
+						_h=" "
+						;;
+					*)
+						echo "# $_h ${_desc}"
+						break
+						;;
+					esac
+				done
+				echo "#   (default: \"$_defval\")"
+			done
+			echo ""
+			;;
+
+		*)
+			rc_usage $_keywords
+			;;
+
+		esac
+		return $_return
+	done
+
+	echo 1>&2 "$0: unknown directive '$rc_arg'."
+	rc_usage $_keywords
+	# not reached
+}
+
+_run_rc_precmd()
+{
+	check_required_before "$rc_arg" || return 1
+
+	if [ -n "$_precmd" ]; then
+		debug "run_rc_command: ${rc_arg}_precmd: $_precmd $rc_extra_args"
+		eval "$_precmd $rc_extra_args"
+		_return=$?
+
+		# If precmd failed and force isn't set, request exit.
+		if [ $_return -ne 0 ] && [ -z "$rc_force" ]; then
+			return 1
+		fi
+	fi
+
+	check_required_after "$rc_arg" || return 1
+
+	return 0
+}
+
+_run_rc_postcmd()
+{
+	if [ -n "$_postcmd" ]; then
+		debug "run_rc_command: ${rc_arg}_postcmd: $_postcmd $rc_extra_args"
+		eval "$_postcmd $rc_extra_args"
+		_return=$?
+	fi
+	return 0
+}
+
+_run_rc_doit()
+{
+	debug "run_rc_command: doit: $*"
+	eval "[email protected]"
+	_return=$?
+
+	# If command failed and force isn't set, request exit.
+	if [ $_return -ne 0 ] && [ -z "$rc_force" ]; then
+		return 1
+	fi
+
+	return 0
+}
+
+_run_rc_notrunning()
+{
+	local _pidmsg
+
+	if [ -n "$pidfile" ]; then
+		_pidmsg=" (check $pidfile)."
+	else
+		_pidmsg=
+	fi
+	echo 1>&2 "${name} not running?${_pidmsg}"
+}
+
+_run_rc_killcmd()
+{
+	local _cmd
+
+	_cmd="kill -$1 $rc_pid"
+	if [ -n "$_user" ]; then
+		_cmd="su -m ${_user} -c 'sh -c \"${_cmd}\"'"
+	fi
+	echo "$_cmd"
+}
+
+run_rc_script()
+{
+	_file=$1
+	_arg=$2
+	if [ -z "$_file" -o -z "$_arg" ]; then
+		err 3 'USAGE: run_rc_script file arg'
+	fi
+
+	unset	name command command_args command_interpreter \
+		extra_commands pidfile procname \
+		rcvar rcvars rcvars_obsolete required_dirs required_files \
+		required_vars
+	eval unset ${_arg}_cmd ${_arg}_precmd ${_arg}_postcmd
+
+	case "$_file" in
+	/etc/rc.d/*.sh)			# no longer allowed in the base
+		warn "Ignoring old-style startup script $_file"
+		;;
+	*[~#]|*.OLD|*.bak|*.orig|*,v)	# scratch file; skip
+		warn "Ignoring scratch file $_file"
+		;;
+	*)				# run in subshell
+		if [ -x $_file ]; then
+			if [ -n "$rc_fast_and_loose" ]; then
+				set $_arg; . $_file
+			else
+				( trap "echo Script $_file interrupted; kill -QUIT $$" 3
+				  trap "echo Script $_file interrupted; exit 1" 2
+				  trap "echo Script $_file running" 29
+				  set $_arg; . $_file )
+			fi
+		fi
+		;;
+	esac
+}
+
+load_rc_config()
+{
+	local _name _var _defval _v _msg _new
+	_name=$1
+	if [ -z "$_name" ]; then
+		err 3 'USAGE: load_rc_config name'
+	fi
+
+	if ${_rc_conf_loaded:-false}; then
+		:
+	else
+		if [ -r /etc/defaults/rc.conf ]; then
+			debug "Sourcing /etc/defaults/rc.conf"
+			. /etc/defaults/rc.conf
+			source_rc_confs
+		elif [ -r /etc/rc.conf ]; then
+			debug "Sourcing /etc/rc.conf (/etc/defaults/rc.conf doesn't exist)."
+			. /etc/rc.conf
+		fi
+		_rc_conf_loaded=true
+	fi
+	if [ -f /etc/rc.conf.d/"$_name" ]; then
+		debug "Sourcing /etc/rc.conf.d/${_name}"
+		. /etc/rc.conf.d/"$_name"
+	fi
+
+	# Old variable names support
+	#
+	[ -n "$enable_quotas" ] && quota_enable="$enable_quotas"
+
+	# Set defaults if defined.
+	for _var in $rcvar $rcvars; do
+		_defval=`eval echo "\\\$${_var}_defval"`
+		if [ -n "$_defval" ]; then
+			eval : \${$_var:=\$${_var}_defval}
+		fi
+	done
+
+	# check obsolete rc.conf variables
+	for _var in $rcvars_obsolete; do
+		_v=`eval echo \\$$_var`
+		_msg=`eval echo \\$${_var}_obsolete_msg`
+		_new=`eval echo \\$${_var}_newvar`
+		case $_v in
+		"")
+			;;
+		*)
+			if [ -z "$_new" ]; then
+				_msg="Ignored."
+			else
+				eval $_new=\"\$$_var\"
+				if [ -z "$_msg" ]; then
+					_msg="Use \$$_new instead."
+				fi
+			fi
+			warn "\$$_var is obsolete.  $_msg"
+			;;
+		esac
+	done
+}
+
+load_rc_config_var()
+{
+	if [ $# -ne 2 ]; then
+		err 3 'USAGE: load_rc_config_var name var'
+	fi
+	eval $(eval '(
+		load_rc_config '$1' >/dev/null;
+                if [ -n "${'$2'}" -o "${'$2'-UNSET}" != "UNSET" ]; then
+			echo '$2'=\'\''${'$2'}\'\'';
+		fi
+	)' )
+}
+
+rc_usage()
+{
+	echo -n 1>&2 "Usage: $0 [fast|force|one]("
+
+	_sep=
+	for _elem; do
+		echo -n 1>&2 "$_sep$_elem"
+		_sep="|"
+	done
+	echo 1>&2 ")"
+	exit 1
+}
+
+err()
+{
+	exitval=$1
+	shift
+
+	if [ -x /usr/bin/logger ]; then
+		logger "$0: ERROR: $*"
+	fi
+	echo 1>&2 "$0: ERROR: $*"
+	exit $exitval
+}
+
+warn()
+{
+	if [ -x /usr/bin/logger ]; then
+		logger "$0: WARNING: $*"
+	fi
+	echo 1>&2 "$0: WARNING: $*"
+}
+
+info()
+{
+	case ${rc_info} in
+	[Yy][Ee][Ss]|[Tt][Rr][Uu][Ee]|[Oo][Nn]|1)
+		if [ -x /usr/bin/logger ]; then
+			logger "$0: INFO: $*"
+		fi
+		echo "$0: INFO: $*"
+		;;
+	esac
+}
+
+debug()
+{
+	case ${rc_debug} in
+	[Yy][Ee][Ss]|[Tt][Rr][Uu][Ee]|[Oo][Nn]|1)
+		if [ -x /usr/bin/logger ]; then
+			logger "$0: DEBUG: $*"
+		fi
+		echo 1>&2 "$0: DEBUG: $*"
+		;;
+	esac
+}
+
+backup_file()
+{
+	_action=$1
+	_file=$2
+	_cur=$3
+	_back=$4
+
+	if checkyesno backup_uses_rcs; then
+		_msg0="backup archive"
+		_msg1="update"
+
+		# ensure that history file is not locked
+		if [ -f $_cur,v ]; then
+			rcs -q -u -U -M $_cur
+		fi
+
+		# ensure after switching to rcs that the
+		# current backup is not lost
+		if [ -f $_cur ]; then
+			# no archive, or current newer than archive
+			if [ ! -f $_cur,v -o $_cur -nt $_cur,v ]; then
+				ci -q -f -u -t-"$_msg0" -m"$_msg1" $_cur
+				rcs -q -kb -U $_cur
+				co -q -f -u $_cur
+			fi
+		fi
+
+		case $_action in
+		add|update)
+			cp -p $_file $_cur
+			ci -q -f -u -t-"$_msg0" -m"$_msg1" $_cur
+			rcs -q -kb -U $_cur
+			co -q -f -u $_cur
+			chown root:wheel $_cur $_cur,v
+			;;
+		remove)
+			cp /dev/null $_cur
+			ci -q -f -u -t-"$_msg0" -m"$_msg1" $_cur
+			rcs -q -kb -U $_cur
+			chown root:wheel $_cur $_cur,v
+			rm $_cur
+			;;
+		esac
+	else
+		case $_action in
+		add|update)
+			if [ -f $_cur ]; then
+				cp -p $_cur $_back
+			fi
+			cp -p $_file $_cur
+			chown root:wheel $_cur
+			;;
+		remove)
+			mv -f $_cur $_back
+			;;
+		esac
+	fi
+}
+
+make_symlink()
+{
+	local src link linkdir _me
+	src="$1"
+	link="$2"
+	linkdir="`dirname $link`"
+	_me="make_symlink()"
+
+	if [ -z "$src" -o -z "$link" ]; then
+		warn "$_me: requires two arguments."
+		return 1
+	fi
+	if [ ! -d "$linkdir" ]; then
+		warn "$_me: the directory $linkdir does not exist."
+		return 1
+	fi
+	if ! ln -sf $src $link; then
+		warn "$_me: unable to make a symbolic link from $link to $src"
+		return 1
+	fi
+	return 0
+}
+
+devfs_rulesets_from_file()
+{
+	local file _err _me
+	file="$1"
+	_me="devfs_rulesets_from_file"
+	_err=0
+
+	if [ -z "$file" ]; then
+		warn "$_me: you must specify a file"
+		return 1
+	fi
+	if [ ! -e "$file" ]; then
+		debug "$_me: no such file ($file)"
+		return 0
+	fi
+	debug "reading rulesets from file ($file)"
+	{ while read line
+	do
+		case $line in
+		\#*)
+			continue
+			;;
+		\[*\]*)
+			rulenum=`expr "$line" : "\[.*=\([0-9]*\)\]"`
+			if [ -z "$rulenum" ]; then
+				warn "$_me: cannot extract rule number ($line)"
+				_err=1
+				break
+			fi
+			rulename=`expr "$line" : "\[\(.*\)=[0-9]*\]"`
+			if [ -z "$rulename" ]; then
+				warn "$_me: cannot extract rule name ($line)"
+				_err=1
+				break;
+			fi
+			eval $rulename=\$rulenum
+			debug "found ruleset: $rulename=$rulenum"
+			if ! /sbin/devfs rule -s $rulenum delset; then
+				_err=1
+				break
+			fi
+			;;
+		*)
+			rulecmd="${line%%"\#*"}"
+			# evaluate the command incase it includes
+			# other rules
+			if [ -n "$rulecmd" ]; then
+				debug "adding rule ($rulecmd)"
+				if ! eval /sbin/devfs rule -s $rulenum $rulecmd
+				then
+					_err=1
+					break
+				fi
+			fi
+			;;
+		esac
+		if [ $_err -ne 0 ]; then
+			debug "error in $_me"
+			break
+		fi
+	done } < $file
+	return $_err
+}
+
+devfs_init_rulesets()
+{
+	local file _me
+	_me="devfs_init_rulesets"
+
+	# Go through this only once
+	if [ -n "$devfs_rulesets_init" ]; then
+		debug "$_me: devfs rulesets already initialized"
+		return
+	fi
+	for file in $devfs_rulesets; do
+		devfs_rulesets_from_file $file || return 1
+	done
+	devfs_rulesets_init=1
+	debug "$_me: devfs rulesets initialized"
+	return 0
+}
+
+devfs_set_ruleset()
+{
+	local devdir rs _me
+	[ -n "$1" ] && eval rs=\$$1 || rs=
+	[ -n "$2" ] && devdir="-m "$2"" || devdir=
+	_me="devfs_set_ruleset"
+
+	if [ -z "$rs" ]; then
+		warn "$_me: you must specify a ruleset number"
+		return 1
+	fi
+	debug "$_me: setting ruleset ($rs) on mount-point (${devdir#-m })"
+	if ! /sbin/devfs $devdir ruleset $rs; then
+		warn "$_me: unable to set ruleset $rs to ${devdir#-m }"
+		return 1
+	fi
+	return 0
+}
+
+devfs_apply_ruleset()
+{
+	local devdir rs _me
+	[ -n "$1" ] && eval rs=\$$1 || rs=
+	[ -n "$2" ] && devdir="-m "$2"" || devdir=
+	_me="devfs_apply_ruleset"
+
+	if [ -z "$rs" ]; then
+		warn "$_me: you must specify a ruleset"
+		return 1
+	fi
+	debug "$_me: applying ruleset ($rs) to mount-point (${devdir#-m })"
+	if ! /sbin/devfs $devdir rule -s $rs applyset; then
+		warn "$_me: unable to apply ruleset $rs to ${devdir#-m }"
+		return 1
+	fi
+	return 0
+}
+
+devfs_domount()
+{
+	local devdir rs _me
+	devdir="$1"
+	[ -n "$2" ] && rs=$2 || rs=
+	_me="devfs_domount()"
+
+	if [ -z "$devdir" ]; then
+		warn "$_me: you must specify a mount-point"
+		return 1
+	fi
+	debug "$_me: mount-point is ($devdir), ruleset is ($rs)"
+	if ! mount -t devfs dev "$devdir"; then
+		warn "$_me: Unable to mount devfs on $devdir"
+		return 1
+	fi
+	if [ -n "$rs" ]; then
+		devfs_init_rulesets
+		devfs_set_ruleset $rs $devdir
+		devfs -m $devdir rule applyset
+	fi
+	return 0
+}
+
+devfs_mount_jail()
+{
+	local jdev rs _me
+	jdev="$1"
+	[ -n "$2" ] && rs=$2 || rs="devfsrules_jail"
+	_me="devfs_mount_jail"
+
+	devfs_init_rulesets
+	if ! devfs_domount "$jdev" $rs; then
+		warn "$_me: devfs was not mounted on $jdev"
+		return 1
+	fi
+	return 0
+}
+
+mount_md()
+{
+	if [ -n "$3" ]; then
+		flags="$3"
+	fi
+	/sbin/mdmfs $flags -s $1 md $2
+}
+
+load_kld()
+{
+	local _loaded _mod _opt _re
+
+	while getopts "e:m:" _opt; do
+		case "$_opt" in
+		e) _re="$OPTARG" ;;
+		m) _mod="$OPTARG" ;;
+		*) err 3 'USAGE: load_kld [-e regex] [-m module] file' ;;
+		esac
+	done
+	shift $(($OPTIND - 1))
+	if [ $# -ne 1 ]; then
+		err 3 'USAGE: load_kld [-e regex] [-m module] file'
+	fi
+	_mod=${_mod:-$1}
+	_loaded=false
+	if [ -n "$_re" ]; then
+		if kldstat -v | egrep -q -e "$_re"; then
+			_loaded=true
+		fi
+	else
+		if kldstat -q -m "$_mod"; then
+			_loaded=true
+		fi
+	fi
+	if ! $_loaded; then
+		if ! kldload "$1"; then
+			warn "Unable to load kernel module $1"
+			return 1
+		else
+			info "$1 kernel module loaded."
+		fi
+	else
+		debug "load_kld: $1 kernel module already loaded."
+	fi
+	return 0
+}
+
+ltr()
+{
+	local _str _src _dst _out _com
+	_str=$1
+	_src=$2
+	_dst=$3
+	_out=""
+
+	IFS=${_src}
+	for _com in ${_str}; do
+		if [ -z "${_out}" ]; then
+			_out="${_com}"
+		else
+			_out="${_out}${_dst}${_com}"
+		fi
+	done
+	echo "${_out}"
+}
+
+geli_make_list()
+{
+	local devices devices2
+	local provider mountpoint type options rest
+
+	# Create list of GELI providers from fstab.
+	while read provider mountpoint type options rest ; do
+		case ":${options}" in
+		:*noauto*)
+			noauto=yes
+			;;
+		*)
+			noauto=no
+			;;
+		esac
+
+		case ":${provider}" in
+		:#*)
+			continue
+			;;
+		*.eli)
+			# Skip swap devices.
+			if [ "${type}" = "swap" -o "${options}" = "sw" -o "${noauto}" = "yes" ]; then
+				continue
+			fi
+			devices="${devices} ${provider}"
+			;;
+		esac
+	done < /etc/fstab
+
+	# Append providers from geli_devices.
+	devices="${devices} ${geli_devices}"
+
+	for provider in ${devices}; do
+		provider=${provider%.eli}
+		provider=${provider#/dev/}
+		devices2="${devices2} ${provider}"
+	done
+
+	echo ${devices2}
+}
+
+find_local_scripts_old () {
+	zlist=''
+	slist=''
+	for dir in ${local_startup}; do
+		if [ -d "${dir}" ]; then
+			for file in ${dir}/[0-9]*.sh; do
+				grep '^# PROVIDE:' $file >/dev/null 2>&1 &&
+				    continue
+				zlist="$zlist $file"
+			done
+			for file in ${dir}/[^0-9]*.sh; do
+				grep '^# PROVIDE:' $file >/dev/null 2>&1 &&
+				    continue
+				slist="$slist $file"
+			done
+		fi
+	done
+}
+
+find_local_scripts_new () {
+	local_rc=''
+	for dir in ${local_startup}; do
+		if [ -d "${dir}" ]; then
+			for file in `grep -l '^# PROVIDE:' ${dir}/* 2>/dev/null`; do
+				case "$file" in
+				*.sample) ;;
+				*)	if [ -x "$file" ]; then
+						local_rc="${local_rc} ${file}"
+					fi
+					;;
+				esac
+			done
+		fi
+	done
+}
+
+check_required_before()
+{
+	local _f
+
+	case "$1" in
+	start)
+		for _f in $required_vars; do
+			if ! checkyesno $_f; then
+				warn "\$${_f} is not enabled."
+				if [ -z "$rc_force" ]; then
+					return 1
+				fi
+			fi
+		done
+
+		for _f in $required_dirs; do
+			if [ ! -d "${_f}/." ]; then
+				warn "${_f} is not a directory."
+				if [ -z "$rc_force" ]; then
+					return 1
+				fi
+			fi
+		done
+
+		for _f in $required_files; do
+			if [ ! -r "${_f}" ]; then
+				warn "${_f} is not readable."
+				if [ -z "$rc_force" ]; then
+					return 1
+				fi
+			fi
+		done
+		;;
+	esac
+
+	return 0
+}
+
+check_required_after()
+{
+	local _f _args
+
+	case "$1" in
+	start)
+		for _f in $required_modules; do
+			case "${_f}" in
+				*~*)	_args="-e ${_f#*~} ${_f%%~*}" ;;
+				*:*)	_args="-m ${_f#*:} ${_f%%:*}" ;;
+				*)	_args="${_f}" ;;
+			esac
+			if ! load_kld ${_args}; then
+				if [ -z "$rc_force" ]; then
+					return 1
+				fi
+			fi
+		done
+		;;
+	esac
+
+	return 0
+}
+
+fi
+
+_echoonce()
+{
+	local _var _msg _mode
+	_var=`eval echo \\$$1`
+	_msg=$2
+	_mode=$3
+
+	case $_mode in
+	1)	[ -n "$_var" ] && echo "$_msg" ;;
+	*)	[ -z "$_var" ] && echo -n "$_msg" && eval "$1=finished" ;;
+	esac
+}
+
+_rc_subr_loaded=:
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/profiles/xSMALL_/files/etc/reboot.sh	Sat Oct 15 02:31:07 2011 +0300
@@ -0,0 +1,3 @@
+#!/bin/sh
+
+kill -INT 1
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/profiles/xSMALL_/files/etc/remote	Sat Oct 15 02:31:07 2011 +0300
@@ -0,0 +1,37 @@
+unixshell|Unix Access:\
+	:pn=\@:tc=unix57600:
+dosbbs|DOS-based BBS:\
+	:pn=\@:tc=dos57600:
+unix57600|57600 Baud dial-out to a UNIX system:\
+	:el=^U^C^R^O^D^S^Q:ie=%$:oe=^D:tc=dial57600:
+unix33600|33600 Baud dial-out to a UNIX system:\
+	:el=^U^C^R^O^D^S^Q:ie=%$:oe=^D:tc=dial33600:
+dos57600|57600 Baud dial-out to a DOS system:\
+	:el=^U^C^R^O^D^S^Q:ie=%$:oe=^Z:pa=none:tc=dial57600:
+dial57600|57600 Baud Hayes attributes:\
+	br
+dial33600|33600 Baud Hayes attributes:\
+	br
+dial28800|28800 Baud Hayes attributes:\
+	br
+dial14400|14400 Baud Hayes attributes:\
+	br
+dial|Generic dialing parameters:\
+	:dv=/dev/cuau0:cu=/dev/cuau0:at=hayes:du:pa=none:
+cuau0c|cua0c:dv=/dev/cuau0:br
+uart0|com1:dv=/dev/cuau0:br
+uart1|com2:dv=/dev/cuau1:br
+uart2|com3:dv=/dev/cuau2:br
+uart3|com4:dv=/dev/cuau3:br
+uart4|com5:dv=/dev/cuau4:br
+uart5|com6:dv=/dev/cuau5:br
+uart6|com7:dv=/dev/cuau6:br
+uart7|com8:dv=/dev/cuau7:br
+ucom1:dv=/dev/cuaU0:br
+ucom2:dv=/dev/cuaU1:br
+ucom3:dv=/dev/cuaU2:br
+ucom4:dv=/dev/cuaU3:br
+ucom5:dv=/dev/cuaU4:br
+ucom6:dv=/dev/cuaU5:br
+ucom7:dv=/dev/cuaU6:br
+ucom8:dv=/dev/cuaU7:br
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/profiles/xSMALL_/files/etc/resolv.conf	Sat Oct 15 02:31:07 2011 +0300
@@ -0,0 +1,1 @@
+/tmp/etc/resolv.conf
\ No newline at end of file
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/profiles/xSMALL_/files/etc/rpc	Sat Oct 15 02:31:07 2011 +0300
@@ -0,0 +1,68 @@
+#
+# $FreeBSD$
+# rpc 88/08/01 4.0 RPCSRC; from 1.12   99/07/25 SMI
+#
+rpcbind		100000  portmap sunrpc rpcbind
+rstatd		100001	rstat rstat_svc rup perfmeter
+rusersd		100002	rusers
+nfs		100003	nfsprog
+ypserv		100004	ypprog
+mountd		100005	mount showmount
+ypbind		100007
+walld		100008	rwall shutdown
+yppasswdd	100009	yppasswd
+etherstatd	100010	etherstat
+rquotad		100011	rquotaprog quota rquota
+sprayd		100012	spray
+3270_mapper	100013
+rje_mapper	100014
+selection_svc	100015	selnsvc
+database_svc	100016
+rexd		100017	rex
+alis		100018
+sched		100019
+llockmgr	100020
+nlockmgr	100021
+x25.inr		100022
+statmon		100023
+status		100024
+bootparamd	100026	bootparam
+ypupdated	100028	ypupdate
+keyserv		100029	keyserver
+sunlink_mapper	100033
+tfsd		100037
+nsed		100038
+nsemntd		100039
+showfhd		100043	showfh
+ioadmd		100055	rpc.ioadmd
+NETlicense	100062
+sunisamd	100065
+debug_svc	100066	dbsrv
+cmsd		100068
+bugtraqd	100071
+kerbd		100078
+ttdbserver	100083	tooltalk
+event		100101	na.event        # SunNet Manager
+logger		100102	na.logger       # SunNet Manager
+sync		100104	na.sync
+hostperf	100107	na.hostperf
+activity	100109	na.activity     # SunNet Manager
+hostmem		100112	na.hostmem
+sample		100113	na.sample
+x25		100114	na.x25
+ping		100115	na.ping
+rpcnfs		100116	na.rpcnfs
+hostif		100117	na.hostif
+etherif		100118	na.etherif
+iproutes	100120	na.iproutes
+layers		100121	na.layers
+snmp		100122	na.snmp snmp-cmc snmp-synoptics snmp-unisys snmp-utk
+traffic		100123	na.traffic
+nfs_acl		100227
+sadmind		100232
+nisd		100300	rpc.nisd
+nispasswd	100303	rpc.nispasswdd
+ufsd		100233
+pcnfsd		150001	pcnfs
+amd		300019
+sgi_fam		391002		# file alteration monitor
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/profiles/xSMALL_/files/etc/save_etc	Sat Oct 15 02:31:07 2011 +0300
@@ -0,0 +1,36 @@
+#!/bin/sh
+
+DEVCONFIG=/dev/map/config
+BLOCK_SIZE=64
+GEOM_PART=`echo ${DEVCONFIG} | sed 's/\/dev\///; s!\/!\\\/!' `
+
+i=0
+for s in `sysctl kern.geom.conftxt | grep "${GEOM_PART}"` ; do
+	i=$(( ${i} + 1 )) ;
+	if [ ${i} == 4 ] ; then
+    		DEVCONFIGSIZE=${s} ;
+	fi ;
+done
+
+DEVCONFIGBLKS=$((${DEVCONFIGSIZE} / ${BLOCK_SIZE} / 1024))
+
+#echo f1 > /dev/led/status
+cd /tmp
+echo "Dumping etc to etc.tar.gz"
+/usr/bin/tar cv --exclude '*pwd.db' -zf /tmp/etc.tar.gz etc/* -C /tmp
+
+lsline=`ls -l /tmp/etc.tar.gz`
+script="arg5() echo \$5; arg5 ${lsline}"
+size=`sh -c "${script}"`
+if [ ${size} -gt ${DEVCONFIGSIZE} ]; then
+	echo "etc.tar.gz too big ${size}, must be less than ${DEVCONFIGSIZE}"
+	echo "Please remove big files from /etc"
+	exit 1
+fi 
+
+echo "Saving /etc"
+sysctl hw.cfi.rdonly=0
+/bin/dd if=/tmp/etc.tar.gz of=/dev/map/config bs=${BLOCK_SIZE}k count=${DEVCONFIGBLKS} conv=sync
+echo '.'
+
+#echo f9 > /dev/led/status
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/profiles/xSMALL_/files/etc/services	Sat Oct 15 02:31:07 2011 +0300
@@ -0,0 +1,482 @@
+rtmp		  1/ddp
+tcpmux		  1/tcp
+tcpmux		  1/udp
+nbp		  2/ddp
+echo		  4/ddp
+echo		  7/tcp
+echo		  7/udp
+discard		  9/tcp	   sink null
+discard		  9/udp	   sink null
+systat		 11/tcp	   users
+systat		 11/udp	   users
+daytime		 13/tcp
+daytime		 13/udp
+qotd		 17/tcp	   quote
+qotd		 17/udp	   quote
+msp		 18/tcp
+msp		 18/udp
+chargen		 19/tcp	   ttytst source
+chargen		 19/udp	   ttytst source
+ftp-data	 20/tcp
+ftp-data	 20/udp
+ftp		 21/tcp
+ftp		 21/udp
+ssh		 22/tcp
+ssh		 22/udp
+telnet		 23/tcp
+telnet		 23/udp
+smtp		 25/tcp	   mail
+smtp		 25/udp	   mail
+time		 37/tcp	   timserver
+time		 37/udp	   timserver
+rlp		 39/tcp	   resource
+rlp		 39/udp	   resource
+nameserver	 42/tcp	   name
+nameserver	 42/udp	   name
+nicname		 43/tcp	   whois
+nicname		 43/udp	   whois
+auditd		 48/tcp
+auditd		 48/udp
+tacacs		 49/tcp
+tacacs		 49/udp
+domain		 53/tcp
+domain		 53/udp
+whois++		 63/tcp
+whois++		 63/udp
+tacacs-ds	 65/tcp
+tacacs-ds	 65/udp
+sql*net		 66/tcp
+sql*net		 66/udp
+bootps		 67/tcp	   dhcps
+bootps		 67/udp	   dhcps
+bootpc		 68/tcp	   dhcpc
+bootpc		 68/udp	   dhcpc
+tftp		 69/tcp
+tftp		 69/udp
+gopher		 70/tcp
+gopher		 70/udp
+finger		 79/tcp
+finger		 79/udp
+http		 80/tcp	   www www-http
+http		 80/udp	   www www-http
+xfer		 82/tcp
+xfer		 82/udp
+mit-ml-dev	 83/tcp
+mit-ml-dev	 83/udp
+ctf		 84/tcp
+ctf		 84/udp
+mit-ml-dev	 85/tcp
+mit-ml-dev	 85/udp
+kerberos-sec	 88/tcp	   kerberos
+kerberos-sec	 88/udp	   kerberos
+newacct		100/tcp
+hostname	101/tcp	   hostnames
+hostname	101/udp	   hostnames
+rtelnet		107/tcp
+rtelnet		107/udp
+pop2		109/tcp	   postoffice
+pop2		109/udp	   postoffice
+pop3		110/tcp
+pop3		110/udp
+sunrpc		111/tcp	   rpcbind
+sunrpc		111/udp	   rpcbind
+auth		113/tcp	   ident tap
+auth		113/udp	   ident tap
+sftp		115/tcp
+sftp		115/udp
+uucp-path	117/tcp
+uucp-path	117/udp
+sqlserv		118/tcp
+sqlserv		118/udp
+nntp		119/tcp	   usenet
+nntp		119/udp	   usenet
+ntp		123/tcp
+ntp		123/udp
+statsrv		133/tcp
+statsrv		133/udp
+profile		136/tcp
+profile		136/udp
+netbios-ns	137/tcp
+netbios-ns	137/udp
+netbios-dgm	138/tcp
+netbios-dgm	138/udp
+netbios-ssn	139/tcp
+netbios-ssn	139/udp
+imap		143/tcp	   imap2 imap4
+imap		143/udp	   imap2 imap4
+NeWS		144/tcp
+NeWS		144/udp
+sql-net		150/tcp
+sql-net		150/udp
+bftp		152/tcp
+bftp		152/udp
+sqlsrv		156/tcp
+sqlsrv		156/udp
+snmp		161/tcp
+snmp		161/udp
+snmptrap	162/tcp	   snmp-trap
+snmptrap	162/udp	   snmp-trap
+rsvd		168/tcp
+rsvd		168/udp
+send		169/tcp
+send		169/udp
+print-srv	170/tcp
+print-srv	170/udp
+mailq		174/tcp
+mailq		174/udp
+vmnet		175/tcp
+vmnet		175/udp
+xdmcp		177/tcp
+xdmcp		177/udp
+NextStep	178/tcp	   nextstep NeXTStep
+NextStep	178/udp	   nextstep NeXTStep
+bgp		179/tcp
+bgp		179/udp
+audit		182/tcp
+audit		182/udp
+irc		194/tcp
+irc		194/udp
+ipx		213/tcp
+ipx		213/udp
+dbase		217/tcp
+dbase		217/udp
+mpp		218/tcp
+mpp		218/udp
+imap3		220/tcp
+imap3		220/udp
+x-bone-ctl	265/tcp
+x-bone-ctl	265/udp
+http-mgmt	280/tcp
+http-mgmt	280/udp
+rtsps		322/tcp
+rtsps		322/udp
+ndsauth		353/tcp
+ndsauth		353/udp
+rpc2portmap	369/tcp
+rpc2portmap	369/udp
+ulistserv	372/tcp	   ulistproc
+ulistserv	372/udp	   ulistproc
+ldap		389/tcp
+ldap		389/udp
+netcp		395/tcp
+netcp		395/udp
+netware-ip	396/tcp
+netware-ip	396/udp
+ups		401/tcp
+ups		401/udp
+bnet		415/tcp
+bnet		415/udp
+utmpsd		430/tcp
+utmpsd		430/udp
+utmpcd		431/tcp
+utmpcd		431/udp
+iasd		432/tcp
+iasd		432/udp
+nnsp		433/tcp
+nnsp		433/udp
+mobileip-agent	434/tcp
+mobileip-agent	434/udp
+mobilip-mn	435/tcp
+mobilip-mn	435/udp
+https		443/tcp
+https		443/udp
+microsoft-ds	445/tcp
+microsoft-ds	445/udp
+kpasswd5	464/tcp
+kpasswd5	464/udp
+smtps		465/tcp
+smtps		465/udp
+rcp		469/tcp
+rcp		469/udp
+gss-http	488/tcp
+gss-http	488/udp
+nest-protocol	489/tcp
+nest-protocol	489/udp
+isakmp		500/tcp
+isakmp		500/udp
+mailbox-lm	505/tcp
+mailbox-lm	505/udp
+fcp		510/tcp
+fcp		510/udp
+exec		512/tcp
+biff		512/udp	   comsat
+login		513/tcp
+who		513/udp	   whod
+shell		514/tcp	   cmd
+syslog		514/udp
+printer		515/tcp	   spooler
+printer		515/udp	   spooler
+talk		517/tcp
+talk		517/udp
+ntalk		518/tcp
+ntalk		518/udp
+ripng		521/tcp
+ripng		521/udp
+timed		525/tcp	   timeserver
+timed		525/udp	   timeserver
+tempo		526/tcp	   newdate
+tempo		526/udp	   newdate
+irc-serv	529/tcp
+irc-serv	529/udp
+courier		530/tcp	   rpc
+courier		530/udp	   rpc
+conference	531/tcp	   chat
+conference	531/udp	   chat
+netnews		532/tcp	   readnews
+netnews		532/udp	   readnews
+netwall		533/tcp
+netwall		533/udp
+uucp		540/tcp	   uucpd
+uucp		540/udp	   uucpd
+uucp-rlogin	541/tcp
+uucp-rlogin	541/udp
+commerce	542/tcp
+commerce	542/udp
+klogin		543/tcp
+klogin		543/udp
+kshell		544/tcp	   krcmd
+kshell		544/udp	   krcmd
+dhcpv6-client	546/tcp
+dhcpv6-client	546/udp
+dhcpv6-server	547/tcp
+dhcpv6-server	547/udp
+new-rwho	550/tcp	   new-who
+new-rwho	550/udp	   new-who
+rtsp		554/tcp
+rtsp		554/udp
+remotefs	556/tcp	   rfs rfs_server
+remotefs	556/udp	   rfs rfs_server
+openvms-sysipc	557/tcp
+openvms-sysipc	557/udp
+rmonitor	560/tcp	   rmonitord
+rmonitor	560/udp	   rmonitord
+monitor		561/tcp
+monitor		561/udp
+chshell		562/tcp	   chcmd
+chshell		562/udp	   chcmd
+nntps		563/tcp	   snntp
+nntps		563/udp	   snntp
+whoami		565/tcp
+whoami		565/udp
+ftp-agent	574/tcp
+ftp-agent	574/udp
+ipcd		576/tcp
+ipcd		576/udp
+sntp-heartbeat	580/tcp
+sntp-heartbeat	580/udp
+keyserver	584/tcp
+keyserver	584/udp
+submission	587/tcp
+submission	587/udp
+smsd		596/tcp
+smsd		596/udp
+ipcserver	600/tcp
+ipcserver	600/udp
+syslog-conn     601/tcp
+syslog-conn     601/udp
+xmlrpc-beep     602/tcp
+xmlrpc-beep     602/udp
+tunnel          604/tcp
+tunnel          604/udp
+soap-beep       605/tcp
+soap-beep       605/udp
+sshell		614/tcp
+sshell		614/udp
+sco-websrvrmgr  620/tcp
+sco-websrvrmgr  620/udp
+escp-ip		621/tcp
+escp-ip		621/udp
+cryptoadmin	624/tcp
+cryptoadmin	624/udp
+ipp		631/tcp
+ipp		631/udp
+servstat	633/tcp
+servstat	633/udp
+ldaps		636/tcp	   sldap
+ldaps		636/udp	   sldap
+lanserver       637/tcp
+lanserver       637/udp
+ldp		646/tcp
+ldp		646/udp
+dhcp-failover   647/tcp
+dhcp-failover   647/udp
+rrp             648/tcp
+rrp             648/udp
+obex		650/tcp
+obex		650/udp
+ieee-mms	651/tcp
+ieee-mms	651/udp
+hello-port	652/tcp
+hello-port	652/udp
+repscmd		653/tcp
+repscmd		653/udp
+xfr             682/tcp
+xfr             682/udp
+nmap            689/tcp
+nmap            689/udp
+msexch-routing	691/tcp
+msexch-routing	691/udp
+uuidgen         697/tcp
+uuidgen         697/udp
+flexlm		744/tcp
+flexlm		744/udp
+kerberos-adm	749/tcp
+kerberos-adm	749/udp
+kerberos-iv	750/udp	   kdc
+kerberos-iv	750/tcp	   kdc
+kerberos_master	751/tcp
+kerberos_master	751/udp
+krb_prop	754/tcp	   krb5_prop
+tell		754/tcp
+tell		754/udp
+nlogin		758/tcp
+nlogin		758/udp
+con		759/tcp
+con		759/udp
+krbupdate	760/tcp	   kreg
+ns		760/tcp
+ns		760/udp
+kpasswd		761/tcp	   kpwd
+quotad		762/tcp
+quotad		762/udp
+webster		765/tcp
+webster		765/udp
+phonebook	767/tcp
+phonebook	767/udp
+submit		773/tcp
+notify		773/udp
+rpasswd		774/tcp
+acmaint_dbd	774/udp
+entomb		775/tcp
+acmaint_transd	775/udp
+wpages		776/tcp
+wpages		776/udp
+multiling-http	777/tcp
+multiling-http	777/udp
+netconf-ssh     830/tcp
+netconf-ssh     830/udp
+netconf-beep    831/tcp
+netconf-beep    831/udp
+netconfsoaphttp 832/tcp
+netconfsoaphttp 832/udp
+netconfsoapbeep 833/tcp
+netconfsoapbeep 833/udp
+dhcp-failover2  847/tcp
+dhcp-failover2  847/udp
+rndc		953/tcp
+ftps-data	989/tcp
+ftps-data	989/udp
+ftps		990/tcp
+ftps		990/udp
+nas		991/tcp
+nas		991/udp
+telnets		992/tcp
+telnets		992/udp
+imaps		993/tcp
+imaps		993/udp
+ircs		994/tcp
+ircs		994/udp
+pop3s		995/tcp	   spop3
+pop3s		995/udp	   spop3
+puprouter	999/tcp
+puprouter	999/udp
+socks		1080/tcp
+socks		1080/udp
+nfsd-status	1110/tcp
+nfsd-keepalive	1110/udp
+openvpn		1194/tcp
+openvpn		1194/udp
+lotusnote	1352/tcp
+lotusnote	1352/udp
+novell-lu6.2	1416/tcp
+novell-lu6.2	1416/udp
+ms-sql-s	1433/tcp
+ms-sql-s	1433/udp
+ms-sql-m	1434/tcp
+ms-sql-m	1434/udp
+ibm_wrless_lan	1461/tcp
+ibm_wrless_lan	1461/udp
+wins		1512/tcp
+wins		1512/udp
+l2f		1701/tcp
+l2f		1701/udp
+l2tp		1701/tcp
+l2tp		1701/udp
+pptp		1723/tcp
+radius		1812/udp
+radacct		1813/udp
+stun-p1		1990/tcp
+stun-p1		1990/udp
+stun-p2		1991/tcp
+stun-p2		1991/udp
+stun-p3		1992/tcp
+stun-p3		1992/udp
+ipsendmsg	1992/tcp
+ipsendmsg	1992/udp
+snmp-tcp-port	1993/tcp
+snmp-tcp-port	1993/udp
+stun-port	1994/tcp
+stun-port	1994/udp
+bootserver	2016/tcp
+bootserver	2016/udp
+bootclient	2017/udp
+interbase	2041/tcp
+interbase	2041/udp
+isis		2042/tcp
+isis		2042/udp
+isis-bcast	2043/tcp
+isis-bcast	2043/udp
+nfsd		2049/tcp   nfs
+nfsd		2049/udp   nfs
+cvspserver	2401/tcp
+cvspserver	2401/udp
+rtsserv		2500/tcp
+rtsserv		2500/udp
+rtsclient	2501/tcp
+rtsclient	2501/udp
+zebrasrv	2600/tcp
+zebra		2601/tcp
+ripd		2602/tcp
+ripngd		2603/tcp
+ospfd		2604/tcp
+bgpd		2605/tcp
+ospf6d		2606/tcp
+dict		2628/tcp
+dict		2628/udp
+iscsi-target	3260/tcp
+iscsi-target	3260/udp
+svn		3690/tcp
+svn		3690/udp
+lockd		4045/udp
+lockd		4045/tcp
+rwhois		4321/tcp
+rwhois		4321/udp
+sip		5060/tcp
+sip		5060/udp
+sip-tls		5061/tcp
+sip-tls		5061/udp
+rmonitor_secure	5145/tcp
+rmonitor_secure	5145/udp
+aol		5190/tcp
+aol		5190/udp
+aol-1		5191/tcp
+aol-1		5191/udp
+aol-2		5192/tcp
+aol-2		5192/udp
+aol-3		5193/tcp
+aol-3		5193/udp
+xmpp-client	5222/tcp
+xmpp-client	5222/udp
+xmpp-server	5269/tcp
+xmpp-server	5269/udp
+postgresql	5432/tcp
+postgresql	5432/udp
+cvsup		5999/tcp
+x11		6000/tcp
+x11		6000/udp
+x11-ssh		6010/tcp
+x11-ssh		6010/udp
+ups-onlinet	7010/tcp
+ups-onlinet	7010/udp
+ftp-proxy	8021/tcp
+natd		8668/divert
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/profiles/xSMALL_/files/etc/shells	Sat Oct 15 02:31:07 2011 +0300
@@ -0,0 +1,2 @@
+
+/bin/sh
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/profiles/xSMALL_/files/etc/snmpd.config	Sat Oct 15 02:31:07 2011 +0300
@@ -0,0 +1,97 @@
+# $FreeBSD$
+#
+# Example configuration file for bsnmpd(1).
+#
+
+#
+# Set some common variables
+#
+location := "Room 200"
+contact := "[email protected]"
+system := 1	# FreeBSD
+traphost := localhost
+trapport := 162
+
+# Change this!
+read := "public"
+# Uncomment begemotSnmpdCommunityString.0.2 below that sets the community
+# string to enable write access.
+write := "geheim"
+trap := "mytrap"
+
+#
+# Configuration
+#
+%snmpd
+begemotSnmpdDebugDumpPdus	= 2
+begemotSnmpdDebugSyslogPri	= 7
+
+#
+# Set the read and write communities.
+#
+# The default value of the community strings is NULL (note, that this is
+# different from the empty string). This disables both read and write access.
+# To enable read access only the read community string must be set. Setting
+# the write community string enables both read and write access with that
+# string.
+#
+# Be sure to understand the security implications of SNMPv2 - the community
+# strings are readable on the wire!
+#
+begemotSnmpdCommunityString.0.1	= $(read)
+# begemotSnmpdCommunityString.0.2	= $(write)
+begemotSnmpdCommunityDisable	= 1
+
+# open standard SNMP ports
+begemotSnmpdPortStatus.0.0.0.0.161 = 1
+
+# open a unix domain socket
+begemotSnmpdLocalPortStatus."/var/run/snmpd.sock" = 1
+begemotSnmpdLocalPortType."/var/run/snmpd.sock" = 4
+
+# send traps to the traphost
+begemotTrapSinkStatus.[$(traphost)].$(trapport) = 4
+begemotTrapSinkVersion.[$(traphost)].$(trapport) = 2
+begemotTrapSinkComm.[$(traphost)].$(trapport) = $(trap)
+
+sysContact	= $(contact)
+sysLocation	= $(location)
+sysObjectId 	= 1.3.6.1.4.1.12325.1.1.2.1.$(system)
+
+snmpEnableAuthenTraps = 2
+
+#
+# Load MIB-2 module
+#
+begemotSnmpdModulePath."mibII"	= "/usr/lib/snmp_mibII.so"
+
+# Force a polling rate for the 64-bit interface counters in case
+# the automatic computation is wrong (which may be the case if an interface
+# announces the wrong bit rate via its MIB).
+#%mibII
+#begemotIfForcePoll = 2000
+
+#
+# Netgraph module
+#
+#begemotSnmpdModulePath."netgraph" = "/usr/lib/snmp_netgraph.so"
+#
+#%netgraph
+#begemotNgControlNodeName = "snmpd"
+
+#
+# pf(4) module
+#
+#begemotSnmpdModulePath."pf"	= "/usr/lib/snmp_pf.so"
+
+#
+# Host resources module
+#  This requires the mibII module.
+#
+#begemotSnmpdModulePath."hostres" = "/usr/lib/snmp_hostres.so"
+
+#
+# Bridge module
+#  This requires the mibII module.
+#
+#begemotSnmpdModulePath."bridge" = "/usr/lib/snmp_bridge.so"
Binary file profiles/xSMALL_/files/etc/spwd.db has changed
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/profiles/xSMALL_/files/etc/sysctl.conf	Sat Oct 15 02:31:07 2011 +0300
@@ -0,0 +1,3 @@
+#security.bsd.see_other_uids=0
+kern.coredump=0
+
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/profiles/xSMALL_/files/etc/syslog.conf	Sat Oct 15 02:31:07 2011 +0300
@@ -0,0 +1,3 @@
+
+*.*		/var/log/all.log
+
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/profiles/xSMALL_/files/etc/ttys	Sat Oct 15 02:31:07 2011 +0300
@@ -0,0 +1,10 @@
+console	"/usr/libexec/getty std.115200"	xterm	off  secure
+ttyu0	"/usr/libexec/getty std.115200"	xterm	on secure
+ttyu1	"/usr/libexec/getty std.115200"	xterm	on secure
+pts/0   none                    network secure
+pts/1   none                    network secure
+pts/2   none                    network secure
+pts/3   none                    network secure
+pts/4   none                    network secure
+pts/5   none                    network secure
+
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/profiles/xSMALL_/files/etc/upgrade	Sat Oct 15 02:31:07 2011 +0300
@@ -0,0 +1,82 @@
+#!/bin/sh
+
+# XXX: Should be in some plase like /etc/rc.conf
+# D-Link_DIR-620-0.1-ALPHA.9ced6c669eb1da9e67c0fd2024058159.zimage
+VENDOR=D-Link
+#HWNAME=DIR-620_A1
+HWNAME=DIR-620
+CURRENT_VERSION=0.1
+CURRENT_RELEASE=ALPHA
+
+URL=$1
+DEVICE=/dev/map/upgrade
+FWFILE=/tmp/fw.img
+BLOCK_SIZE=64
+GEOM_PART=`echo ${DEVICE} | sed 's/\/dev\///; s!\/!\\\/!' `
+
+i=0
+for s in `sysctl kern.geom.conftxt | grep "${GEOM_PART}"` ; do
+        i=$(( ${i} + 1 )) ;
+        if [ ${i} == 4 ] ; then
+                DEVICESIZE=${s} ;
+        fi ;
+done
+
+DEVICEBLKS=$((${DEVICESIZE} / ${BLOCK_SIZE} / 1024))
+
+#echo f1 > /dev/led/status
+
+for p in collector.sh.pid collector.pid dhcpd.pid hostapd.pid httpd.sh.pid httpd.pid ; do
+    echo "Kill ${p}"
+    kill `cat /var/run/${p}` > /dev/null 2>&1
+    # XXX: collector and httpd can't remove thier pid's (yet)
+    rm -f /var/run/${p}
+done
+
+
+cd /tmp
+rm -f ${FWFILE}
+echo "Fetching new image from $1"
+fetch -o ${FWFILE} "$1" || exit 1
+
+lsline=`ls -l ${FWFILE}`
+script="arg5() echo \$5; arg5 ${lsline}"
+size=`sh -c "${script}"`
+if [ ${size} -gt ${DEVICESIZE} ]; then
+        echo "new image too big ${size}, must be less than ${DEVICESIZE}"
+        exit 1
+fi
+
+# TODO: image check here
+SRCMD5=`echo "$1" | sed -E "s/^.*\/${VENDOR}\_${HWNAME}\-[[:digit:]]+\.[[:digit:]]+\-[[:alnum:]]+\.//; s/\.zimage$//"`
+arg4() echo $4; MD5=`arg4 \`md5 ${FWFILE}\``;
+
+echo "Orig MD5=${SRCMD5}"
+echo "Actl MD5=${MD5}"
+set
+
+
+if [ "${SRCMD5}" != "${MD5}" ]; then
+	echo "Checksum mismatch, upgrade aborted";
+	# XXX: Better to restore services
+	reboot;
+fi
+
+sysctl hw.cfi.rdonly=0
+
+killall mpd
+for p in dhclient.pid mpd.pid ; do
+    echo "Kill ${p}"
+    kill `cat /var/run/${p}` > /dev/null 2>&1
+    # XXX: collector and httpd can't remove thier pid's (yet)
+    rm -f /var/run/${p}
+done
+echo "Update /dev/md0 mount to sync mode"
+mount -u -o sync /dev/md0 /tmp
+echo "Flashing new Firware image"
+# -V don't verify, -S don't sync
+upgrade -f ${FWFILE} -d ${DEVICE}
+echo '.'
+
+#echo f9 > /dev/led/status
+
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/profiles/xSMALL_/files/usr/share/misc/termcap	Sat Oct 15 02:31:07 2011 +0300
@@ -0,0 +1,72 @@
+wsvt25m|NetBSD wscons in 25 line DEC VT220 mode with Meta:km:\
+	:tc=wsvt25:
+
+wsvt25|NetBSD wscons in 25 line DEC VT220 mode:Co#8:pa#64:it#8:ut:\
+	:co#80:li#25:[email protected]:[email protected]:NC#2:k1=\E[11~:k2=\E[12~:k3=\E[13~:k4=\E[14~:\
+	:k5=\E[15~:k;=\E[21~:AB=\E[4%dm:AF=\E[3%dm:op=\E[m:is=\E[!p:\
+	:ti=\E)0:te=\E)B:ac=``aaffggjjkkllmmnnqqttuuvvwwxxyyzz{{}}~~:\
+	:@7=\E[8~:kh=\E[7~:kH=\E[8~:rs=\Ec:tc=vt220-8:
+
+vt220-8|dec vt220 8 bit terminal:am:bs:mi:ms:xn:xo:co#80:it#8:\
+	:li#24:AL=\E[%dL:DC=\E[%dP:DL=\E[%dM:DO=\E[%dB:IC=\E[%[email protected]:LE=\E[%dD:\
+	:RI=\E[%dC:UP=\E[%dA:ae=^O:al=\E[L:as=^N:bl=^G:cd=\E[J:ce=\E[K:\
+	:cl=\E[H\E[J:cm=\E[%i%d;%dH:cr=^M:cs=\E[%i%d;%dr:ct=\E[3g:dc=\E[P:\
+	:dl=\E[M:do=^J:ec=\E[%dX:ei=\E[4l:ho=\E[H:\
+	:if=/usr/share/tabset/vt100:im=\E[4h:is=\E[?7h\E[>\E[?1h\E F\E[?4l:\
+	:k1=\EOP:k2=\EOQ:k3=\EOR:k4=\EOS:k6=\E[17~:k7=\E[18~:k8=\E[19~:\
+	:k9=\E[20~:kI=\E[2~:kN=\E[6~:kP=\E[5~:kb=^H:kd=\E[B:kh=\E[H:\
+	:kl=\E[D:kr=\E[C:ku=\E[A:le=^H:mb=\E[5m:md=\E[1m:me=\E[m:mr=\E[7m:\
+	:nd=\E[C:nw=\EE:rc=\E8:sc=\E7:se=\E[27m:sf=\ED:so=\E[7m:sr=\EM:\
+	:st=\EH:ta=^I:ue=\E[24m:up=\E[A:us=\E[4m:vb=\E[?5h\E[?5l:\
+	:ve=\E[?25h:vi=\E[?25l:
+
+vt100|vt100-am|dec vt100 (w/advanced video):am:bs:ms:xn:xo:co#80:\
+	:it#8:li#24:vt#3:@8=\EOM:DO=\E[%dB:K1=\EOq:K2=\EOr:K3=\EOs:K4=\EOp:\
+	:K5=\EOn:LE=\E[%dD:RA=\E[?7l:RI=\E[%dC:SA=\E[?7h:UP=\E[%dA:\
+	:ac=``aaffggjjkkllmmnnooppqqrrssttuuvvwwxxyyzz{{||}}~~:ae=\E(B:\
+	:as=\E(0:bl=^G:cb=\E[1K:cd=\E[J:ce=\E[K:cl=\E[H\E[J:cm=\E[%i%d;%dH:\
+	:cr=^M:cs=\E[%i%d;%dr:ct=\E[3g:do=^J:eA=\E(B:ho=\E[H:k0=\EOy:\
+	:k1=\EOP:k2=\EOQ:k3=\EOR:k4=\EOS:k5=\EOt:k6=\EOu:k7=\EOv:k8=\EOl:\
+	:k9=\EOw:k;=\EOx:kb=^H:kd=\EOB:ke=\E[?1l\E>:kl=\EOD:kr=\EOC:\
+	:ks=\E[?1h\E=:ku=\EOA:le=^H:mb=\E[5m:md=\E[1m:me=\E[m\017:mr=\E[7m:\
+	:nd=\E[C:r2=\E>\E[?3l\E[?4l\E[?5l\E[?7h\E[?8h:rc=\E8:sc=\E7:\
+	:se=\E[m:sf=^J:so=\E[7m:sr=\EM:st=\EH:ta=^I:ue=\E[m:up=\E[A:\
+	:us=\E[4m:
+
+vt220|vt200|DEC VT220 in vt100 emulation mode:am:bs:mi:pt:xn:xo:\
+	:co#80:li#24:vt#3:@7=\E[4~:RA=\E[?7l:SA=\E[?7h:\
+	:ac=``aaffggjjkkllmmnnooppqqrrssttuuvvwwxxyyzz{{||}}~~:ae=\E(B:\
+	:al=\E[L:as=\E(0:bl=^G:cd=\E[J:ce=\E[K:cl=\E[H\E[2J:cm=\E[%i%d;%dH:\
+	:cr=^M:cs=\E[%i%d;%dr:dc=\E[P:dl=\E[M:do=\E[B:ei=\E[4l:ho=\E[H:\
+	:if=/usr/share/tabset/vt100:im=\E[4h:is=\E[1;24r\E[24;1H:k1=\EOP:\
+	:k2=\EOQ:k3=\EOR:k4=\EOS:k5=\E[17~:k6=\E[18~:k7=\E[19~:k8=\E[20~:\
+	:k9=\E[21~:k;=\E[29~:kD=\E[3~:kI=\E[2~:kN=\E[6~:kP=\E[5~:kb=^H:\
+	:kd=\E[B:kh=\E[1~:kl=\E[D:kr=\E[C:ku=\E[A:le=^H:mb=\E[5m:md=\E[1m:\
+	:me=\E[m:mr=\E[7m:nd=\E[C:nl=^J:\
+	:r2=\E>\E[?3l\E[?4l\E[?5l\E[?7h\E[?8h:rc=\E8:\
+	:rf=/usr/share/tabset/vt100:sc=\E7:se=\E[27m:sf=20\ED:so=\E[7m:\
+	:sr=14\EM:ta=^I:ue=\E[24m:up=\E[A:us=\E[4m:ve=\E[?25h:vi=\E[?25l:
+
+xterm|vs100|xterm terminal emulator (X Window System):am:bs:km:mi:\
+	:ms:ut:xn:co#80:it#8:li#24:Co#8:pa#64:AB=\E[4%dm:AF=\E[3%dm:\
+	:op=\E[m:@1=\EOE:@7=\EOF:@8=\EOM:k;=\E[21~:F1=\E[23~:F2=\E[24~:\
+	:ac=``aaffggjjkkllmmnnooppqqrrssttuuvvwwxxyyzz{{||}}~~:AL=\E[%dL:\
+	:DC=\E[%dP:DL=\E[%dM:DO=\E[%dB:IC=\E[%[email protected]:K1=\EOw:K2=\EOy:K3=\EOu:\
+	:K4=\EOq:K5=\EOs:LE=\E[%dD:RI=\E[%dC:UP=\E[%dA:ae=^O:al=\E[L:as=^N:\
+	:bl=^G:bt=\E[Z:cd=\E[J:ce=\E[K:cl=\E[H\E[2J:cm=\E[%i%d;%dH:cr=^M:\
+	:cs=\E[%i%d;%dr:ct=\E[3g:dc=\E[P:dl=\E[M:do=^J:eA=\E(B\E)0:\
+	:ec=\E[%dX:ei=\E[4l:ho=\E[H:im=\E[4h:\
+	:is=\E[m\E7\E[r\E[?7h\E[?1;3;4;6l\E[4l\E8\E>:k1=\EOP:k2=\EOQ:\
+	:k3=\EOR:k4=\EOS:k5=\E[15~:k6=\E[17~:k7=\E[18~:k8=\E[19~:k9=\E[20~:\
+	:kB=\E[Z:kD=\E[3~:kI=\E[2~:kN=\E[6~:kP=\E[5~:kb=^H:kd=\EOB:\
+	:ke=\E[?1l\E>:kh=\EOH:kl=\EOD:kr=\EOC:ks=\E[?1h\E=:ku=\EOA:le=^H:\
+	:md=\E[1m:me=\E[m:mr=\E[7m:nd=\E[C:rc=\E8:sc=\E7:se=\E[m:sf=^J:\
+	:so=\E[7m:sr=\EM:st=\EH:ta=^I:te=\E[2J\E[?47l\E8:ti=\E7\E[?47h:\
+	:ue=\E[m:up=\E[A:us=\E[4m:ve=\E[?25h:vi=\E[?25l:vs=\E[?25h:
+
+ansi|ansi/pc-term compatible with color:5i:am:bs:mi:ms:Co#8:NC#3:\
+	:co#80:it#8:li#24:pa#64:AB=\E[4%dm:AF=\E[3%dm:AL=\E[%dL:DC=\E[%dP:\
+	:DL=\E[%dM:DO=\E[%dB:IC=\E[%[email protected]:LE=\E[%dD:RI=\E[%dC:S2=\E[11m:\
+	:S3=\E[10m:SF=\E[%dS:SR=\E[%dT:UP=\E[%dA:\
+	:ac=`\004a\261f\370g\361h\260j\331k\277l\332m\300n\305o~q\304r\362s_t\303u\264v\301w\302x\263y\371z\372{\373|\374}\375~\376.\031-\030,\021+^P0\333p\304r\304y\363z\362{\343|\330}\234:ae=\E[10m:al=\E[L:as=\E[11m:bl=^G:bt=\E[Z:cb=\E[1K:cd=\E[J:ce=\E[K:ch=\E[%i%dG:cl=\E[H\E[J:cm=\E[%i%d;%dH:cr=^M:ct=\E[2g:cv=\E[%i%dd:dc=\E[P:dl=\E[M:do=\E[B:ec=\E[%dX:ei=:ho=\E[H:im=:kB=\E[Z:kI=\E[L:kb=^H:kd=\E[B:kh=\E[H:kl=\E[D:kr=\E[C:ku=\E[A:le=\E[D:mb=\E[5m:md=\E[1m:me=\E[0;10m:mk=\E[8m:mr=\E[7m:nd=\E[C:nw=\r\E[S:op=\E[39;49m:pf=\E[4i:po=\E[5i:s0=\E(B:s1=\E)B:s2=\E*B:s3=\E+B:se=\E[m:sf=^J:so=\E[7m:st=\EH:ta=\E[I:u6=\E[%i%d;%dR:u7=\E[6n:u9=\E[c:ue=\E[m:up=\E[A:us=\E[4m:
+
Binary file profiles/xSMALL_/files/usr/share/misc/termcap.db has changed
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/profiles/xSMALL_/profile.mk	Sat Oct 15 02:31:07 2011 +0300
@@ -0,0 +1,208 @@
+
+
+
+
+
+WORLD_SUBDIRS_LIB+= \
+libalias \
+libbsm \
+libc \
+libedit \
+libelf \
+libexpat \
+libcrypt \
+libgeom \
+libkiconv \
+libkvm \
+libmd \
+libmemstat \
+msun \
+ncurses/ncurses \
+libpmc \
+libsbuf \
+libthr \
+libufs \
+libutil \
+libz \
+libfetch \
+libarchive \
+libmp \
+libnetgraph \
+libpam/libpam \
+libpam/modules/pam_unix \
+librt \
+libbz2 \
+liblzma \
+libwrap
+
+
+#libipsec \
+#libjail \
+#libradius \
+#libtacplus \
+#ncurses/form \
+#ncurses/menu \
+#ncurses/panel
+
+#WORLD_SUBDIRS+= \
+#secure/lib/libcrypto \
+#secure/lib/libssl
+
+#libipx \
+# Compile ping without libipsec and ifconfig without libjail,libipx
+# "libcrypto.so.6" not found, required by "bsdtar"
+# "libssl.so.6" not found, required by "fetch"
+# "libbsm.so.3" not found, required by "groups"
+# "libbsm.so.3" not found, required by "id"
+# "libbsm.so.3" not found, required by "login"
+# "libmemstat.so.3" not found, required by "netstat"
+
+#libgcc_s.so.1
+
+# XXX must define NOENABLE_WIDEC someway
+
+WORLD_SUBDIRS_BIN+= \
+cat \
+cp \
+chmod \
+date \
+dd \
+df \
+expr \
+hostname \
+kenv \
+kill \
+ln \
+ls \
+mkdir \
+mv \
+ps \
+realpath \
+rm \
+sh \
+sleep \
+stty \
+sync \
+uuidgen
+
+WORLD_SUBDIRS_SBIN+= \
+dmesg \
+ifconfig \
+init \
+ipfw \
+kldload \
+kldstat \
+kldunload \
+ldconfig \
+md5 \
+mdconfig \
+mount \
+mount_cd9660 \
+mount_nullfs \
+mount_unionfs \
+newfs \
+ping \
+rcorder \
+reboot \
+route \
+switchctl \
+sysctl \
+umount
+
+#mount_msdosfs \
+#newfs_msdos \
+#/sbin/oinit
+
+
+
+WORLD_SUBDIRS_ZROUTER+=		\
+target/sbin/cdevd		\
+target/usr.bin/hex2bin
+
+
+
+
+WORLD_SUBDIRS_USR_BIN+= \
+basename \
+dirname \
+fetch \
+find \
+getopt \
+grep \
+head \
+id \
+killall \
+logger \
+login \
+minigzip \
+passwd \
+sed \
+sockstat \
+tail \
+tar \
+tee \
+telnet \
+touch \
+uname \
+vi \
+wc \
+xargs
+
+#netstat \
+
+WORLD_SUBDIRS_GNU_USR_BIN+= \
+sort
+
+WORLD_SUBDIRS_GNU_LIB+= \
+csu \
+libgcc \
+libregex \
+libssp
+
+# \
+#libstdc++
+
+#libreadline \
+# XXX: libreadline must be replaced with libedit
+
+
+
+WORLD_SUBDIRS_LIBEXEC+= \
+rtld-elf \
+getty \
+telnetd
+
+#ppp \
+WORLD_SUBDIRS_USR_SBIN+= \
+ngctl \
+nghook \
+chroot \
+cron \
+pwd_mkdb \
+inetd \
+gpioctl \
+syslogd
+
+.if defined(WITH_USB)
+WORLD_SUBDIRS_USR_SBIN+= \
+usbconfig \
+usbdump
+
+WORLD_SUBDIRS_LIB+= \
+libusb
+.endif
+
+
+KERNCONF_MODULES_OVERRIDE+=random if_bridge bridgestp ipfw dummynet
+KERNCONF_MODULES_OVERRIDE+=libalias/libalias
+#KERNCONF_MODULES_OVERRIDE+=libalias/modules/cuseeme
+KERNCONF_MODULES_OVERRIDE+=libalias/modules/ftp
+KERNCONF_MODULES_OVERRIDE+=libalias/modules/pptp
+#KERNCONF_MODULES_OVERRIDE+=libalias/modules/smedia
+#KERNCONF_MODULES_OVERRIDE+=libalias/modules/dummy
+#KERNCONF_MODULES_OVERRIDE+=libalias/modules/irc
+#KERNCONF_MODULES_OVERRIDE+=libalias/modules/nbt
+#KERNCONF_MODULES_OVERRIDE+=libalias/modules/skinny
+KERNCONF_MODULES_OVERRIDE+=geom/geom_label
+KERNCONF_MODULES_OVERRIDE+=md unionfs ufs
+