Subversion Repositories freemyipod

Rev

Details | Last modification | View Log | RSS feed

Rev Author Line No. Line
865 user890104 1
#!/bin/bash
2
#
3
#
4
#    Copyright 2012 user890104
5
#
6
#
7
#    This file is part of emCORE.
8
#
9
#    emCORE is free software: you can redistribute it and/or
10
#    modify it under the terms of the GNU General Public License as
11
#    published by the Free Software Foundation, either version 2 of the
12
#    License, or (at your option) any later version.
13
#
14
#    emCORE is distributed in the hope that it will be useful,
15
#    but WITHOUT ANY WARRANTY; without even the implied warranty of
16
#    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
17
#    See the GNU General Public License for more details.
18
#
19
#    You should have received a copy of the GNU General Public License
20
#    along with emCORE.  If not, see <http://www.gnu.org/licenses/>.
21
#
22
#
23
 
24
# Quick README:
25
# 1. place this script in your home dir
26
# 2. checkout our SVN to $HOME/freemyipod
27
# 3. build the tree (or use precompiled binaries)
28
# 4. adjust the paths below
29
# 5. plug your iPod and enter DFU mode
30
# 6. run the script
31
# 7. enjoy!
32
 
33
# works for both initial installs and updating
34
 
35
####################################
36
# IMPORTANT!!! EDIT THESE BELOW!!! #
37
####################################
38
 
39
if [ -z "${1}" ]
40
then
41
	FMI_TARGET_DEVICE='/dev/sdc'
42
else
43
	FMI_TARGET_DEVICE="${1}"
44
fi
45
 
46
FMI_IPODDFU="${HOME}/freemyipod/tools/ipoddfu/ipoddfu.py"
47
FMI_BOOTSTRAP="${HOME}/freemyipod/apps/installer-ipodclassic/build/bootstrap-ipodclassic.dfu"
48
#FMI_BOOTSTRAP="${HOME}/dfu-images/bootstrap-ipodclassic-r708-20110424.dfu"
49
#FMI_INSTALLER="${HOME}/freemyipod/emcore/trunk/build/ipodclassic/emcore.bin"
50
FMI_INSTALLER="${HOME}/freemyipod/apps/installer-ipodclassic/build/installer-ipodclassic.ubi"
51
#FMI_INSTALLER="${HOME}/installers/installer-ipodclassic-r708-20110424.ubi"
52
 
53
########################
54
# DO NOT EDIT BELOW!!! #
55
########################
56
 
57
FMI_MOUNTPOINT="$(mktemp --directory --tmpdir freemyipod.XXXXXXXX)"/
58
trap "echo; rm -vrf '${FMI_MOUNTPOINT}'" EXIT
59
 
60
python3 "${FMI_IPODDFU}" "${FMI_BOOTSTRAP}" && \
61
 
62
( \
63
	echo -n 'Please wait'
64
 
65
	while [ ! -e "${FMI_TARGET_DEVICE}" ]
66
	do
67
		echo -n .
68
		sleep 1
69
	done
70
 
71
	echo
72
) && \
73
sudo mount "${FMI_TARGET_DEVICE}" "${FMI_MOUNTPOINT}" && \
74
sudo cp "${FMI_INSTALLER}" "${FMI_MOUNTPOINT}"/init.ubi && \
75
sudo eject "${FMI_TARGET_DEVICE}" && \
76
rm -vrf "${FMI_MOUNTPOINT}" && \
77
echo 'Installer has been launched!'