head	1.5;
access;
symbols
	netbsd-11-0-RC4:1.5
	netbsd-11-0-RC3:1.5
	netbsd-11-0-RC2:1.5
	netbsd-11-0-RC1:1.5
	perseant-exfatfs-base-20250801:1.5
	netbsd-11:1.5.0.114
	netbsd-11-base:1.5
	netbsd-10-1-RELEASE:1.5
	perseant-exfatfs-base-20240630:1.5
	perseant-exfatfs:1.5.0.112
	perseant-exfatfs-base:1.5
	netbsd-8-3-RELEASE:1.5
	netbsd-9-4-RELEASE:1.5
	netbsd-10-0-RELEASE:1.5
	netbsd-10-0-RC6:1.5
	netbsd-10-0-RC5:1.5
	netbsd-10-0-RC4:1.5
	netbsd-10-0-RC3:1.5
	netbsd-10-0-RC2:1.5
	netbsd-10-0-RC1:1.5
	netbsd-10:1.5.0.110
	netbsd-10-base:1.5
	netbsd-9-3-RELEASE:1.5
	cjep_sun2x-base1:1.5
	cjep_sun2x:1.5.0.108
	cjep_sun2x-base:1.5
	cjep_staticlib_x-base1:1.5
	netbsd-9-2-RELEASE:1.5
	cjep_staticlib_x:1.5.0.106
	cjep_staticlib_x-base:1.5
	netbsd-9-1-RELEASE:1.5
	phil-wifi-20200421:1.5
	phil-wifi-20200411:1.5
	is-mlppp:1.5.0.104
	is-mlppp-base:1.5
	phil-wifi-20200406:1.5
	netbsd-8-2-RELEASE:1.5
	netbsd-9-0-RELEASE:1.5
	netbsd-9-0-RC2:1.5
	netbsd-9-0-RC1:1.5
	phil-wifi-20191119:1.5
	netbsd-9:1.5.0.102
	netbsd-9-base:1.5
	phil-wifi-20190609:1.5
	netbsd-8-1-RELEASE:1.5
	netbsd-8-1-RC1:1.5
	pgoyette-compat-merge-20190127:1.5
	pgoyette-compat-20190127:1.5
	pgoyette-compat-20190118:1.5
	pgoyette-compat-1226:1.5
	pgoyette-compat-1126:1.5
	pgoyette-compat-1020:1.5
	pgoyette-compat-0930:1.5
	pgoyette-compat-0906:1.5
	netbsd-7-2-RELEASE:1.5
	pgoyette-compat-0728:1.5
	netbsd-8-0-RELEASE:1.5
	phil-wifi:1.5.0.100
	phil-wifi-base:1.5
	pgoyette-compat-0625:1.5
	netbsd-8-0-RC2:1.5
	pgoyette-compat-0521:1.5
	pgoyette-compat-0502:1.5
	pgoyette-compat-0422:1.5
	netbsd-8-0-RC1:1.5
	pgoyette-compat-0415:1.5
	pgoyette-compat-0407:1.5
	pgoyette-compat-0330:1.5
	pgoyette-compat-0322:1.5
	pgoyette-compat-0315:1.5
	netbsd-7-1-2-RELEASE:1.5
	pgoyette-compat:1.5.0.98
	pgoyette-compat-base:1.5
	netbsd-7-1-1-RELEASE:1.5
	matt-nb8-mediatek:1.5.0.96
	matt-nb8-mediatek-base:1.5
	perseant-stdc-iso10646:1.5.0.94
	perseant-stdc-iso10646-base:1.5
	netbsd-8:1.5.0.92
	netbsd-8-base:1.5
	prg-localcount2-base3:1.5
	prg-localcount2-base2:1.5
	prg-localcount2-base1:1.5
	prg-localcount2:1.5.0.90
	prg-localcount2-base:1.5
	pgoyette-localcount-20170426:1.5
	bouyer-socketcan-base1:1.5
	pgoyette-localcount-20170320:1.5
	netbsd-7-1:1.5.0.88
	netbsd-7-1-RELEASE:1.5
	netbsd-7-1-RC2:1.5
	netbsd-7-nhusb-base-20170116:1.5
	bouyer-socketcan:1.5.0.86
	bouyer-socketcan-base:1.5
	pgoyette-localcount-20170107:1.5
	netbsd-7-1-RC1:1.5
	pgoyette-localcount-20161104:1.5
	netbsd-7-0-2-RELEASE:1.5
	localcount-20160914:1.5
	netbsd-7-nhusb:1.5.0.84
	netbsd-7-nhusb-base:1.5
	pgoyette-localcount-20160806:1.5
	pgoyette-localcount-20160726:1.5
	pgoyette-localcount:1.5.0.82
	pgoyette-localcount-base:1.5
	netbsd-7-0-1-RELEASE:1.5
	netbsd-7-0:1.5.0.80
	netbsd-7-0-RELEASE:1.5
	netbsd-7-0-RC3:1.5
	netbsd-7-0-RC2:1.5
	netbsd-7-0-RC1:1.5
	netbsd-5-2-3-RELEASE:1.5
	netbsd-5-1-5-RELEASE:1.5
	netbsd-6-0-6-RELEASE:1.5
	netbsd-6-1-5-RELEASE:1.5
	netbsd-7:1.5.0.78
	netbsd-7-base:1.5
	yamt-pagecache-base9:1.5
	yamt-pagecache-tag8:1.5
	netbsd-6-1-4-RELEASE:1.5
	netbsd-6-0-5-RELEASE:1.5
	tls-earlyentropy:1.5.0.76
	tls-earlyentropy-base:1.5
	riastradh-xf86-video-intel-2-7-1-pre-2-21-15:1.5
	riastradh-drm2-base3:1.5
	netbsd-6-1-3-RELEASE:1.5
	netbsd-6-0-4-RELEASE:1.5
	netbsd-5-2-2-RELEASE:1.5
	netbsd-5-1-4-RELEASE:1.5
	netbsd-6-1-2-RELEASE:1.5
	netbsd-6-0-3-RELEASE:1.5
	netbsd-5-2-1-RELEASE:1.5
	netbsd-5-1-3-RELEASE:1.5
	netbsd-6-1-1-RELEASE:1.5
	riastradh-drm2-base2:1.5
	riastradh-drm2-base1:1.5
	riastradh-drm2:1.5.0.68
	riastradh-drm2-base:1.5
	netbsd-6-1:1.5.0.74
	netbsd-6-0-2-RELEASE:1.5
	netbsd-6-1-RELEASE:1.5
	khorben-n900:1.5.0.72
	netbsd-6-1-RC4:1.5
	netbsd-6-1-RC3:1.5
	agc-symver:1.5.0.70
	agc-symver-base:1.5
	netbsd-6-1-RC2:1.5
	netbsd-6-1-RC1:1.5
	yamt-pagecache-base8:1.5
	netbsd-5-2:1.5.0.66
	netbsd-6-0-1-RELEASE:1.5
	yamt-pagecache-base7:1.5
	netbsd-5-2-RELEASE:1.5
	netbsd-5-2-RC1:1.5
	matt-nb6-plus-nbase:1.5
	yamt-pagecache-base6:1.5
	netbsd-6-0:1.5.0.64
	netbsd-6-0-RELEASE:1.5
	netbsd-6-0-RC2:1.5
	tls-maxphys:1.5.0.62
	tls-maxphys-base:1.5
	matt-nb6-plus:1.5.0.60
	matt-nb6-plus-base:1.5
	netbsd-6-0-RC1:1.5
	yamt-pagecache-base5:1.5
	yamt-pagecache-base4:1.5
	netbsd-6:1.5.0.58
	netbsd-6-base:1.5
	netbsd-5-1-2-RELEASE:1.5
	netbsd-5-1-1-RELEASE:1.5
	yamt-pagecache-base3:1.5
	yamt-pagecache-base2:1.5
	yamt-pagecache:1.5.0.56
	yamt-pagecache-base:1.5
	cherry-xenmp:1.5.0.54
	cherry-xenmp-base:1.5
	bouyer-quota2-nbase:1.5
	bouyer-quota2:1.5.0.52
	bouyer-quota2-base:1.5
	matt-mips64-premerge-20101231:1.5
	matt-nb5-mips64-premerge-20101231:1.5
	matt-nb5-pq3:1.5.0.50
	matt-nb5-pq3-base:1.5
	netbsd-5-1:1.5.0.48
	netbsd-5-1-RELEASE:1.5
	netbsd-5-1-RC4:1.5
	matt-nb5-mips64-k15:1.5
	netbsd-5-1-RC3:1.5
	netbsd-5-1-RC2:1.5
	netbsd-5-1-RC1:1.5
	netbsd-5-0-2-RELEASE:1.5
	matt-nb5-mips64-premerge-20091211:1.5
	matt-premerge-20091211:1.5
	matt-nb5-mips64-u2-k2-k4-k7-k8-k9:1.5
	matt-nb4-mips64-k7-u2a-k9b:1.5
	matt-nb5-mips64-u1-k1-k5:1.5
	matt-nb5-mips64:1.5.0.46
	netbsd-5-0-1-RELEASE:1.5
	jym-xensuspend-nbase:1.5
	netbsd-5-0:1.5.0.44
	netbsd-5-0-RELEASE:1.5
	netbsd-5-0-RC4:1.5
	netbsd-5-0-RC3:1.5
	netbsd-5-0-RC2:1.5
	jym-xensuspend:1.5.0.42
	jym-xensuspend-base:1.5
	netbsd-5-0-RC1:1.5
	netbsd-5:1.5.0.40
	netbsd-5-base:1.5
	matt-mips64-base2:1.5
	matt-mips64:1.5.0.38
	netbsd-4-0-1-RELEASE:1.5
	wrstuden-revivesa-base-3:1.5
	wrstuden-revivesa-base-2:1.5
	wrstuden-fixsa-newbase:1.5
	wrstuden-revivesa-base-1:1.5
	yamt-pf42-base4:1.5
	yamt-pf42-base3:1.5
	hpcarm-cleanup-nbase:1.5
	yamt-pf42-baseX:1.5
	yamt-pf42-base2:1.5
	wrstuden-revivesa:1.5.0.36
	wrstuden-revivesa-base:1.5
	yamt-pf42:1.5.0.34
	yamt-pf42-base:1.5
	mjf-devfs2:1.5.0.32
	mjf-devfs2-base:1.5
	keiichi-mipv6:1.5.0.30
	keiichi-mipv6-base:1.5
	mjf-devfs:1.5.0.28
	mjf-devfs-base:1.5
	matt-armv6-nbase:1.5
	matt-armv6-prevmlocking:1.5
	wrstuden-fixsa-base-1:1.5
	netbsd-4-0:1.5.0.26
	netbsd-4-0-RELEASE:1.5
	cube-autoconf:1.5.0.24
	cube-autoconf-base:1.5
	netbsd-4-0-RC5:1.5
	netbsd-4-0-RC4:1.5
	netbsd-4-0-RC3:1.5
	netbsd-4-0-RC2:1.5
	netbsd-4-0-RC1:1.5
	matt-armv6:1.5.0.22
	matt-armv6-base:1.5
	matt-mips64-base:1.5
	hpcarm-cleanup:1.5.0.20
	hpcarm-cleanup-base:1.5
	netbsd-3-1-1-RELEASE:1.5
	netbsd-3-0-3-RELEASE:1.5
	wrstuden-fixsa:1.5.0.18
	wrstuden-fixsa-base:1.5
	abandoned-netbsd-4-base:1.5
	abandoned-netbsd-4:1.5.0.12
	netbsd-3-1:1.5.0.14
	netbsd-3-1-RELEASE:1.5
	netbsd-3-0-2-RELEASE:1.5
	netbsd-3-1-RC4:1.5
	netbsd-3-1-RC3:1.5
	netbsd-3-1-RC2:1.5
	netbsd-3-1-RC1:1.5
	netbsd-4:1.5.0.16
	netbsd-4-base:1.5
	netbsd-3-0-1-RELEASE:1.5
	netbsd-3-0:1.5.0.10
	netbsd-3-0-RELEASE:1.5
	netbsd-3-0-RC6:1.5
	netbsd-3-0-RC5:1.5
	netbsd-3-0-RC4:1.5
	netbsd-3-0-RC3:1.5
	netbsd-3-0-RC2:1.5
	netbsd-3-0-RC1:1.5
	netbsd-2-0-3-RELEASE:1.5
	netbsd-2-1:1.5.0.8
	netbsd-2-1-RELEASE:1.5
	netbsd-2-1-RC6:1.5
	netbsd-2-1-RC5:1.5
	netbsd-2-1-RC4:1.5
	netbsd-2-1-RC3:1.5
	netbsd-2-1-RC2:1.5
	netbsd-2-1-RC1:1.5
	netbsd-2-0-2-RELEASE:1.5
	netbsd-3:1.5.0.6
	netbsd-3-base:1.5
	netbsd-2-0-1-RELEASE:1.5
	netbsd-2:1.5.0.4
	netbsd-2-base:1.5
	netbsd-2-0-RELEASE:1.5
	netbsd-2-0-RC5:1.5
	netbsd-2-0-RC4:1.5
	netbsd-2-0-RC3:1.5
	netbsd-2-0-RC2:1.5
	netbsd-2-0-RC1:1.5
	netbsd-2-0:1.5.0.2
	netbsd-2-0-base:1.5
	netbsd-1-6-PATCH002-RELEASE:1.4
	netbsd-1-6-PATCH002:1.4
	netbsd-1-6-PATCH002-RC4:1.4
	netbsd-1-6-PATCH002-RC3:1.4
	netbsd-1-6-PATCH002-RC2:1.4
	netbsd-1-6-PATCH002-RC1:1.4
	netbsd-1-6-PATCH001:1.4
	netbsd-1-6-PATCH001-RELEASE:1.4
	netbsd-1-6-PATCH001-RC3:1.4
	netbsd-1-6-PATCH001-RC2:1.4
	netbsd-1-6-PATCH001-RC1:1.4
	fvdl_fs64_base:1.4
	netbsd-1-6-RELEASE:1.4
	netbsd-1-6-RC3:1.4
	netbsd-1-6-RC2:1.4
	netbsd-1-6-RC1:1.4
	netbsd-1-6:1.4.0.14
	netbsd-1-6-base:1.4
	netbsd-1-5-PATCH003:1.4
	netbsd-1-5-PATCH002:1.4
	netbsd-1-5-PATCH001:1.4
	netbsd-1-5-RELEASE:1.4
	netbsd-1-5-BETA2:1.4
	netbsd-1-5-BETA:1.4
	netbsd-1-4-PATCH003:1.4
	netbsd-1-5-ALPHA2:1.4
	netbsd-1-5:1.4.0.12
	netbsd-1-5-base:1.4
	minoura-xpg4dl:1.4.0.10
	minoura-xpg4dl-base:1.4
	netbsd-1-4-PATCH002:1.4
	wrstuden-devbsize-19991221:1.4
	wrstuden-devbsize:1.4.0.8
	wrstuden-devbsize-base:1.4
	comdex-fall-1999:1.4.0.6
	comdex-fall-1999-base:1.4
	netbsd-1-4-PATCH001:1.4
	netbsd-1-4-RELEASE:1.4
	netbsd-1-4:1.4.0.4
	netbsd-1-4-base:1.4
	netbsd-1-3-PATCH003:1.4
	netbsd-1-3-PATCH003-CANDIDATE2:1.4
	netbsd-1-3-PATCH003-CANDIDATE1:1.4
	netbsd-1-3-PATCH003-CANDIDATE0:1.4
	netbsd-1-3-PATCH002:1.4
	netbsd-1-3-PATCH001:1.4
	netbsd-1-3-RELEASE:1.4
	netbsd-1-3-BETA:1.4
	netbsd-1-3:1.4.0.2
	netbsd-1-3-base:1.4
	netbsd-1-2-PATCH001:1.1.2.1
	netbsd-1-2-RELEASE:1.1.2.1
	netbsd-1-2-BETA:1.1.2.1
	netbsd-1-2-base:1.1.2.1
	netbsd-1-2:1.1.0.2;
locks; strict;
comment	@# @;


1.5
date	2003.01.06.20.30.42;	author wiz;	state Exp;
branches
	1.5.32.1;
next	1.4;

1.4
date	97.04.18.18.05.26;	author cgd;	state Exp;
branches;
next	1.3;

1.3
date	97.02.17.20.15.40;	author cgd;	state Exp;
branches;
next	1.2;

1.2
date	96.06.15.04.04.28;	author cgd;	state Exp;
branches;
next	1.1;

1.1
date	96.06.15.04.02.44;	author cgd;	state dead;
branches
	1.1.2.1;
next	;

1.5.32.1
date	2008.10.05.20.10.11;	author mjf;	state dead;
branches;
next	;

1.1.2.1
date	96.06.15.04.02.44;	author cgd;	state Exp;
branches;
next	;


desc
@@


1.5
log
@writable, not writeable.
@
text
@# $NetBSD: rc.hack,v 1.4 1997/04/18 18:05:26 cgd Exp $

# Hackish /etc/rc to do basic setup for a distribution rz25 image to
# make it slightly easier to use.

PATH=/sbin:/usr/sbin:/bin:/usr/bin:/alphadist
export PATH

single_user()
{
	echo "Returning to single-user mode..."
	exit 1
}

root_dev=`(sysctl -n machdep.root_device) 2> /dev/null`
#echo "root_dev is '$root_dev'"

if [ X"${root_dev}" = X'' ] || [ X"${root_dev}" = X'??' ]; then
	echo "Can't figure out root device!"
	single_user
fi

root_dev_base=`expr $root_dev : '\([a-z][a-z]*\)[0-9]*[a-z]'`
root_dev_unit=`expr $root_dev : '[a-z][a-z]*\([0-9]*\)[a-z]'`
root_dev_part=`expr $root_dev : '[a-z][a-z]*[0-9]*\([a-z]\)'`

#echo $root_dev_base
#echo $root_dev_unit
#echo $root_dev_part

usr_dev="${root_dev_base}${root_dev_unit}d"
#echo usr_dev = $usr_dev

case $root_dev_base in
cd|sd|wd)
	;;

*)
	echo "Unexpected root device type '$root_dev_base'."
	single_user
	;;
esac

# If /tmp is already writable, we've already been run...  punt!
if [ -w /tmp ]; then
	echo ""
	case $root_dev_base in
	cd)
		echo "Can't boot multi-user from a CD-ROM, because"
		echo "the system can't have been configured."
		echo ""
		echo "Install on a real disk!"
		echo ""
		single_user
		;;

	sd|wd)
		echo "If you want to boot multi-user, make sure that you've"
		echo "configured the system properly, then run the"
		echo "following:"
		echo ""
		echo "        /bin/rm -f /etc/rc"
		echo "        /bin/cp -p /alphadist/rc.real /etc/rc"
		echo ""
		echo "from single-user mode then exit the single-user shell."
		echo ""
		single_user
		;;
	esac
fi

case $root_dev_base in
cd)
	echo -n "Remounting root device..."
	mount -u -o ro /dev/$root_dev /
	echo ""

	echo -n "Mounting /usr..."
	mount -o ro /dev/$usr_dev /usr
	echo ""

	echo -n "Preparing temporary file systems..."
	mount -t mfs -o -s=6144 swap /tmp
	mount -t mfs -o -s=6144 swap /var/tmp
	mkdir /var/tmp/vi.recover
	chmod -R 1777 /tmp /var/tmp
	echo ""
	;;

sd|wd)
	echo "Checking root and /usr..."
	fsck -n -t ffs /dev/r$root_dev /dev/r$usr_dev > /dev/null 2>&1
	if [ $? -ne 0 ]; then
		echo "File system check failed!"
		single_user
	fi

	echo -n "Remounting root device..."
	mount -u /dev/$root_dev /
	echo ""

	echo -n "Mounting /usr..."
	mount /dev/$usr_dev /usr
	echo ""
	;;
esac

single_user
@


1.5.32.1
log
@Sync with HEAD.
@
text
@d1 1
a1 1
# $NetBSD: rc.hack,v 1.5 2003/01/06 20:30:42 wiz Exp $
@


1.4
log
@rcs id cleanups
@
text
@d1 1
a1 1
# $NetBSD: rc.hack,v 1.3 1997/02/17 20:15:40 cgd Exp $
d44 1
a44 1
# If /tmp is already writeable, we've already been run...  punt!
@


1.3
log
@support wd, add '-t ffs' to fsck
@
text
@d1 1
a1 1
#	$NetBSD: rc.hack,v 1.2 1996/06/15 04:04:28 cgd Exp $
@


1.2
log
@pull down from branch:
>add a little hack, to replace /etc/rc on the distribution disk image,
>to make life a little bit easier for people just starting out.
>(remounts root read-write, mounts /usr, etc.)  includes instructions
>on how to get 'normal' /etc/rc as the default.  does _not_ appear
>in the tar files.
@
text
@d1 1
a1 1
#	$NetBSD$
d35 1
a35 1
cd|sd)
d57 1
a57 1
	sd)
d90 1
a90 1
sd)
d92 1
a92 1
	fsck -n /dev/r$root_dev /dev/r$usr_dev > /dev/null 2>&1
@


1.1
log
@file rc.hack was initially added on branch netbsd-1-2.
@
text
@d1 108
@


1.1.2.1
log
@add a little hack, to replace /etc/rc on the distribution disk image,
to make life a little bit easier for people just starting out.
(remounts root read-write, mounts /usr, etc.)  includes instructions
on how to get 'normal' /etc/rc as the default.  does _not_ appear
in the tar files.
@
text
@a0 108
#	$NetBSD$

# Hackish /etc/rc to do basic setup for a distribution rz25 image to
# make it slightly easier to use.

PATH=/sbin:/usr/sbin:/bin:/usr/bin:/alphadist
export PATH

single_user()
{
	echo "Returning to single-user mode..."
	exit 1
}

root_dev=`(sysctl -n machdep.root_device) 2> /dev/null`
#echo "root_dev is '$root_dev'"

if [ X"${root_dev}" = X'' ] || [ X"${root_dev}" = X'??' ]; then
	echo "Can't figure out root device!"
	single_user
fi

root_dev_base=`expr $root_dev : '\([a-z][a-z]*\)[0-9]*[a-z]'`
root_dev_unit=`expr $root_dev : '[a-z][a-z]*\([0-9]*\)[a-z]'`
root_dev_part=`expr $root_dev : '[a-z][a-z]*[0-9]*\([a-z]\)'`

#echo $root_dev_base
#echo $root_dev_unit
#echo $root_dev_part

usr_dev="${root_dev_base}${root_dev_unit}d"
#echo usr_dev = $usr_dev

case $root_dev_base in
cd|sd)
	;;

*)
	echo "Unexpected root device type '$root_dev_base'."
	single_user
	;;
esac

# If /tmp is already writeable, we've already been run...  punt!
if [ -w /tmp ]; then
	echo ""
	case $root_dev_base in
	cd)
		echo "Can't boot multi-user from a CD-ROM, because"
		echo "the system can't have been configured."
		echo ""
		echo "Install on a real disk!"
		echo ""
		single_user
		;;

	sd)
		echo "If you want to boot multi-user, make sure that you've"
		echo "configured the system properly, then run the"
		echo "following:"
		echo ""
		echo "        /bin/rm -f /etc/rc"
		echo "        /bin/cp -p /alphadist/rc.real /etc/rc"
		echo ""
		echo "from single-user mode then exit the single-user shell."
		echo ""
		single_user
		;;
	esac
fi

case $root_dev_base in
cd)
	echo -n "Remounting root device..."
	mount -u -o ro /dev/$root_dev /
	echo ""

	echo -n "Mounting /usr..."
	mount -o ro /dev/$usr_dev /usr
	echo ""

	echo -n "Preparing temporary file systems..."
	mount -t mfs -o -s=6144 swap /tmp
	mount -t mfs -o -s=6144 swap /var/tmp
	mkdir /var/tmp/vi.recover
	chmod -R 1777 /tmp /var/tmp
	echo ""
	;;

sd)
	echo "Checking root and /usr..."
	fsck -n /dev/r$root_dev /dev/r$usr_dev > /dev/null 2>&1
	if [ $? -ne 0 ]; then
		echo "File system check failed!"
		single_user
	fi

	echo -n "Remounting root device..."
	mount -u /dev/$root_dev /
	echo ""

	echo -n "Mounting /usr..."
	mount /dev/$usr_dev /usr
	echo ""
	;;
esac

single_user
@
