From nobody@FreeBSD.org  Sat Aug  4 15:25:45 2007
Return-Path: <nobody@FreeBSD.org>
Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34])
	by hub.freebsd.org (Postfix) with ESMTP id 41BD016A41A
	for <freebsd-gnats-submit@FreeBSD.org>; Sat,  4 Aug 2007 15:25:45 +0000 (UTC)
	(envelope-from nobody@FreeBSD.org)
Received: from www.freebsd.org (www.freebsd.org [IPv6:2001:4f8:fff6::21])
	by mx1.freebsd.org (Postfix) with ESMTP id 44E5D13C45E
	for <freebsd-gnats-submit@FreeBSD.org>; Sat,  4 Aug 2007 15:25:45 +0000 (UTC)
	(envelope-from nobody@FreeBSD.org)
Received: from www.freebsd.org (localhost [127.0.0.1])
	by www.freebsd.org (8.14.1/8.14.1) with ESMTP id l74FPiGd046529
	for <freebsd-gnats-submit@FreeBSD.org>; Sat, 4 Aug 2007 15:25:44 GMT
	(envelope-from nobody@www.freebsd.org)
Received: (from nobody@localhost)
	by www.freebsd.org (8.14.1/8.14.1/Submit) id l74FPixq046528;
	Sat, 4 Aug 2007 15:25:44 GMT
	(envelope-from nobody)
Message-Id: <200708041525.l74FPixq046528@www.freebsd.org>
Date: Sat, 4 Aug 2007 15:25:44 GMT
From: Joe Barbish <fbsd2@a1poweruser.com>
To: freebsd-gnats-submit@FreeBSD.org
Subject: can not install from USB stick drive
X-Send-Pr-Version: www-3.0

>Number:         115197
>Category:       bin
>Synopsis:       sysinstall(8): can not install from USB stick drive
>Confidential:   no
>Severity:       non-critical
>Priority:       low
>Responsible:    brucec
>State:          closed
>Quarter:        
>Keywords:       
>Date-Required:  
>Class:          update
>Submitter-Id:   current-users
>Arrival-Date:   Sat Aug 04 15:30:02 GMT 2007
>Closed-Date:    Sun Dec 05 09:38:17 UTC 2010
>Last-Modified:  Sun Dec 05 09:38:17 UTC 2010
>Originator:     Joe Barbish
>Release:        6.2
>Organization:
>Environment:
>Description:
Put the cd1 .iso install cdrom file on a 1GB USB stick drive. Was able
to boot from it ok. During the sysinstall process after it asks for hard
drive fdisk and bsdlable info it asks you for where to get the install
files from (IE: cdrom, remote ftp, floppy, dos partition, ECT) there is
no option to tell the sysinstall program to use USB-dd as source location. 

Here is the script I used to populate the USB stick drive with the cd1.iso
info.


#!/bin/sh
#Purpose = Use to transfer the FreeBSD install cd1 to 
#          a bootable 1GB USB flash drive so it can be used to install from. 
#          First fetch the FreeBSD 6.2-RELEASE-i386-disc1.iso to your
#          hard drive /usr. Then execute this script from the command line
# fbsd2usb /usr/6.2-RELEASE-i386-disc1.iso /usr/6.2-RELEASE-i386-disc1.img
# Change system bios to boot from USB-dd and away you go. 

# NOTE: This script has to be run from root and your 1GB USB flash drive
#       has to be plugged in before running this script. 

# On the command line enter fbsd2usb iso-path img-path

# You can set some variables here. Edit them to fit your needs.

# Set serial variable to 0 if you don't want serial console at all,
# 1 if you want comconsole and 2 if you want comconsole and vidconsole
serial=0

set -u

if [ $# -lt 2 ]; then
    echo "Usage: $0 source-iso-path output-img-path"
    exit 1
fi

isoimage=$1; shift
imgoutfile=$1; shift

# Temp  directory to be used later
#export tmpdir=$(mktemp -d -t fbsdmount)
export tmpdir=$(mktemp -d /usr/fbsdmount)

export isodev=$(mdconfig -a -t vnode -f ${isoimage})

ISOSIZE=$(du -k ${isoimage} | awk '{print $1}')
SECTS=$((($ISOSIZE + ($ISOSIZE/5))*4))
#SECTS=$((($ISOSIZE + ($ISOSIZE/5))*2))


echo " "
echo "### Initializing image File started ###"
echo "### This will take about 4 minutes ###"
date
dd if=/dev/zero of=${imgoutfile} count=${SECTS}
echo "### Initializing image File completed ###"
date

echo " "
ls -l ${imgoutfile}
export imgdev=$(mdconfig -a -t vnode -f ${imgoutfile})

bsdlabel -w -B ${imgdev}
newfs -O1 /dev/${imgdev}a

mkdir -p ${tmpdir}/iso ${tmpdir}/img

mount -t cd9660 /dev/${isodev} ${tmpdir}/iso
mount /dev/${imgdev}a ${tmpdir}/img

echo " "
echo "### Started Copying files to the image now ###"
echo "### This will take about 15 minutes ###"
date

( cd ${tmpdir}/iso && find . -print -depth | cpio -dump ${tmpdir}/img )

echo "### Completed Copying files to the image ###"
date


if [ ${serial} -eq 2 ]; then
        echo "-D" > ${tmpdir}/img/boot.config
        echo 'console="comconsole, vidconsole"' >> ${tmpdir}/img/boot/loader.conf
elif [ ${serial} -eq 1 ]; then
        echo "-h" > ${tmpdir}/img/boot.config
        echo 'console="comconsole"' >> ${tmpdir}/img/boot/loader.conf
fi

echo " "
echo "### Started writing image to flash drive now ###"
echo "### This will take about 30 minutes ###"
date
dd if=${imgoutfile} of=/dev/da0 bs=1m
echo "### Completed writing image to flash drive at ###"
date

cleanup() {
    umount ${tmpdir}/iso
    mdconfig -d -u ${isodev}
    umount ${tmpdir}/img
    mdconfig -d -u ${imgdev}
    rm -rf ${tmpdir} 
}

cleanup

ls -lh ${imgoutfile}

echo "### Script finished ###"


>How-To-Repeat:

>Fix:
Make change to sysinstall pgm and add option to use USB-dd as source of
install files.

>Release-Note:
>Audit-Trail:
Responsible-Changed-From-To: freebsd-i386->freebsd-usb 
Responsible-Changed-By: linimon 
Responsible-Changed-When: Mon Sep 17 03:40:14 UTC 2007 
Responsible-Changed-Why:  
This does not sound i386-specific. 

http://www.freebsd.org/cgi/query-pr.cgi?pr=115197 
Responsible-Changed-From-To: freebsd-usb->freebsd-bugs 
Responsible-Changed-By: linimon 
Responsible-Changed-When: Mon Jan 28 08:47:38 UTC 2008 
Responsible-Changed-Why:  
On rereading, this is actually a sysinstall PR. 

http://www.freebsd.org/cgi/query-pr.cgi?pr=115197 

From: "enom-FBSD1" <fbsd1@a1poweruser.com>
To: <bug-followup@FreeBSD.org>
Cc: <fbsd1@a1poweruser.com>
Subject: Re: bin/115197: sysinstall(8): can not install from USB stick drive
Date: Tue, 26 Aug 2008 12:26:16 +0800

 This is over a year old now.
 Does not look like it has been assigned to anyone.
 It's not a bug.
 It's a simple function addition to update the sysinstall to use the current
 popular USB disk sticks as install media.
 Can this make it into release 8.0??
 
Responsible-Changed-From-To: freebsd-bugs->kensmith 
Responsible-Changed-By: kensmith 
Responsible-Changed-When: Mon Dec 15 00:50:59 UTC 2008 
Responsible-Changed-Why:  
Looking into options for USB media for installs. 

http://www.freebsd.org/cgi/query-pr.cgi?pr=115197 

From: Christopher Key <cjk32@cam.ac.uk>
To: bug-followup@FreeBSD.org, fbsd2@a1poweruser.com
Cc:  
Subject: Re: bin/115197: sysinstall(8): can not install from USB stick drive
Date: Thu, 12 Mar 2009 10:14:30 +0000

 Is there any chance that the fix for this might also enable the 
 'Fixit/Use the "live" filesystem CDROM/DVD' to work from a USB stick too?

From: dfilter@FreeBSD.ORG (dfilter service)
To: bug-followup@FreeBSD.org
Cc:  
Subject: Re: bin/115197: commit references a PR
Date: Wed, 24 Jun 2009 23:17:15 +0000 (UTC)

 Author: cperciva
 Date: Wed Jun 24 23:17:00 2009
 New Revision: 194931
 URL: http://svn.freebsd.org/changeset/base/194931
 
 Log:
   Make sysinstall search for /dev/daXa and register such devices as USB disks.
   This covers the common case of unsliced USB drives, and makes it possible to
   select them as installation source media.
   
   PR:		61152, 115197, 135016
   Submitted by:	randi
   MFC after:	1 month
 
 Added:
   head/usr.sbin/sysinstall/usb.c   (contents, props changed)
 Modified:
   head/usr.sbin/sysinstall/Makefile
   head/usr.sbin/sysinstall/devices.c
   head/usr.sbin/sysinstall/dispatch.c
   head/usr.sbin/sysinstall/media.c
   head/usr.sbin/sysinstall/menus.c
   head/usr.sbin/sysinstall/options.c
   head/usr.sbin/sysinstall/sysinstall.h
 
 Modified: head/usr.sbin/sysinstall/Makefile
 ==============================================================================
 --- head/usr.sbin/sysinstall/Makefile	Wed Jun 24 22:57:07 2009	(r194930)
 +++ head/usr.sbin/sysinstall/Makefile	Wed Jun 24 23:17:00 2009	(r194931)
 @@ -11,7 +11,7 @@ SRCS=	anonFTP.c cdrom.c command.c config
  	ftp.c globals.c http.c index.c install.c installUpgrade.c keymap.c \
  	label.c main.c makedevs.c media.c menus.c misc.c modules.c \
  	mouse.c msg.c network.c nfs.c options.c package.c \
 -	system.c tcpip.c termcap.c ttys.c ufs.c user.c \
 +	system.c tcpip.c termcap.c ttys.c ufs.c usb.c user.c \
  	variable.c ${_wizard} keymap.h countries.h
  
  CFLAGS+= -DUSE_GZIP=1
 
 Modified: head/usr.sbin/sysinstall/devices.c
 ==============================================================================
 --- head/usr.sbin/sysinstall/devices.c	Wed Jun 24 22:57:07 2009	(r194930)
 +++ head/usr.sbin/sysinstall/devices.c	Wed Jun 24 23:17:00 2009	(r194931)
 @@ -65,6 +65,8 @@ static int numDevs;
  	DEVICE_ENTRY(DEVICE_TYPE_NETWORK, name, descr, 0)
  #define	SERIAL(name, descr, max)					\
  	DEVICE_ENTRY(DEVICE_TYPE_NETWORK, name, descr, max)
 +#define	USB(name, descr, max)						\
 +	DEVICE_ENTRY(DEVICE_TYPE_USB, name, descr, max)
  
  static struct _devname {
      DeviceType type;
 @@ -89,6 +91,7 @@ static struct _devname {
      DISK("mfid%d",	"LSI MegaRAID SAS array",		4),
      FLOPPY("fd%d",	"floppy drive unit A",			4),
      SERIAL("cuad%d",	"%s on device %s (COM%d)",		16),
 +    USB("da%da",	"USB Mass Storage Device",		16),
      NETWORK("ae",	"Attansic/Atheros L2 Fast Ethernet"),
      NETWORK("age",	"Attansic/Atheros L1 Gigabit Ethernet"),
      NETWORK("alc",	"Atheros AR8131/AR8132 PCIe Ethernet"),
 @@ -392,6 +395,22 @@ skipif:
  		}
  		break;
  
 +	    case DEVICE_TYPE_USB:
 +		fd = deviceTry(device_names[i], try, j);
 +		if (fd >= 0) {
 +			char n[BUFSIZ];
 +
 +			close(fd);
 +			snprintf(n, sizeof(n), device_names[i].name, j);
 +			deviceRegister(strdup(n), device_names[i].description,
 +			    strdup(try), DEVICE_TYPE_USB, TRUE, mediaInitUSB,
 +			    mediaGetUSB, mediaShutdownUSB, NULL);
 +
 +			if (isDebug())
 +				msgDebug("Found a USB disk for %s\n", try);
 +		}
 +		break;
 +
  	    case DEVICE_TYPE_NETWORK:
  		fd = deviceTry(device_names[i], try, j);
  		/* The only network devices that you can open this way are serial ones */
 
 Modified: head/usr.sbin/sysinstall/dispatch.c
 ==============================================================================
 --- head/usr.sbin/sysinstall/dispatch.c	Wed Jun 24 22:57:07 2009	(r194930)
 +++ head/usr.sbin/sysinstall/dispatch.c	Wed Jun 24 23:17:00 2009	(r194931)
 @@ -96,6 +96,7 @@ static struct _word {
      { "mediaClose",		dispatch_mediaClose	},
      { "mediaSetCDROM",		mediaSetCDROM		},
      { "mediaSetFloppy",		mediaSetFloppy		},
 +    { "mediaSetUSB",		mediaSetUSB		},
      { "mediaSetDOS",		mediaSetDOS		},
      { "mediaSetFTP",		mediaSetFTP		},
      { "mediaSetFTPActive",	mediaSetFTPActive	},
 @@ -511,7 +512,8 @@ dispatch_load_menu(dialogMenuItem *self)
      Device	**devlist;
      char	*err;
      int		what, i, j, msize, count;
 -    DeviceType	dtypes[] = {DEVICE_TYPE_FLOPPY, DEVICE_TYPE_CDROM, DEVICE_TYPE_DOS, DEVICE_TYPE_UFS};
 +    DeviceType	dtypes[] = {DEVICE_TYPE_FLOPPY, DEVICE_TYPE_CDROM,
 +	DEVICE_TYPE_DOS, DEVICE_TYPE_UFS, DEVICE_TYPE_USB};
  
      fprintf(stderr, "dispatch_load_menu called\n");
  
 
 Modified: head/usr.sbin/sysinstall/media.c
 ==============================================================================
 --- head/usr.sbin/sysinstall/media.c	Wed Jun 24 22:57:07 2009	(r194930)
 +++ head/usr.sbin/sysinstall/media.c	Wed Jun 24 23:17:00 2009	(r194931)
 @@ -221,6 +221,52 @@ mediaSetFloppy(dialogMenuItem *self)
  }
  
  static int
 +USBHook(dialogMenuItem *self)
 +{
 +	return genericHook(self, DEVICE_TYPE_USB);
 +}
 +
 +
 +/*
 + * Attempt to use USB as the installation media type.
 + */
 +int
 +mediaSetUSB(dialogMenuItem *self)
 +{
 +	Device **devs;
 +	int cnt;
 +
 +	mediaClose();
 +	devs = deviceFind(NULL, DEVICE_TYPE_USB);
 +	cnt = deviceCount(devs);
 +
 +	if (!cnt) {
 +		msgConfirm("No USB devices found!");
 +		return DITEM_FAILURE | DITEM_CONTINUE;
 +	}
 +	else if (cnt > 1) {
 +		DMenu *menu;
 +		int status;
 +
 +		menu = deviceCreateMenu(&MenuMediaUSB, DEVICE_TYPE_USB, USBHook,
 +		    NULL);
 +		if (!menu)
 +			msgFatal("Unable to create USB menu! Something is " \
 +			    "seriously wrong.");
 +		status = dmenuOpenSimple(menu, FALSE);
 +		free(menu);
 +		if (!status)
 +			return DITEM_FAILURE;
 +	}
 +	else
 +		mediaDevice = devs[0];
 +	if (mediaDevice)
 +		mediaDevice->private = NULL;
 +	msgConfirm("Using USB device: %s", mediaDevice->name);
 +	return (mediaDevice ? DITEM_LEAVE_MENU : DITEM_FAILURE);
 +}
 +
 +static int
  DOSHook(dialogMenuItem *self)
  {
      return genericHook(self, DEVICE_TYPE_DOS);
 
 Modified: head/usr.sbin/sysinstall/menus.c
 ==============================================================================
 --- head/usr.sbin/sysinstall/menus.c	Wed Jun 24 22:57:07 2009	(r194930)
 +++ head/usr.sbin/sysinstall/menus.c	Wed Jun 24 23:17:00 2009	(r194931)
 @@ -191,6 +191,7 @@ DMenu MenuIndex = {
        { " Media, NFS",		"Select NFS installation media.",	NULL, mediaSetNFS },
        { " Media, Floppy",	"Select floppy installation media.",	NULL, mediaSetFloppy },
        { " Media, CDROM/DVD",	"Select CDROM/DVD installation media.",	NULL, mediaSetCDROM },
 +      { " Media, USB",		"Select USB installation media.",	NULL, mediaSetUSB },
        { " Media, DOS",		"Select DOS installation media.",	NULL, mediaSetDOS },
        { " Media, UFS",		"Select UFS installation media.",	NULL, mediaSetUFS },
        { " Media, FTP",		"Select FTP installation media.",	NULL, mediaSetFTP },
 @@ -428,6 +429,16 @@ DMenu MenuMediaFloppy = {
      { { NULL } },
  };
  
 +DMenu MenuMediaUSB = {
 +	DMENU_NORMAL_TYPE | DMENU_SELECTION_RETURNS,
 +	"Choose a USB drive",
 +	"You have more than one USB drive. Please choose which drive\n"
 +	"you would like to use.",
 +	NULL,
 +	NULL,
 +	{ { NULL } },
 +};
 +
  DMenu MenuMediaDOS = {
      DMENU_NORMAL_TYPE | DMENU_SELECTION_RETURNS,
      "Choose a DOS partition",
 @@ -850,6 +861,7 @@ DMenu MenuMedia = {
        { "6 NFS",		"Install over NFS",			NULL, mediaSetNFS },
        { "7 File System",	"Install from an existing filesystem",	NULL, mediaSetUFS },
        { "8 Floppy",		"Install from a floppy disk set",	NULL, mediaSetFloppy },
 +      { "9 USB",		"Install from a USB drive",		NULL, mediaSetUSB },
        { "X Options",		"Go to the Options screen",		NULL, optionsEditor },
        { NULL } },
  };
 
 Modified: head/usr.sbin/sysinstall/options.c
 ==============================================================================
 --- head/usr.sbin/sysinstall/options.c	Wed Jun 24 22:57:07 2009	(r194930)
 +++ head/usr.sbin/sysinstall/options.c	Wed Jun 24 23:17:00 2009	(r194931)
 @@ -78,6 +78,9 @@ mediaCheck(Option *opt)
  	case DEVICE_TYPE_CDROM:
  	    return "CDROM";
  
 +	case DEVICE_TYPE_USB:
 +	    return "USB";
 +
  	case DEVICE_TYPE_DOS:
  	    return "DOS";
  
 
 Modified: head/usr.sbin/sysinstall/sysinstall.h
 ==============================================================================
 --- head/usr.sbin/sysinstall/sysinstall.h	Wed Jun 24 22:57:07 2009	(r194930)
 +++ head/usr.sbin/sysinstall/sysinstall.h	Wed Jun 24 23:17:00 2009	(r194931)
 @@ -271,6 +271,7 @@ typedef enum {
      DEVICE_TYPE_FTP,
      DEVICE_TYPE_NETWORK,
      DEVICE_TYPE_CDROM,
 +    DEVICE_TYPE_USB,
      DEVICE_TYPE_DOS,
      DEVICE_TYPE_UFS,
      DEVICE_TYPE_NFS,
 @@ -440,6 +441,7 @@ extern DMenu		MenuMedia;		/* Media type 
  extern DMenu		MenuMouse;		/* Mouse type menu				*/
  #endif
  extern DMenu		MenuMediaCDROM;		/* CDROM media menu				*/
 +extern DMenu		MenuMediaUSB;		/* USB media menu				*/
  extern DMenu		MenuMediaDOS;		/* DOS media menu				*/
  extern DMenu		MenuMediaFloppy;	/* Floppy media menu				*/
  extern DMenu		MenuMediaFTP;		/* FTP media menu				*/
 @@ -717,6 +719,7 @@ extern void	mediaClose(void);
  extern int	mediaTimeout(void);
  extern int	mediaSetCDROM(dialogMenuItem *self);
  extern int	mediaSetFloppy(dialogMenuItem *self);
 +extern int	mediaSetUSB(dialogMenuItem *self);
  extern int	mediaSetDOS(dialogMenuItem *self);
  extern int	mediaSetFTP(dialogMenuItem *self);
  extern int	mediaSetFTPActive(dialogMenuItem *self);
 @@ -848,6 +851,11 @@ extern void	mediaShutdownUFS(Device *dev
  extern Boolean	mediaInitUFS(Device *dev);
  extern FILE	*mediaGetUFS(Device *dev, char *file, Boolean probe);
  
 +/* usb.c */
 +extern Boolean	mediaInitUSB(Device *dev);
 +extern FILE	*mediaGetUSB(Device *dev, char *file, Boolean probe);
 +extern void	mediaShutdownUSB(Device *dev);
 +
  /* user.c */
  extern int	userAddGroup(dialogMenuItem *self);
  extern int	userAddUser(dialogMenuItem *self);
 
 Added: head/usr.sbin/sysinstall/usb.c
 ==============================================================================
 --- /dev/null	00:00:00 1970	(empty, because file is newly added)
 +++ head/usr.sbin/sysinstall/usb.c	Wed Jun 24 23:17:00 2009	(r194931)
 @@ -0,0 +1,88 @@
 +/*
 + * Redistribution and use in source and binary forms, with or without
 + * modification, are permitted provided that the following conditions
 + * are met:
 + * 1. Redistributions of source code must retain the above copyright
 + *    notice, this list of conditions and the following disclaimer,
 + *    verbatim and that no modifications are made prior to this
 + *    point in the file.
 + * 2. Redistributions in binary form must reproduce the above copyright
 + *    notice, this list of conditions and the following disclaimer in the
 + *    documentation and/or other materials provided with the distribution.
 + *
 + * THIS SOFTWARE IS PROVIDED BY JORDAN HUBBARD ``AS IS'' AND
 + * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
 + * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
 + * ARE DISCLAIMED.  IN NO EVENT SHALL JORDAN HUBBARD OR HIS PETS BE LIABLE
 + * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
 + * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
 + * OR SERVICES; LOSS OF USE, DATA, LIFE OR PROFITS; OR BUSINESS INTERRUPTION)
 + * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
 + * 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
 + * SUCH DAMAGE.
 + *
 + * used floppy.c and cdrom.c as templates, edited as necessary.
 + *
 + * $FreeBSD$
 + */
 +
 +#include <sys/fcntl.h>
 +#include <sys/param.h>
 +#include <sys/mount.h>
 +
 +#include <ufs/ufs/ufsmount.h>
 +
 +#include "sysinstall.h"
 +
 +static Boolean USBMounted;
 +static char mountpoint[] = "/dist";
 +
 +Boolean
 +mediaInitUSB(Device *dev)
 +{
 +	struct ufs_args ufsargs;
 +
 +	if (USBMounted)
 +		return TRUE;
 +
 +	Mkdir(mountpoint);
 +
 +	memset(&ufsargs, 0, sizeof(ufsargs));
 +	ufsargs.fspec = dev->devname;
 +
 +	if (mount("ufs", mountpoint, MNT_RDONLY, (caddr_t)&ufsargs) != -1) {
 +		USBMounted = TRUE;
 +		return TRUE;
 +	}
 +
 +	msgConfirm("Error mounting USB drive %s (%s) on %s : %s",
 +	    dev->name, dev->devname, mountpoint, strerror(errno));
 +	return FALSE;
 +}
 +
 +
 +FILE *
 +mediaGetUSB(Device *dev, char *file, Boolean probe)
 +{
 +	return mediaGenericGet(mountpoint, file);
 +}
 +
 +
 +/* 
 + * When sysinstall terminates, all USB drives handled by deviceRegister will 
 + * be checked and unmounted if necessary.
 + */
 +void
 +mediaShutdownUSB(Device *dev)
 +{
 +	if (!USBMounted) 
 +		return;
 +
 +	if (unmount(mountpoint, MNT_FORCE) != 0)
 +		msgConfirm("Could not unmount the USB drive from %s: %s", 
 +				mountpoint, strerror(errno));
 +	else
 +		USBMounted = FALSE;
 +
 +}
 _______________________________________________
 svn-src-all@freebsd.org mailing list
 http://lists.freebsd.org/mailman/listinfo/svn-src-all
 To unsubscribe, send any mail to "svn-src-all-unsubscribe@freebsd.org"
 
State-Changed-From-To: open->closed 
State-Changed-By: brucec 
State-Changed-When: Sun Dec 5 09:37:07 UTC 2010 
State-Changed-Why:  
Fixed in r194931 and merged to stable/8. 


Responsible-Changed-From-To: kensmith->brucec 
Responsible-Changed-By: brucec 
Responsible-Changed-When: Sun Dec 5 09:37:07 UTC 2010 
Responsible-Changed-Why:  
Track. 

http://www.freebsd.org/cgi/query-pr.cgi?pr=115197 
>Unformatted:
