diff options
| -rw-r--r-- | meta/classes-recipe/kernel-arch.bbclass | 8 | ||||
| -rw-r--r-- | meta/classes-recipe/kernel.bbclass | 14 | ||||
| -rw-r--r-- | meta/classes-recipe/kernelsrc.bbclass | 1 | ||||
| -rw-r--r-- | meta/classes-recipe/linux-kernel-base.bbclass | 11 | ||||
| -rw-r--r-- | meta/classes-recipe/module-base.bbclass | 1 | ||||
| -rw-r--r-- | meta/recipes-kernel/make-mod-scripts/make-mod-scripts_1.0.bb | 3 |
6 files changed, 30 insertions, 8 deletions
diff --git a/meta/classes-recipe/kernel-arch.bbclass b/meta/classes-recipe/kernel-arch.bbclass index df4884b6c4..b0db99faa3 100644 --- a/meta/classes-recipe/kernel-arch.bbclass +++ b/meta/classes-recipe/kernel-arch.bbclass | |||
| @@ -79,11 +79,3 @@ KERNEL_AR = "${CCACHE}${HOST_PREFIX}ar ${HOST_AR_KERNEL_ARCH}" | |||
| 79 | KERNEL_OBJCOPY = "${CCACHE}${HOST_PREFIX}objcopy ${HOST_OBJCOPY_KERNEL_ARCH}" | 79 | KERNEL_OBJCOPY = "${CCACHE}${HOST_PREFIX}objcopy ${HOST_OBJCOPY_KERNEL_ARCH}" |
| 80 | KERNEL_STRIP = "${CCACHE}${HOST_PREFIX}strip ${HOST_STRIP_KERNEL_ARCH}" | 80 | KERNEL_STRIP = "${CCACHE}${HOST_PREFIX}strip ${HOST_STRIP_KERNEL_ARCH}" |
| 81 | TOOLCHAIN ?= "gcc" | 81 | TOOLCHAIN ?= "gcc" |
| 82 | |||
| 83 | # 6.3+ requires the variable LOCALVERSION to be set to not get a "+" in | ||
| 84 | # the local version. Having it empty means nothing will be added, and any | ||
| 85 | # value will be appended to the local kernel version. This replaces the | ||
| 86 | # use of .scmversion file for setting a localversion without using | ||
| 87 | # the CONFIG_LOCALVERSION option. | ||
| 88 | KERNEL_LOCALVERSION ??= "" | ||
| 89 | export LOCALVERSION ?= "${KERNEL_LOCALVERSION}" | ||
diff --git a/meta/classes-recipe/kernel.bbclass b/meta/classes-recipe/kernel.bbclass index 2e9563186e..247ef4a48a 100644 --- a/meta/classes-recipe/kernel.bbclass +++ b/meta/classes-recipe/kernel.bbclass | |||
| @@ -551,6 +551,7 @@ do_shared_workdir () { | |||
| 551 | # | 551 | # |
| 552 | 552 | ||
| 553 | echo "${KERNEL_VERSION}" > $kerneldir/${KERNEL_PACKAGE_NAME}-abiversion | 553 | echo "${KERNEL_VERSION}" > $kerneldir/${KERNEL_PACKAGE_NAME}-abiversion |
| 554 | echo "${KERNEL_LOCALVERSION}" > $kerneldir/${KERNEL_PACKAGE_NAME}-localversion | ||
| 554 | 555 | ||
| 555 | # Copy files required for module builds | 556 | # Copy files required for module builds |
| 556 | cp System.map $kerneldir/System.map-${KERNEL_VERSION} | 557 | cp System.map $kerneldir/System.map-${KERNEL_VERSION} |
| @@ -640,6 +641,19 @@ python check_oldest_kernel() { | |||
| 640 | check_oldest_kernel[vardepsexclude] += "OLDEST_KERNEL KERNEL_VERSION" | 641 | check_oldest_kernel[vardepsexclude] += "OLDEST_KERNEL KERNEL_VERSION" |
| 641 | do_configure[prefuncs] += "check_oldest_kernel" | 642 | do_configure[prefuncs] += "check_oldest_kernel" |
| 642 | 643 | ||
| 644 | KERNEL_LOCALVERSION ??= "" | ||
| 645 | |||
| 646 | # 6.3+ requires the variable LOCALVERSION to be set to not get a "+" in | ||
| 647 | # the local version. Having it empty means nothing will be added, and any | ||
| 648 | # value will be appended to the local kernel version. This replaces the | ||
| 649 | # use of .scmversion file for setting a localversion without using | ||
| 650 | # the CONFIG_LOCALVERSION option. | ||
| 651 | # | ||
| 652 | # Note: This class saves the value of localversion to a file | ||
| 653 | # so other recipes like make-mod-scripts can restore it via the | ||
| 654 | # helper function get_kernellocalversion_file | ||
| 655 | export LOCALVERSION="${KERNEL_LOCALVERSION}" | ||
| 656 | |||
| 643 | kernel_do_configure() { | 657 | kernel_do_configure() { |
| 644 | # fixes extra + in /lib/modules/2.6.37+ | 658 | # fixes extra + in /lib/modules/2.6.37+ |
| 645 | # $ scripts/setlocalversion . => + | 659 | # $ scripts/setlocalversion . => + |
diff --git a/meta/classes-recipe/kernelsrc.bbclass b/meta/classes-recipe/kernelsrc.bbclass index a32882a5d2..ecb02dc9ed 100644 --- a/meta/classes-recipe/kernelsrc.bbclass +++ b/meta/classes-recipe/kernelsrc.bbclass | |||
| @@ -11,6 +11,7 @@ do_patch[depends] += "virtual/kernel:do_shared_workdir" | |||
| 11 | do_patch[noexec] = "1" | 11 | do_patch[noexec] = "1" |
| 12 | do_package[depends] += "virtual/kernel:do_populate_sysroot" | 12 | do_package[depends] += "virtual/kernel:do_populate_sysroot" |
| 13 | KERNEL_VERSION = "${@get_kernelversion_file("${STAGING_KERNEL_BUILDDIR}")}" | 13 | KERNEL_VERSION = "${@get_kernelversion_file("${STAGING_KERNEL_BUILDDIR}")}" |
| 14 | LOCAL_VERSION = "${@get_kernellocalversion_file("${STAGING_KERNEL_BUILDDIR}")}" | ||
| 14 | 15 | ||
| 15 | inherit linux-kernel-base | 16 | inherit linux-kernel-base |
| 16 | 17 | ||
diff --git a/meta/classes-recipe/linux-kernel-base.bbclass b/meta/classes-recipe/linux-kernel-base.bbclass index 65cc48f304..e2187a73f0 100644 --- a/meta/classes-recipe/linux-kernel-base.bbclass +++ b/meta/classes-recipe/linux-kernel-base.bbclass | |||
| @@ -39,6 +39,17 @@ def get_kernelversion_file(p): | |||
| 39 | except IOError: | 39 | except IOError: |
| 40 | return None | 40 | return None |
| 41 | 41 | ||
| 42 | def get_kernellocalversion_file(p): | ||
| 43 | fn = p + '/kernel-localversion' | ||
| 44 | |||
| 45 | try: | ||
| 46 | with open(fn, 'r') as f: | ||
| 47 | return f.readlines()[0].strip() | ||
| 48 | except IOError: | ||
| 49 | return "" | ||
| 50 | |||
| 51 | return "" | ||
| 52 | |||
| 42 | def linux_module_packages(s, d): | 53 | def linux_module_packages(s, d): |
| 43 | suffix = "" | 54 | suffix = "" |
| 44 | return " ".join(map(lambda s: "kernel-module-%s%s" % (s.lower().replace('_', '-').replace('@', '+'), suffix), s.split())) | 55 | return " ".join(map(lambda s: "kernel-module-%s%s" % (s.lower().replace('_', '-').replace('@', '+'), suffix), s.split())) |
diff --git a/meta/classes-recipe/module-base.bbclass b/meta/classes-recipe/module-base.bbclass index 094b563b1a..2a225881ba 100644 --- a/meta/classes-recipe/module-base.bbclass +++ b/meta/classes-recipe/module-base.bbclass | |||
| @@ -20,6 +20,7 @@ export CROSS_COMPILE = "${TARGET_PREFIX}" | |||
| 20 | export KBUILD_OUTPUT = "${STAGING_KERNEL_BUILDDIR}" | 20 | export KBUILD_OUTPUT = "${STAGING_KERNEL_BUILDDIR}" |
| 21 | 21 | ||
| 22 | export KERNEL_VERSION = "${@oe.utils.read_file('${STAGING_KERNEL_BUILDDIR}/kernel-abiversion')}" | 22 | export KERNEL_VERSION = "${@oe.utils.read_file('${STAGING_KERNEL_BUILDDIR}/kernel-abiversion')}" |
| 23 | export LOCALVERSION = "${@oe.utils.read_file('${STAGING_KERNEL_BUILDDIR}/kernel-localversion')}" | ||
| 23 | KERNEL_OBJECT_SUFFIX = ".ko" | 24 | KERNEL_OBJECT_SUFFIX = ".ko" |
| 24 | 25 | ||
| 25 | # kernel modules are generally machine specific | 26 | # kernel modules are generally machine specific |
diff --git a/meta/recipes-kernel/make-mod-scripts/make-mod-scripts_1.0.bb b/meta/recipes-kernel/make-mod-scripts/make-mod-scripts_1.0.bb index e3b258753f..a91680d497 100644 --- a/meta/recipes-kernel/make-mod-scripts/make-mod-scripts_1.0.bb +++ b/meta/recipes-kernel/make-mod-scripts/make-mod-scripts_1.0.bb | |||
| @@ -21,6 +21,9 @@ DEPENDS += "gmp-native" | |||
| 21 | EXTRA_OEMAKE = " HOSTCC="${BUILD_CC} ${BUILD_CFLAGS} ${BUILD_LDFLAGS}" HOSTCPP="${BUILD_CPP}"" | 21 | EXTRA_OEMAKE = " HOSTCC="${BUILD_CC} ${BUILD_CFLAGS} ${BUILD_LDFLAGS}" HOSTCPP="${BUILD_CPP}"" |
| 22 | EXTRA_OEMAKE += " HOSTCXX="${BUILD_CXX} ${BUILD_CXXFLAGS} ${BUILD_LDFLAGS}" CROSS_COMPILE=${TARGET_PREFIX}" | 22 | EXTRA_OEMAKE += " HOSTCXX="${BUILD_CXX} ${BUILD_CXXFLAGS} ${BUILD_LDFLAGS}" CROSS_COMPILE=${TARGET_PREFIX}" |
| 23 | 23 | ||
| 24 | KERNEL_LOCALVERSION = "${@get_kernellocalversion_file("${STAGING_KERNEL_BUILDDIR}")}" | ||
| 25 | export LOCALVERSION="${KERNEL_LOCALVERSION}" | ||
| 26 | |||
| 24 | # Build some host tools under work-shared. CC, LD, and AR are probably | 27 | # Build some host tools under work-shared. CC, LD, and AR are probably |
| 25 | # not used, but this is the historical way of invoking "make scripts". | 28 | # not used, but this is the historical way of invoking "make scripts". |
| 26 | # | 29 | # |
