forked from mindboards/ev3sources
-
Notifications
You must be signed in to change notification settings - Fork 1
/
update_sdcard.sh
executable file
·65 lines (48 loc) · 1.45 KB
/
update_sdcard.sh
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
#! /bin/bash
echo
echo -------------------------------------------------------------------------------
echo UPDATE SDCARD WITH NEWEST KERNEL, FILESYSTEM AND APPLICATION TCP120709
echo -------------------------------------------------------------------------------
echo
sudo -v
echo
echo " ...."checking.sdcard
sleep 10
current=${PWD}
if [ -d /media/LMS2012 ]
then
if [ -d /media/LMS2012_EXT ]
then
echo " ...."erasing.sdcard
sudo rm -r /media/LMS2012/*
sudo rm -r /media/LMS2012_EXT/*
sync
echo " ...."copying.kernel.to.sdcard
sudo cp uImage /media/LMS2012/uImage
sync
echo " ...."copying.filesystem.to.sdcard
sudo cp lmsfs.tar.bz2 /media/LMS2012_EXT
cd /media/LMS2012_EXT
sudo tar -jxf lmsfs.tar.bz2
sudo rm lmsfs.tar.bz2
cd ${current}
sync
echo " ...."copying.application.to.sdcard
sudo cp -r ~/projects/lms2012/lms2012/Linux_AM1808/* /media/LMS2012_EXT/home/root/lms2012
echo " ...."copying.testprograms.to.sdcard
sudo cp -r ~/projects/lms2012/lmssrc/Test/Test /media/LMS2012_EXT/home/root/lms2012/prjs/
echo " ...."writing.to.sdcard
sync
echo
echo REMOVE sdcard
else
echo
echo SDCARD NOT PROPERLY FORMATTED !!!
fi
else
echo
echo SDCARD NOT PROPERLY FORMATTED !!!
fi
echo
echo -------------------------------------------------------------------------------
echo