diff options
author | ficus <ficus@robocracy.org> | 2012-09-22 18:07:42 +0200 |
---|---|---|
committer | ficus <ficus@robocracy.org> | 2012-09-22 18:07:42 +0200 |
commit | e2973e8ea5c57bfa6ed41293e0250c68d29cfed9 (patch) | |
tree | c198195bfc91800d93300788c85efba3feaaa050 /freedom-maker/copy2card.sh | |
parent | e6d4f095e61d0c875a11cec57302db9f2fd5838f (diff) | |
download | torouter-e2973e8ea5c57bfa6ed41293e0250c68d29cfed9.tar.gz torouter-e2973e8ea5c57bfa6ed41293e0250c68d29cfed9.zip |
backup WIP
Diffstat (limited to 'freedom-maker/copy2card.sh')
-rwxr-xr-x | freedom-maker/copy2card.sh | 43 |
1 files changed, 43 insertions, 0 deletions
diff --git a/freedom-maker/copy2card.sh b/freedom-maker/copy2card.sh new file mode 100755 index 0000000..0a5208d --- /dev/null +++ b/freedom-maker/copy2card.sh @@ -0,0 +1,43 @@ +#!/bin/sh + +set -e + +if [ -n "`mount | grep 'mnt'`" ] +then + echo "/mnt mount point is in use?" + exit 1 +fi + +if ! [ -b "$1" ] +then + echo "need to specify a target boot partition (/dev/sdb1)" + exit 1 +else + BOOTDEV=$1 +fi + +if ! [ -b "$2" ] +then + echo "need to specify a target root partition (/dev/sdb2)" + exit 1 +else + ROOTDEV=$2 +fi + +echo "mounting rootdev..." +mount $ROOTDEV /mnt +echo "rsyncing over rootfs" +rsync -atv --progress --delete --exclude=boot build/armel/ /mnt/ +echo "sync filesystems..." +sync +echo "un-mounting rootdev..." +umount /mnt + +echo "mounting bootdev..." +mount $BOOTDEV /mnt +echo "copying boot files..." +cp -v build/armel/boot/* /mnt +echo "sync filesystems..." +sync +echo "un-mounting bootdev..." +umount /mnt |