From owner-freebsd-i386@FreeBSD.ORG Sat Aug 4 15:30:02 2007 Return-Path: Delivered-To: freebsd-i386@hub.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id CC74B16A421 for ; Sat, 4 Aug 2007 15:30:02 +0000 (UTC) (envelope-from gnats@FreeBSD.org) Received: from freefall.freebsd.org (freefall.freebsd.org [IPv6:2001:4f8:fff6::28]) by mx1.freebsd.org (Postfix) with ESMTP id BF40F13C469 for ; Sat, 4 Aug 2007 15:30:02 +0000 (UTC) (envelope-from gnats@FreeBSD.org) Received: from freefall.freebsd.org (gnats@localhost [127.0.0.1]) by freefall.freebsd.org (8.14.1/8.14.1) with ESMTP id l74FU2En038694 for ; Sat, 4 Aug 2007 15:30:02 GMT (envelope-from gnats@freefall.freebsd.org) Received: (from gnats@localhost) by freefall.freebsd.org (8.14.1/8.14.1/Submit) id l74FU2nA038693; Sat, 4 Aug 2007 15:30:02 GMT (envelope-from gnats) Resent-Date: Sat, 4 Aug 2007 15:30:02 GMT Resent-Message-Id: <200708041530.l74FU2nA038693@freefall.freebsd.org> Resent-From: FreeBSD-gnats-submit@FreeBSD.org (GNATS Filer) Resent-To: freebsd-i386@FreeBSD.org Resent-Reply-To: FreeBSD-gnats-submit@FreeBSD.org, Joe Barbish Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 41BD016A41A for ; 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 ; 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 ; 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 To: freebsd-gnats-submit@FreeBSD.org X-Send-Pr-Version: www-3.0 Cc: Subject: i386/115197: can not install from USB stick drive X-BeenThere: freebsd-i386@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: I386-specific issues for FreeBSD List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 04 Aug 2007 15:30:02 -0000 >Number: 115197 >Category: i386 >Synopsis: can not install from USB stick drive >Confidential: no >Severity: non-critical >Priority: low >Responsible: freebsd-i386 >State: open >Quarter: >Keywords: >Date-Required: >Class: update >Submitter-Id: current-users >Arrival-Date: Sat Aug 04 15:30:02 GMT 2007 >Closed-Date: >Last-Modified: >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: >Unformatted: