From owner-freebsd-bugs@FreeBSD.ORG Tue Oct 28 22:30:02 2008 Return-Path: Delivered-To: freebsd-bugs@hub.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 18A51106568B for ; Tue, 28 Oct 2008 22: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 D04868FC0C for ; Tue, 28 Oct 2008 22:30:01 +0000 (UTC) (envelope-from gnats@FreeBSD.org) Received: from freefall.freebsd.org (gnats@localhost [127.0.0.1]) by freefall.freebsd.org (8.14.3/8.14.3) with ESMTP id m9SMU1Dm067499 for ; Tue, 28 Oct 2008 22:30:01 GMT (envelope-from gnats@freefall.freebsd.org) Received: (from gnats@localhost) by freefall.freebsd.org (8.14.3/8.14.3/Submit) id m9SMU1HJ067498; Tue, 28 Oct 2008 22:30:01 GMT (envelope-from gnats) Resent-Date: Tue, 28 Oct 2008 22:30:01 GMT Resent-Message-Id: <200810282230.m9SMU1HJ067498@freefall.freebsd.org> Resent-From: FreeBSD-gnats-submit@FreeBSD.org (GNATS Filer) Resent-To: freebsd-bugs@FreeBSD.org Resent-Reply-To: FreeBSD-gnats-submit@FreeBSD.org, Nick Hibma Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 3BC0F106564A for ; Tue, 28 Oct 2008 22:25:29 +0000 (UTC) (envelope-from nick@van-laarhoven.org) Received: from hpsmtp-eml18.kpnxchange.com (hpsmtp-eml18.KPNXCHANGE.COM [213.75.38.118]) by mx1.freebsd.org (Postfix) with ESMTP id C1AFB8FC0A for ; Tue, 28 Oct 2008 22:25:28 +0000 (UTC) (envelope-from nick@van-laarhoven.org) Received: from hpsmtp-eml05.kpnxchange.com ([213.75.38.105]) by hpsmtp-eml18.kpnxchange.com with Microsoft SMTPSVC(6.0.3790.3959); Tue, 28 Oct 2008 23:25:26 +0100 Received: from uitsmijter.van-laarhoven.org ([81.207.207.222]) by hpsmtp-eml05.kpnxchange.com with Microsoft SMTPSVC(6.0.3790.3959); Tue, 28 Oct 2008 23:25:20 +0100 Received: (qmail 52914 invoked by uid 98); 28 Oct 2008 22:25:20 -0000 Received: from 10.251.2.191 (nick@10.251.2.191) by uitsmijter.van-laarhoven.org (envelope-from , uid 82) with qmail-scanner-2.01 (clamdscan: 0.92/5270. f-prot: 4.6.7/3.16.15. spamassassin: 3.2.3. Clear:RC:0(10.251.2.191):SA:0(-1.4/5.0):. Processed in 5.646154 secs); 28 Oct 2008 22:25:20 -0000 Received: from unknown (HELO van-laarhoven.org) (nick@10.251.2.191) by uitsmijter.van-laarhoven.org with SMTP; 28 Oct 2008 22:25:14 -0000 Received: (nullmailer pid 51355 invoked by uid 1001); Tue, 28 Oct 2008 22:25:13 -0000 Message-Id: <1225232713.266403.51354.nullmailer@van-laarhoven.org> Date: Tue, 28 Oct 2008 23:25:13 +0100 From: Nick Hibma To: FreeBSD-gnats-submit@FreeBSD.org X-Send-Pr-Version: 3.113 Cc: Subject: misc/128444: USB stick install image X-BeenThere: freebsd-bugs@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: Bug reports List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 28 Oct 2008 22:30:02 -0000 >Number: 128444 >Category: misc >Synopsis: USB stick install image >Confidential: no >Severity: non-critical >Priority: low >Responsible: freebsd-bugs >State: open >Quarter: >Keywords: >Date-Required: >Class: change-request >Submitter-Id: current-users >Arrival-Date: Tue Oct 28 22:30:00 UTC 2008 >Closed-Date: >Last-Modified: >Originator: Nick Hibma >Release: FreeBSD 7.0-STABLE i386 >Organization: AnyWi Technologies >Environment: System: FreeBSD hind.van-laarhoven.org 7.0-STABLE FreeBSD 7.0-STABLE #3: Thu Aug 14 21:10:55 CEST 2008 toor@hind.van-laarhoven.org:/usr/src/sys/i386/compile/HIND i386 >Description: One can only use an ISO image to install from (boot-only image). It would be great if FreeBSD would have a USB Stick image as well. Dario Freni has written a script that lets you convert an ISO image to a bootable disk image with a UFS partition. It would be great if the release process would spit out such an image as well. It's so much easier to take a stick with you, stick it in a machine and then suck FreeBSD off the Internet onto that machine. >How-To-Repeat: >Fix: I cannot find the link no more, so I've included the script written by him #!/bin/sh # 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 export tmpdir=$(mktemp -d -t fbsdmount) # Temp file and directory to be used later export tmpfile=$(mktemp -t bsdmount) export isodev=$(mdconfig -a -t vnode -f ${isoimage}) echo "#### Building bootable UFS image ####" ISOSIZE=$(du -k ${isoimage} | awk '{print $1}') SECTS=$((($ISOSIZE + ($ISOSIZE/5))*2)) # Root partition size echo "Initializing image..." dd if=/dev/zero of=${imgoutfile} count=${SECTS} 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 "Copying files to the image..." ( cd ${tmpdir}/iso && find . -print -depth | cpio -dump ${tmpdir}/img ) #bzcat ${tmpdir}/iso/dist/root.dist.bz2 | mtree -PUr -p ${tmpdir}/img 2>&1 > /dev/null #echo "/dev/ufs/${UFS_LABEL} / ufs ro 1 1" > ${tmpdir}/img/etc/fstab 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 cleanup() { umount ${tmpdir}/iso mdconfig -d -u ${isodev} umount ${tmpdir}/img mdconfig -d -u ${imgdev} rm -rf ${tmpdir} ${tmpfile} } cleanup ls -lh ${imgoutfile} >Release-Note: >Audit-Trail: >Unformatted: