diff options
Diffstat (limited to 'meta/classes/kernel.bbclass')
| -rw-r--r-- | meta/classes/kernel.bbclass | 91 |
1 files changed, 3 insertions, 88 deletions
diff --git a/meta/classes/kernel.bbclass b/meta/classes/kernel.bbclass index 70ed95bbe0..bca34f4698 100644 --- a/meta/classes/kernel.bbclass +++ b/meta/classes/kernel.bbclass | |||
| @@ -3,6 +3,8 @@ inherit linux-kernel-base kernel-module-split | |||
| 3 | PROVIDES += "virtual/kernel" | 3 | PROVIDES += "virtual/kernel" |
| 4 | DEPENDS += "virtual/${TARGET_PREFIX}binutils virtual/${TARGET_PREFIX}gcc kmod-native depmodwrapper-cross bc-native" | 4 | DEPENDS += "virtual/${TARGET_PREFIX}binutils virtual/${TARGET_PREFIX}gcc kmod-native depmodwrapper-cross bc-native" |
| 5 | 5 | ||
| 6 | S = "${STAGING_DIR_TARGET}/${KERNEL_SRC_PATH}" | ||
| 7 | |||
| 6 | # we include gcc above, we dont need virtual/libc | 8 | # we include gcc above, we dont need virtual/libc |
| 7 | INHIBIT_DEFAULT_DEPS = "1" | 9 | INHIBIT_DEFAULT_DEPS = "1" |
| 8 | 10 | ||
| @@ -55,7 +57,7 @@ KERNEL_IMAGEDEST = "boot" | |||
| 55 | # | 57 | # |
| 56 | export CMDLINE_CONSOLE = "console=${@d.getVar("KERNEL_CONSOLE",1) or "ttyS0"}" | 58 | export CMDLINE_CONSOLE = "console=${@d.getVar("KERNEL_CONSOLE",1) or "ttyS0"}" |
| 57 | 59 | ||
| 58 | KERNEL_VERSION = "${@get_kernelversion('${B}')}" | 60 | KERNEL_VERSION = "${@get_kernelversion_headers('${B}')}" |
| 59 | 61 | ||
| 60 | KERNEL_LOCALVERSION ?= "" | 62 | KERNEL_LOCALVERSION ?= "" |
| 61 | 63 | ||
| @@ -221,93 +223,6 @@ kernel_do_install() { | |||
| 221 | # | 223 | # |
| 222 | 224 | ||
| 223 | echo "${KERNEL_VERSION}" > $kerneldir/kernel-abiversion | 225 | echo "${KERNEL_VERSION}" > $kerneldir/kernel-abiversion |
| 224 | |||
| 225 | # | ||
| 226 | # Store kernel image name to allow use during image generation | ||
| 227 | # | ||
| 228 | |||
| 229 | echo "${KERNEL_IMAGE_BASE_NAME}" >$kerneldir/kernel-image-name | ||
| 230 | |||
| 231 | # | ||
| 232 | # Copy the entire source tree. In case an external build directory is | ||
| 233 | # used, copy the build directory over first, then copy over the source | ||
| 234 | # dir. This ensures the original Makefiles are used and not the | ||
| 235 | # redirecting Makefiles in the build directory. | ||
| 236 | # | ||
| 237 | find . -depth -not -name "*.cmd" -not -name "*.o" -not -name "*.so.dbg" -not -name "*.so" -not -path "./Documentation*" -not -path "./source*" -not -path "./.*" -print0 | cpio --null -pdlu $kerneldir | ||
| 238 | cp .config $kerneldir | ||
| 239 | if [ "${S}" != "${B}" ]; then | ||
| 240 | pwd="$PWD" | ||
| 241 | cd "${S}" | ||
| 242 | find . -depth -not -path "./Documentation*" -not -path "./.*" -print0 | cpio --null -pdlu $kerneldir | ||
| 243 | cd "$pwd" | ||
| 244 | fi | ||
| 245 | |||
| 246 | # Test to ensure that the output file and image type are not actually | ||
| 247 | # the same file. If hardlinking is used, they will be the same, and there's | ||
| 248 | # no need to install. | ||
| 249 | ! [ ${KERNEL_OUTPUT} -ef $kerneldir/${KERNEL_IMAGETYPE} ] && install -m 0644 ${KERNEL_OUTPUT} $kerneldir/${KERNEL_IMAGETYPE} | ||
| 250 | install -m 0644 System.map $kerneldir/System.map-${KERNEL_VERSION} | ||
| 251 | |||
| 252 | # Dummy Makefile so the clean below works | ||
| 253 | mkdir $kerneldir/Documentation | ||
| 254 | touch $kerneldir/Documentation/Makefile | ||
| 255 | |||
| 256 | # | ||
| 257 | # Clean and remove files not needed for building modules. | ||
| 258 | # Some distributions go through a lot more trouble to strip out | ||
| 259 | # unecessary headers, for now, we just prune the obvious bits. | ||
| 260 | # | ||
| 261 | # We don't want to leave host-arch binaries in /sysroots, so | ||
| 262 | # we clean the scripts dir while leaving the generated config | ||
| 263 | # and include files. | ||
| 264 | # | ||
| 265 | oe_runmake -C $kerneldir CC="${KERNEL_CC}" LD="${KERNEL_LD}" clean _mrproper_scripts | ||
| 266 | |||
| 267 | # hide directories that shouldn't have their .c, s and S files deleted | ||
| 268 | for d in tools scripts lib; do | ||
| 269 | mv $kerneldir/$d $kerneldir/.$d | ||
| 270 | done | ||
| 271 | |||
| 272 | # delete .c, .s and .S files, unless we hid a directory as .<dir>. This technique is | ||
| 273 | # much faster than find -prune and -exec | ||
| 274 | find $kerneldir -not -path '*/\.*' -type f -name "*.[csS]" -delete | ||
| 275 | |||
| 276 | # put the hidden dirs back | ||
| 277 | for d in tools scripts lib; do | ||
| 278 | mv $kerneldir/.$d $kerneldir/$d | ||
| 279 | done | ||
| 280 | |||
| 281 | # As of Linux kernel version 3.0.1, the clean target removes | ||
| 282 | # arch/powerpc/lib/crtsavres.o which is present in | ||
| 283 | # KBUILD_LDFLAGS_MODULE, making it required to build external modules. | ||
| 284 | if [ ${ARCH} = "powerpc" ]; then | ||
| 285 | cp -l arch/powerpc/lib/crtsavres.o $kerneldir/arch/powerpc/lib/crtsavres.o | ||
| 286 | fi | ||
| 287 | |||
| 288 | # Necessary for building modules like compat-wireless. | ||
| 289 | if [ -f include/generated/bounds.h ]; then | ||
| 290 | cp -l include/generated/bounds.h $kerneldir/include/generated/bounds.h | ||
| 291 | fi | ||
| 292 | if [ -d arch/${ARCH}/include/generated ]; then | ||
| 293 | mkdir -p $kerneldir/arch/${ARCH}/include/generated/ | ||
| 294 | cp -flR arch/${ARCH}/include/generated/* $kerneldir/arch/${ARCH}/include/generated/ | ||
| 295 | fi | ||
| 296 | |||
| 297 | # Remove the following binaries which cause strip or arch QA errors | ||
| 298 | # during do_package for cross-compiled platforms | ||
| 299 | bin_files="arch/powerpc/boot/addnote arch/powerpc/boot/hack-coff \ | ||
| 300 | arch/powerpc/boot/mktree scripts/kconfig/zconf.tab.o \ | ||
| 301 | scripts/kconfig/conf.o scripts/kconfig/kxgettext.o" | ||
| 302 | for entry in $bin_files; do | ||
| 303 | rm -f $kerneldir/$entry | ||
| 304 | done | ||
| 305 | |||
| 306 | # kernels <2.6.30 don't have $kerneldir/tools directory so we check if it exists before calling sed | ||
| 307 | if [ -f $kerneldir/tools/perf/Makefile ]; then | ||
| 308 | # Fix SLANG_INC for slang.h | ||
| 309 | sed -i 's#-I/usr/include/slang#-I=/usr/include/slang#g' $kerneldir/tools/perf/Makefile | ||
| 310 | fi | ||
| 311 | } | 226 | } |
| 312 | do_install[prefuncs] += "package_get_auto_pr" | 227 | do_install[prefuncs] += "package_get_auto_pr" |
| 313 | 228 | ||
