12118f387SNathan Whitehorn#!/bin/sh 22118f387SNathan Whitehorn#- 32118f387SNathan Whitehorn# Copyright (c) 2011 Nathan Whitehorn 42118f387SNathan Whitehorn# All rights reserved. 52118f387SNathan Whitehorn# 62118f387SNathan Whitehorn# Redistribution and use in source and binary forms, with or without 72118f387SNathan Whitehorn# modification, are permitted provided that the following conditions 82118f387SNathan Whitehorn# are met: 92118f387SNathan Whitehorn# 1. Redistributions of source code must retain the above copyright 102118f387SNathan Whitehorn# notice, this list of conditions and the following disclaimer. 112118f387SNathan Whitehorn# 2. Redistributions in binary form must reproduce the above copyright 122118f387SNathan Whitehorn# notice, this list of conditions and the following disclaimer in the 132118f387SNathan Whitehorn# documentation and/or other materials provided with the distribution. 142118f387SNathan Whitehorn# 152118f387SNathan Whitehorn# THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND 162118f387SNathan Whitehorn# ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE 172118f387SNathan Whitehorn# IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE 182118f387SNathan Whitehorn# ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE 192118f387SNathan Whitehorn# FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL 202118f387SNathan Whitehorn# DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS 212118f387SNathan Whitehorn# OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) 222118f387SNathan Whitehorn# HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT 232118f387SNathan Whitehorn# LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY 242118f387SNathan Whitehorn# OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF 252118f387SNathan Whitehorn# SUCH DAMAGE. 262118f387SNathan Whitehorn# 272118f387SNathan Whitehorn# $FreeBSD$ 282118f387SNathan Whitehorn 29*a107ddbbSRebecca CranTMP_FSTAB=${TMPDIR:-"/tmp"}/bsdinstall-tmp-fstab 302118f387SNathan Whitehorn 312118f387SNathan Whitehorncat $PATH_FSTAB | awk -v BSDINSTALL_CHROOT=$BSDINSTALL_CHROOT '{ 322118f387SNathan Whitehorn if ($2 ~ "^/.*") { 332118f387SNathan Whitehorn fsname = $2; 342118f387SNathan Whitehorn if (fsname == "/") 352118f387SNathan Whitehorn fsname = "" 362118f387SNathan Whitehorn printf("%s\t%s%s\t%s\t%s\t%s\t%s\n", $1, BSDINSTALL_CHROOT, 372118f387SNathan Whitehorn fsname, $3, $4, $5, $6); 382118f387SNathan Whitehorn } 392118f387SNathan Whitehorn}' > $TMP_FSTAB 402118f387SNathan Whitehorn 412118f387SNathan WhitehornFILESYSTEMS=`cat $TMP_FSTAB | awk '/^[^#].*/ {if ($2 ~ "^/.*") printf("%s\n", $2);}' | sort -t /` 422118f387SNathan Whitehorn 432118f387SNathan Whitehornfor i in $FILESYSTEMS; do 442118f387SNathan Whitehorn mkdir -p $i 2>/dev/null 452118f387SNathan Whitehorn MNTERROR=`mount -F $TMP_FSTAB $i 2>&1` 462118f387SNathan Whitehorn if [ $? -ne 0 ]; then 472118f387SNathan Whitehorn dialog --backtitle "FreeBSD Installer" --title "Error" \ 482118f387SNathan Whitehorn --msgbox "Error mounting partition $i:\n$MNTERROR" 0 0 492118f387SNathan Whitehorn exit 1 502118f387SNathan Whitehorn fi 512118f387SNathan Whitehorndone 522118f387SNathan Whitehorn 532118f387SNathan Whitehorn# User might want a shell and require devfs, so mount it 542118f387SNathan Whitehornmkdir $BSDINSTALL_CHROOT/dev 2>/dev/null 552118f387SNathan Whitehornmount -t devfs devfs $BSDINSTALL_CHROOT/dev 56