From owner-freebsd-questions@FreeBSD.ORG Mon Sep 15 15:30:19 2014 Return-Path: Delivered-To: freebsd-questions@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id C7E5B8CD for ; Mon, 15 Sep 2014 15:30:19 +0000 (UTC) Received: from sola.nimnet.asn.au (paqi.nimnet.asn.au [115.70.110.159]) (using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 3F8AF1EE for ; Mon, 15 Sep 2014 15:30:18 +0000 (UTC) Received: from localhost (localhost [127.0.0.1]) by sola.nimnet.asn.au (8.14.2/8.14.2) with ESMTP id s8FFSZOk035601; Tue, 16 Sep 2014 01:28:36 +1000 (EST) (envelope-from smithi@nimnet.asn.au) Date: Tue, 16 Sep 2014 01:28:35 +1000 (EST) From: Ian Smith To: Michael Sierchio Subject: Re: Using the ISO releases on USB sticks. In-Reply-To: Message-ID: <20140911224106.X61666@sola.nimnet.asn.au> References: MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII Cc: freebsd-questions@freebsd.org, atar , Derek Ragona , Darren Pilgrim X-BeenThere: freebsd-questions@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: User questions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 15 Sep 2014 15:30:20 -0000 In freebsd-questions Digest, Vol 536, Issue 5, Message: 25 On Wed, 10 Sep 2014 18:16:22 -0400 Michael Sierchio writes: > On Wed, Sep 10, 2014 at 12:34 PM, atar wrote: > > I know about the 'memstick.img' version but I want just the ISO > > versions because they have more softwares installed on them right > > from the package and I want to use them just from my USB stick. > > There are tools that make an ISO image into a bootable USB stick. > > http://bit.ly/1rX250x The LMGTFY page that points to falsely insists my JS isn't enabled, and googling 'iso to usb freebsd' found plenty of mostly dead ends and red herrings - you may be luckier :) What works[*] is the below script by Darren Pilgrim, derived from the /usr/src/release scripts with a tar joiner. I just used it to make a 2GB FreeBSD-9.3-RELEASE-amd64-dvd1-memstick.img .. not yet installed. ======== #!/bin/sh # originally by Darren Pilgrim 17/12/13 from http://pastebin.com/fzgVaCgW # smithi@nimnet.asn.au 22/2/14 for FreeBSD 8.2-R (no makefs label option) # compaction & extra paranoia 23/6/14; rm 8.2 hack, quit() tidyup 11/9/14 PATH=/bin:/usr/bin:/sbin:/usr/sbin export PATH if [ -z "$*" ]; then echo `basename $0 [dvd1 img] [dvd1 dir] [memstick img] [memstick dir]` echo ' [dvd1 img] is the dvd1 image to convert' echo ' [dvd1 dir] is the mountpoint for the dvd1 image' echo ' [memstick img] is name of the memstick image file to create' echo ' [memstick dir] is temporary work directory for memstick contents' exit 1 fi quit() { echo "$1" ; exit 1 ; } [ `id -u` -ne 0 ] && quit "This script must be run as root" [ ! -f $1 ] && quit "Source dvd1 image $1 does not exist" [ ! -d $2 ] && quit "dvd1 dir mountpoint $2 must be a directory" [ -e $3 ] && quit "Memstick img file $3 already exists" [ ! -d $4 ] && quit "Memstick dir $4 not an existing directory" [ `du -sm $4 | awk '{print $1}'` -gt 2 ] && quit "Memstick dir $4 not empty" unit=`mdconfig -f $1` || quit "dvd1 img mdconfig fail" mount_cd9660 /dev/$unit $2 || quit "mount_cd9660 fail" tar cf - -C $2 . | tar xpf - -C $4 || quit "tar pipeline fail" umount $2 && mdconfig -d -u $unit || quit "Could not umount dvd1" echo '/dev/ufs/FreeBSD_Install / ufs ro,noatime 1 1' > $4/etc/fstab makefs -B little -o label=FreeBSD_Install $3 $4 || quit "makefs fail" unit=`mdconfig -f $3` || quit "memstick img mdconfig fail" gpart create -s BSD $unit || quit "gpart create -s BSD fail" gpart bootcode -b $4/boot/boot $unit || quit "gpart bootcode fail" gpart add -t freebsd-ufs $unit || quit "gpart add -t freebsd-ufs fail" mdconfig -d -u $unit echo "Memstick image $3 created:" ; ls -l $3 ======= [*] These images boot and install FreeBSD fine, however with 10.0-R, bsdconfig failed to install included packages, due to relying on how it _detected_ its media not as a CD/DVD but as USB/other, and so not pointing pkg(8) to its local package repository - thus needing an online connection, rather contrary to the point of a DVD[-like] install .. When I can find a spare box to test on, I hope to try a patch to fix this - unless 9.3-R is already updated from 10.0-R in this respect? So with 10-R, as things stand, this won't work for atar's primary aim. Once installed and rebooted, you could perhaps add its packages/All/ to a properly pre-configured local repo then install pkgs from that, but I don't grok pkg(8) at all well yet .. fortunately, others do. I've just seen Matthias Apitz' post; more complicated but thorough. If atar works through that there's lots to be learned. The above is more just for moving a release from .iso to .img format fairly quickly. cheers, Ian