update media_build_config
[pandora-misc.git] / kernel2 / update.sh
1 #!/bin/sh
2
3 set -e
4
5 ksrc=`pwd`
6 target=../../3.2_rootfs/
7 target_abs=$ksrc/$target
8
9 mkdir -p ${target}lib/modules
10 mkdir -p ${target}boot
11
12 make uImage modules
13 cp arch/arm/boot/uImage ${target}boot/uImage-3
14
15 rm -rf ${target}lib/modules/*
16 make modules_install INSTALL_MOD_PATH=${target}
17 rm ${target}lib/modules/*/modules.dep
18 rm ${target}lib/modules/*/build
19 rm ${target}lib/modules/*/source
20 # for OE recipe..
21 rm -rf ${target}lib/firmware
22
23 kmoddir=`ls -d ${target}lib/modules/*/kernel/`
24
25 if test -z "$1"; then
26 #if true; then
27 #if false; then
28
29 cp_if_exists()
30 {
31   if test -f $1; then
32     cp -v $1 $2
33   fi
34 }
35
36 # SGX
37 sgxbase=/home/notaz/stuff/sgx/km/
38 sgxbranches="1.4.14.2616 nokia 1.5.15.2766 1.6.16.3977 1.6.16.4117
39  1.7.17.783851 1.7.17.867897 1.9.19.2139099 1.9.19.2188537 1.10.2359475"
40 for branch in $sgxbranches; do
41   cd $sgxbase
42   git checkout $branch
43   make KERNELDIR=$ksrc clean
44   make KERNELDIR=$ksrc -j2 all
45   cd $ksrc
46   gput=${kmoddir}drivers/gpu/pvr/$branch/
47   mkdir -p $gput
48   cp_if_exists $sgxbase/services4/3rdparty/bufferclass_ti/bufferclass_ti.ko $gput
49   cp_if_exists $sgxbase/services4/3rdparty/dc_omap3_linux/omaplfb.ko $gput
50   cp_if_exists $sgxbase/services4/3rdparty/dc_omap3430_linux/omaplfb.ko $gput
51   cp_if_exists $sgxbase/services4/3rdparty/dc_omapfb3_linux/omaplfb.ko $gput
52   cp_if_exists $sgxbase/pvrsrvkm.ko $gput
53   # Nokia
54   cp_if_exists $sgxbase/pvr/omaplfb.ko $gput
55   cp_if_exists $sgxbase/pvr/pvrsrvkm.ko $gput
56   cp_if_exists $sgxbase/pvr/bufferclass_ti.ko $gput
57
58   make M=$sgxbase clean
59 done
60 mv ${kmoddir}drivers/gpu/pvr/nokia/* ${kmoddir}drivers/gpu/pvr/
61 rmdir ${kmoddir}drivers/gpu/pvr/nokia
62
63
64 # Realtek USB wifi
65 d=../modules/rtl8192_8188CU_linux_v3.1.2590.20110922/
66 make -C $d ARCH=arm KSRC=$ksrc clean
67 make -C $d ARCH=arm KSRC=$ksrc modules -j2
68 cp -v $d/8192cu.ko ${kmoddir}drivers/net/wireless/
69
70 d=../modules/rtl8712_8188_8191_8192SU_usb_linux_v2.6.6.0.20110401/
71 make -C $d ARCH=arm KSRC=$ksrc clean
72 make -C $d ARCH=arm KSRC=$ksrc modules -j2
73 cp -v $d/8712u.ko ${kmoddir}drivers/net/wireless/
74
75 d=../modules/rtl8188eu/
76 make -C $d ARCH=arm KSRC=$ksrc clean
77 make -C $d ARCH=arm KSRC=$ksrc modules -j2
78 make -C $d ARCH=arm KSRC=$ksrc strip
79 cp -v $d/8188eu.ko ${kmoddir}drivers/net/wireless/
80
81 # MT7601U (Mediatek/digitus, ED sold some..)
82 d=../modules/DPO_MT7601U_LinuxSTA_3.0.0.4_20130913
83 make -C $d ARCH=arm CROSS_COMPILE=$CROSS_COMPILE LINUX_SRC=$ksrc clean
84 make -C $d ARCH=arm CROSS_COMPILE=$CROSS_COMPILE LINUX_SRC=$ksrc all -j2
85 cp -v $d/os/linux/mt7601Usta.ko ${kmoddir}drivers/net/wireless/
86
87
88 # DSP stuff
89 mkdir ${kmoddir}drivers/dsp/
90 c64_tools=`pwd`/../modules/c64_tools/kmod
91 sed -i -e 's://#define USE_DSP_POWER_NOTIFY:#define USE_DSP_POWER_NOTIFY:' $c64_tools/kmod.h
92 make -C $c64_tools ARCH=arm KDIR=$ksrc clean bin
93 cp -v $c64_tools/c64.ko ${kmoddir}drivers/dsp/
94
95 dsplink=`pwd`/../modules/dsplink_linux_1_65_00_03/dsplink
96 make -C $dsplink/gpp/src ARCH=arm KERNEL_DIR=$ksrc BASE_BUILDOS=$ksrc DSPLINK=$dsplink MAKE_OPTS= \
97         CC=${CROSS_COMPILE}gcc LD=${CROSS_COMPILE}ld release
98 cp -v $dsplink/gpp/export/BIN/Linux/OMAP3530/RELEASE/dsplinkk.ko ${kmoddir}drivers/dsp/
99
100 dsputils=`pwd`/../modules/linuxutils_2_26_01_02/packages/ti/sdo/linuxutils
101 make -C $dsputils/cmem/src/module ARCH=arm LINUXKERNEL_INSTALL_DIR=$ksrc MAKE_ENV= release
102 cp -v $dsputils/cmem/src/module/cmemk.ko ${kmoddir}drivers/dsp/
103 make -C $dsputils/sdma/src/module ARCH=arm LINUXKERNEL_INSTALL_DIR=$ksrc MAKE_ENV= release
104 cp -v $dsputils/sdma/src/module/sdmak.ko ${kmoddir}drivers/dsp/
105
106 dsp_lpm=../modules/local_power_manager_linux_1_24_02_09/packages/ti/bios/power/modules/omap3530/lpm
107 make -C $dsp_lpm ARCH=arm LINUXKERNEL_INSTALL_DIR=$ksrc MAKE_OPTS= DSPLINK_REPO=$dsplink/.. release
108 cp -v $dsp_lpm/lpm_omap3530.ko ${kmoddir}drivers/dsp/
109 fi
110
111
112 # media
113 media_build=`pwd`/../media_build
114 make -C $media_build ARCH=arm DIR=$ksrc release
115 make -C $media_build ARCH=arm DIR=$ksrc prepare
116 make -C $media_build ARCH=arm DIR=$ksrc -j3
117 make -C $media_build ARCH=arm DIR=$ksrc DESTDIR=${target_abs} install
118
119
120 cd ${target_abs}
121 rm -f /tmp/oe_rootfs_extra.tar.bz2
122 tar cjf /tmp/oe_rootfs_extra.tar.bz2 *
123 echo TODO scp /tmp/oe_rootfs_extra.tar.bz2 pnd13:/tmp/