-
Notifications
You must be signed in to change notification settings - Fork 0
/
generate-cpio-rootfs.sh
executable file
·1241 lines (1128 loc) · 37.2 KB
/
generate-cpio-rootfs.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
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
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
732
733
734
735
736
737
738
739
740
741
742
743
744
745
746
747
748
749
750
751
752
753
754
755
756
757
758
759
760
761
762
763
764
765
766
767
768
769
770
771
772
773
774
775
776
777
778
779
780
781
782
783
784
785
786
787
788
789
790
791
792
793
794
795
796
797
798
799
800
801
802
803
804
805
806
807
808
809
810
811
812
813
814
815
816
817
818
819
820
821
822
823
824
825
826
827
828
829
830
831
832
833
834
835
836
837
838
839
840
841
842
843
844
845
846
847
848
849
850
851
852
853
854
855
856
857
858
859
860
861
862
863
864
865
866
867
868
869
870
871
872
873
874
875
876
877
878
879
880
881
882
883
884
885
886
887
888
889
890
891
892
893
894
895
896
897
898
899
900
901
902
903
904
905
906
907
908
909
910
911
912
913
914
915
916
917
918
919
920
921
922
923
924
925
926
927
928
929
930
931
932
933
934
935
936
937
938
939
940
941
942
943
944
945
946
947
948
949
950
951
952
953
954
955
956
957
958
959
960
961
962
963
964
965
966
967
968
969
970
971
972
973
974
975
976
977
978
979
980
981
982
983
984
985
986
987
988
989
990
991
992
993
994
995
996
997
998
999
1000
#!/bin/bash
echo "Generator for a simple initramfs root filesystem for some ARM targets"
CURDIR=`pwd`
STAGEDIR=${CURDIR}/stage
BUILDDIR=${CURDIR}/build
STRACEVER=strace-4.7
STRACE=${CURDIR}/${STRACEVER}
BUILD_BUSYBOX=1
BUILD_LINUX_HEADERS=
BUILD_FBTEST=
BUILD_ALSA=
BUILD_PERF=
BUILD_KSELFTEST=
BUILD_IIOTOOLS=
BUILD_GPIOTOOLS=
BUILD_LIBIIO=
BUILD_TRINITY=
BUILD_LTP=
BUILD_CRASHME=
BUILD_IOZONE=
BUILD_FIO=
BUILD_MMCUTILS=
BUILD_WIRELESS_TOOLS=
BUILD_LIBDRM=
BUILD_ETHTOOL=
# If present, perf will be built and added to the filesystem
LINUX_TREE=${HOME}/linux-gpio
# Helper function to copy one level of files and then one level
# of links from a directory to another directory.
# Clones only shared objects, and strips them.
#
# Doesn't blacklist unused libraries as we don't know if there
# is a binary using e.g. libasan or other exotic stuff.
function clone_so_dir()
{
local SRCDIR=$1
local DSTDIR=$2
local FILES=`find ${SRCDIR} -maxdepth 1 -type f -path '*.so*'`
for file in ${FILES} ; do
local BASE=`basename $file`
cp $file ${DSTDIR}/${BASE}
${STRIP} -s ${DSTDIR}/${BASE}
done;
# Clone links from the toolchain binary library dir
local LINKS=`find ${SRCDIR} -maxdepth 1 -type l -path '*.so*'`
cd ${DSTDIR}
for file in ${LINKS} ; do
local BASE=`basename $file`
local TARGET=`readlink $file`
ln -s ${TARGET} ${BASE}
done;
cd ${CURDIR}
}
function clone_to_cpio()
{
local SRCDIR=$1
local TARGETBASE=$2
echo "dir ${TARGETBASE} 755 0 0" >> filelist-final.txt
local FILES=`find ${SRCDIR} -maxdepth 1 -type f`
for file in ${FILES} ; do
local BASE=`basename $file`
echo "file ${TARGETBASE}/${BASE} $file 755 0 0" >> filelist-final.txt
done;
local DIRS=`find ${SRCDIR} -maxdepth 1 -type d`
for dir in ${DIRS} ; do
local BASE=`basename $dir`
clone_to_cpio ${SRCDIR}/${BASE} ${TARGETBASE}/${BASE}
done;
}
case $1 in
"i486")
echo "Building Intel i486 root filesystem"
export ARCH=i486
CC_PREFIX=i486
CC_DIR=/var/linus/cross-compiler-i486
LIBCBASE=${CC_DIR}
CFLAGS="-march=i486 -mtune=i486 -m32"
cp etc/inittab-pc etc/inittab
echo "i486" > etc/hostname
;;
"i586")
echo "Building Intel i586 Pentium root filesystem"
export ARCH=i586
CC_PREFIX=i586
CC_DIR=/var/linus/cross-compiler-i586
LIBCBASE=${CC_DIR}
# Skip -mtune pentium-mmx for generic Pentium image
CFLAGS="-march=i586 -mtune=pentium-mmx -m32"
cp etc/inittab-pc etc/inittab
echo "i586" > etc/hostname
;;
"h3600")
echo "Building SA1110 Compaq h3600 ARMv4 root filesystem"
export ARCH=arm
# Use ARMv4l base for SA1100 rootfs builds
# This is the convention of Rob Landley's binaries
CC_PREFIX=armv4l
CC_DIR=/var/linus/cross-compiler-armv4l
LIBCBASE=${CC_DIR}
CFLAGS="-msoft-float -marm -mabi=aapcs-linux -mno-thumb-interwork -mcpu=strongarm1100"
# BUILD_CRASHME=1
BUILD_GPIOTOOLS=1
cp etc/inittab-sa1100 etc/inittab
echo "h3600" > etc/hostname
;;
"gemini")
echo "Building FA526 Gemini ARMv4 root filesystem"
export ARCH=arm
# Use ARMv4l base for FA526 rootfs builds
# This is the convention of Rob Landley's binaries
# CC_PREFIX=armv4l
# CC_DIR=/var/linus/cross-compiler-armv4l
# LIBCBASE=${CC_DIR}
CC_PREFIX=arm-oe-linux-gnueabi
CC_DIR=/var/linus/oecore-x86_64-armv4-toolchain-nodistro/sysroots/x86_64-oesdk-linux/usr/bin/arm-oe-linux-gnueabi
LIBCBASE=/var/linus/oecore-x86_64-armv4-toolchain-nodistro/sysroots/armv4-oe-linux-gnueabi
CFLAGS="-march=armv4 -msoft-float -marm -mabi=aapcs-linux -mno-thumb-interwork --sysroot=/var/linus/oecore-x86_64-armv4-toolchain-nodistro/sysroots/armv4-oe-linux-gnueabi"
LDFLAGS="--sysroot=/var/linus/oecore-x86_64-armv4-toolchain-nodistro/sysroots/armv4-oe-linux-gnueabi"
#BUILD_BUSYBOX=
BUILD_GPIOTOOLS=1
#BUILD_WIRELESS_TOOLS=1
#BUILD_FBTEST=1
BUILD_ETHTOOL=1
cp etc/inittab-gemini etc/inittab
echo "gemini" > etc/hostname
;;
"footbridge")
echo "Building SA110 Footbridge ARMv4 root filesystem"
export ARCH=arm
# Use ARMv4l base for SA110 rootfs builds
# This is the convention of Rob Landley's binaries
CC_PREFIX=armv4l
CC_DIR=/var/linus/cross-compiler-armv4l
LIBCBASE=${CC_DIR}
CFLAGS="-msoft-float -marm -mabi=aapcs-linux -mno-thumb-interwork -mcpu=strongarm110"
cp etc/inittab-footbridge etc/inittab
echo "footbridge" > etc/hostname
;;
"ixp4")
echo "Building IXP4 ARMv5TE XScale root filesystem"
export ARCH=arm
CC_PREFIX=armeb-openwrt-linux
# This toolchain apparently needs this
export STAGING_DIR=${STAGEDIR}
CC_DIR=/var/linus/openwrt-toolchain-ixp4xx-generic_gcc-7.4.0_musl.Linux-x86_64/toolchain-armeb_xscale_gcc-7.4.0_musl
LIBCBASE=/var/linus/openwrt-toolchain-ixp4xx-generic_gcc-7.4.0_musl.Linux-x86_64/toolchain-armeb_xscale_gcc-7.4.0_musl/armeb-openwrt-linux
CFLAGS="-march=armv5te -msoft-float -marm -mthumb -mthumb-interwork --sysroot=/var/linus/openwrt-toolchain-ixp4xx-generic_gcc-7.4.0_musl.Linux-x86_64/toolchain-armeb_xscale_gcc-7.4.0_musl/armeb-openwrt-linux"
LDFLAGS="--sysroot=/var/linus/openwrt-toolchain-ixp4xx-generic_gcc-7.4.0_musl.Linux-x86_64/toolchain-armeb_xscale_gcc-7.4.0_musl/armeb-openwrt-linux"
cp etc/inittab-ixp4 etc/inittab
echo "ixp4" > etc/hostname
;;
"integrator")
echo "Building Integrator ARMv4 root filesystem"
export ARCH=arm
# Use ARMv4T base for Integrator rootfs builds
#CC_PREFIX=armv4tl
#CC_DIR=/var/linus/cross-compiler-armv4tl
#LIBCBASE=${CC_DIR}
#CFLAGS="-msoft-float -marm -mabi=aapcs-linux -mthumb -mthumb-interwork -march=armv4t -mtune=arm9tdmi"
# Works but no framebuffer... (error on mmap)
#CC_PREFIX=armv4l
#CC_DIR=/var/linus/cross-compiler-armv4l
#LIBCBASE=${CC_DIR}
#CFLAGS="-msoft-float -marm -mabi=aapcs-linux -mno-thumb-interwork -mcpu=arm9tdmi"
# Code Sourcery
# CC_PREFIX=arm-none-linux-gnueabi
# CC_DIR=/var/linus/arm-2010q1
# LIBCBASE=${CC_DIR}/${CC_PREFIX}/libc/armv4t
# CFLAGS="-msoft-float -marm -mabi=aapcs-linux -mthumb -mthumb-interwork -march=armv4t -mtune=arm9tdmi"
CC_PREFIX=arm-oe-linux-gnueabi
CC_DIR=/var/linus/oecore-x86_64-armv4-toolchain-nodistro/sysroots/x86_64-oesdk-linux/usr/bin/arm-oe-linux-gnueabi
LIBCBASE=/var/linus/oecore-x86_64-armv4-toolchain-nodistro/sysroots/armv4-oe-linux-gnueabi
CFLAGS="-march=armv4 -mtune=arm9tdmi -msoft-float -marm -mabi=aapcs-linux -mno-thumb-interwork --sysroot=/var/linus/oecore-x86_64-armv4-toolchain-nodistro/sysroots/armv4-oe-linux-gnueabi"
LDFLAGS="--sysroot=/var/linus/oecore-x86_64-armv4-toolchain-nodistro/sysroots/armv4-oe-linux-gnueabi"
BUILD_GPIOTOOLS=1
cp etc/inittab-integrator etc/inittab
echo "integrator" > etc/hostname
;;
"msm8660")
echo "Building Qualcomm MSM8660 root filesystem"
export ARCH=arm
CC_PREFIX=arm-linux-gnueabihf
CC_DIR=/var/linus/gcc-linaro-5.3-2016.02-x86_64_arm-linux-gnueabihf
LIBCBASE=${CC_DIR}/${CC_PREFIX}/libc
CFLAGS="-marm -mabi=aapcs-linux -mthumb -mthumb-interwork -mcpu=cortex-a9"
BUILD_ALSA=1
BUILD_IIOTOOLS=1
BUILD_GPIOTOOLS=1
# BUILD_MMCUTILS=1
cp etc/inittab-msm8660 etc/inittab
echo "msm8660" > etc/hostname
;;
"nexus7")
echo "Building LGE Nexus 7 root filesystem"
export ARCH=arm
CC_PREFIX=arm-linux-gnueabihf
CC_DIR=/var/linus/gcc-linaro-5.3-2016.02-x86_64_arm-linux-gnueabihf
LIBCBASE=${CC_DIR}/${CC_PREFIX}/libc
CFLAGS="-marm -mabi=aapcs-linux -mthumb -mthumb-interwork -mcpu=cortex-a9"
BUILD_ALSA=1
BUILD_IIOTOOLS=1
BUILD_GPIOTOOLS=1
# BUILD_MMCUTILS=1
cp etc/inittab-msm8660 etc/inittab
echo "nexus7" > etc/hostname
;;
"nhk8815")
echo "Building Nomadik NHK8815 root filesystem"
export ARCH=arm
CC_PREFIX=armv5l
CC_DIR=/var/linus/cross-compiler-armv5l
LIBCBASE=${CC_DIR}
CFLAGS="-msoft-float -marm -mabi=aapcs-linux -mno-thumb-interwork -march=armv5te -mtune=arm926ej-s"
BUILD_IIOTOOLS=1
BUILD_GPIOTOOLS=1
cp etc/inittab-nhk8815 etc/inittab
echo "NHK8815" > etc/hostname
;;
"kirkwood")
echo "Building Kirkwood root filesystem"
export ARCH=arm
CC_PREFIX=armv5l
CC_DIR=/var/linus/cross-compiler-armv5l
LIBCBASE=${CC_DIR}
CFLAGS="-msoft-float -marm -mabi=aapcs-linux -mno-thumb-interwork -march=armv5te -mtune=xscale"
cp etc/inittab-kirkwood etc/inittab
echo "Kirkwood" > etc/hostname
;;
"pb1176")
echo "Building ARM RealView PB1176 root filesystem"
export ARCH=arm
CC_PREFIX=armv6l
CC_DIR=/var/linus/cross-compiler-armv6l
LIBCBASE=${CC_DIR}
# Notice: no thumb VFP hardfloat on Thumb1
CFLAGS="-marm -mabi=aapcs-linux -mno-thumb -mno-thumb-interwork -mcpu=arm1176jzf-s"
cp etc/inittab-realview etc/inittab
echo "PB1176" > etc/hostname
;;
"pb11mp")
echo "Building ARM RealView PB11MPCore root filesystem"
export ARCH=arm
CC_PREFIX=armv6l
CC_DIR=/var/linus/cross-compiler-armv6l
LIBCBASE=${CC_DIR}
# CC_PREFIX=arm-linux-gnueabi
# CC_DIR=/var/linus/gcc-linaro-5.3-2016.02-x86_64_arm-linux-gnueabi
# LIBCBASE=${CC_DIR}/${CC_PREFIX}/libc
# Notice: no thumb VFP hardfloat on Thumb1
# -mno-thumb -mno-thumb-interwork
CFLAGS="-marm -mabi=aapcs-linux -mcpu=mpcorenovfp"
BUILD_GPIOTOOLS=1
cp etc/inittab-realview etc/inittab
echo "PB11MPCore" > etc/hostname
;;
"eb")
echo "Building ARM RealView EB ARM1136 root filesystem"
export ARCH=arm
CC_PREFIX=armv6l
CC_DIR=/var/linus/cross-compiler-armv6l
LIBCBASE=${CC_DIR}
# Notice: no thumb VFP hardfloat on Thumb1
# -mno-thumb -mno-thumb-interwork
CFLAGS="-marm -mabi=aapcs-linux -mcpu=arm1136j-s"
cp etc/inittab-realview etc/inittab
echo "EB 1136" > etc/hostname
;;
"a9mp")
echo "Building ARM RealView EB Cortex-A9 root filesystem"
export ARCH=arm
CC_PREFIX=arm-linux-gnueabihf
CC_DIR=/var/linus/gcc-linaro-5.3-2016.02-x86_64_arm-linux-gnueabihf
LIBCBASE=${CC_DIR}/${CC_PREFIX}/libc
CFLAGS="-marm -mabi=aapcs-linux -mthumb -mthumb-interwork -mcpu=cortex-a9"
BUILD_GPIOTOOLS=1
cp etc/inittab-realview etc/inittab
echo "EB-A9MPCore" > etc/hostname
;;
"u300")
echo "Building ST-Ericsson U300 root filesystem"
export ARCH=arm
CC_PREFIX=armv5l
CC_DIR=/var/linus/cross-compiler-armv5l
LIBCBASE=${CC_DIR}
CFLAGS="-msoft-float -marm -mabi=aapcs-linux -mthumb -mthumb-interwork -march=armv5t -mtune=arm9tdmi"
BUILD_KSELFTEST=1
cp etc/inittab-u300 etc/inittab
echo "U300" > etc/hostname
;;
"ux500")
echo "Building ST-Ericsson Ux500 root filesystem"
export ARCH=arm
CC_PREFIX=arm-linux-gnueabihf
CC_DIR=/var/linus/gcc-linaro-7.3.1-2018.05-x86_64_arm-linux-gnueabihf
LIBCBASE=${CC_DIR}/${CC_PREFIX}/libc
CFLAGS="-marm -mabi=aapcs-linux -mthumb -mthumb-interwork -mcpu=cortex-a9"
# BUILD_BUSYBOX=
BUILD_ALSA=1
BUILD_IIOTOOLS=1
# BUILD_LIBIIO=
# BUILD_TRINITY=1
# BUILD_LTP=1
# BUILD_CRASHME=1
# BUILD_IOZONE=1
# BUILD_KSELFTEST=1
BUILD_GPIOTOOLS=1
# BUILD_FIO=1
BUILD_MMCUTILS=1
cp etc/inittab-ux500 etc/inittab
echo "Ux500" > etc/hostname
;;
"exynos")
echo "Building Samsung Exynos root filesystem"
export ARCH=arm
CC_PREFIX=arm-linux-gnueabihf
CC_DIR=/var/linus/gcc-linaro-5.3-2016.02-x86_64_arm-linux-gnueabihf
LIBCBASE=${CC_DIR}/${CC_PREFIX}/libc
CFLAGS="-marm -mabi=aapcs-linux -mthumb -mthumb-interwork -mcpu=cortex-a15"
cp etc/inittab-exynos etc/inittab
echo "Exynos" > etc/hostname
;;
"simone")
echo "Building SIM.ONE ARMv4 root filesystem"
export ARCH=arm
# Rob's cross compiler
# CC_PREFIX=armv4tl
# CC_DIR=/var/linus/cross-compiler-armv4tl
# LIBCBASE=${CC_DIR}
# -mcpu=ep9312?
# CFLAGS="-msoft-float -marm -mabi=aapcs-linux -mthumb -march=armv4t"
CC_PREFIX=arm-oe-linux-gnueabi
CC_DIR=/var/linus/oecore-x86_64-armv4-toolchain-nodistro/sysroots/x86_64-oesdk-linux/usr/bin/arm-oe-linux-gnueabi
LIBCBASE=/var/linus/oecore-x86_64-armv4-toolchain-nodistro/sysroots/armv4-oe-linux-gnueabi
CFLAGS="-march=armv4 -msoft-float -marm -mabi=aapcs-linux -mno-thumb-interwork --sysroot=/var/linus/oecore-x86_64-armv4-toolchain-nodistro/sysroots/armv4-oe-linux-gnueabi"
LDFLAGS="--sysroot=/var/linus/oecore-x86_64-armv4-toolchain-nodistro/sysroots/armv4-oe-linux-gnueabi"
cp etc/inittab-simone etc/inittab
echo "SIMONE" > etc/hostname
;;
"versatile")
echo "Building ARM Versatile root filesystem"
export ARCH=arm
# CC_PREFIX=arm-linux-gnueabi
# CC_DIR=/var/linus/gcc-linaro-5.3-2016.02-x86_64_arm-linux-gnueabi
# LIBCBASE=${CC_DIR}/${CC_PREFIX}/libc
CC_PREFIX=armv5l
CC_DIR=/var/linus/cross-compiler-armv5l
LIBCBASE=${CC_DIR}
CFLAGS="-marm -msoft-float -mabi=aapcs-linux -mcpu=arm9tdmi"
# BUILD_CRASHME=1
# BUILD_LTP=1
# BUILD_KSELFTEST=1
# BUILD_BUSYBOX=
# BUILD_FIO=1
BUILD_GPIOTOOLS=1
cp etc/inittab-versatile etc/inittab
echo "Versatile" > etc/hostname
;;
"vexpress")
echo "Building Versatile Express Cortex-A9 root filesystem"
export ARCH=arm
CC_PREFIX=arm-linux-gnueabihf
#CC_DIR=/var/linus/gcc-linaro-5.3-2016.02-x86_64_arm-linux-gnueabihf
CC_DIR=/var/linus/gcc-linaro-7.2.1-2017.11-x86_64_arm-linux-gnueabihf
LIBCBASE=${CC_DIR}/${CC_PREFIX}/libc
CFLAGS="-marm -mabi=aapcs-linux -mthumb -mthumb-interwork -mcpu=cortex-a9"
cp etc/inittab-vexpress etc/inittab
echo "Vexpress" > etc/hostname
;;
"aarch64")
echo "Building AARCH64 root filesystem"
export ARCH=aarch64
CC_PREFIX=aarch64-linux-gnu
CC_DIR=/var/linus/gcc-linaro-aarch64-linux-gnu-4.9-2014.09_linux
#CC_DIR=/var/linus/gcc-linaro-4.9-2015.02-3-x86_64_aarch64-linux-gnu
LIBCBASE=${CC_DIR}/${CC_PREFIX}/libc
CFLAGS="-march=armv8-a"
cp etc/inittab-vexpress etc/inittab
echo "AARCH64" > etc/hostname
BUILD_CRASHME=1
BUILD_LTP=1
BUILD_IOZONE=1
;;
"zynqmp")
echo "Building ZynqMP Aarch64 root filesystem"
export ARCH=aarch64
CC_PREFIX=aarch64-linux-gnu
CC_DIR=/var/linus/gcc-linaro-7.2.1-2017.11-x86_64_aarch64-linux-gnu
LIBCBASE=${CC_DIR}/${CC_PREFIX}/libc
CFLAGS="-march=armv8-a"
cp etc/inittab-zynqmp etc/inittab
echo "ZynqMP" > etc/hostname
BUILD_GPIOTOOLS=1
;;
*)
echo "Usage: $0 [i486|i586|h3600|footbridge|gemini|integrator|msm8660|nhk8815|pb1176|u300|ux500|exynos|versatile|vexpress|aarch64|zynqmp]"
exit 1
;;
esac
if test "${CC_PREFIX}" = "armv4tl" ; then
CROSS_HOST="arm-linux-gnu"
else
CROSS_HOST=${CC_PREFIX}
fi
echo "CROSS_HOST = ${CROSS_HOST}"
# Define more tools
STRIP=${CC_PREFIX}-strip
OUTFILE=${HOME}/rootfs-$1.cpio
echo "OUTFILE = ${OUTFILE}"
echo "Check prerequisites..."
# Use nothing but the standard paths, the CC path and current
# dir for this environment, kill off everything else.
if [ -x ${CC_DIR}/${CC_PREFIX}-gcc ] ; then
echo "Crosscompiler found at ${CC_DIR}"
export PATH="${CC_DIR}:/usr/bin:/usr/sbin:/bin:/sbin:${CURDIR}"
elif [ -x ${CC_DIR}/bin/${CC_PREFIX}-gcc ] ; then
echo "Crosscompiler found at ${CC_DIR}/bin"
export PATH="${CC_DIR}/bin:/usr/bin:/usr/sbin:/bin:/sbin:${CURDIR}"
fi
echo -n "Check if we can find crosscompiler ... "
which ${CC_PREFIX}-gcc > /dev/null ; if [ ! $? -eq 0 ] ; then
echo "ERROR: cross-compiler ${CC_PREFIX}-gcc not in PATH=$PATH!"
echo "ABORTING."
exit 1
else
echo "OK"
fi
echo -n "gen_init_cpio ... "
which gen_init_cpio > /dev/null ; if [ ! $? -eq 0 ] ; then
echo "ERROR: gen_init_cpio not in PATH=$PATH!"
echo "Copy this binary from the Linux build tree."
echo "Or set your PATH into the Linux kernel tree, I don't care..."
echo "ABORTING."
exit 1
else
echo "OK"
fi
# Copy the template of static files to be used
cp filelist.txt filelist-final.txt
# Prep dirs
if [ -d ${STAGEDIR} ] ; then
echo "Scrathing old ${STAGEDIR}"
rm -rf ${STAGEDIR}
fi
if [ -d ${BUILDDIR} ] ; then
echo "Scrathing old ${BUILDDIR}"
rm -rf ${BUILDDIR}
fi
mkdir ${STAGEDIR}
mkdir ${STAGEDIR}/etc
mkdir ${STAGEDIR}/bin
mkdir ${STAGEDIR}/lib
mkdir ${STAGEDIR}/sbin
mkdir ${STAGEDIR}/usr
mkdir ${STAGEDIR}/usr/bin
mkdir ${STAGEDIR}/usr/lib
mkdir ${STAGEDIR}/usr/sbin
mkdir ${STAGEDIR}/usr/share
mkdir ${BUILDDIR}
# Trigger all header builds like this
if test ${BUILD_BUSYBOX} ; then
BUILD_LINUX_HEADERS=1
fi
if test ${BUILD_ALSA} ; then
BUILD_LINUX_HEADERS=1
fi
if test ${BUILD_FBTEST} ; then
BUILD_LINUX_HEADERS=1
fi
if test ${BUILD_IIOTOOLS} ; then
BUILD_LINUX_HEADERS=1
fi
if test ${BUILD_GPIOTOOLS} ; then
BUILD_LINUX_HEADERS=1
fi
if test ${BUILD_LIBIIO} ; then
BUILD_LINUX_HEADERS=1
fi
if test ${BUILD_TRINITY} ; then
BUILD_LINUX_HEADERS=1
fi
if test ${BUILD_LTP} ; then
BUILD_LINUX_HEADERS=1
fi
if test ${BUILD_CRASHME} ; then
BUILD_LINUX_HEADERS=1
fi
if test ${BUILD_IOZONE} ; then
BUILD_LINUX_HEADERS=1
fi
if test ${BUILD_FIO} ; then
BUILD_LINUX_HEADERS=1
fi
if test ${BUILD_MMCUTILS} ; then
BUILD_LINUX_HEADERS=1
fi
if test ${BUILD_WIRELESS_TOOLS} ; then
BUILD_LINUX_HEADERS=1
fi
if test ${BUILD_LIBDRM} ; then
BUILD_LINUX_HEADERS=1
fi
if test ${BUILD_ETHTOOL} ; then
BUILD_LINUX_HEADERS=1
fi
# But these cross-compilers do not play well with native
# Linux headers
#echo ${CC_PREFIX} | grep "^armv.l$" ; \
# if [ $? -eq 0 ] ; \
# then BUILD_LINUX_HEADERS= ; \
# echo "This cross compiler does not like custom Linux headers" ; \
# fi
if test ${BUILD_LINUX_HEADERS} ; then
if [ -d ${LINUX_TREE} ] ; then
echo "Building linux headers..."
if [ -d ${BUILDDIR}/include-linux ] ; then
rf -rf ${BUILDDIR}/include-linux
fi
mkdir -p ${BUILDDIR}/include-linux
if test ${ARCH} = aarch64 ; then
LINUXARCH=arm64
else
LINUXARCH=${ARCH}
fi
make -C ${LINUX_TREE} headers_install ARCH=${LINUXARCH} INSTALL_HDR_PATH=${BUILDDIR}/include-linux
if [ ! $? -eq 0 ] ; then
echo "Build failed!"
exit 1
fi
fi
# Now use these includes in subsequent builds
CFLAGS="${CFLAGS} -I${BUILDDIR}/include-linux/include"
echo "New CFLAGS: ${CFLAGS}"
# end of building Linux headers
fi
if test ${BUILD_BUSYBOX} ; then
# Clone the busybox git if we don't have it...
if [ ! -d busybox ] ; then
echo "It appears we're missing a busybox git, cloning it."
git clone git://busybox.net/busybox.git busybox
if [ ! -d busybox ] ; then
echo "Failed. ABORTING."
exit 1
fi
fi
cd busybox
make O=${BUILDDIR} defconfig
echo "Configuring cross compiler etc..."
# Comment in this line to create a statically linked busybox
#sed -i "s/^#.*CONFIG_STATIC.*/CONFIG_STATIC=y/" ${BUILDDIR}/.config
sed -i -e "s;CONFIG_CROSS_COMPILER_PREFIX=\"\";CONFIG_CROSS_COMPILER_PREFIX=\"${CC_PREFIX}-\";g" ${BUILDDIR}/.config
sed -i -e "s;CONFIG_EXTRA_CFLAGS=\"\";CONFIG_EXTRA_CFLAGS=\"${CFLAGS}\";g" ${BUILDDIR}/.config
sed -i -e "s;CONFIG_EXTRA_LDFLAGS=\"\";CONFIG_EXTRA_LDFLAGS=\"${LDFLAGS}\";g" ${BUILDDIR}/.config
sed -i -e "s;CONFIG_PREFIX=\".*\";CONFIG_PREFIX=\"../stage\";g" ${BUILDDIR}/.config
# This doesn't work on old compilers
sed -i -e "s/CONFIG_FALLOCATE=y/\# CONFIG_FALLOCATE is not set/g" ${BUILDDIR}/.config
# Turn off "eject" command, we don't have a CDROM
sed -i -e "s/CONFIG_EJECT=y/\# CONFIG_EJECT is not set/g" ${BUILDDIR}/.config
sed -i -e "s/CONFIG_FEATURE_EJECT_SCSI=y/\# CONFIG_FEATURE_EJECT_SCSI is not set/g" ${BUILDDIR}/.config
# Unshare does not compile for some cross compilers
sed -i -e "s/CONFIG_FEATURE_UNSHARE=y/\# CONFIG_FEATURE_UNSHARE is not set/g" ${BUILDDIR}/.config
# Fancy sync has problems with some cross compilers
sed -i -e "s/CONFIG_FEATURE_SYNC_FANCY=y/\# CONFIG_FEATURE_SYNC_FANCY is not set/g" ${BUILDDIR}/.config
# Nsenter has problems for some cross compilers
sed -i -e "s/CONFIG_FEATURE_NSENTER_LONG_OPTS=y/\# CONFIG_FEATURE_NSENTER_LONG_OPTS is not set/g" ${BUILDDIR}/.config
sed -i -e "s/CONFIG_NSENTER=y/\# CONFIG_NSENTER is not set/g" ${BUILDDIR}/.config
# tcpudp/tcpsvd doesn't work with Landley's compilers
sed -i -e "s/CONFIG_TCPSVD=y/\# CONFIG_TCPSVD is not set/g" ${BUILDDIR}/.config
sed -i -e "s/CONFIG_UDPSVD=y/\# CONFIG_UDPSVD is not set/g" ${BUILDDIR}/.config
# neither does runlevel
sed -i -e "s/CONFIG_RUNLEVEL=y/\# CONFIG_RUNLEVEL is not set/g" ${BUILDDIR}/.config
# We need taskset though for SMP tests
sed -i -e "s/\# CONFIG_TASKSET is not set/CONFIG_TASKSET=y/g" ${BUILDDIR}/.config
# LTP needs a proper bash to run
if test ${BUILD_KSELFTEST} ; then
sed -i -e "s/\# CONFIG_FEATURE_BASH_IS_ASH is not set/CONFIG_FEATURE_BASH_IS_ASH=y/g" ${BUILDDIR}/.config
sed -i -e "s/CONFIG_FEATURE_BASH_IS_NONE=y/\# CONFIG_FEATURE_BASH_IS_NONE is not set/g" ${BUILDDIR}/.config
fi
# Enable for manual config
#make O=${BUILDDIR} menuconfig
make O=${BUILDDIR}
make O=${BUILDDIR} install
cd ${CURDIR}
fi
# First the flat library where arch-independent stuff will
# end up
clone_so_dir ${LIBCBASE}/lib ${STAGEDIR}/lib
# The C library may be in a per-arch subdir (multiarch)
# OR it may not...
if [ -d ${LIBCBASE}/lib/${CC_PREFIX} ] ; then
mkdir -p ${STAGEDIR}/lib/${CC_PREFIX}
echo "dir /lib/${CC_PREFIX} 755 0 0" >> filelist-final.txt
clone_so_dir ${LIBCBASE}/lib/${CC_PREFIX} ${STAGEDIR}/lib/${CC_PREFIX}
fi
# Add files by searching stage directory
BINFILES=`find ${STAGEDIR}/bin -maxdepth 1 -type f`
for file in ${BINFILES} ; do
BASE=`basename $file`
echo "file /bin/${BASE} $file 755 0 0" >> filelist-final.txt
done;
SBINFILES=`find ${STAGEDIR}/sbin -maxdepth 1 -type f`
for file in ${SBINFILES} ; do
BASE=`basename $file`
echo "file /sbin/${BASE} $file 755 0 0" >> filelist-final.txt
done;
LIBFILES=`find ${STAGEDIR}/lib -maxdepth 1 -type f`
for file in ${LIBFILES} ; do
BASE=`basename $file`
echo "file /lib/${BASE} $file 755 0 0" >> filelist-final.txt
done;
LIBLINKS=`find ${STAGEDIR}/lib -maxdepth 1 -type l`
for file in ${LIBLINKS} ; do
BASE=`basename $file`
TARGET=`readlink $file`
echo "slink /lib/${BASE} ${TARGET} 755 0 0" >> filelist-final.txt
done;
# Add multiarch library dir
if [ -d ${STAGEDIR}/lib/${CC_PREFIX} ] ; then
echo "dir /lib/${CC_PREFIX} 755 0 0" >> filelist-final.txt
CLIBFILES=`find ${STAGEDIR}/lib/${CC_PREFIX} -maxdepth 1 -type f`
for file in ${CLIBFILES} ; do
BASE=`basename $file`
echo "file /lib/${CC_PREFIX}/${BASE} $file 755 0 0" >> filelist-final.txt
done;
CLIBLINKS=`find ${STAGEDIR}/lib/${CC_PREFIX} -maxdepth 1 -type l`
for file in ${CLIBLINKS} ; do
BASE=`basename $file`
TARGET=`readlink $file`
echo "slink /lib/${CC_PREFIX}/${BASE} ${TARGET} 755 0 0" >> filelist-final.txt
done;
fi
# Add links by searching stage directory
LINKSBIN=`find ${STAGEDIR}/bin -maxdepth 1 -type l`
for file in ${LINKSBIN} ; do
BASE=`basename $file`
TARGET=`readlink $file`
echo "slink /bin/${BASE} ${TARGET} 755 0 0" >> filelist-final.txt
done;
LINKSSBIN=`find ${STAGEDIR}/sbin -maxdepth 1 -type l`
for file in ${LINKSSBIN} ; do
BASE=`basename $file`
TARGET=`readlink $file`
echo "slink /sbin/${BASE} ${TARGET} 755 0 0" >> filelist-final.txt
done;
LINKSUSRBIN=`find ${STAGEDIR}/usr/bin -maxdepth 1 -type l`
for file in ${LINKSUSRBIN} ; do
BASE=`basename $file`
TARGET=`readlink $file`
echo "slink /usr/bin/${BASE} ${TARGET} 755 0 0" >> filelist-final.txt
done;
LINKSUSRSBIN=`find ${STAGEDIR}/usr/sbin -maxdepth 1 -type l`
for file in ${LINKSUSRSBIN} ; do
BASE=`basename $file`
TARGET=`readlink $file`
echo "slink /sbin/${BASE} ${TARGET} 755 0 0" >> filelist-final.txt
done;
if test ${BUILD_FBTEST} ; then
echo "Compiling fbtest..."
${CC_PREFIX}-gcc ${CFLAGS} -o ${STAGEDIR}/usr/bin/fbtest fbtest/fbtest.c
echo "file /usr/bin/fbtest ${STAGEDIR}/usr/bin/fbtest 755 0 0" >> filelist-final.txt
# End of building fbtest
fi
if test ${BUILD_ALSA} ; then
# Clone the tinyalsa git if we don't have it...
if [ ! -d tinyalsa ] ; then
echo "It appears we're missing a tinyalsa git, cloning it."
git clone https://github.com/tinyalsa/tinyalsa.git tinyalsa
if [ ! -d tinyalsa ] ; then
echo "Failed. ABORTING."
exit 1
fi
fi
echo "Compiling tinyalsa..."
cd tinyalsa
make clean
make CROSS_COMPILE=${CC_PREFIX}- CFLAGS="${CFLAGS} -I${CURDIR}/tinyalsa/include -L${CURDIR}/tinyalsa/src"
cd ${CURDIR}
echo "file /usr/lib/libtinyalsa.so ${CURDIR}/tinyalsa/src/libtinyalsa.so 755 0 0" >> filelist-final.txt
echo "slink /usr/lib/libtinyalsa.so.1 libtinyalsa.so 755 0 0" >> filelist-final.txt
echo "slink /usr/lib/libtinyalsa.so.1.1.0 libtinyalsa.so 755 0 0" >> filelist-final.txt
echo "file /usr/bin/tinycap ${CURDIR}/tinyalsa/utils/tinycap 755 0 0" >> filelist-final.txt
echo "file /usr/bin/tinymix ${CURDIR}/tinyalsa/utils/tinymix 755 0 0" >> filelist-final.txt
echo "file /usr/bin/tinypcminfo ${CURDIR}/tinyalsa/utils/tinypcminfo 755 0 0" >> filelist-final.txt
echo "file /usr/bin/tinyplay ${CURDIR}/tinyalsa/utils/tinyplay 755 0 0" >> filelist-final.txt
echo "file /usr/share/doriano48_low.wav ${CURDIR}/share/doriano48_low.wav 644 0 0" >> filelist-final.txt
#end of ALSA build
fi
if test ${BUILD_PERF} ; then
if [ -d ${LINUX_TREE}/tools/perf ] ; then
echo "Building perf..."
if [ -d ${BUILDDIR}/perf ] ; then
rf -rf ${BUILDDIR}/perf
fi
mkdir -p ${BUILDDIR}/perf
ARCH=${ARCH} CROSS_COMPILE=${CC_PREFIX}- O=${BUILDDIR}/perf/ \
NO_NEWT=1 NO_SLANG=1 NO_GTK2=1 NO_LIBPERL=1 NO_LIBPYTHON=1 NO_LIBELF=1 NO_LIBBIONIC=1 \
LDFLAGS=-static \
make -C ${LINUX_TREE}/tools/perf
if [ ! $? -eq 0 ] ; then
echo "Build failed!"
exit 1
fi
echo "file /usr/bin/perf ${BUILDDIR}/perf/perf 755 0 0" >> filelist-final.txt
fi
# end of perf build
fi
if test ${BUILD_IIOTOOLS} ; then
IIOTOOLS_DIR=${LINUX_TREE}/tools/iio
if [ -d ${IIOTOOLS_DIR} ] ; then
echo "Building IIO tools..."
if [ -d ${BUILDDIR}/iiotools ] ; then
rf -rf ${BUILDDIR}/iiotools
fi
mkdir -p ${BUILDDIR}/iiotools
ARCH=${ARCH} \
CROSS_COMPILE=${CC_PREFIX}- \
O=${BUILDDIR}/iiotools \
CFLAGS="${CFLAGS} -I${BUILDDIR}/include-linux/include" \
make -C ${IIOTOOLS_DIR}
if [ ! $? -eq 0 ] ; then
echo "Build failed!"
exit 1
fi
echo "file /usr/bin/lsiio ${IIOTOOLS_DIR}/lsiio 755 0 0" >> filelist-final.txt
echo "file /usr/bin/iio_generic_buffer ${IIOTOOLS_DIR}/iio_generic_buffer 755 0 0" >> filelist-final.txt
echo "file /usr/bin/iio_event_monitor ${IIOTOOLS_DIR}/iio_event_monitor 755 0 0" >> filelist-final.txt
fi
# end of IIO tools build
fi
if test ${BUILD_GPIOTOOLS} ; then
GPIOTOOLS_DIR=${LINUX_TREE}/tools/gpio
if [ -d ${GPIOTOOLS_DIR} ] ; then
echo "Building GPIO tools..."
make -C ${GPIOTOOLS_DIR} clean
ARCH=${ARCH} \
CROSS_COMPILE=${CC_PREFIX}- \
CFLAGS="${CFLAGS} -I${BUILDDIR}/include-linux/include" \
LDFLAGS="${LDFLAGS}" \
make -C ${GPIOTOOLS_DIR}
if [ ! $? -eq 0 ] ; then
echo "Build failed!"
exit 1
fi
echo "file /usr/bin/lsgpio ${GPIOTOOLS_DIR}/lsgpio 755 0 0" >> filelist-final.txt
echo "file /usr/bin/gpio-hammer ${GPIOTOOLS_DIR}/gpio-hammer 755 0 0" >> filelist-final.txt
echo "file /usr/bin/gpio-event-mon ${GPIOTOOLS_DIR}/gpio-event-mon 755 0 0" >> filelist-final.txt
fi
# end of GPIO tools build
fi
if test ${BUILD_LIBIIO} ; then
if [ ! -d libiio ] ; then
echo "It appears we're missing a libiio git, cloning it."
git clone https://github.com/analogdevicesinc/libiio.git
if [ ! -d libiio ] ; then
echo "Failed. ABORTING."
exit 1
fi
fi
echo "Building libiio..."
cd libiio
cmake ./
echo "ARCH=${ARCH} \
CROSS_=${CC_PREFIX}- \
O=${BUILDDIR}/iiotools \
CFLAGS="${CFLAGS} -I${BUILDDIR}/include-linux/include" \
make -C ${IIOTOOLS_DIR} all"
if [ ! $? -eq 0 ] ; then
echo "Build failed!"
exit 1
fi
#echo "file /usr/bin/lsiio ${IIOTOOLS_DIR}/lsiio 755 0 0" >> filelist-final.txt
#echo "file /usr/bin/generic_buffer ${IIOTOOLS_DIR}/generic_buffer 755 0 0" >> filelist-final.txt
#echo "file /usr/bin/iio_event_monitor ${IIOTOOLS_DIR}/iio_event_monitor 755 0 0" >> filelist-final.txt
# end of libiio build
fi
if test ${BUILD_TRINITY} ; then
if [ ! -d trinity ] ; then
echo "It appears we're missing a trinity git, cloning it."
git clone https://github.com/kernelslacker/trinity.git
if [ ! -d trinity ] ; then
echo "Failed. ABORTING."
exit 1
fi
fi
echo "Building trinity..."
cd trinity
CC=gcc CROSS_COMPILE=${CC_PREFIX}- CFLAGS="$CFLAGS" ./configure.sh
make clean
echo "Cleaned up"
echo "Compiler: ${CC_PREFIX}-gcc ${CFLAGS}"
CC=gcc CROSS_COMPILE=${CC_PREFIX}- CROSS_CFLAGS="${CFLAGS}" make all
if [ ! $? -eq 0 ] ; then
echo "Trinity build failed!"
exit 1
fi
cd ${CURDIR}
echo "file /usr/bin/trinity ${CURDIR}/trinity/trinity 755 0 0" >> filelist-final.txt
# end of trinity build
fi
if test ${BUILD_LTP} ; then
if [ ! -d ltp ] ; then
echo "It appears we're missing an LTP git, cloning it."
git clone https://github.com/linux-test-project/ltp.git
if [ ! -d ltp ] ; then
echo "Failed. ABORTING."
exit 1
fi
fi
echo "Building LTP..."
cd ltp
make autotools
mkdir -p ${BUILDDIR}/ltp
cd ${BUILDDIR}/ltp
${CURDIR}/ltp/configure CC=${CC_PREFIX}-gcc CFLAGS="$CFLAGS" --build x86_64 --host=${CROSS_HOST}
cd ${CURDIR}/ltp
#cp include/config.h.default ${BUILDDIR}/ltp/include/config.h
#cp include/mk/config.mk.default ${BUILDDIR}/ltp/include/mk/config.mk
#cp include/mk/features.mk.default ${BUILDDIR}/ltp/include/mk/features.mk
make \
-C ${BUILDDIR}/ltp \
-f ${CURDIR}/ltp/Makefile \
top_srcdir=${CURDIR}/ltp \
top_builddir=${BUILDDIR}/ltp
if [ ! $? -eq 0 ] ; then
echo "LTP build failed!"
exit 1
fi
make \
-C ${BUILDDIR}/ltp \
-f ${CURDIR}/ltp/Makefile \
top_srcdir=${CURDIR}/ltp \
top_builddir=${BUILDDIR}/ltp \
DESTDIR=${STAGEDIR} \
install
cd ${CURDIR}
clone_to_cpio ${STAGEDIR}/opt/ltp /opt/ltp
# end of LTP build
fi
if test ${BUILD_CRASHME} ; then
echo "Building Crashme..."
cd crashme-2.8.5
make clean
make CC=${CC_PREFIX}-gcc CFLAGS="${CFLAGS}"
cd ${CURDIR}
echo "file /usr/bin/crashme ${CURDIR}/crashme-2.8.5/crashme 755 0 0" >> filelist-final.txt
# end of Crashme build
fi
if test ${BUILD_FIO} ; then
echo "Building fio..."
FIO_DIR=${CURDIR}/fio
if [ ! -d ${FIO_DIR} ] ; then
echo "It appears we're missing a FIO git, cloning it."
cd ${CURDIR}
git clone https://github.com/axboe/fio.git
if [ ! -d fio ] ; then
echo "Failed. ABORTING."
exit 1
fi
fi
cd ${FIO_DIR}
git checkout configure
make clean
rm *.o
mkdir -p ${STAGEDIR}/fio
./configure --prefix=${STAGEDIR}/fio --cc=${CC_PREFIX}-gcc --extra-cflags="${CFLAGS}"
make
if [ ! $? -eq 0 ] ; then
echo "Build failed!"
exit 1
fi
cd ${CURDIR}
echo "file /usr/bin/fio ${FIO_DIR}/fio 755 0 0" >> filelist-final.txt
# end of iozone build
fi
if test ${BUILD_IOZONE} ; then
echo "Building iozone..."
IOZONE_DIR=${CURDIR}/iozone3_430/src/current
if [ ! -d ${IOZONE_DIR} ] ; then
echo "It appears we're missing the iozone dir, fix it."
exit 1
fi
cd ${IOZONE_DIR}
rm *.o
CC=${CC_PREFIX}-gcc GCC=${CC_PREFIX}-gcc CFLAGS="${CFLAGS}" LDFLAGS="${CFLAGS}" make -f makefile linux-arm
if [ ! $? -eq 0 ] ; then
echo "Build failed!"
exit 1
fi
cd ${CURDIR}
echo "file /usr/bin/iozone ${IOZONE_DIR}/iozone 755 0 0" >> filelist-final.txt
# end of fio build
fi
if test ${BUILD_MMCUTILS} ; then
if [ ! -d mmc-utils ] ; then
echo "It appears we're missing a mmc-utils git, cloning it."
git clone git://git.kernel.org/pub/scm/linux/kernel/git/cjb/mmc-utils.git
if [ ! -d mmc-utils ] ; then
echo "Failed. ABORTING."
exit 1
fi
fi
echo "Building MMC-UTILS..."
cd mmc-utils
make clean
echo "Compiler: ${CC_PREFIX}-gcc ${CFLAGS}"
CC=${CC_PREFIX}-gcc CFLAGS="${CFLAGS} -g -O2" make all
if [ ! $? -eq 0 ] ; then
echo "MMC-utils build failed!"
exit 1
fi
cd ${CURDIR}
echo "file /usr/bin/mmc ${CURDIR}/mmc-utils/mmc 755 0 0" >> filelist-final.txt
# end of mmcutils build
fi
if test ${BUILD_WIRELESS_TOOLS} ; then