summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorKoen Kooi <koen@dominion.thruhere.net>2011-03-21 19:35:25 +0100
committerKoen Kooi <koen@dominion.thruhere.net>2011-03-21 19:35:25 +0100
commit42fabd7d8c5cafe7045c853073d40d7545c324b9 (patch)
treeb4d21a7bcdf532acfe00b8c49fcf7923f7ac3fcb
parent469531f353696e6235b56dd4dcafe77ab9c1cae3 (diff)
downloadmeta-openembedded-42fabd7d8c5cafe7045c853073d40d7545c324b9.tar.gz
kernel bbclass: sync with OE-core for do_install changes
Signed-off-by: Koen Kooi <koen@dominion.thruhere.net>
-rw-r--r--meta-oe/classes/kernel.bbclass98
1 files changed, 35 insertions, 63 deletions
diff --git a/meta-oe/classes/kernel.bbclass b/meta-oe/classes/kernel.bbclass
index 13670f6674..f8223be3ae 100644
--- a/meta-oe/classes/kernel.bbclass
+++ b/meta-oe/classes/kernel.bbclass
@@ -127,85 +127,57 @@ kernel_do_install() {
127 install -d ${D}/etc/modprobe.d 127 install -d ${D}/etc/modprobe.d
128 fi 128 fi
129 129
130 130 #
131 # Support for external module building - create a minimal copy of the
132 # kernel source tree.
133 #
134 kerneldir=${STAGING_KERNEL_DIR}
135 install -d $kerneldir
131 136
132 # 137 #
133 # Support for external module building - create a minimal copy of the kernel source tree 138 # Copy the entire source tree. In case an external build directory is
139 # used, copy the build directory over first, then copy over the source
140 # dir. This ensures the original Makefiles are used and not the
141 # redirecting Makefiles in the build directory.
134 # 142 #
135 kerneldir=${D}/kernel/ 143 # work and sysroots can be on different partitions, so we can't rely on
136 144 # hardlinking, unfortunately.
137 # Take care of arch specific headers 145 #
138 # Kernel 2.6.27 moved headers from includes/asm-${ARCH} to arch/${ARCH}/include/asm 146 cp -fR * $kerneldir
139 if [ -e arch/${ARCH}/include/asm/ ] ; then 147 cp .config $kerneldir
140 install -d $kerneldir/arch/${ARCH}/ 148 if [ ! "${S}" == "${B}" ]; then
141 cp -fR arch/${ARCH}/* $kerneldir/arch/${ARCH}/ 149 cp -fR ${S}/* $kerneldir
142
143 # Check for arch/x86 on i386
144 elif [ -d arch/x86/include/asm/ ]; then
145 if [ -e include/asm ] ; then
146 install -d $kerneldir/include/asm/
147 cp -fR arch/x86/include/asm/* $kerneldir/include/asm/
148 fi
149 install -d $kerneldir/arch/x86/include
150 cp -fR arch/x86/* $kerneldir/arch/x86/
151 fi 150 fi
151 echo "LINUX BUILD TREE COPIED TO SYSROOTS"
152 du -hs $kerneldir
152 153
153 # Take care of the rest of the main directories we need 154 #
154 for entry in drivers/crypto drivers/media include scripts; do 155 # Clean and remove files not needed for building modules.
155 if [ -d $entry ]; then 156 # Some distributions go through a lot more trouble to strip out
156 mkdir -p $kerneldir/$entry 157 # unecessary headers, for now, we just prune the obvious bits.
157 cp -fR $entry/* $kerneldir/$entry/ 158 #
158 fi 159 # We don't want to leave host-arch binaries in /sysroots, so
159 done 160 # we clean the scripts dir while leaving the generated config
160 161 # and include files.
161 install -m 0644 .config $kerneldir/config-${KERNEL_VERSION} 162 #
162 ln -sf config-${KERNEL_VERSION} $kerneldir/.config 163 oe_runmake -C $kerneldir CC="${KERNEL_CC}" LD="${KERNEL_LD}" clean
163 ln -sf config-${KERNEL_VERSION} $kerneldir/kernel-config 164 make -C $kerneldir _mrproper_scripts
164 echo "${KERNEL_VERSION}" >$kerneldir/kernel-abiversion 165 find $kerneldir -path $kerneldir/scripts -prune -o -name "*.[csS]" -exec rm '{}' \;
165 echo "${S}" >$kerneldir/kernel-source 166 find $kerneldir/Documentation -name "*.txt" -exec rm '{}' \;
166 echo "${KERNEL_CCSUFFIX}" >$kerneldir/kernel-ccsuffix
167 echo "${KERNEL_LDSUFFIX}" >$kerneldir/kernel-ldsuffix
168 [ -e vmlinux ] && install -m 0644 vmlinux $kerneldir/
169 install -m 0644 ${KERNEL_OUTPUT} $kerneldir/${KERNEL_IMAGETYPE}
170 install -m 0644 System.map $kerneldir/System.map-${KERNEL_VERSION}
171 [ -e Module.symvers ] && install -m 0644 Module.symvers $kerneldir/
172
173 # Copy over the main Makefiles
174 [ -e Rules.make ] && install -m 0644 Rules.make $kerneldir/
175 [ -e Makefile ] && install -m 0644 Makefile $kerneldir/
176 # Check if arch/${ARCH}/Makefile exists and install it
177 if [ -e arch/${ARCH}/Makefile ]; then
178 install -d $kerneldir/arch/${ARCH}
179 install -m 0644 arch/${ARCH}/Makefile* $kerneldir/arch/${ARCH}
180 # Otherwise check arch/x86/Makefile for i386 and x86_64 on kernels >= 2.6.24
181 elif [ -e arch/x86/Makefile ]; then
182 install -d $kerneldir/arch/x86
183 install -m 0644 arch/x86/Makefile* $kerneldir/arch/x86
184 fi
185 167
186 # Remove the following binaries which cause strip errors 168 # Remove the following binaries which cause strip errors
187 # during do_package for cross-compiled platforms 169 # during do_package for cross-compiled platforms
188 bin_files="arch/powerpc/boot/addnote arch/powerpc/boot/hack-coff \ 170 bin_files="arch/powerpc/boot/addnote arch/powerpc/boot/hack-coff \
189 arch/powerpc/boot/mktree scripts/bin2c scripts/conmakehash \ 171 arch/powerpc/boot/mktree"
190 scripts/ihex2fw scripts/kallsyms scripts/pnmtologo scripts/basic/docproc \
191 scripts/basic/fixdep scripts/basic/hash scripts/dtc/dtc \
192 scripts/genksyms/genksyms scripts/kconfig/conf scripts/mod/mk_elfconfig \
193 scripts/mod/modpost scripts/recordmcount"
194 rm -rf $kerneldir/scripts/*.o
195 rm -rf $kerneldir/scripts/basic/*.o
196 rm -rf $kerneldir/scripts/kconfig/*.o
197 rm -rf $kerneldir/scripts/mod/*.o
198 rm -rf $kerneldir/scripts/dtc/*.o
199 for entry in $bin_files; do 172 for entry in $bin_files; do
200 rm -f $kerneldir/$entry 173 rm -f $kerneldir/$entry
201 done 174 done
202} 175}
203 176
204sysroot_stage_all_append() { 177sysroot_stage_all_append() {
205 sysroot_stage_dir ${D}/kernel ${SYSROOT_DESTDIR}/kernel 178 sysroot_stage_dir ${D}/kernel ${SYSROOT_DESTDIR}/kernel
206} 179}
207 180
208
209kernel_do_configure() { 181kernel_do_configure() {
210 # Copy defconfig to .config if .config does not exist. This allows 182 # Copy defconfig to .config if .config does not exist. This allows
211 # recipes to manage the .config themselves in do_configure_prepend(). 183 # recipes to manage the .config themselves in do_configure_prepend().