diff options
Diffstat (limited to 'external/poky/meta/recipes-kernel/linux/kernel-devsrc.bb')
-rw-r--r-- | external/poky/meta/recipes-kernel/linux/kernel-devsrc.bb | 71 |
1 files changed, 49 insertions, 22 deletions
diff --git a/external/poky/meta/recipes-kernel/linux/kernel-devsrc.bb b/external/poky/meta/recipes-kernel/linux/kernel-devsrc.bb index ec5cf099..5940cc90 100644 --- a/external/poky/meta/recipes-kernel/linux/kernel-devsrc.bb +++ b/external/poky/meta/recipes-kernel/linux/kernel-devsrc.bb @@ -32,7 +32,7 @@ B = "${STAGING_KERNEL_BUILDDIR}" PACKAGE_ARCH = "${MACHINE_ARCH}" -KERNEL_BUILD_ROOT="/lib/modules/" +KERNEL_BUILD_ROOT="${nonarch_base_libdir}/modules/" do_install() { kerneldir=${D}${KERNEL_BUILD_ROOT}${KERNEL_VERSION} @@ -48,7 +48,7 @@ do_install() { mkdir -p ${D}/usr/src ( cd ${D}/usr/src - ln -s ${KERNEL_BUILD_ROOT}${KERNEL_VERSION}/source kernel + lnr ${D}${KERNEL_BUILD_ROOT}${KERNEL_VERSION}/source kernel ) # for on target purposes, we unify build and source @@ -62,16 +62,9 @@ do_install() { cd ${S} cp --parents $(find -type f -name "Makefile*" -o -name "Kconfig*") $kerneldir/build cp --parents $(find -type f -name "Build" -o -name "Build.include") $kerneldir/build - - # Copy localversion file if any to keep correct version magic after - # modules_prepare. - if [ -f *localversion* ]; then - cp *localversion* $kerneldir/build - fi ) # then drop all but the needed Makefiles/Kconfig files - rm -rf $kerneldir/build/Documentation rm -rf $kerneldir/build/scripts rm -rf $kerneldir/build/include @@ -85,7 +78,7 @@ do_install() { cp Module.markers $kerneldir/build fi - cp .config $kerneldir/build + cp -a .config $kerneldir/build # This scripts copy blow up QA, so for now, we require a more # complex 'make scripts' to restore these, versus copying them @@ -135,11 +128,12 @@ do_install() { # extra files, just in case cp -a --parents tools/objtool/* $kerneldir/build/ - cp -a --parents tools/lib/str_error_r.c $kerneldir/build/ - cp -a --parents tools/lib/string.c $kerneldir/build/ + cp -a --parents tools/lib/* $kerneldir/build/ cp -a --parents tools/lib/subcmd/* $kerneldir/build/ cp -a --parents tools/include/* $kerneldir/build/ + + cp -a --parents $(find tools/arch/${ARCH}/ -type f) $kerneldir/build/ fi if [ "${ARCH}" = "arm64" ]; then @@ -148,12 +142,19 @@ do_install() { # arch/arm64/include/asm/opcodes.h references arch/arm cp -a --parents arch/arm/include/asm/opcodes.h $kerneldir/build/ - cp -a --parents arch/arm64/kernel/vdso/gettimeofday.S $kerneldir/build/ + cp -a --parents arch/arm64/kernel/vdso/*gettimeofday.* $kerneldir/build/ cp -a --parents arch/arm64/kernel/vdso/sigreturn.S $kerneldir/build/ cp -a --parents arch/arm64/kernel/vdso/note.S $kerneldir/build/ cp -a --parents arch/arm64/kernel/vdso/gen_vdso_offsets.sh $kerneldir/build/ - cp -a --parents arch/arm64/kernel/module.lds $kerneldir/build/ + cp -a --parents arch/arm64/kernel/module.lds $kerneldir/build/ 2>/dev/null || : + fi + + if [ "${ARCH}" = "powerpc" ]; then + # 5.0 needs these files, but don't error if they aren't present in the source + cp -a --parents arch/${ARCH}/kernel/syscalls/syscall.tbl $kerneldir/build/ 2>/dev/null || : + cp -a --parents arch/${ARCH}/kernel/syscalls/syscalltbl.sh $kerneldir/build/ 2>/dev/null || : + cp -a --parents arch/${ARCH}/kernel/syscalls/syscallhdr.sh $kerneldir/build/ 2>/dev/null || : fi # include the machine specific headers for ARM variants, if available. @@ -163,7 +164,12 @@ do_install() { # include a few files for 'make prepare' cp -a --parents arch/arm/tools/gen-mach-types $kerneldir/build/ cp -a --parents arch/arm/tools/mach-types $kerneldir/build/ - cp -a --parents arch/arm/tools/syscall* $kerneldir/build/ + + # ARM syscall table tools only exist for kernels v4.10 or later + SYSCALL_TOOLS=$(find arch/arm/tools -name "syscall*") + if [ -n "$SYSCALL_TOOLS" ] ; then + cp -a --parents $SYSCALL_TOOLS $kerneldir/build/ + fi cp -a --parents arch/arm/kernel/module.lds $kerneldir/build/ fi @@ -174,23 +180,27 @@ do_install() { cp -a include $kerneldir/build + cp -a --parents lib/vdso/* $kerneldir/build/ 2>/dev/null || : + cp -a --parents tools/include/tools/le_byteshift.h $kerneldir/build/ cp -a --parents tools/include/tools/be_byteshift.h $kerneldir/build/ # required for generate missing syscalls prepare phase - cp -a --parents arch/x86/entry/syscalls/syscall_32.tbl $kerneldir/build + cp -a --parents $(find arch/x86 -type f -name "syscall_32.tbl") $kerneldir/build + cp -a --parents $(find arch/arm -type f -name "*.tbl") $kerneldir/build 2>/dev/null || : if [ "${ARCH}" = "x86" ]; then # files for 'make prepare' to succeed with kernel-devel - cp -a --parents arch/x86/entry/syscalls/syscall_32.tbl $kerneldir/build/ - cp -a --parents arch/x86/entry/syscalls/syscalltbl.sh $kerneldir/build/ - cp -a --parents arch/x86/entry/syscalls/syscallhdr.sh $kerneldir/build/ - cp -a --parents arch/x86/entry/syscalls/syscall_64.tbl $kerneldir/build/ + cp -a --parents $(find arch/x86 -type f -name "syscall_32.tbl") $kerneldir/build/ + cp -a --parents $(find arch/x86 -type f -name "syscalltbl.sh") $kerneldir/build/ + cp -a --parents $(find arch/x86 -type f -name "syscallhdr.sh") $kerneldir/build/ + cp -a --parents $(find arch/x86 -type f -name "syscall_64.tbl") $kerneldir/build/ cp -a --parents arch/x86/tools/relocs_32.c $kerneldir/build/ cp -a --parents arch/x86/tools/relocs_64.c $kerneldir/build/ cp -a --parents arch/x86/tools/relocs.c $kerneldir/build/ cp -a --parents arch/x86/tools/relocs_common.c $kerneldir/build/ cp -a --parents arch/x86/tools/relocs.h $kerneldir/build/ + cp -a --parents arch/x86/tools/gen-insn-attr-x86.awk $kerneldir/build/ 2>/dev/null || : cp -a --parents arch/x86/purgatory/purgatory.c $kerneldir/build/ # 4.18 + have unified the purgatory files, so we ignore any errors if @@ -199,12 +209,17 @@ do_install() { cp -a --parents arch/x86/purgatory/sha256.c $kerneldir/build/ 2>/dev/null || : cp -a --parents arch/x86/purgatory/stack.S $kerneldir/build/ - cp -a --parents arch/x86/purgatory/string.c $kerneldir/build/ + cp -a --parents arch/x86/purgatory/string.c $kerneldir/build/ 2>/dev/null || : cp -a --parents arch/x86/purgatory/setup-x86_64.S $kerneldir/build/ cp -a --parents arch/x86/purgatory/entry64.S $kerneldir/build/ cp -a --parents arch/x86/boot/string.h $kerneldir/build/ cp -a --parents arch/x86/boot/string.c $kerneldir/build/ + cp -a --parents arch/x86/boot/compressed/string.c $kerneldir/build/ 2>/dev/null || : cp -a --parents arch/x86/boot/ctype.h $kerneldir/build/ + + # objtool requires these files + cp -a --parents arch/x86/lib/inat.c $kerneldir/build/ 2>/dev/null || : + cp -a --parents arch/x86/lib/insn.c $kerneldir/build/ 2>/dev/null || : fi if [ "${ARCH}" = "mips" ]; then @@ -215,6 +230,9 @@ do_install() { cp -a --parents kernel/time/timeconst.bc $kerneldir/build cp -a --parents kernel/bounds.c $kerneldir/build cp -a --parents Kbuild $kerneldir/build + cp -a --parents arch/mips/kernel/syscalls/*.sh $kerneldir/build 2>/dev/null || : + cp -a --parents arch/mips/kernel/syscalls/*.tbl $kerneldir/build 2>/dev/null || : + cp -a --parents arch/mips/tools/elf-entry.c $kerneldir/build 2>/dev/null || : fi # required to build scripts/selinux/genheaders/genheaders @@ -231,6 +249,15 @@ do_install() { # Copy .config to include/config/auto.conf so "make prepare" is unnecessary. cp $kerneldir/build/.config $kerneldir/build/include/config/auto.conf + # make the scripts python3 safe. We won't be running these, and if they are + # left as /usr/bin/python rootfs assembly will fail, since we only have python3 + # in the RDEPENDS (and the python3 package does not include /usr/bin/python) + for ss in $(find $kerneldir/build/scripts -type f -name '*'); do + sed -i 's,/usr/bin/python2,/usr/bin/env python3,' "$ss" + sed -i 's,/usr/bin/env python2,/usr/bin/env python3,' "$ss" + sed -i 's,/usr/bin/python,/usr/bin/env python3,' "$ss" + done + chown -R root:root ${D} } @@ -240,7 +267,7 @@ do_install[lockfiles] = "${TMPDIR}/kernel-scripts.lock" FILES_${PN} = "${KERNEL_BUILD_ROOT} ${KERNEL_SRC_PATH}" FILES_${PN}-dbg += "${KERNEL_BUILD_ROOT}*/build/scripts/*/.debug/*" -RDEPENDS_${PN} = "bc python flex bison ${TCLIBC}-utils" +RDEPENDS_${PN} = "bc python3 flex bison ${TCLIBC}-utils" # 4.15+ needs these next two RDEPENDS RDEPENDS_${PN} += "openssl-dev util-linux" # and x86 needs a bit more for 4.15+ |