trisquel 11 changed the sources archive format
usage(){
echo
echo You need to run this script as root
-echo Usage: sudo $0 sources.iso /dev/sdX
-echo Example: sudo $0 trisquel_9.0fsf_sources.iso /dev/sdb
+echo Usage: sudo $0 sources.tar /dev/sdX
+echo Example: sudo $0 trisquel_11.0_sources.tar /dev/sdb
echo
echo WARNING!: This script can bite your dog. Use it with care, backup your data.
echo
[ $(id -u) != 0 ] && usage
[ $# != 2 ] && usage
-ISO=$1
+TAR=$1
DEV=$2
-ISOTMP=$(mktemp -d)
DEVTMP=$(mktemp -d)
-mount -o loop $ISO $ISOTMP
mount ${DEV}1 $DEVTMP
###
-cp -vr $ISOTMP/* $DEVTMP/source/ || true
+tar -C $DEVTMP/source/ -xvf $TAR
###
sleep 3
umount $DEVTMP
-umount $ISOTMP
rmdir $DEVTMP
-rmdir $ISOTMP
sync