-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathpart_sd.sh
More file actions
executable file
·79 lines (63 loc) · 1.17 KB
/
Copy pathpart_sd.sh
File metadata and controls
executable file
·79 lines (63 loc) · 1.17 KB
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
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
#!/bin/bash
############################################
# Script to create the partitions
# for a bootable sd card for
# the Renesas EMEV tablet
#### sd partitions #########################
#
# p1 500MB : boot files
# p2 256KB : uboot environment
# p3 400MB : android-fs
# p4 : EXTENDED
# p5 750MB : data-fs / cache
# p6 the rest : nand-fs
#
############################################
set +x -e
SDCARD=$1
if [ ! -b "$SDCARD" ]
then
echo "'${SDCARD}' is not a block device!"
exit -1
fi
echo "You're about to erase all data on '${SDCARD}/' !"
read -p "If you're really sure about that hit <ENTER>, or abort with <CTRL>-C"
set +e
for n in "${SDCARD}*" ;
do umount -f $n >/dev/null 2>&1 ;
done
set -e
echo "(1) Partioning sd card ..."
fdisk ${SDCARD} <<_EOF_ >/dev/null 2>&1
o
n
p
1
+256M
n
p
2
+256K
n
p
3
+512M
n
e
n
+512M
n
t
1
6
w
_EOF_
echo .
sleep 3
sync;sync;sync
echo "(2) Creating file systems ... will take a while!"
mkfs.msdos -F 32 -n bootfs4 ${SDCARD}1 >/dev/null 2>&1
mke2fs -t ext3 -L androidfs4 ${SDCARD}3 >/dev/null 2>&1
mke2fs -t ext3 -L datafs4 ${SDCARD}5 >/dev/null 2>&1
mke2fs -t ext3 -L nandfs4 ${SDCARD}6 >/dev/null 2>&1
echo "DONE."