From e55744bb195f0d665332ceb48acb57b4a4e186b5 Mon Sep 17 00:00:00 2001 From: ficus Date: Tue, 11 Sep 2012 01:16:38 +0200 Subject: update to FBx public-0.1 freedom-maker Snapshot commit with no torouter-specific changes re-applied. Updated freedom-maker image to a significantly more recent version, used by the FreedomBox project. This includes a shift from debian "stable" to "testing" (wheezy), which has a Linux 3.2 kernel. date Fri, 24 Aug 2012 03:50:41 +0000 repo git://anonscm.debian.org/freedombox/freedom-maker.git commit de1f66f0651a3a7c306331eeda1db93535b1470a (public-0.1) --- freedom-maker/bin/partition-stick | 37 +++++++++++++++++++++++++++++++++++++ 1 file changed, 37 insertions(+) create mode 100755 freedom-maker/bin/partition-stick (limited to 'freedom-maker/bin/partition-stick') diff --git a/freedom-maker/bin/partition-stick b/freedom-maker/bin/partition-stick new file mode 100755 index 0000000..e54dc9a --- /dev/null +++ b/freedom-maker/bin/partition-stick @@ -0,0 +1,37 @@ +#!/bin/sh +# create required partitions on a USB stick + +# Do not tolerate errors. +set -e + +if [ $# -ne 1 ]; then + echo 'Usage: partition-stick ' + exit 1 +fi + +if [ ! -b $1 ]; then + echo "Error: $1 is not a block device." + exit 1 +fi + +if grep -q $1 /etc/mtab; then + echo "Error: $1 is currently mounted." + exit 1; +fi + +repeat=1 +while [ $repeat -eq 1 ]; do + read -p "Do you really want to format (and lose all data on) device $MOUNTED? [y/n] " CONFIRMATION + case "$CONFIRMATION" in + y|Y) repeat=0 ;; + n|N) exit 0 ;; + *) echo "You have to type 'y' or 'n'." ;; + esac +done + +sudo parted -s $1 mklabel msdos +sudo parted -a optimal -s $1 mkpart primary fat16 0 128 +sudo parted -a optimal -s $1 mkpart primary ext2 128 100% + +sudo mkdosfs ${1}1 +sudo mkfs.ext3 -j ${1}2 -- cgit v1.2.3