From mboxrd@z Thu Jan 1 00:00:00 1970 Received: by 10.236.50.47 with SMTP id y35csp153490yhb; Sun, 6 May 2012 20:44:19 -0700 (PDT) Return-Path: <9front+bncCIfk-sO2AhCSip39BBoEJlnZxQ@googlegroups.com> Received-SPF: pass (google.com: domain of 9front+bncCIfk-sO2AhCSip39BBoEJlnZxQ@googlegroups.com designates 10.224.197.7 as permitted sender) client-ip=10.224.197.7; Authentication-Results: mr.google.com; spf=pass (google.com: domain of 9front+bncCIfk-sO2AhCSip39BBoEJlnZxQ@googlegroups.com designates 10.224.197.7 as permitted sender) smtp.mail=9front+bncCIfk-sO2AhCSip39BBoEJlnZxQ@googlegroups.com; dkim=pass header.i=9front+bncCIfk-sO2AhCSip39BBoEJlnZxQ@googlegroups.com Received: from mr.google.com ([10.224.197.7]) by 10.224.197.7 with SMTP id ei7mr6755968qab.16.1336362258755 (num_hops = 1); Sun, 06 May 2012 20:44:18 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=googlegroups.com; s=beta; h=x-beenthere:received-spf:message-id:date:from:to:subject :mime-version:x-original-sender:x-original-authentication-results :reply-to:precedence:mailing-list:list-id:x-google-group-id :list-post:list-help:list-archive:sender:list-subscribe :list-unsubscribe:content-type:content-transfer-encoding; bh=5zawnOL6RRnEpCA4PN3OzYFn0Svf7QCrBNBV4yKNcUE=; b=JTgaHh+wv6lPyqg+ZoIlN1QODkFLqHszfOibSgQ50B3k2tBqanFkTX4fkXF5L8/IOQ GF83B4c5RosK5bWj1kKFotcfJ7vLX1nskkJP+9QkiBMWUwBv95c4CXfC30puSWGwrx4S KJQLSjdfWYf2ATGL94/TUwqOJFoq8ujQRmSZs= Received: by 10.224.197.7 with SMTP id ei7mr731155qab.16.1336362258692; Sun, 06 May 2012 20:44:18 -0700 (PDT) X-BeenThere: 9front@googlegroups.com Received: by 10.224.33.144 with SMTP id h16ls4163646qad.4.gmail; Sun, 06 May 2012 20:44:18 -0700 (PDT) Received: by 10.224.217.200 with SMTP id hn8mr5614747qab.4.1336362258421; Sun, 06 May 2012 20:44:18 -0700 (PDT) Received: by 10.224.217.200 with SMTP id hn8mr5614746qab.4.1336362258411; Sun, 06 May 2012 20:44:18 -0700 (PDT) Received: from sp.nv ([68.179.132.47]) by gmr-mx.google.com with ESMTP id c25si6579540qch.2.2012.05.06.20.44.18; Sun, 06 May 2012 20:44:18 -0700 (PDT) Received-SPF: neutral (google.com: 68.179.132.47 is neither permitted nor denied by best guess record for domain of sl@9front.org) client-ip=68.179.132.47; Message-ID: <4d9c26e53ce8a3673377c6f581cd7f2a@sp.inri.net> Date: Mon, 7 May 2012 03:44:16 +0000 From: sl@9front.org To: 9front@googlegroups.com Subject: mkusb MIME-Version: 1.0 X-Original-Sender: sl@9front.org X-Original-Authentication-Results: gmr-mx.google.com; spf=neutral (google.com: 68.179.132.47 is neither permitted nor denied by best guess record for domain of sl@9front.org) smtp.mail=sl@9front.org Reply-To: 9front@googlegroups.com Precedence: list Mailing-list: list 9front@googlegroups.com; contact 9front+owners@googlegroups.com List-ID: <9front.googlegroups.com> X-Google-Group-Id: 831096995978 List-Post: , List-Help: , List-Archive: Sender: 9front@googlegroups.com List-Subscribe: , List-Unsubscribe: , Content-Type: text/plain; charset="US-ASCII" Content-Transfer-Encoding: 7bit NAME mkusb - create a bootable USB device DESCRIPTION This script will make bootable a USB device. If the 9fat partition is made large enough, the entire 9front.iso may be copied into the root of the partition and used to boot a stand alone terminal. SYNOPSIS mkusb [-dw] device OPTIONS -d create the bootable device -w wipe the device SEE ALSO prep(8), /sys/src/boot/pc/mkfile -sl --- #!/bin/rc # create bootable usb fn logprog{ echo $"* $* } fn dev{ dev=$1 cd /sys/src/boot/pc && mk 9bootfat mbr pbs dev/mbr -m mbr $dev/data dev/fdev -baw $dev/data echo echo 'This is dev/prep; use it to create a 9fat partition.' echo 'NOTE: FAT16 partitions such as 9fat are limited to 2GB.' echo 'When finished, type ''w'' and then ''q''.' echo dev/prep -b $dev/plan9 dev/format -b pbs -d -r 2 $dev/9fat dossrv -f $dev/9fat usb.dos mount -c /srv/usb.dos /n/usb.9fat { echo 'bootfile=/$cputype/9pcf' echo 'mouseport=ask' echo 'monitor=ask' echo 'vgasize=ask' } >/n/usb.9fat/plan9.ini logprog cp 9bootfat /n/usb.9fat logprog mkdir /n/usb.9fat/$cputype logprog cp /$cputype/9pcf /n/usb.9fat/$cputype unmount /n/usb.9fat rm -f /srv/usb.dos } fn wipe{ dev=$1 echo 'echo delpart plan9 >'$"dev'/ctl' echo delpart plan9 >$dev/ctl >[2]/dev/null echo 'echo delpart 9fat >'$"dev'/ctl' echo delpart 9fat >$dev/ctl >[2]/dev/null logprog dd -if /dev/zero -of $dev/data -bs 51dev -count 4 } fn usage{ echo usage: $0 [ -d device ] [ -w device ] >[1=2] exit usage } if(! ~ $1 -* || ~ $#2 0) usage switch($1){ case -d dev $2 case -w wipe $2 case * usage }