-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathmagic
More file actions
executable file
·178 lines (142 loc) · 2.21 KB
/
magic
File metadata and controls
executable file
·178 lines (142 loc) · 2.21 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
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
#!/bin/bash
# Configure this script here:
DEFAULT_CMD=compile
ROOT_DIR="buildroot-2013.11"
# Unused
SSH_IP="141.37.31.27"
#-------Configs------
CONFIG_DIR="../configs"
SAV_BR_CONFIG="$CONFIG_DIR/br.config"
#--------Script-------
cd $ROOT_DIR
rebuild()
{
clean
compile
}
clean()
{
saveConfigs
make clean
}
compile()
{
repack
loadBR
make
copy
}
config()
{
loadBR
make menuconfig
saveBR
}
configBB()
{
make busybox-menuconfig
saveBB
}
configK()
{
make linux-menuconfig
saveK
}
repack()
{
rmPack
pack
}
rmPack()
{
rm -f dl/jefa_web.tar.gz
rm -f dl/jefa_gpio.tar.gz
rm -f -r output/build/jefa_web-1.0/
rm -f -r output/build/jefa_gpio-1.0/
}
pack()
{
mkdir -p ../myPackages
cd ../website
tar -czf ../myPackages/jefa_web.tar.gz src
cd ../myPackages
mkdir -p package_tmp/app package_tmp/driver
cp -r ../driver/src package_tmp/driver
cp -r ../app/src package_tmp/app
tar -czf jefa_gpio.tar.gz package_tmp
rm -r package_tmp
cd ../$ROOT_DIR
}
copy()
{
cp -f output/images/uImage /srv/tftp/rpi/uImage-7
echo "copied image to tftp"
}
control()
{
ssh -oBatchMode=yes -oStrictHostKeyChecking=no root@$SSH_IP
}
live()
{
install
install_live
}
install()
{
#install apps
#cd ../app/src
#make install
#install modules
#cd ../../driver/src
#make install
#copy scripts
cd ../../scripts
cp S98initLED_TAST S97mdev_hotplug S96insert_modules ../rootfs_files/etc/init.d/
cp led.sh ../rootfs_files/usr/share/
cd ../$ROOT_DIR
}
install_live()
{
scp -oBatchMode=yes -oStrictHostKeyChecking=no -r ../rootfs_files/* root@$SSH_IP:/
}
download()
{
make source
}
#---------Config----------
# Configure the right defconfigs!
loadBR()
{
make defconfig BR2_DEFCONFIG="$SAV_BR_CONFIG"
}
saveConfigs()
{
saveBR
saveK
saveBB
}
saveK()
{
make linux-update-defconfig
}
saveBB()
{
make busybox-update-config
}
saveBR()
{
make savedefconfig
}
if [ $# -eq 0 ]
then
command=$DEFAULT_CMD
else
command=$1
fi
if [ "$(type -t "$command")" == "function" ]
then
echo "Running $command"
$command
else
echo "Unrecognized command." 1>&2
fi