clean-move-defconfigs-stable.patch
[linux-2.6/openmoko-kernel/knife-kernel.git] / build-all-mw
blobd334a7bcbb27efbc2c0a7a7568d00fab9c42785a
1 #!/bin/sh
3 oedir=/u/moko/build/tmp
4 export CROSS_COMPILE=${oedir}/cross/bin/arm-angstrom-linux-gnueabi-
6 L="1 2"
7 [ "${1}" = "1" ] && L="1"
8 [ "${1}" = "2" ] && L="2"
10 M=" \
11 fs/nls/nls_utf8.ko \
12 fs/cifs/cifs.ko \ \
13 lib/crc-ccitt.ko \ \
14 net/ipv4/netfilter/nf_nat.ko \
15 net/ipv4/netfilter/ip_tables.ko \
16 net/ipv4/netfilter/nf_conntrack_ipv4.ko \
17 net/ipv4/netfilter/iptable_nat.ko \
18 net/ipv4/netfilter/iptable_filter.ko \
19 net/ipv4/netfilter/ipt_MASQUERADE.ko \
20 net/netfilter/x_tables.ko \
21 net/netfilter/nf_conntrack.ko \
22 drivers/hid/usbhid/usbhid.ko \
23 drivers/net/ppp_mppe.ko \
24 drivers/net/slhc.ko \
25 drivers/net/ppp_async.ko \
26 drivers/net/ppp_generic.ko \
27 drivers/net/ppp_deflate.ko \
28 drivers/usb/storage/usb-storage.ko \
29 drivers/usb/serial/usbserial.ko \
30 drivers/scsi/scsi_mod.ko \
31 drivers/scsi/sd_mod.ko \
32 drivers/input/misc/uinput.ko \
33 crypto/michael_mic.ko \
34 crypto/ecb.ko \
35 crypto/aes_generic.ko \
36 crypto/arc4.ko \
39 BRANCH=
40 HEAD=
41 FULLHEAD=
42 if [ -d .git ] ; then
43 HEAD=`git show --pretty=oneline | head -n1 | cut -d' ' -f1 | cut -b1-8`
44 FULLHEAD=`git show --pretty=oneline | head -n1 | cut -d' ' -f1`
45 BRANCH=`git branch | grep ^\* | cut -d' ' -f2`
48 for i in ${L} ; do
50 cp defconfig-mw-gta0${i} .config
52 make clean
53 rm -f modules-all-gta0${i}-g${HEAD}_${BRANCH}.tgz
54 rm -f modules-min-gta0${i}-g${HEAD}_${BRANCH}.tgz
55 rm -rf modules-all-gta0${i}-g${HEAD}_${BRANCH}
56 rm -rf modules-min-gta0${i}-g${HEAD}_${BRANCH}
58 ./build-mw
59 mv uImage.bin uImage-gta0${i}-g${HEAD}_${BRANCH}.bin
61 make INSTALL_MOD_PATH=./modules-all-gta0${i}-g${HEAD}_${BRANCH} modules_install
62 (cd modules-all-gta0${i}-g${HEAD}_${BRANCH}; tar czf ../modules-all-gta0${i}-g${HEAD}_${BRANCH}.tgz lib)
64 v=`(cd modules-all-gta0${i}-g${HEAD}_${BRANCH}/lib/modules; ls -d 2.6.*)`
65 for m in ${M} ; do
66 a=./modules-all-gta0${i}-g${HEAD}_${BRANCH}/lib/modules/${v}/kernel/${m}
67 b=./modules-min-gta0${i}-g${HEAD}_${BRANCH}/lib/modules/${v}/kernel/${m}
68 if [ -f "${a}" ] ; then
69 bb=`dirname "${b}"`
70 [ -d "${bb}" ] || mkdir -p "${bb}"
71 cp -a "${a}" "${b}"
72 # ${CROSS_COMPILE}strip -v -g "${b}"
73 ${CROSS_COMPILE}strip -g "${b}"
75 done
76 if [ -d ./modules-min-gta0${i}-g${HEAD}_${BRANCH} ] ; then
77 depmod -b ./modules-min-gta0${i}-g${HEAD}_${BRANCH} -F System.map ${v}
78 (cd modules-min-gta0${i}-g${HEAD}_${BRANCH}; tar czf ../modules-min-gta0${i}-g${HEAD}_${BRANCH}.tgz lib)
81 done