Home | History | Annotate | Line # | Download | only in installcd
etc.rc revision 1.3.6.2
      1  1.3.6.2  tls # $NetBSD: etc.rc,v 1.3.6.2 2014/08/19 23:45:49 tls Exp $
      2  1.3.6.2  tls #
      3  1.3.6.2  tls # Copyright (c) 1997 Perry E. Metzger
      4  1.3.6.2  tls # Copyright (c) 1994 Christopher G. Demetriou
      5  1.3.6.2  tls # All rights reserved.
      6  1.3.6.2  tls # 
      7  1.3.6.2  tls # Redistribution and use in source and binary forms, with or without
      8  1.3.6.2  tls # modification, are permitted provided that the following conditions
      9  1.3.6.2  tls # are met:
     10  1.3.6.2  tls # 1. Redistributions of source code must retain the above copyright
     11  1.3.6.2  tls #    notice, this list of conditions and the following disclaimer.
     12  1.3.6.2  tls # 2. Redistributions in binary form must reproduce the above copyright
     13  1.3.6.2  tls #    notice, this list of conditions and the following disclaimer in the
     14  1.3.6.2  tls #    documentation and/or other materials provided with the distribution.
     15  1.3.6.2  tls # 3. All advertising materials mentioning features or use of this software
     16  1.3.6.2  tls #    must display the following acknowledgement:
     17  1.3.6.2  tls #          This product includes software developed for the
     18  1.3.6.2  tls #          NetBSD Project.  See http://www.NetBSD.org/ for
     19  1.3.6.2  tls #          information about NetBSD.
     20  1.3.6.2  tls # 4. The name of the author may not be used to endorse or promote products
     21  1.3.6.2  tls #    derived from this software without specific prior written permission.
     22  1.3.6.2  tls # 
     23  1.3.6.2  tls # THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR
     24  1.3.6.2  tls # IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
     25  1.3.6.2  tls # OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
     26  1.3.6.2  tls # IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT,
     27  1.3.6.2  tls # INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT
     28  1.3.6.2  tls # NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
     29  1.3.6.2  tls # DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
     30  1.3.6.2  tls # THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
     31  1.3.6.2  tls # (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
     32  1.3.6.2  tls # THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
     33  1.3.6.2  tls # 
     34  1.3.6.2  tls # <<Id: LICENSE,v 1.2 2000/06/14 15:57:33 cgd Exp>>
     35  1.3.6.2  tls 
     36  1.3.6.2  tls PATH=/sbin:/bin:/usr/bin:/usr/sbin:/
     37  1.3.6.2  tls export PATH
     38  1.3.6.2  tls 
     39  1.3.6.2  tls # hack to get around bugs in kernfs's rootdev/rrootdev lookup.
     40  1.3.6.2  tls ls -l /dev/* > /dev/null 2>&1
     41  1.3.6.2  tls 
     42  1.3.6.2  tls lowmemfail()
     43  1.3.6.2  tls {
     44  1.3.6.2  tls 	cat << "EOM"
     45  1.3.6.2  tls This machine seems to not have enough memory for this install method.
     46  1.3.6.2  tls Please refer to the installation documentation on how to create and
     47  1.3.6.2  tls boot a custom kernel and how to install with that.
     48  1.3.6.2  tls 
     49  1.3.6.2  tls Please use the 'halt' command to stop the machine.
     50  1.3.6.2  tls EOM
     51  1.3.6.2  tls 	exec sh
     52  1.3.6.2  tls }
     53  1.3.6.2  tls 
     54  1.3.6.2  tls # if /dev has not been populated by init, it may be a stock "MAKEDEV all"
     55  1.3.6.2  tls # variant without "opty" - in which case we need to mount a ptyfs
     56  1.3.6.2  tls if [ ! -r /dev/ttypf ]; then
     57  1.3.6.2  tls 	if mount | grep '^ptyfs on /dev/pts' >/dev/null 2>&1; then
     58  1.3.6.2  tls 		# do not mount it again
     59  1.3.6.2  tls 	else
     60  1.3.6.2  tls 		mount -t ptyfs ptyfs /dev/pts
     61  1.3.6.2  tls 	fi
     62  1.3.6.2  tls fi
     63  1.3.6.2  tls 
     64  1.3.6.2  tls # mount a few tempfs to allow modifications over the CD contents
     65  1.3.6.2  tls mount -t tmpfs tmpfs /tmp || lowmemfail
     66  1.3.6.2  tls mount -t tmpfs tmpfs /var || lowmemfail
     67  1.3.6.2  tls mount -t tmpfs -o union tmpfs /etc || lowmemfail
     68  1.3.6.2  tls 
     69  1.3.6.2  tls # prepare important directories in the tmpfses, so dhcpcd and vi will work
     70  1.3.6.2  tls mkdir -p /var/run /var/db /var/tmp
     71  1.3.6.2  tls 
     72  1.3.6.2  tls # create a gettytab to autologin and run sysinst (etc/gettytab is a symlink
     73  1.3.6.2  tls # to /tmp/gettytab)
     74  1.3.6.2  tls echo "# Autostart sysinst" > /tmp/gettytab
     75  1.3.6.2  tls echo -n "sysinst:al=root:lo=/install.sh:im=:sp#" >> /tmp/gettytab
     76  1.3.6.2  tls stty speed >> /tmp/gettytab
     77  1.3.6.2  tls 
     78  1.3.6.2  tls # done, move on to multiuser mode
     79  1.3.6.2  tls exit 0
     80