summaryrefslogtreecommitdiffstats
path: root/meta/classes
diff options
context:
space:
mode:
authorRichard Purdie <rpurdie@linux.intel.com>2010-05-24 11:14:56 +0100
committerRichard Purdie <rpurdie@linux.intel.com>2010-05-24 11:14:56 +0100
commit6bf1f8c76e0d69ed64c5f0bb9e9b24215c32dfbe (patch)
tree9faf2386ad9505a1297af7c392707ebeb6304cf4 /meta/classes
parent78988bb014c671c43e04a2ee95abc663766831e3 (diff)
downloadpoky-6bf1f8c76e0d69ed64c5f0bb9e9b24215c32dfbe.tar.gz
kernel.bbclass: Simplify the current external module code
Signed-off-by: Richard Purdie <rpurdie@linux.intel.com>
Diffstat (limited to 'meta/classes')
-rw-r--r--meta/classes/kernel.bbclass66
1 files changed, 21 insertions, 45 deletions
diff --git a/meta/classes/kernel.bbclass b/meta/classes/kernel.bbclass
index 0de4dfbef0..b8bff3e565 100644
--- a/meta/classes/kernel.bbclass
+++ b/meta/classes/kernel.bbclass
@@ -83,13 +83,19 @@ kernel_do_compile() {
83} 83}
84 84
85kernel_do_install() { 85kernel_do_install() {
86 #
87 # First install the modules
88 #
86 unset CFLAGS CPPFLAGS CXXFLAGS LDFLAGS MACHINE 89 unset CFLAGS CPPFLAGS CXXFLAGS LDFLAGS MACHINE
87 if (grep -q -i -e '^CONFIG_MODULES=y$' .config); then 90 if (grep -q -i -e '^CONFIG_MODULES=y$' .config); then
88 oe_runmake DEPMOD=echo INSTALL_MOD_PATH="${D}" modules_install 91 oe_runmake DEPMOD=echo INSTALL_MOD_PATH="${D}" modules_install
89 else 92 else
90 oenote "no modules to install" 93 oenote "no modules to install"
91 fi 94 fi
92 95
96 #
97 # Install various kernel output (zImage, map file, config, module support files)
98 #
93 install -d ${D}/${KERNEL_IMAGEDEST} 99 install -d ${D}/${KERNEL_IMAGEDEST}
94 install -d ${D}/boot 100 install -d ${D}/boot
95 install -m 0644 ${KERNEL_OUTPUT} ${D}/${KERNEL_IMAGEDEST}/${KERNEL_IMAGETYPE}-${KERNEL_VERSION} 101 install -m 0644 ${KERNEL_OUTPUT} ${D}/${KERNEL_IMAGEDEST}/${KERNEL_IMAGETYPE}-${KERNEL_VERSION}
@@ -101,23 +107,16 @@ kernel_do_install() {
101 if [ "${KERNEL_MAJOR_VERSION}" = "2.6" ]; then 107 if [ "${KERNEL_MAJOR_VERSION}" = "2.6" ]; then
102 install -d ${D}/etc/modprobe.d 108 install -d ${D}/etc/modprobe.d
103 fi 109 fi
104
105 # Check if scripts/genksyms exists and if so, build it
106 if [ -e scripts/genksyms/ ]; then
107 oe_runmake SUBDIRS="scripts/genksyms"
108 fi
109 110
110 kerneldir=${D}/kernel/
111 111
112 if [ -e include/asm ] ; then
113 # This link is generated only in kernel before 2.6.33-rc1, don't stage it for newer kernels
114 ASMDIR=`readlink include/asm`
115 112
116 mkdir -p $kerneldir/include/$ASMDIR 113 #
117 cp -fR include/$ASMDIR/* $kerneldir/include/$ASMDIR/ 114 # Support for external module building - create a minimal copy of the kernel source tree
118 fi 115 #
116 kerneldir=${D}/kernel/
119 117
120 # Kernel 2.6.27 moved headers from includes/asm-${ARCH} to arch/${ARCH}/include/asm 118 # Take care of arch specific headers
119 # Kernel 2.6.27 moved headers from includes/asm-${ARCH} to arch/${ARCH}/include/asm
121 if [ -e arch/${ARCH}/include/asm/ ] ; then 120 if [ -e arch/${ARCH}/include/asm/ ] ; then
122 if [ -e include/asm ] ; then 121 if [ -e include/asm ] ; then
123 cp -fR arch/${ARCH}/include/asm/* $kerneldir/include/asm/ 122 cp -fR arch/${ARCH}/include/asm/* $kerneldir/include/asm/
@@ -134,34 +133,14 @@ kernel_do_install() {
134 cp -fR arch/x86/* $kerneldir/arch/x86/ 133 cp -fR arch/x86/* $kerneldir/arch/x86/
135 fi 134 fi
136 135
137 # ASMDIR is not always set ... 136 # Take care of the rest of the main directories we need
138 if [ -e include/asm ] ; then 137 for entry in drivers/crypto drivers/media include scripts; do
139 rm -f $kerneldir/include/asm
140 if [ -n $ASMDIR ] ; then
141 ln -sf $ASMDIR $kerneldir/include/asm
142 fi
143 fi
144
145 mkdir -p $kerneldir/include/asm-generic
146 cp -fR include/asm-generic/* $kerneldir/include/asm-generic/
147
148 for entry in drivers/crypto drivers/media include/generated include/linux include/net include/pcmcia include/media include/acpi include/sound include/video include/scsi include/trace include/mtd include/rdma include/drm include/xen; do
149 if [ -d $entry ]; then 138 if [ -d $entry ]; then
150 mkdir -p $kerneldir/$entry 139 mkdir -p $kerneldir/$entry
151 cp -fR $entry/* $kerneldir/$entry/ 140 cp -fR $entry/* $kerneldir/$entry/
152 fi 141 fi
153 done 142 done
154 143
155 if [ -f include/Kbuild ]; then
156 cp -fR include/Kbuild $kerneldir/include
157 fi
158
159 if [ -d drivers/sound ]; then
160 # 2.4 alsa needs some headers from this directory
161 mkdir -p $kerneldir/include/drivers/sound
162 cp -fR drivers/sound/*.h $kerneldir/include/drivers/sound/
163 fi
164
165 install -m 0644 .config $kerneldir/config-${KERNEL_VERSION} 144 install -m 0644 .config $kerneldir/config-${KERNEL_VERSION}
166 ln -sf config-${KERNEL_VERSION} $kerneldir/.config 145 ln -sf config-${KERNEL_VERSION} $kerneldir/.config
167 ln -sf config-${KERNEL_VERSION} $kerneldir/kernel-config 146 ln -sf config-${KERNEL_VERSION} $kerneldir/kernel-config
@@ -169,9 +148,14 @@ kernel_do_install() {
169 echo "${S}" >$kerneldir/kernel-source 148 echo "${S}" >$kerneldir/kernel-source
170 echo "${KERNEL_CCSUFFIX}" >$kerneldir/kernel-ccsuffix 149 echo "${KERNEL_CCSUFFIX}" >$kerneldir/kernel-ccsuffix
171 echo "${KERNEL_LDSUFFIX}" >$kerneldir/kernel-ldsuffix 150 echo "${KERNEL_LDSUFFIX}" >$kerneldir/kernel-ldsuffix
151 [ -e vmlinux ] && install -m 0644 vmlinux $kerneldir/
152 install -m 0644 ${KERNEL_OUTPUT} $kerneldir/${KERNEL_IMAGETYPE}
153 install -m 0644 System.map $kerneldir/System.map-${KERNEL_VERSION}
154 [ -e Module.symvers ] && install -m 0644 Module.symvers $kerneldir/
155
156 # Copy over the main Makefiles
172 [ -e Rules.make ] && install -m 0644 Rules.make $kerneldir/ 157 [ -e Rules.make ] && install -m 0644 Rules.make $kerneldir/
173 [ -e Makefile ] && install -m 0644 Makefile $kerneldir/ 158 [ -e Makefile ] && install -m 0644 Makefile $kerneldir/
174
175 # Check if arch/${ARCH}/Makefile exists and install it 159 # Check if arch/${ARCH}/Makefile exists and install it
176 if [ -e arch/${ARCH}/Makefile ]; then 160 if [ -e arch/${ARCH}/Makefile ]; then
177 install -d $kerneldir/arch/${ARCH} 161 install -d $kerneldir/arch/${ARCH}
@@ -181,14 +165,6 @@ kernel_do_install() {
181 install -d $kerneldir/arch/x86 165 install -d $kerneldir/arch/x86
182 install -m 0644 arch/x86/Makefile* $kerneldir/arch/x86 166 install -m 0644 arch/x86/Makefile* $kerneldir/arch/x86
183 fi 167 fi
184 cp -fR include/config* $kerneldir/include/
185 # Install kernel images and system.map to staging
186 [ -e vmlinux ] && install -m 0644 vmlinux $kerneldir/
187 install -m 0644 ${KERNEL_OUTPUT} $kerneldir/${KERNEL_IMAGETYPE}
188 install -m 0644 System.map $kerneldir/System.map-${KERNEL_VERSION}
189 [ -e Module.symvers ] && install -m 0644 Module.symvers $kerneldir/
190
191 cp -fR scripts $kerneldir/
192 168
193 # Remove the following binaries which cause strip errors 169 # Remove the following binaries which cause strip errors
194 # during do_package for cross-compiled platforms 170 # during do_package for cross-compiled platforms