summaryrefslogtreecommitdiff
path: root/meta-phosphor/classes/obmc-phosphor-kernel-version.bbclass
blob: e0d7ec28125ae1249e88d49b8191f2d4b131229e (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
do_kernel_configme:append() {
    # Remove previous CONFIG_LOCALVERSION
    sed -i '/CONFIG_LOCALVERSION/d' ${B}/.config

    # Latest version after yocto patched (if any)
    latestVersion="-$(git rev-parse --verify HEAD)"
    shortLatestVersion="$(echo ${latestVersion} | cut -c1-8)"

    shortLinuxVersionExt="$(echo ${LINUX_VERSION_EXTENSION} | cut -c1-8)"

    if [ "${latestVersion}" != "${LINUX_VERSION_EXTENSION}" ]; then
        dirtyString="-patch"
        echo "CONFIG_LOCALVERSION="\"${shortLinuxVersionExt}${dirtyString}${shortLatestVersion}\" >> ${B}/.config
    else
        echo "CONFIG_LOCALVERSION="\"${shortLinuxVersionExt}\" >> ${B}/.config
    fi
    echo "CONFIG_LOCALVERSION_AUTO=no" >> ${B}/.config
}