aboutsummaryrefslogtreecommitdiff
path: root/build.sh
blob: f4fd4da618d4fc7d7808d8b8f4d000f54230d498 (plain)
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
#!/bin/sh
#
# kernel build script for apollo3g 
#
# Usage: 'sh build.sh' to just use defaults (need to have the ELDK installed)
#        'sh build.sh CROSS_COMPILE ARCH OUTLOC' to specifiy all parameters
#
_CROSS_COMPILE=${1:-ppc_4xxFP-}
_ARCH=${2:-powerpc}
OUTLOC=${3:-_BuildOutput}
if [ ! -d ${OUTLOC} ]; then 
    mkdir -p "${OUTLOC}"
fi

echo =========== Building Linux ===============
make distclean
make mrproper
make O=${OUTLOC} CROSS_COMPILE=${_CROSS_COMPILE} ARCH=${_ARCH} 44x/apollo_3G_nas_defconfig
make O=${OUTLOC} CROSS_COMPILE=${_CROSS_COMPILE} ARCH=${_ARCH} -j 5 uImage

echo
echo =========== Building device tree ===========
make O=${OUTLOC} CROSS_COMPILE=${_CROSS_COMPILE} ARCH=${_ARCH} -j 5 apollo3g.dtb

echo
echo "=========== Copying images to directory $(pwd) ==============="
cp -v ${OUTLOC}/arch/powerpc/boot/uImage .
cp -v ${OUTLOC}/arch/powerpc/boot/apollo3g.dtb .
ls -ll *.dtb uImage

# We don't use the combined image
#echo
#echo =========== Combining images ===============
#dd if=/dev/zero of=apollo3g_boot.img bs=1 count=5M
#dd if=${OUTLOC}/arch/powerpc/boot/uImage of=apollo3g_boot.img conv=notrunc bs=1
#dd if=${OUTLOC}/arch/powerpc/boot/apollo3g.dtb of=apollo3g_boot.img conv=notrunc bs=1 seek=4M


#
# original beech script... 
#
#echo =========== Building Linux ===============
#make distclean
#make 44x/beech_nas_optimized_defconfig
#make uImage
#
#echo =========== Building device tree ===========
#make beech.dtb
#
#echo =========== Combining images ===============
#dd if=/dev/zero of=beech_boot.img bs=1 count=5M
#dd if=arch/powerpc/boot/uImage of=beech_boot.img conv=notrunc bs=1
#dd if=arch/powerpc/boot/beech.dtb of=beech_boot.img conv=notrunc bs=1 seek=4M