5 if [ "$#" -lt 2 ] ; then
6 echo "Usage: $0 <kernel dir> <arch (arm/i386)> [<cross compile>]"
14 if [ ${arch} = "arm" ] ; then
16 elif [ ${arch} = "i386" ] ; then
19 echo "Unknown arch $arch"
23 buffer_dir=${modules_dir}/buffer
24 driver_dir=${modules_dir}/driver
25 writer_dir=${modules_dir}/writer
26 kprobe_dir=${modules_dir}/kprobe
27 kprobe_arch_dir=${kprobe_dir}/arch
28 ksyms_dir=${modules_dir}/ksyms
29 ks_manager_dir=${modules_dir}/ks_manager
30 uprobe_dir=${modules_dir}/uprobe
31 uprobe_arch_dir=${uprobe_dir}/arch
32 us_manager_dir=${modules_dir}/us_manager
33 ks_features_dir=${modules_dir}/ks_features
34 sampler_dir=${modules_dir}/sampler
35 energy_dir=${modules_dir}/energy
36 parser_dir=${modules_dir}/parser
38 install_dir="/opt/swap/sdk"
40 rm -f ${kprobe_arch_dir}/asm
41 ln -s asm-${link_name} ${kprobe_arch_dir}/asm
42 rm -f ${uprobe_arch_dir}/asm
43 ln -s asm-${link_name} ${uprobe_arch_dir}/asm
45 buffer_module_name=swap_buffer.ko
46 buffer_inc=${modules_inc}
47 make CROSS_COMPILE=${cross_compile} ARCH=${arch} -C ${kernel_dir} M=${buffer_dir} \
48 extra_cflags="-Werror" modules || exit 1
50 driver_module_name=swap_driver.ko
51 make CROSS_COMPILE=${cross_compile} ARCH=${arch} -C ${kernel_dir} M=${driver_dir} \
52 extra_cflags="-Werror -I${modules_dir}" modules || exit 1
54 writer_module_name=swap_writer.ko
55 writer_inc=${modules_inc}
56 make CROSS_COMPILE=${cross_compile} ARCH=${arch} -C ${kernel_dir} M=${writer_dir} \
57 extra_cflags="-Werror -I${modules_dir} -I${kprobe_dir} -I${kprobe_arch_dir} -I${uprobe_arch_dir}" modules || exit 1
59 kprobe_module_name=swap_kprobe.ko
60 make CROSS_COMPILE=${cross_compile} ARCH=${arch} -C ${kernel_dir} M=${kprobe_dir} \
61 extra_cflags="-Werror -I${modules_dir}" modules || exit 1
63 ks_manager_module_name=swap_ks_manager.ko
64 make CROSS_COMPILE=${cross_compile} ARCH=${arch} -C ${kernel_dir} M=${ks_manager_dir} \
65 extra_cflags="-Werror -I${modules_dir}" modules || exit 1
67 uprobe_module_name=swap_uprobe.ko
68 make CROSS_COMPILE=${cross_compile} ARCH=${arch} -C ${kernel_dir} M=${uprobe_dir} \
69 extra_cflags="-Werror -I${modules_dir}" modules || exit 1
71 us_manager_module_name=swap_us_manager.ko
72 make CROSS_COMPILE=${cross_compile} ARCH=${arch} -C ${kernel_dir} M=${us_manager_dir} \
73 extra_cflags="-Werror -I${modules_dir}" modules || exit 1
75 ks_features_module_name=swap_ks_features.ko
76 make CROSS_COMPILE=${cross_compile} ARCH=${arch} -C ${kernel_dir} M=${ks_features_dir} \
77 extra_cflags="-Werror -I${modules_dir}" modules || exit 1
79 sampler_module_name=swap_sampler.ko
80 make CROSS_COMPILE=${cross_compile} ARCH=${arch} -C ${kernel_dir} M=${sampler_dir} \
81 extra_cflags="-Werror -I${modules_dir}" modules || exit 1
83 energy_module_name=swap_energy.ko
84 make CROSS_COMPILE=${cross_compile} ARCH=${arch} -C ${kernel_dir} M=${energy_dir} \
85 extra_cflags="-Werror -I${modules_dir}" modules || exit 1
87 parser_module_name=swap_message_parser.ko
88 make CROSS_COMPILE=${cross_compile} ARCH=${arch} -C ${kernel_dir} M=${parser_dir} \
89 extra_cflags="-Werror -I${modules_dir}" modules || exit 1
92 "${buffer_dir}/${buffer_module_name} \
93 ${driver_dir}/${driver_module_name} \
94 ${writer_dir}/${writer_module_name} \
95 ${kprobe_dir}/${kprobe_module_name} \
96 ${ks_manager_dir}/${ks_manager_module_name} \
97 ${uprobe_dir}/${uprobe_module_name} \
98 ${us_manager_dir}/${us_manager_module_name} \
99 ${ks_features_dir}/${ks_features_module_name} \
100 ${sampler_dir}/${sampler_module_name} \
101 ${energy_dir}/${energy_module_name} \
102 ${parser_dir}/${parser_module_name}"
104 # for m in ${modules} ; do
105 # sdb -e push $m ${install_dir}