dot.profile revision 1.11 1 1.11 pk # $NetBSD: dot.profile,v 1.11 2000/10/20 11:56:58 pk Exp $
2 1.1 mrg #
3 1.11 pk # Copyright (c) 2000 The NetBSD Foundation, Inc.
4 1.1 mrg # All rights reserved.
5 1.11 pk #
6 1.11 pk # This code is derived from software contributed to The NetBSD Foundation
7 1.11 pk # by Paul Kranenburg.
8 1.11 pk #
9 1.1 mrg # Redistribution and use in source and binary forms, with or without
10 1.1 mrg # modification, are permitted provided that the following conditions
11 1.1 mrg # are met:
12 1.1 mrg # 1. Redistributions of source code must retain the above copyright
13 1.1 mrg # notice, this list of conditions and the following disclaimer.
14 1.1 mrg # 2. Redistributions in binary form must reproduce the above copyright
15 1.1 mrg # notice, this list of conditions and the following disclaimer in the
16 1.1 mrg # documentation and/or other materials provided with the distribution.
17 1.1 mrg # 3. All advertising materials mentioning features or use of this software
18 1.1 mrg # must display the following acknowledgement:
19 1.11 pk # This product includes software developed by the NetBSD
20 1.11 pk # Foundation, Inc. and its contributors.
21 1.11 pk # 4. Neither the name of The NetBSD Foundation nor the names of its
22 1.11 pk # contributors may be used to endorse or promote products derived
23 1.11 pk # from this software without specific prior written permission.
24 1.11 pk #
25 1.11 pk # THIS SOFTWARE IS PROVIDED BY THE NETBSD FOUNDATION, INC. AND CONTRIBUTORS
26 1.11 pk # ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED
27 1.11 pk # TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
28 1.11 pk # PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE FOUNDATION OR CONTRIBUTORS
29 1.11 pk # BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
30 1.11 pk # CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
31 1.11 pk # SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
32 1.11 pk # INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
33 1.11 pk # CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
34 1.11 pk # ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
35 1.11 pk # POSSIBILITY OF SUCH DAMAGE.
36 1.11 pk #
37 1.1 mrg
38 1.1 mrg PATH=/sbin:/bin:/usr/bin:/usr/sbin:/
39 1.1 mrg export PATH
40 1.1 mrg HOME=/
41 1.1 mrg export HOME
42 1.1 mrg
43 1.1 mrg umask 022
44 1.1 mrg
45 1.11 pk if [ "${BOOTFS_DONEPROFILE}" = "YES" ]; then
46 1.11 pk exit
47 1.1 mrg fi
48 1.11 pk
49 1.11 pk BOOTFS_DONEPROFILE=YES
50 1.11 pk export BOOTFS_DONEPROFILE
51 1.11 pk
52 1.11 pk # mount root read-write
53 1.11 pk mount -u /dev/md0a /
54 1.11 pk
55 1.11 pk # mount /instfs
56 1.11 pk MINIROOT_FSSIZE=10000
57 1.11 pk mount -t mfs -o -s=$MINIROOT_FSSIZE swap /instfs
58 1.11 pk
59 1.11 pk # Load instfs
60 1.11 pk echo ""
61 1.11 pk echo "If you booted the system from a floppy you can now remove the disk."
62 1.11 pk echo ""
63 1.11 pk echo "Next, insert the floppy disk labeled \`instfs' into the disk drive."
64 1.11 pk echo "The question below allows you to specify the device name of the floppy"
65 1.11 pk echo "drive. Usually, the default answer \`floppy' will do just fine."
66 1.11 pk echo ""
67 1.11 pk
68 1.11 pk _dev="floppy"
69 1.11 pk while :; do
70 1.11 pk #if [ "$_dev" = "" ] ; then _dev=floppy; fi
71 1.11 pk echo -n "Device to load the \`instfs' filesystem from [$_dev]: "
72 1.11 pk read _answer
73 1.11 pk if [ "$_answer" != "" ]; then _dev=$_answer; fi
74 1.11 pk if [ "$_dev" = floppy ]; then _dev=/dev/rfd0a; fi
75 1.11 pk if [ "$_dev" = "none" ]; then continue; fi
76 1.11 pk (cd /instfs && tar zxvpf $_dev) && break
77 1.11 pk done
78 1.11 pk
79 1.11 pk # switch to /instfs, and pretend we logged in there.
80 1.11 pk exec chroot /instfs /bin/sh /.profile
81