11.8Ssalo# $NetBSD: dot.upgrutils,v 1.8 2003/07/26 17:06:30 salo Exp $ 21.1Schopps# 31.1Schopps# Copyright (c) 1994 Christopher G. Demetriou 41.1Schopps# All rights reserved. 51.1Schopps# 61.1Schopps# Redistribution and use in source and binary forms, with or without 71.1Schopps# modification, are permitted provided that the following conditions 81.1Schopps# are met: 91.1Schopps# 1. Redistributions of source code must retain the above copyright 101.1Schopps# notice, this list of conditions and the following disclaimer. 111.1Schopps# 2. Redistributions in binary form must reproduce the above copyright 121.1Schopps# notice, this list of conditions and the following disclaimer in the 131.1Schopps# documentation and/or other materials provided with the distribution. 141.1Schopps# 3. All advertising materials mentioning features or use of this software 151.1Schopps# must display the following acknowledgement: 161.7Scgd# This product includes software developed for the 171.8Ssalo# NetBSD Project. See http://www.NetBSD.org/ for 181.7Scgd# information about NetBSD. 191.1Schopps# 4. The name of the author may not be used to endorse or promote products 201.7Scgd# derived from this software without specific prior written permission. 211.7Scgd# 221.1Schopps# THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR 231.1Schopps# IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES 241.1Schopps# OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. 251.1Schopps# IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, 261.1Schopps# INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT 271.1Schopps# NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, 281.1Schopps# DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY 291.1Schopps# THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT 301.1Schopps# (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF 311.1Schopps# THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 321.7Scgd# 331.7Scgd# <<Id: LICENSE,v 1.2 2000/06/14 15:57:33 cgd Exp>> 341.1Schopps 351.1Schopps# Upgrade cleanup utilites (functions), to make sure a recently-upgraded 361.1Schopps# system is safely runnable. These are meant to be invoked from the shell 371.1Schopps# prompt, by people installing NetBSD. 381.1Schopps 391.1SchoppsCleanup() 401.1Schopps{ 411.1Schopps upgrade_dir=/ 421.1Schopps 431.1Schopps if [ ! -f /etc/fstab ]; then 441.1Schopps upgrade_dir=/mnt 451.1Schopps fi 461.1Schopps 471.1Schopps echo "Cleaning up miscellaneous files in /etc..." 481.1Schopps chroot $upgrade_dir /usr/sbin/pwd_mkdb -p /etc/master.passwd 491.1Schopps chroot $upgrade_dir /bin/rm /etc/sendmail.fc > /dev/null 2>&1 501.1Schopps sync 511.1Schopps echo "Done." 521.1Schopps 531.1Schopps echo "" 541.3Sis echo -n "Copying the kernel..." 551.3Sis cp /netbsd $upgrade_dir/netbsd 561.3Sis echo "Done." 571.3Sis echo -n "Installing boot block..." 581.3Sis read rdev rest < /mnt/etc/fstab 591.4Sis /mnt/usr/mdec/installboot /mnt/usr/mdec/xxboot `echo $rdev | sed -e 's^/dev/^/dev/r^'` 601.3Sis echo " done." 611.3Sis 621.3Sis echo "" 631.3Sis echo "You should now halt your machine using the 'halt' command." 641.3Sis echo "Once the machine is halted, reboot it." 651.3Sis 661.1Schopps} 67