Issue
I am working on a Yocto Linux project and all is working fine, but I have one annoying problem. I have cloned a copy of Linux Kernel in my machine and I have pointed the attached bb file to it (branch and the latest revision). It works fine but like this every time I change something I have to commit my changes first. Is there a way to configure the bb file so it only points to the repository without bothering about the branch and revision? enter image description here
SUMMARY = "Mainline kernel package"
LICENSE = "GPLv2"
LIC_FILES_CHKSUM = "file://COPYING;md5=bbea815ee2795b2f4230826c0c6b8814"
inherit kernel
DEPENDS += "lzop"
SRC_URI = "git:///home/dand/myFolder/firmware_linux;protocol=file;branch=cc-4.19"
#SRCREV = "a9aa91b7b589d633ed687306be0bd06173ba595b"
SRCREV = "${AUTOREV}"
S = "${WORKDIR}/git"
# The kernel class expects a defconfig in ${WORKDIR}, so tell it which one to use
DEFAULT_KERNEL_DEFCONFIG_arm = "multi_v7_defconfig"
DEFAULT_KERNEL_DEFCONFIG_aarch64 = "defconfig"
DEFAULT_KERNEL_DEFCONFIG_x86 = "i386_defconfig"
DEFAULT_KERNEL_DEFCONFIG_x86_64 = "x86_64_defconfig"
KERNEL_DEFCONFIG ?= "${DEFAULT_KERNEL_DEFCONFIG}"
# enable support for device tree overlays
EXTRA_OEMAKE += "DTC_FLAGS=-@"
# Pick up configured default configurations from the linux source tree
do_configure_prepend() {
if [ -n "${KERNEL_DEFCONFIG}" ]; then
cp ${S}/arch/${ARCH}/configs/${KERNEL_DEFCONFIG} ${B}/.config
fi
}
# Set git commit version from yocto repo
do_configure_append() {
${S}/scripts/config --disable LOCALVERSION_AUTO --set-str LOCALVERSION -${DISTRO_VERSION}
}
# install devicetree blobs where those are configured
RRECOMMENDS_kernel-image += "kernel-devicetree"
I have looked everywhere around the internet.
Solution
You need to use AUTOREV
for SRCREV
, see the following:
https://docs.yoctoproject.org/dev-manual/packages.html#automatically-incrementing-a-package-version-number
In an other question there is a solution for it also: https://stackoverflow.com/a/38372518/19516062
Answered By - Livius Answer Checked By - David Marino (WPSolving Volunteer)