diff options
Diffstat (limited to 'meta')
| -rw-r--r-- | meta/classes/kernel-arch.bbclass | 8 | ||||
| -rw-r--r-- | meta/classes/kernel.bbclass | 14 | ||||
| -rw-r--r-- | meta/classes/kernelsrc.bbclass | 1 | ||||
| -rw-r--r-- | meta/classes/linux-kernel-base.bbclass | 11 | ||||
| -rw-r--r-- | meta/classes/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/kernel-arch.bbclass b/meta/classes/kernel-arch.bbclass index 0a79dea0af..62c8211621 100644 --- a/meta/classes/kernel-arch.bbclass +++ b/meta/classes/kernel-arch.bbclass | |||
| @@ -65,11 +65,3 @@ KERNEL_CC = "${CCACHE}${HOST_PREFIX}gcc ${HOST_CC_KERNEL_ARCH} -fuse-ld=bfd ${DE | |||
| 65 | KERNEL_LD = "${CCACHE}${HOST_PREFIX}ld.bfd ${HOST_LD_KERNEL_ARCH}" | 65 | KERNEL_LD = "${CCACHE}${HOST_PREFIX}ld.bfd ${HOST_LD_KERNEL_ARCH}" |
| 66 | KERNEL_AR = "${CCACHE}${HOST_PREFIX}ar ${HOST_AR_KERNEL_ARCH}" | 66 | KERNEL_AR = "${CCACHE}${HOST_PREFIX}ar ${HOST_AR_KERNEL_ARCH}" |
| 67 | TOOLCHAIN ?= "gcc" | 67 | TOOLCHAIN ?= "gcc" |
| 68 | |||
| 69 | # 6.3+ requires the variable LOCALVERSION to be set to not get a "+" in | ||
| 70 | # the local version. Having it empty means nothing will be added, and any | ||
| 71 | # value will be appended to the local kernel version. This replaces the | ||
| 72 | # use of .scmversion file for setting a localversion without using | ||
| 73 | # the CONFIG_LOCALVERSION option. | ||
| 74 | KERNEL_LOCALVERSION ??= "" | ||
| 75 | export LOCALVERSION ?= "${KERNEL_LOCALVERSION}" | ||
diff --git a/meta/classes/kernel.bbclass b/meta/classes/kernel.bbclass index 940f1a3cf4..96e41b5192 100644 --- a/meta/classes/kernel.bbclass +++ b/meta/classes/kernel.bbclass | |||
| @@ -541,6 +541,7 @@ do_shared_workdir () { | |||
| 541 | # | 541 | # |
| 542 | 542 | ||
| 543 | echo "${KERNEL_VERSION}" > $kerneldir/${KERNEL_PACKAGE_NAME}-abiversion | 543 | echo "${KERNEL_VERSION}" > $kerneldir/${KERNEL_PACKAGE_NAME}-abiversion |
| 544 | echo "${KERNEL_LOCALVERSION}" > $kerneldir/${KERNEL_PACKAGE_NAME}-localversion | ||
| 544 | 545 | ||
| 545 | # Copy files required for module builds | 546 | # Copy files required for module builds |
| 546 | cp System.map $kerneldir/System.map-${KERNEL_VERSION} | 547 | cp System.map $kerneldir/System.map-${KERNEL_VERSION} |
| @@ -630,6 +631,19 @@ python check_oldest_kernel() { | |||
| 630 | check_oldest_kernel[vardepsexclude] += "OLDEST_KERNEL KERNEL_VERSION" | 631 | check_oldest_kernel[vardepsexclude] += "OLDEST_KERNEL KERNEL_VERSION" |
| 631 | do_configure[prefuncs] += "check_oldest_kernel" | 632 | do_configure[prefuncs] += "check_oldest_kernel" |
| 632 | 633 | ||
| 634 | KERNEL_LOCALVERSION ??= "" | ||
| 635 | |||
| 636 | # 6.3+ requires the variable LOCALVERSION to be set to not get a "+" in | ||
| 637 | # the local version. Having it empty means nothing will be added, and any | ||
| 638 | # value will be appended to the local kernel version. This replaces the | ||
| 639 | # use of .scmversion file for setting a localversion without using | ||
| 640 | # the CONFIG_LOCALVERSION option. | ||
| 641 | # | ||
| 642 | # Note: This class saves the value of localversion to a file | ||
| 643 | # so other recipes like make-mod-scripts can restore it via the | ||
| 644 | # helper function get_kernellocalversion_file | ||
| 645 | export LOCALVERSION="${KERNEL_LOCALVERSION}" | ||
| 646 | |||
| 633 | kernel_do_configure() { | 647 | kernel_do_configure() { |
| 634 | # fixes extra + in /lib/modules/2.6.37+ | 648 | # fixes extra + in /lib/modules/2.6.37+ |
| 635 | # $ scripts/setlocalversion . => + | 649 | # $ scripts/setlocalversion . => + |
diff --git a/meta/classes/kernelsrc.bbclass b/meta/classes/kernelsrc.bbclass index a951ba3325..a79bf18b09 100644 --- a/meta/classes/kernelsrc.bbclass +++ b/meta/classes/kernelsrc.bbclass | |||
| @@ -5,6 +5,7 @@ do_patch[depends] += "virtual/kernel:do_shared_workdir" | |||
| 5 | do_patch[noexec] = "1" | 5 | do_patch[noexec] = "1" |
| 6 | do_package[depends] += "virtual/kernel:do_populate_sysroot" | 6 | do_package[depends] += "virtual/kernel:do_populate_sysroot" |
| 7 | KERNEL_VERSION = "${@get_kernelversion_file("${STAGING_KERNEL_BUILDDIR}")}" | 7 | KERNEL_VERSION = "${@get_kernelversion_file("${STAGING_KERNEL_BUILDDIR}")}" |
| 8 | LOCAL_VERSION = "${@get_kernellocalversion_file("${STAGING_KERNEL_BUILDDIR}")}" | ||
| 8 | 9 | ||
| 9 | inherit linux-kernel-base | 10 | inherit linux-kernel-base |
| 10 | 11 | ||
diff --git a/meta/classes/linux-kernel-base.bbclass b/meta/classes/linux-kernel-base.bbclass index 73a6fe36d9..0e2a4a4abe 100644 --- a/meta/classes/linux-kernel-base.bbclass +++ b/meta/classes/linux-kernel-base.bbclass | |||
| @@ -33,6 +33,17 @@ def get_kernelversion_file(p): | |||
| 33 | except IOError: | 33 | except IOError: |
| 34 | return None | 34 | return None |
| 35 | 35 | ||
| 36 | def get_kernellocalversion_file(p): | ||
| 37 | fn = p + '/kernel-localversion' | ||
| 38 | |||
| 39 | try: | ||
| 40 | with open(fn, 'r') as f: | ||
| 41 | return f.readlines()[0].strip() | ||
| 42 | except IOError: | ||
| 43 | return "" | ||
| 44 | |||
| 45 | return "" | ||
| 46 | |||
| 36 | def linux_module_packages(s, d): | 47 | def linux_module_packages(s, d): |
| 37 | suffix = "" | 48 | suffix = "" |
| 38 | return " ".join(map(lambda s: "kernel-module-%s%s" % (s.lower().replace('_', '-').replace('@', '+'), suffix), s.split())) | 49 | return " ".join(map(lambda s: "kernel-module-%s%s" % (s.lower().replace('_', '-').replace('@', '+'), suffix), s.split())) |
diff --git a/meta/classes/module-base.bbclass b/meta/classes/module-base.bbclass index 27bd69ff33..5b2fde8144 100644 --- a/meta/classes/module-base.bbclass +++ b/meta/classes/module-base.bbclass | |||
| @@ -14,6 +14,7 @@ export CROSS_COMPILE = "${TARGET_PREFIX}" | |||
| 14 | export KBUILD_OUTPUT = "${STAGING_KERNEL_BUILDDIR}" | 14 | export KBUILD_OUTPUT = "${STAGING_KERNEL_BUILDDIR}" |
| 15 | 15 | ||
| 16 | export KERNEL_VERSION = "${@oe.utils.read_file('${STAGING_KERNEL_BUILDDIR}/kernel-abiversion')}" | 16 | export KERNEL_VERSION = "${@oe.utils.read_file('${STAGING_KERNEL_BUILDDIR}/kernel-abiversion')}" |
| 17 | export LOCALVERSION = "${@oe.utils.read_file('${STAGING_KERNEL_BUILDDIR}/kernel-localversion')}" | ||
| 17 | KERNEL_OBJECT_SUFFIX = ".ko" | 18 | KERNEL_OBJECT_SUFFIX = ".ko" |
| 18 | 19 | ||
| 19 | # kernel modules are generally machine specific | 20 | # 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 f6f47cfff5..8727d003f9 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 | # |
