#!/bin/bash -x

# Uses a script, transferSugarImage, to make a copy of a live Sugar on a Stick image
# on a second device. Calls transferSugarImage with the 'switch user, su command
# with root priveledges so that it may be called in the Sugar Terminal as the 
# default liveuser in SoaS.
#
# Copyright 2010, Sugar Labs
# Frederick Grose <fgrose@sugarlabs.org>

# Requires: 'transferSugarImage'
#     from http://people.sugarlabs.org/transferSugarImage
# Requires: 'modified_livecd-iso-to-disk'
#     from http://people.sugarlabs.org/modified_livecd-iso-to-disk
# If accepted upstream, the previous requirement would become:
# Requires: 'livecd-iso-to-disk'
#     from http://git.fedorahosted.org/git/livecd/tools?p=livecd;a=tree;f=tools;hb=HEAD

# to install a live media iso or running image so that
# it's bootable off of a bootable, flash storage device.
# 
# This program is free software; you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation; version 2 of the License.
#
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
# GNU Library General Public License for more details.
#
# You should have received a copy of the GNU General Public License
# along with this program; if not, write to the Free Software
# Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.

su --session-command="/mnt/live/transferSugarImage" root

