-
Notifications
You must be signed in to change notification settings - Fork 0
/
newrc_v2
executable file
·706 lines (668 loc) · 25.8 KB
/
newrc_v2
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
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
#!/bin/sh -x
# Prerequisite /etc/rc.d/rc.local
# this script is run on NFS server for weekly test
# init the root file system to run vte scripts
# by Hake Huang
# freescale copy right. all rights reserved
#HOST_SERVER=10.192.225.222
HOST_SERVER=10.192.224.48
#PLATFORM="MX31 MX35 MX37 MX51 MX25 MX233 MX53"
#PLATFORM="MX233"
#PLATFORM="MX35 MX25 MX51 MX233"
#PLATFORM="BL"
#PLATFORM="MX35"
#released package name
RELEASE_PACKAGE=$(basename $1)
#release path in build server
if [ $HOST_SERVER == "10.192.224.48" ]
then
RELEASE_PATH="/pub1$(dirname $1)"
RELEASE_PATH=$(echo $RELEASE_PATH | sed 's/hive//g')
RELEASE_PATH=$(echo $RELEASE_PATH | sed 's/10.192.224.48//g')
RELEASE_PATH=$(echo $RELEASE_PATH | sed 's/(/\\(/g')
RELEASE_PATH=$(echo $RELEASE_PATH | sed 's/)/\\)/g')
echo $RELEASE_PATH
else
RELEASE_PATH="$(dirname $1)"
fi
#path for test script
VTE_ORIGINAL_PATH=/rootfs/
#tftpd server
TFTP_SERVER=10.192.225.218
#NFS server
#NFS_SERVER=10.192.224.170
#NFS server path
NFS_PATH=/rootfs/
#rootfs path
MX233_ROOTFS=${NFS_PATH}imx233_rootfs_r/
MX28_ROOTFS=${NFS_PATH}imx28_rootfs_r/
MX31_ROOTFS=${NFS_PATH}imx31_rootfs_r/
MX35_ROOTFS=${NFS_PATH}imx35_rootfs_r/
MX37_ROOTFS=${NFS_PATH}imx37_rootfs_r/
MX51_ROOTFS=${NFS_PATH}imx51_rootfs_r/
MX25_ROOTFS=${NFS_PATH}imx25_rootfs_r/
MX53_ROOTFS=${NFS_PATH}imx53_rootfs_r/
MX50_ROOTFS=${NFS_PATH}imx50_rootfs_r/
MX61_ROOTFS=${NFS_PATH}imx61_rootfs_r/
MX51_ROOTFS_d=${NFS_PATH}imx51_rootfs/
MX53_ROOTFS_d=${NFS_PATH}imx53_rootfs/
MX50_ROOTFS_d=${NFS_PATH}imx50_rootfs/
MX61_ROOTFS_d=${NFS_PATH}imx61_rootfs/
echo "$(date +"%y%m%d")" >> .newrclog
echo "$0 $@" >> .newrclog
if [ $# -ne 1 ]
then
echo "need released filename"
echo "or"
echo "./newrc clean"
echo "to clean all folders"
exit 0
fi
if [ $1 == "clean" ]
then
rm -rf ${NFS_PATH}imx31_rootfs_r
rm -rf ${NFS_PATH}imx35_rootfs_r
rm -rf ${NFS_PATH}imx37_rootfs_r
rm -rf ${NFS_PATH}imx51_rootfs_r
rm -rf ${NFS_PATH}imx25_rootfs_r
rm -rf ${NFS_PATH}imx28_rootfs_r
rm -rf ${NFS_PATH}imx53_rootfs_r
rm -rf ${NFS_PATH}imx50_rootfs_r
rm -rf ${NFS_PATH}imx61_rootfs_r
exit 0
fi
isBL=$(echo $PLATFORM | grep "BL" | wc -l)
if [ $isBL == "1" ]
then
if [ -e ${NFS_PATH}temp2 ]
then
rm -rf ${NFS_PATH}temp2
fi
sleep 1
mkdir -p ${NFS_PATH}temp2
else
if [ -e ${NFS_PATH}temp ]
then
rm -rf ${NFS_PATH}temp
echo "help"
fi
sleep 1
mkdir ${NFS_PATH}temp
echo "get the package"
scp b20222@${HOST_SERVER}:${RELEASE_PATH}/${RELEASE_PACKAGE} ${NFS_PATH}temp/ || exit 1
# wget http://bluebell.am.freescale.net/previous/101214_222612_CST/${RELEASE_PACKAGE} -P ${NFS_PATH}temp/ || exit 1
echo "unzip the package"
tar xzvf ${NFS_PATH}temp/$RELEASE_PACKAGE -C ${NFS_PATH}temp || exit 2
#RELEASE_TARGET=$(basename ${RELEASE_PACKAGE} .tar.gz)
RELEASE_TARGET=$(ls -l ${NFS_PATH}temp | grep ^d | awk '{print $9}')
fi
if [ $isBL == 1 ]; then
if [ $PLATFORM == "BL" ]
then
echo "upload boot loader"
echo "get the package"
scp b20222@${HOST_SERVER}:${RELEASE_PATH}/${RELEASE_PACKAGE} ${NFS_PATH}temp2/ || exit 1
echo "unzip the package"
tar xzvf ${NFS_PATH}temp2/$RELEASE_PACKAGE -C ${NFS_PATH}temp2 || exit 2
#RELEASE_TARGET=$(basename ${RELEASE_PACKAGE} .tar.gz)
RELEASE_TARGET=$(ls -l ${NFS_PATH}temp2 | grep ^d | awk '{print $9}')
cd ${NFS_PATH}temp2/${RELEASE_TARGET}/
RBDIR=$(ls redboot*)
echo unzip $RBDIR
unzip $RBDIR
RBDIR=$(ls | grep redboot)
for i in $RBDIR
do
if [ -d $i ]
then
echo "copy boot loader"
scp ${i}/bin/mx31_3stack_redboot.bin ${TFTP_SERVER}:/tftpboot/
scp ${i}/bin/mx35_3stack_redboot.bin ${TFTP_SERVER}:/tftpboot/
scp ${i}/bin/mx37_3stack_redboot.bin ${TFTP_SERVER}:/tftpboot/
scp ${i}/bin/mx51_3stack_redboot.bin ${TFTP_SERVER}:/tftpboot/
scp ${i}/bin/mx25_3stack_redboot.bin ${TFTP_SERVER}:/tftpboot/
echo "finish transfer bootloader"
fi
done
exit 0
fi
fi
echo "now copy the kernel Images"
for i in $PLATFORM
do
echo "${i} process.."
if [ $i == "MX31" ]
then
scp ${NFS_PATH}temp/${RELEASE_TARGET}/zImage ${TFTP_SERVER}:/tftpboot/zImage_mx31
scp ${NFS_PATH}temp/${RELEASE_TARGET}/uImage ${TFTP_SERVER}:/tftpboot/uImage_mx31
scp ${NFS_PATH}temp/${RELEASE_TARGET}/rootfs.jffs2 ${TFTP_SERVER}:/tftpboot/mx31_rootfs.jffs2
fi
if [ $i == "MX35" ]
then
scp ${NFS_PATH}temp/${RELEASE_TARGET}/zImage ${TFTP_SERVER}:/tftpboot/zImage_mx35
scp ${NFS_PATH}temp/${RELEASE_TARGET}/uImage ${TFTP_SERVER}:/tftpboot/uImage_mx35
scp ${NFS_PATH}temp/${RELEASE_TARGET}/rootfs.jffs2 ${TFTP_SERVER}:/tftpboot/mx35_rootfs.jffs2
fi
if [ $i == "MX37" ]
then
scp ${NFS_PATH}temp/${RELEASE_TARGET}/zImage ${TFTP_SERVER}:/tftpboot/zImage_mx37
scp ${NFS_PATH}temp/${RELEASE_TARGET}/uImage ${TFTP_SERVER}:/tftpboot/uImage_mx37
scp ${NFS_PATH}temp/${RELEASE_TARGET}/rootfs.jffs2 ${TFTP_SERVER}:/tftpboot/mx37_rootfs.jffs2
fi
if [ $i == "MX37_24" ]
then
scp ${NFS_PATH}temp/${RELEASE_TARGET}/zImage ${TFTP_SERVER}:/tftpboot/zImage_mx37_24
scp ${NFS_PATH}temp/${RELEASE_TARGET}/uImage ${TFTP_SERVER}:/tftpboot/uImage_mx37_24
scp ${NFS_PATH}temp/${RELEASE_TARGET}/rootfs.jffs2 ${TFTP_SERVER}:/tftpboot/mx37_24_rootfs.jffs2
fi
if [ $i == "MX51" ]
then
FS=$(ls ${NFS_PATH}temp/${RELEASE_TARGET} | grep imx51 )
scp ${NFS_PATH}temp/${RELEASE_TARGET}/zImage ${TFTP_SERVER}:/tftpboot/zImage_mx51
scp ${NFS_PATH}temp/${RELEASE_TARGET}/zImage ${NFS_PATH}/ubuntu_9.10/zImage
scp ${NFS_PATH}temp/${RELEASE_TARGET}/uImage ${TFTP_SERVER}:/tftpboot/uImage_mx51
scp ${NFS_PATH}temp/${RELEASE_TARGET}/rootfs.jffs2 ${TFTP_SERVER}:/tftpboot/mx51_rootfs.jffs2
fi
if [ $i == "MX51_28" ]
then
FS=$(ls ${NFS_PATH}temp/${RELEASE_TARGET} | grep imx51 )
scp ${NFS_PATH}temp/${RELEASE_TARGET}/zImage ${TFTP_SERVER}:/tftpboot/zImage_mx51_babbage
cp ${NFS_PATH}temp/${RELEASE_TARGET}/zImage ${NFS_PATH}/ubuntu_9.10/zImage
scp ${NFS_PATH}temp/${RELEASE_TARGET}/uImage ${TFTP_SERVER}:/tftpboot/uImage_mx51_babbage
scp ${NFS_PATH}temp/${RELEASE_TARGET}/rootfs.jffs2 ${TFTP_SERVER}:/tftpboot/mx51_rootfs_babbage.jffs2
fi
if [ $i == "MX25" ]
then
scp ${NFS_PATH}temp/${RELEASE_TARGET}/zImage ${TFTP_SERVER}:/tftpboot/zImage_mx25
scp ${NFS_PATH}temp/${RELEASE_TARGET}/uImage ${TFTP_SERVER}:/tftpboot/uImage_mx25
scp ${NFS_PATH}temp/${RELEASE_TARGET}/rootfs.jffs2 ${TFTP_SERVER}:/tftpboot/mx25_rootfs.jffs2
fi
if [ $i == "MX233" ]
then
scp ${NFS_PATH}temp/${RELEASE_TARGET}/zImage ${TFTP_SERVER}:/tftpboot/zImage_mx233
scp ${NFS_PATH}temp/${RELEASE_TARGET}/uImage ${TFTP_SERVER}:/tftpboot/uImage_mx233
scp ${NFS_PATH}temp/${RELEASE_TARGET}/rootfs.jffs2 ${TFTP_SERVER}:/tftpboot/mx233_rootfs.jffs2
fi
if [ $i == "MX28" ]
then
scp ${NFS_PATH}temp/${RELEASE_TARGET}/zImage ${TFTP_SERVER}:/tftpboot/zImage_mx28
scp ${NFS_PATH}temp/${RELEASE_TARGET}/uImage ${TFTP_SERVER}:/tftpboot/uImage_mx28
scp ${NFS_PATH}temp/${RELEASE_TARGET}/rootfs.jffs2 ${TFTP_SERVER}:/tftpboot/mx28_rootfs.jffs2
fi
if [ $i == "MX53" ]
then
scp ${NFS_PATH}temp/${RELEASE_TARGET}/zImage ${TFTP_SERVER}:/tftpboot/zImage_mx53
scp ${NFS_PATH}temp/${RELEASE_TARGET}/uImage ${TFTP_SERVER}:/tftpboot/uImage_mx53
scp ${NFS_PATH}temp/${RELEASE_TARGET}/rootfs.jffs2 ${TFTP_SERVER}:/tftpboot/mx53_rootfs.jffs2
fi
if [ $i == "MX50" ]
then
scp ${NFS_PATH}temp/${RELEASE_TARGET}/zImage ${TFTP_SERVER}:/tftpboot/zImage_mx50
scp ${NFS_PATH}temp/${RELEASE_TARGET}/uImage ${TFTP_SERVER}:/tftpboot/uImage_mx50
scp ${NFS_PATH}temp/${RELEASE_TARGET}/rootfs.jffs2 ${TFTP_SERVER}:/tftpboot/mx50_rootfs.jffs2
fi
if [ $i == "MX61" ]
then
scp ${NFS_PATH}temp/${RELEASE_TARGET}/zImage ${TFTP_SERVER}:/tftpboot/zImage_mx61
scp ${NFS_PATH}temp/${RELEASE_TARGET}/uImage ${TFTP_SERVER}:/tftpboot/uImage_mx61
scp ${NFS_PATH}temp/${RELEASE_TARGET}/rootfs.jffs2 ${TFTP_SERVER}:/tftpboot/mx61_rootfs.jffs2
fi
done
echo "now copy the rootfs"
mkdir -p /mnt/tempfs
for i in $PLATFORM
do
LOOP_AVAIL=$(losetup -f)
if [ $? -ne 0 ]
then
echo "no loop device available"
echo "using losetup -f to check"
echo "using losetup -d /dev/loop? to delete"
exit 1
fi
if [ $i == "MX31" ]
then
gzip -d ${NFS_PATH}temp/${RELEASE_TARGET}/rootfs.ext2.gz
if [ $? -ne 0 ]
then
mv ${NFS_PATH}temp/${RELEASE_TARGET}/rootfs.ext2.gz ${NFS_PATH}temp/${RELEASE_TARGET}/rootfs.ext2
fi
mount -o loop ${NFS_PATH}temp/${RELEASE_TARGET}/rootfs.ext2 /mnt/tempfs
#rm -rf ${MX31_ROOTFS}
rm -rf ./last_week/imx31_rootfs
mv ${MX31_ROOTFS} ./last_week/
mkdir -p ${MX31_ROOTFS}
cp -a /mnt/tempfs/* ${MX31_ROOTFS}/
sync
umount /mnt/tempfs
fi
sleep 1
if [ $i == "MX35" ]
then
gzip -d ${NFS_PATH}temp/${RELEASE_TARGET}/rootfs.ext2.gz
if [ $? -ne 0 ]
then
mv ${NFS_PATH}temp/${RELEASE_TARGET}/rootfs.ext2.gz ${NFS_PATH}temp/${RELEASE_TARGET}/rootfs.ext2
fi
mount -o loop ${NFS_PATH}temp/${RELEASE_TARGET}/rootfs.ext2 /mnt/tempfs
ls /mnt/tempfs
#rm -rf ${MX35_ROOTFS}
rm -rf ./last_week/imx35_rootfs
mv ${MX35_ROOTFS} ./last_week/
mkdir -p ${MX35_ROOTFS}
cp -a /mnt/tempfs/* ${MX35_ROOTFS}/
sync
umount /mnt/tempfs
fi
if [ $i == "MX37" ]
then
gzip -d ${NFS_PATH}temp/${RELEASE_TARGET}/rootfs.ext2.gz
if [ $? -ne 0 ]
then
mv ${NFS_PATH}temp/${RELEASE_TARGET}/rootfs.ext2.gz ${NFS_PATH}temp/${RELEASE_TARGET}/rootfs.ext2
fi
mount -o loop ${NFS_PATH}temp/${RELEASE_TARGET}/rootfs.ext2 /mnt/tempfs
rm -rf ./last_week/imx37_rootfs
mv ${MX37_ROOTFS} ./last_week/
mkdir -p ${MX37_ROOTFS}
cp -a /mnt/tempfs/* ${MX37_ROOTFS}/
sync
umount /mnt/tempfs
fi
if [ $i == "MX37_24" ]
then
gzip -d ${NFS_PATH}temp/${RELEASE_TARGET}/rootfs.ext2.gz
if [ $? -ne 0 ]
then
mv ${NFS_PATH}temp/${RELEASE_TARGET}/rootfs.ext2.gz ${NFS_PATH}temp/${RELEASE_TARGET}/rootfs.ext2
fi
mount -o loop ${NFS_PATH}temp/${RELEASE_TARGET}/rootfs.ext2 /mnt/tempfs
rm -rf ${MX37_ROOTFS_24}
mkdir -p ${MX37_ROOTFS_24}
cp -a /mnt/tempfs/* ${MX37_ROOTFS_24}/
sync
umount /mnt/tempfs
fi
if [ $i == "MX51" ]
then
gzip -d ${NFS_PATH}temp/${RELEASE_TARGET}/rootfs.ext2.gz
if [ $? -ne 0 ]
then
mv ${NFS_PATH}temp/${RELEASE_TARGET}/rootfs.ext2.gz ${NFS_PATH}temp/${RELEASE_TARGET}/rootfs.ext2
fi
mount -o loop ${NFS_PATH}temp/${RELEASE_TARGET}/rootfs.ext2 /mnt/tempfs
rm -rf ./last_week/imx51_rootfs
mv ${MX51_ROOTFS} ./last_week/
mkdir -p ${MX51_ROOTFS}
cp -a /mnt/tempfs/* ${MX51_ROOTFS}/
sync
umount /mnt/tempfs
fi
if [ $i == "MX233" ]
then
mkdir -p ${MX233_ROOTFS}
rm -rf ./last_week/imx233_rootfs
cp ${MX233_ROOTFS} ./last_week/ -a
cd ${MX233_ROOTFS}
rm -f rootfs.ext2
rm -rf rootfs.ext2.gz
cp ${NFS_PATH}temp/${RELEASE_TARGET}/rootfs.ext2.gz .
cp ${NFS_PATH}temp/${RELEASE_TARGET}/rootfs.ext2 .
cp ${NFS_PATH}temp/${RELEASE_TARGET}/imx23_uboot.sb .
cp ${NFS_PATH}temp/${RELEASE_TARGET}/imx23_linux.sb .
gunzip rootfs.ext2.gz
mount -o loop rootfs.ext2 /mnt/tempfs
rm -rf ${MX233_ROOTFS}/rootfs
mkdir -p ${MX233_ROOTFS}/rootfs
cp -a /mnt/tempfs/* ${MX233_ROOTFS}/rootfs/
sync
umount /mnt/tempfs
rm -rf zImage
cp ${NFS_PATH}temp/${RELEASE_TARGET}/zImage .
rm -rf uImage
cp ${NFS_PATH}temp/${RELEASE_TARGET}/uImage .
#./elftosb2 -z -c stmp378x_linux_sb.db -o stmp378x_linux.sb
rm -rf mmc_boot_partition.raw
dd if=/dev/zero of=mmc_boot_partition.raw bs=512 count=4
dd if=imx23_linux.sb of=mmc_boot_partition.raw ibs=512 seek=4 conv=sync,notrunc
fi
if [ $i == "MX28" ]
then
mkdir -p ${MX28_ROOTFS}
rm -rf ./last_week/imx28_rootfs
cp ${MX28_ROOTFS} ./last_week/ -a
cd ${MX28_ROOTFS}
rm -f rootfs.ext2
rm -rf rootfs.ext2.gz
cp ${NFS_PATH}temp/${RELEASE_TARGET}/rootfs.ext2.gz .
cp ${NFS_PATH}temp/${RELEASE_TARGET}/rootfs.ext2 .
cp ${NFS_PATH}temp/${RELEASE_TARGET}/imx28_uboot.sb .
cp ${NFS_PATH}temp/${RELEASE_TARGET}/imx28_linux.sb .
gunzip rootfs.ext2.gz
mount -o loop rootfs.ext2 /mnt/tempfs
rm -rf ${MX28_ROOTFS}/rootfs
mkdir -p ${MX28_ROOTFS}/rootfs
cp -a /mnt/tempfs/* ${MX28_ROOTFS}/rootfs/
sync
umount /mnt/tempfs
rm -rf zImage
cp ${NFS_PATH}temp/${RELEASE_TARGET}/zImage .
rm -rf uImage
cp ${NFS_PATH}temp/${RELEASE_TARGET}/uImage .
#./elftosb2 -z -c stmp378x_linux_sb.db -o stmp378x_linux.sb
rm -rf mmc_boot_partition.raw
dd if=/dev/zero of=mmc_boot_partition.raw bs=512 count=4
dd if=imx28_linux.sb of=mmc_boot_partition.raw ibs=512 seek=4 conv=sync,notrunc
fi
if [ $i == "MX51_28" ]
then
gzip -d ${NFS_PATH}temp/${RELEASE_TARGET}/rootfs.ext2.gz
if [ $? -ne 0 ]
then
mv ${NFS_PATH}temp/${RELEASE_TARGET}/rootfs.ext2.gz ${NFS_PATH}temp/${RELEASE_TARGET}/rootfs.ext2
fi
mount -o loop ${NFS_PATH}temp/${RELEASE_TARGET}/rootfs.ext2 /mnt/tempfs
rm -rf ./last_week/${MX51_ROOTFS_28}
mv ${MX51_ROOTFS_28} ./last_week/
mkdir -p ${MX51_ROOTFS_28}
cp -a /mnt/tempfs/* ${MX51_ROOTFS_28}/
sync
umount /mnt/tempfs
fi
if [ $i == "MX25" ]
then
gzip -d ${NFS_PATH}temp/${RELEASE_TARGET}/rootfs.ext2.gz
if [ $? -ne 0 ]
then
mv ${NFS_PATH}temp/${RELEASE_TARGET}/rootfs.ext2.gz ${NFS_PATH}temp/${RELEASE_TARGET}/rootfs.ext2
fi
mount -o loop ${NFS_PATH}temp/${RELEASE_TARGET}/rootfs.ext2 /mnt/tempfs
rm -rf ./last_week/imx25_rootfs
mv ${MX25_ROOTFS} ./last_week/
mkdir -p ${MX25_ROOTFS}
cp -a /mnt/tempfs/* ${MX25_ROOTFS}/
sync
umount /mnt/tempfs
fi
if [ $i == "MX53" ]
then
gzip -d ${NFS_PATH}temp/${RELEASE_TARGET}/rootfs.ext2.gz
if [ $? -ne 0 ]
then
mv ${NFS_PATH}temp/${RELEASE_TARGET}/rootfs.ext2.gz ${NFS_PATH}temp/${RELEASE_TARGET}/rootfs.ext2
fi
mount -o loop ${NFS_PATH}temp/${RELEASE_TARGET}/rootfs.ext2 /mnt/tempfs
rm -rf ./last_week/imx53_rootfs
mv ${MX53_ROOTFS} ./last_week/
mkdir -p ${MX53_ROOTFS}
cp -a /mnt/tempfs/* ${MX53_ROOTFS}/
sync
umount /mnt/tempfs
#copy debain packages
mkdir -p ${NFS_PATH}debains
cp ${NFS_PATH}temp/${RELEASE_TARGET}/*.deb ${NFS_PATH}debains/
fi
if [ $i == "MX50" ]
then
gzip -d ${NFS_PATH}temp/${RELEASE_TARGET}/rootfs.ext2.gz
if [ $? -ne 0 ]
then
mv ${NFS_PATH}temp/${RELEASE_TARGET}/rootfs.ext2.gz ${NFS_PATH}temp/${RELEASE_TARGET}/rootfs.ext2
fi
mount -o loop ${NFS_PATH}temp/${RELEASE_TARGET}/rootfs.ext2 /mnt/tempfs
rm -rf ./last_week/imx50_rootfs
mv ${MX50_ROOTFS} ./last_week/
mkdir -p ${MX50_ROOTFS}
cp -a /mnt/tempfs/* ${MX50_ROOTFS}/
cp ${NFS_PATH}temp/${RELEASE_TARGET}/u-boot-mx50-*.bin ${MX50_ROOTFS}/root
sync
umount /mnt/tempfs
fi
if [ $i == "MX61" ]
then
gzip -d ${NFS_PATH}temp/${RELEASE_TARGET}/rootfs.ext2.gz
if [ $? -ne 0 ]
then
mv ${NFS_PATH}temp/${RELEASE_TARGET}/rootfs.ext2.gz ${NFS_PATH}temp/${RELEASE_TARGET}/rootfs.ext2
fi
mount -o loop ${NFS_PATH}temp/${RELEASE_TARGET}/rootfs.ext2 /mnt/tempfs
rm -rf ./last_week/imx61_rootfs
mv ${MX61_ROOTFS} ./last_week/
mkdir -p ${MX61_ROOTFS}
cp -a /mnt/tempfs/* ${MX61_ROOTFS}/
cp ${NFS_PATH}temp/${RELEASE_TARGET}/u-boot-mx6q-*.bin ${MX61_ROOTFS}/root
sync
umount /mnt/tempfs
fi
done
echo "now copy the vte script to /etc/rc.d/init.d/"
for i in $PLATFORM
do
if [ $i == "MX31" ]
then
cp ${VTE_ORIGINAL_PATH}vte ${MX31_ROOTFS}etc/rc.d/init.d/
fi
if [ $i == "MX35" ]
then
cp ${VTE_ORIGINAL_PATH}vte ${MX35_ROOTFS}etc/rc.d/init.d/
fi
if [ $i == "MX37" ]
then
cp ${VTE_ORIGINAL_PATH}vte ${MX37_ROOTFS}etc/rc.d/init.d/
fi
if [ $i == "MX37_24" ]
then
cp ${VTE_ORIGINAL_PATH}vte ${MX37_ROOTFS_24}etc/rc.d/init.d/
fi
if [ $i == "MX51" ]
then
cp ${VTE_ORIGINAL_PATH}vte ${MX51_ROOTFS}etc/rc.d/init.d/
fi
if [ $i == "MX51_28" ]
then
cp ${VTE_ORIGINAL_PATH}vte ${MX51_ROOTFS_28}etc/rc.d/init.d/
fi
if [ $i == "MX25" ]
then
cp ${VTE_ORIGINAL_PATH}vte ${MX25_ROOTFS}etc/rc.d/init.d/
fi
if [ $i == "MX233" ]
then
cp ${VTE_ORIGINAL_PATH}vte ${MX233_ROOTFS}/rootfs/etc/rc.d/init.d/
fi
if [ $i == "MX28" ]
then
cp ${VTE_ORIGINAL_PATH}vte ${MX28_ROOTFS}/rootfs/etc/rc.d/init.d/
fi
if [ $i == "MX53" ]
then
cp ${VTE_ORIGINAL_PATH}vte ${MX53_ROOTFS}/etc/rc.d/init.d/
fi
if [ $i == "MX50" ]
then
cp ${VTE_ORIGINAL_PATH}vte ${MX50_ROOTFS}/etc/rc.d/init.d/
fi
if [ $i == "MX61" ]
then
cp ${VTE_ORIGINAL_PATH}vte ${MX61_ROOTFS}/etc/rc.d/init.d/
fi
done
echo "now modify the /etc/rc.d/rc.local & /etc/udev/rules.d/20-board.rules"
for i in $PLATFORM
do
if [ $i == "MX31" ]
then
#pango gtk2 fslgnome
sed -i '/sd-show-icon/s/^/#/g' ${MX31_ROOTFS}etc/udev/rules.d/20-board.rules
sed -i "4s/fslgui//" ${MX31_ROOTFS}etc/rc.d/rc.conf
echo "/etc/rc.d/init.d/vte \$1 &" >> ${MX31_ROOTFS}etc/rc.d/rc.local
echo "/dev/ttyGS0" >> ${MX31_ROOTFS}etc/securetty
sed -i "s/pango//g" ${MX31_ROOTFS}etc/rc.d/rc.conf
sed -i "s/gtk2//g" ${MX31_ROOTFS}etc/rc.d/rc.conf
sed -i "s/fslgnome//g" ${MX31_ROOTFS}etc/rc.d/rc.conf
echo "/dev/mmcblk0p1 /mnt/mmcblk0p1 ext3 defaults 0 0" >> ${MX31_ROOTFS}etc/fstab
echo "/dev/mmcblk1p1 /mnt/mmcblk1p1 ext3 defaults 0 0" >> ${MX31_ROOTFS}etc/fstab
echo "/dev/sda1 /mnt/sda1 ext3 noauto 0 0" >> ${MX31_ROOTFS}etc/fstab
echo "/dev/sdb1 /mnt/sdb1 ext3 noauto 0 0" >> ${MX31_ROOTFS}etc/fstab
fi
if [ $i == "MX35" ]
then
sed -i '/sd-show-icon/s/^/#/g' ${MX35_ROOTFS}etc/udev/rules.d/20-board.rules
sed -i "4s/fslgui//" ${MX35_ROOTFS}etc/rc.d/rc.conf
echo "/etc/rc.d/init.d/vte \$1 &" >> ${MX35_ROOTFS}etc/rc.d/rc.local
echo "/dev/ttyGS0" >> ${MX35_ROOTFS}etc/securetty
sed -i "s/pango//g" ${MX35_ROOTFS}etc/rc.d/rc.conf
sed -i "s/gtk2//g" ${MX35_ROOTFS}etc/rc.d/rc.conf
sed -i "s/fslgnome//g" ${MX35_ROOTFS}etc/rc.d/rc.conf
echo "/dev/mmcblk0p1 /mnt/mmcblk0p1 ext3 defaults 0 0" >> ${MX31_ROOTFS}etc/fstab
echo "/dev/mmcblk1p1 /mnt/mmcblk1p1 ext3 defaults 0 0" >> ${MX31_ROOTFS}etc/fstab
echo "/dev/sda1 /mnt/sda1 ext3 noauto 0 0" >> ${MX31_ROOTFS}etc/fstab
echo "/dev/sdb1 /mnt/sdb1 ext3 noauto 0 0" >> ${MX31_ROOTFS}etc/fstab
fi
if [ $i == "MX37" ]
then
sed -i '/sd-show-icon/s/^/#/g' ${MX37_ROOTFS}/etc/udev/rules.d/20-board.rules
sed -i "4s/fslgui//" ${MX37_ROOTFS}etc/rc.d/rc.conf
echo "/etc/rc.d/init.d/vte \$1 &" >> ${MX37_ROOTFS}etc/rc.d/rc.local
echo "/dev/ttyGS0" >> ${MX37_ROOTFS}etc/securetty
sed -i "s/pango//g" ${MX37_ROOTFS}etc/rc.d/rc.conf
sed -i "s/gtk2//g" ${MX37_ROOTFS}etc/rc.d/rc.conf
sed -i "s/fslgnome//g" ${MX37_ROOTFS}etc/rc.d/rc.conf
echo "/dev/mmcblk0p1 /mnt/mmcblk0p1 ext3 defaults 0 0" >> ${MX31_ROOTFS}etc/fstab
echo "/dev/mmcblk1p1 /mnt/mmcblk1p1 ext3 defaults 0 0" >> ${MX31_ROOTFS}etc/fstab
echo "/dev/sda1 /mnt/sda1 ext3 noauto 0 0" >> ${MX31_ROOTFS}etc/fstab
echo "/dev/sdb1 /mnt/sdb1 ext3 noauto 0 0" >> ${MX31_ROOTFS}etc/fstab
fi
if [ $i == "MX37_24" ]
then
sed -i '/sd-show-icon/s/^/#/g' ${MX37_ROOTFS_24}/etc/udev/rules.d/20-board.rules
sed -i "4s/fslgui//" ${MX37_ROOTFS_24}etc/rc.d/rc.conf
echo "/etc/rc.d/init.d/vte \$1 &" >> ${MX37_ROOTFS_24}etc/rc.d/rc.local
echo "/dev/ttygs0" >> ${MX37_ROOTFS_24}etc/securetty
sed -i "s/pango//g" ${MX37_ROOTFS_24}etc/rc.d/rc.conf
sed -i "s/gtk2//g" ${MX37_ROOTFS_24}etc/rc.d/rc.conf
sed -i "s/fslgnome//g" ${MX37_ROOTFS_24}etc/rc.d/rc.conf
echo "/dev/mmcblk0p1 /mnt/mmcblk0p1 ext3 defaults 0 0" >> ${MX31_ROOTFS}etc/fstab
echo "/dev/mmcblk1p1 /mnt/mmcblk1p1 ext3 defaults 0 0" >> ${MX31_ROOTFS}etc/fstab
echo "/dev/sda1 /mnt/sda1 ext3 noauto 0 0" >> ${MX31_ROOTFS}etc/fstab
echo "/dev/sdb1 /mnt/sdb1 ext3 noauto 0 0" >> ${MX31_ROOTFS}etc/fstab
fi
if [ $i == "MX51" ]
then
sed -i '/sd-show-icon.sh/s/^/#/g' ${MX51_ROOTFS}/etc/udev/rules.d/20-board.rules
sed -i "4s/fslgui//" ${MX51_ROOTFS}etc/rc.d/rc.conf
echo "/etc/rc.d/init.d/vte \$1 &" >> ${MX51_ROOTFS}etc/rc.d/rc.local
echo "/dev/ttyGS0" >> ${MX51_ROOTFS}etc/securetty
sed -i "s/pango//g" ${MX51_ROOTFS}etc/rc.d/rc.conf
sed -i "s/gtk2//g" ${MX51_ROOTFS}etc/rc.d/rc.conf
sed -i "s/fslgnome//g" ${MX51_ROOTFS}etc/rc.d/rc.conf
echo "/dev/mmcblk0p1 /mnt/mmcblk0p1 ext3 defaults 0 0" >> ${MX31_ROOTFS}etc/fstab
echo "/dev/mmcblk1p1 /mnt/mmcblk1p1 ext3 defaults 0 0" >> ${MX31_ROOTFS}etc/fstab
echo "/dev/sda1 /mnt/sda1 ext3 noauto 0 0" >> ${MX31_ROOTFS}etc/fstab
echo "/dev/sdb1 /mnt/sdb1 ext3 noauto 0 0" >> ${MX31_ROOTFS}etc/fstab
fi
if [ $i == "MX51_28" ]
then
sed -i '/sd-show-icon.sh/s/^/#/g' ${MX51_ROOTFS_28}/etc/udev/rules.d/20-board.rules
sed -i "4s/fslgui//" ${MX51_ROOTFS_28}etc/rc.d/rc.conf
echo "/etc/rc.d/init.d/vte \$1 &" >> ${MX51_ROOTFS_28}etc/rc.d/rc.local
echo "/dev/ttyGS0" >> ${MX51_ROOTFS_28}etc/securetty
sed -i "s/pango//g" ${MX51_ROOTFS_28}etc/rc.d/rc.conf
sed -i "s/gtk2//g" ${MX51_ROOTFS_28}etc/rc.d/rc.conf
sed -i "s/fslgnome//g" ${MX51_ROOTFS_28}etc/rc.d/rc.conf
echo "/dev/mmcblk0p1 /mnt/mmcblk0p1 ext3 defaults 0 0" >> ${MX31_ROOTFS}etc/fstab
echo "/dev/mmcblk1p1 /mnt/mmcblk1p1 ext3 defaults 0 0" >> ${MX31_ROOTFS}etc/fstab
echo "/dev/sda1 /mnt/sda1 ext3 noauto 0 0" >> ${MX31_ROOTFS}etc/fstab
echo "/dev/sdb1 /mnt/sdb1 ext3 noauto 0 0" >> ${MX31_ROOTFS}etc/fstab
fi
if [ $i == "MX25" ]
then
sed -i '/sd-show-icon.sh/s/^/#/g' ${MX25_ROOTFS}/etc/udev/rules.d/20-board.rules
sed -i "4s/fslgui//" ${MX25_ROOTFS}etc/rc.d/rc.conf
echo "/etc/rc.d/init.d/vte \$1 &" >> ${MX25_ROOTFS}etc/rc.d/rc.local
echo "/dev/ttyGS0" >> ${MX25_ROOTFS}etc/securetty
sed -i "s/pango//g" ${MX25_ROOTFS}etc/rc.d/rc.conf
sed -i "s/gtk2//g" ${MX25_ROOTFS}etc/rc.d/rc.conf
sed -i "s/fslgnome//g" ${MX25_ROOTFS}etc/rc.d/rc.conf
echo "/dev/mmcblk0p1 /mnt/mmcblk0p1 ext3 defaults 0 0" >> ${MX31_ROOTFS}etc/fstab
echo "/dev/mmcblk1p1 /mnt/mmcblk1p1 ext3 defaults 0 0" >> ${MX31_ROOTFS}etc/fstab
echo "/dev/sda1 /mnt/sda1 ext3 noauto 0 0" >> ${MX31_ROOTFS}etc/fstab
echo "/dev/sdb1 /mnt/sdb1 ext3 noauto 0 0" >> ${MX31_ROOTFS}etc/fstab
fi
if [ $i == "MX233" ]
then
echo "/etc/rc.d/init.d/vte \$1 &" >> ${MX233_ROOTFS}/rootfs/etc/rc.d/rc.local || exit 1
sed -i "s/pango//g" ${MX233_ROOTFS}/rootfs/etc/rc.d/rc.conf
sed -i "s/gtk2//g" ${MX233_ROOTFS}/rootfs/etc/rc.d/rc.conf
sed -i "s/fslgnome//g" ${MX233_ROOTFS}/rootfs/etc/rc.d/rc.conf
echo "/dev/mmcblk0p1 /mnt/mmcblk0p1 ext3 defaults 0 0" >> ${MX31_ROOTFS}etc/fstab
echo "/dev/mmcblk1p1 /mnt/mmcblk1p1 ext3 defaults 0 0" >> ${MX31_ROOTFS}etc/fstab
echo "/dev/sda1 /mnt/sda1 ext3 noauto 0 0" >> ${MX31_ROOTFS}etc/fstab
echo "/dev/sdb1 /mnt/sdb1 ext3 noauto 0 0" >> ${MX31_ROOTFS}etc/fstab
fi
if [ $i == "MX28" ]
then
echo "/etc/rc.d/init.d/vte \$1 &" >> ${MX28_ROOTFS}/rootfs/etc/rc.d/rc.local || exit 1
sed -i "s/pango//g" ${MX28_ROOTFS}/rootfs/etc/rc.d/rc.conf
sed -i "s/gtk2//g" ${MX28_ROOTFS}/rootfs/etc/rc.d/rc.conf
sed -i "s/fslgnome//g" ${MX28_ROOTFS}/rootfs/etc/rc.d/rc.conf
echo "/dev/mmcblk0p1 /mnt/mmcblk0p1 ext3 defaults 0 0" >> ${MX31_ROOTFS}etc/fstab
echo "/dev/mmcblk1p1 /mnt/mmcblk1p1 ext3 defaults 0 0" >> ${MX31_ROOTFS}etc/fstab
echo "/dev/sda1 /mnt/sda1 ext3 noauto 0 0" >> ${MX31_ROOTFS}etc/fstab
echo "/dev/sdb1 /mnt/sdb1 ext3 noauto 0 0" >> ${MX31_ROOTFS}etc/fstab
fi
if [ $i == "MX53" ]
then
echo "/etc/rc.d/init.d/vte \$1 &" >> ${MX53_ROOTFS}/etc/rc.d/rc.local || exit 1
sed -i "s/pango//g" ${MX53_ROOTFS}/etc/rc.d/rc.conf
sed -i "s/gtk2//g" ${MX53_ROOTFS}/etc/rc.d/rc.conf
sed -i "s/fslgnome//g" ${MX53_ROOTFS}/etc/rc.d/rc.conf
echo "/dev/mmcblk0p1 /mnt/mmcblk0p1 ext3 defaults 0 0" >> ${MX31_ROOTFS}etc/fstab
echo "/dev/mmcblk1p1 /mnt/mmcblk1p1 ext3 defaults 0 0" >> ${MX31_ROOTFS}etc/fstab
echo "/dev/sda1 /mnt/sda1 ext3 noauto 0 0" >> ${MX31_ROOTFS}etc/fstab
echo "/dev/sdb1 /mnt/sdb1 ext3 noauto 0 0" >> ${MX31_ROOTFS}etc/fstab
fi
if [ $i == "MX50" ]
then
echo "/etc/rc.d/init.d/vte \$1 &" >> ${MX50_ROOTFS}/etc/rc.d/rc.local || exit 1
sed -i "s/pango//g" ${MX50_ROOTFS}/etc/rc.d/rc.conf
sed -i "s/gtk2//g" ${MX50_ROOTFS}/etc/rc.d/rc.conf
sed -i "s/fslgnome//g" ${MX50_ROOTFS}/etc/rc.d/rc.conf
echo "/dev/mmcblk0p1 /mnt/mmcblk0p1 ext3 defaults 0 0" >> ${MX31_ROOTFS}etc/fstab
echo "/dev/mmcblk1p1 /mnt/mmcblk1p1 ext3 defaults 0 0" >> ${MX31_ROOTFS}etc/fstab
echo "/dev/sda1 /mnt/sda1 ext3 noauto 0 0" >> ${MX31_ROOTFS}etc/fstab
echo "/dev/sdb1 /mnt/sdb1 ext3 noauto 0 0" >> ${MX31_ROOTFS}etc/fstab
fi
if [ $i == "MX61" ]
then
echo "/etc/rc.d/init.d/vte \$1 &" >> ${MX61_ROOTFS}/etc/rc.d/rc.local || exit 1
sed -i "s/pango//g" ${MX61_ROOTFS}/etc/rc.d/rc.conf
sed -i "s/gtk2//g" ${MX61_ROOTFS}/etc/rc.d/rc.conf
sed -i "s/fslgnome//g" ${MX61_ROOTFS}/etc/rc.d/rc.conf
echo "/dev/mmcblk0p1 /mnt/mmcblk0p1 ext3 defaults 0 0" >> ${MX61_ROOTFS}etc/fstab
echo "/dev/mmcblk1p1 /mnt/mmcblk1p1 ext3 defaults 0 0" >> ${MX61_ROOTFS}etc/fstab
echo "/dev/sda1 /mnt/sda1 ext3 noauto 0 0" >> ${MX61_ROOTFS}etc/fstab
echo "/dev/sdb1 /mnt/sdb1 ext3 noauto 0 0" >> ${MX61_ROOTFS}etc/fstab
fi
done
#update the rootfs to rootfs_r
for i in $PLATFORM
do
if [ $i == "MX53" ]; then
rm -rf ${MX53_ROOTFS_d}
cp -a ${MX53_ROOTFS} ${MX53_ROOTFS_d}
fi
if [ $i == "MX51" ]; then
rm -rf ${MX51_ROOTFS_d}
cp -a ${MX51_ROOTFS} ${MX51_ROOTFS_d}
fi
if [ $i == "MX50" ]; then
rm -rf ${MX50_ROOTFS_d}
cp -a ${MX50_ROOTFS} ${MX50_ROOTFS_d}
fi
if [ $i == "MX61" ]; then
rm -rf ${MX61_ROOTFS_d}
cp -a ${MX61_ROOTFS} ${MX61_ROOTFS_d}
fi
done
echo "finish processing!"