aboutsummaryrefslogtreecommitdiffstats
path: root/freedom-maker/copy2img.sh
blob: c11b0a6589b81d02a7c6c103a8dce5533819beb0 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
#!/bin/sh

set -e

if [ -b "$1" ]
then
    DEV=$1
else
    echo "need to specify a card device (eg, /dev/sdb)"
    exit 1
fi

NAME="torouter-dev"
if [ -n "$2" ]
then
    NAME=$2
fi

echo "dd-ing $DEV to $NAME.img"
dd if=$DEV of=$NAME.img bs=1M
echo "gzip compressing image"
gzip $NAME.img