Changeset View
Changeset View
Standalone View
Standalone View
usr.sbin/bsdinstall/scripts/umount
Show All 20 Lines | |||||
# OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) | # OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) | ||||
# HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT | # HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT | ||||
# LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY | # LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY | ||||
# OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF | # OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF | ||||
# SUCH DAMAGE. | # SUCH DAMAGE. | ||||
# | # | ||||
# $FreeBSD$ | # $FreeBSD$ | ||||
# If we mounted the DVD packages, unmount them | |||||
if [ -d $BSDINSTALL_CHROOT/dist/packages ]; then | |||||
umount $BSDINSTALL_CHROOT/dist/packages | |||||
rmdir $BSDINSTALL_CHROOT/dist/packages | |||||
rmdir $BSDINSTALL_CHROOT/dist | |||||
fi | |||||
TMP_FSTAB=${TMPDIR:-"/tmp"}/bsdinstall-tmp-fstab | TMP_FSTAB=${TMPDIR:-"/tmp"}/bsdinstall-tmp-fstab | ||||
cat $PATH_FSTAB | awk -v BSDINSTALL_CHROOT=$BSDINSTALL_CHROOT '{ | cat $PATH_FSTAB | awk -v BSDINSTALL_CHROOT=$BSDINSTALL_CHROOT '{ | ||||
if ($2 ~ "^/.*") { | if ($2 ~ "^/.*") { | ||||
fsname = $2; | fsname = $2; | ||||
if (fsname == "/") | if (fsname == "/") | ||||
fsname = "" | fsname = "" | ||||
printf("%s\t%s%s\t%s\t%s\t%s\t%s\n", $1, BSDINSTALL_CHROOT, | printf("%s\t%s%s\t%s\t%s\t%s\t%s\n", $1, BSDINSTALL_CHROOT, | ||||
fsname, $3, $4, $5, $6); | fsname, $3, $4, $5, $6); | ||||
} | } | ||||
}' > $TMP_FSTAB | }' > $TMP_FSTAB | ||||
umount $BSDINSTALL_CHROOT/dev 2>/dev/null | umount $BSDINSTALL_CHROOT/dev 2>/dev/null | ||||
if [ -n "$TMP_FSTAB" ]; then | if [ -n "$TMP_FSTAB" ]; then | ||||
umount -F $TMP_FSTAB -a 2>/dev/null | umount -F $TMP_FSTAB -a 2>/dev/null | ||||
fi | fi |