Old version of library is included in image after updating bitbake file - yocto

After updating dotnet-runtime in our Yocto based Linux distribution to version 2.1.12, I saw that the resulting image had increased significantly in size. On closer inspection i found that the image contained both the new 2.1.12 version and the older 2.1.11 version of the dotnet-runtime library. How can I ensure that older version are not included in the image? Do I have to change more that just the SRC_URI and checksum?
Here is the content of dotnet-runtime.bb
DESCRIPTION = ".NET Core Runtime, SDK & CLI tools"
HOMEPAGE = "https://www.microsoft.com/net/core"
LICENSE = "MIT"
LIC_FILES_CHKSUM = "file://LICENSE.txt;md5=42b611e7375c06a28601953626ab16cb"
COMPATIBLE_HOST ?= "x86_64.*-linux"
RDEPENDS_${PN} = "glibc zlib libunwind icu libcurl openssl krb5 libgssglue"
INSANE_SKIP_${PN} += "already-stripped staticdev file-rdeps libdir"
INHIBIT_PACKAGE_STRIP = "1"
INHIBIT_SYSROOT_STRIP = "1"
INHIBIT_PACKAGE_DEBUG_SPLIT = "1"
SRC_URI = "https://download.visualstudio.microsoft.com/download/pr/c1b620fe-7d8e-4685-b6ae-82b444dbc7a7/3d5610f0607da49ee014c61c6cd4e9af/aspne
tcore-runtime-2.1.12-linux-x64.tar.gz"
SRC_URI[sha256sum] = "cdb8816a437de168b25500b14ea32169abe610675ced08ca31f77f9542c2149a"
S = "${WORKDIR}"
do_install() {
install -d ${D}${bindir}
install -d ${D}${datadir}/dotnet
install -d ${D}${datadir}/dotnet/host/
install -d ${D}${datadir}/dotnet/shared/
install -m 0755 ${S}/dotnet ${D}${datadir}/dotnet
install -m 0644 ${S}/LICENSE.txt ${D}${datadir}/dotnet
install -m 0644 ${S}/ThirdPartyNotices.txt ${D}${datadir}/dotnet
cp -r --no-preserve=ownership ${S}/host/ ${D}${datadir}/dotnet/
cp -r --no-preserve=ownership ${S}/shared/ ${D}${datadir}/dotnet/
# Symlinks
cd ${D}${bindir}
ln -s ../../${datadir}/dotnet/dotnet dotnet || true
}
FILES_${PN} = "\
${bindir}/dotnet \
${datadir}/dotnet/ \
"

You might need to clean the cache of the recipe.
Just run:
$ bitbake -c clean {recipe name}
Then build your image again.
Hope it helps.

Adding the version number to the bitbake file, dotnet-runtime_2.1.12.bb instead of dotnet-runtime.bb, solved the issue.
Info about recipe naming http://www.embeddedlinux.org.cn/OEManual/recipes_versioning.html

Related

How to have Yocto checking my file has been changed

I have a bb file that will install a file into rootfs:
DESCRIPTION = "Add file to rootfs"
LICENSE = "test"
CONF_FILE = "${TOPDIR}/../meta/meta-test/recipes-test/test_file"
do_install() {
install -d ${D}/home/root
install -m 755 ${CONF_FILE} ${D}/home/root
}
FILES_${PN} += "/home/root"
It works fine and I can see my file in /home/root
Then I modify the file and build again.
But I find that the file isn't changed.
How can I have Yocto to check this file and build-in every time when it's changed?
Thanks to Nayfe.
It's been solved after adding SRC_URI
DESCRIPTION = "Add file to rootfs"
LICENSE = "test"
CONF_FILE = "${TOPDIR}/../meta/meta-test/recipes-test/test_file"
SRC_URI = ${CONF_FILE}
do_install() {
install -d ${D}/home/root
install -m 755 ${CONF_FILE} ${D}/home/root
}
FILES_${PN} += "/home/root"

Bitbake not installing files from recipe to rootfs

I'm currently using yocto to build the system imx6sxsabresd (IMX6 Solo X). I have successfully built the image however I want to add a script to init.d to turn on a led. I'm appending to the linux-imx recipes within the meta-fsl-bsp-release layer.
This is my linux-imx.bbappend file:
FILESEXTRAPATHS_prepend := "${THISDIR}/linux-imx:"
SRC_URI += "file://0001-added-pad-for-heartbeat-led.patch \
file://heartbeat.sh \
file://heartbeat "
PACKAGECONFIG_append = " heartbeat"
inherit update-rc.d
INITSCRIPT_PACKAGES = "${PN}"
INITSCRIPT_PARAMS = "start"
INITSCRIPT_NAME = "heartbeat.sh"
do_install_append()
{
install -d ${D}${sysconfdir}/init.d
install -m 0755 ${WORKDIR}/heartbeat.sh ${D}${sysconfdir}/init.d/heartbeat.sh
install -d ${D}/home/root
install -m 0755 ${WORKDIR}/heartbeat ${D}/home/root/heartbeat
}
FILES_${PN} += "${sysconfdir}/init.d/heartbeat.sh /home/root/heartbeat"
PACKAGES = "${PN}"
I'm able to create the sdcard image succesfully with the patch I've included in this bbappend file, however, the files heartbeat.sh and heartbeat are not copying to the final rootfs added to the output sdcard file. This is very odd because I'm able to see these files in their paths copied to ../tmp/work/imx6sxsabresd-poky-linux-gnueabi/linux-imx/4.14.98-r0/image/
As the comments suggests appending to the kernel recipe is the wrong way to go about this. You should instead add your own recipe and reference that recipe from the image definition (append to IMAGE_INSTALL).
Your recipe could look something like:
SUMMARY = "LED heartbeat init script"
inherit update-rc.d
SRC_URI += "\
file://heartbeat.sh \
"
do_install() {
install -d ${D}${sysconfdir}/init.d
install -m 0755 ${WORKDIR}/heartbeat.sh ${D}${sysconfdir}/init.d/
}
FILES_${PN} = "${sysconfdir}/init.d/heartbeat.sh"
INITSCRIPT_NAME = "heartbeat.sh"
INITSCRIPT_PARAMS = "start 90 5 . stop 20 0 1 6 ."

Yocto: BUILD_LDFLAGS set to build system libraries, not target

I've got a makefile recipe that builds a shared library (an alsa plugin). If I build the library outside if yocto everything works correctly and alsa will link to the library.
However if I build it with yocto, even though the log is error free, when I try and run alsa, I get an error "Cannot open shared library". The library is installed in location referenced by the error message and it's permissions are correct.
From within the recipe if I print out what BUILD_LDFLAGS is set to I notice the it's pointing to the x86_64-linux (build system) libraries instead of the 'MACHINE' libraries (example: -L//.build-yocto/tmp/sysroots/x86_64-linux/lib"
My questions are:
Is the BUILD_LDFLAGS the source of my problem?
If so how do I remedy it?
If not BUILD_LDFLAGS, any idea what is the problem.
Here is a copy of my recipe bb file:
SUMMARY = "..."
LICENSE = "CLOSED"
#Package release number
PR = "r0"
###################################################################
#The following lines tell yocto where to get the source code from
# This section is for git. Comment out ALL this section if
# you DO NOT want to pull from a git repo (local or remote).
# If pulling from git uncomment and modify paths.
###################################################################
#Uncomment following line to pull from REMOTE git repo
#SRC_URI = "git://gitpath;protocol=ssh;branch=master"
#Uncomment following line and modify path to pull from LOCAL git repo clone
##SRC_URI = "git:///localgitpath;protocol=file;branch=master"
#Change hash to match the commit you want yocto to use
##SRCREV="xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx"
##S = "${WORKDIR}/git/"
# End of git section
###################################################################
#The following lines tell yocto where to use a local file system
# for the source. Uncomment all lines and modify paths
###################################################################
SRC_URI = ""
inherit externalsrc
EXTERNALSRC = "/home/<my_path>"
EXTERNALSRC_BUILD = "/home/<my_path>"
# End of local file system section
##################################################################
#END of where to get source code
##################################################################
#Ignore vendor ldflags checking and use ours
INSANE_SKIP_${PN} = "ldflags"
#Don't strip debug symbols
INHIBIT_PACKAGE_STRIP = "1"
INHIBIT_SYSROOT_STRIP = "1"
SOLIBS = ".so"
#Tell yocto that the .so files are real and not sym-links.
FILES_SOLIBSDEV = ""
#/usr/lib/alsa-lib
FILES_${PN} += "${libdir}/alsa-lib"
#/usr/<PATH>
FILES_${PN} += "${prefix}/<PATH>"
DEPENDS += "alsa-lib"
EXTRA_OEMAKE += "'CC=${CC}' 'RANLIB=${RANLIB}' 'AR=${AR}' 'CFLAGS=${CFLAGS} -I${S}/include' 'BUILDDIR=${S}' 'DESTDIR=${D}'"
TARGET_CFLAGS += "-DPIC -fPIC -Wall -Wextra -O2 -g -I./include -I<path> -I-I<path2> -I<path3> -lasound"
TARGET_LDFLAGS += "-shared -lasound"
do_configure() {
oe_runmake -f Makefile.yocto clean
}
do_compile() {
# unset LDFLAGS TARGET_LDFLAGS BUILD_LDFLAGS
echo " Werkdir ${WORKDIR}"
echo " Compiler ${CC}"
echo " BUILD_LDFLAGS ${BUILD_LDFLAGS}"
echo " LDFLAGS ${LDFLAGS}"
echo " TARGET_LDFLAGS ${TARGET_LDFLAGS}"
oe_runmake -f Makefile.yocto all 'CC=${CC}'
}
do_install() {
install -d ${D}${libdir}
install -d ${D}${libdir}/alsa-lib
install -d ${D}${bindir}
install -d ${D}${prefix}
install -d ${D}${prefix}/<PATH>
install -m 0644 <path_n>lib1.so ${D}${libdir}
install -m 0644 <path_n>lib2.so.so ${D}${libdir}
install -m 0644 <path_n>lib3.so.so ${D}${libdir}
install -m 0644 <path_n>lib4.so.so ${D}${libdir}
install -m 0644 <path_n>lib1pcm_plugin.so ${D}${libdir}/alsa-lib
install -m 0755 <path_n>app1 ${D}${bindir}
install -m 0755 <path_n>app2 ${D}${bindir}
install -m 0755 <path_n>app3 ${D}${bindir}
install -m 0755 <path_n>app4 ${D}${bindir}
install -m 0755 <path_n>app5 ${D}${bindir}
install -m 0755 <path_n>app6 ${D}${bindir}
install -m 0755 <path_n>app7 ${D}${bindir}
install -m 0755 <path_n>app8 ${D}${bindir}
}
Makefile:
# Makefile template for shared library
#Yocto will pass in the CC flag so this is commented out. Otherwise the correct compiler won't be used
#CC = gcc # C compiler
#These are here to allow a build outside of Yocto (testing the build). Yocto's CFLAGS
#and LDFLAGS will override these.
CFLAGS += -fPIC -Wall -Wextra -O2 -g -I<path1> -I<path2> -I<path2> # C flags
LDFLAGS = -shared # linking flags
RM = rm -f # rm command
TARGET_LIB = libasoundplugin.so # target lib
LIB1=lib1
PATH1=<path1>
LIB2=lib2
PATH2=<path2>
INCLUDE_FLAGS = -L$(PATH1) -l$(LIB1I) \
-L$(PATH2) -l$(LIB2) \
-lasound
SRCS = source.c
OBJS = $(SRCS:.c=.o)
.PHONY: all
all: ${TARGET_LIB}
$(TARGET_LIB): $(OBJS)
$(CC) ${LDFLAGS} ${INCLUDE_FLAGS} -o $# $^
$(SRCS:.c=.d):%.d:%.c
$(CC) $(CFLAGS) -MM $< >$#
include $(SRCS:.c=.d)
.PHONY: clean
clean:
-${RM} ${TARGET_LIB} ${OBJS} $(SRCS:.c=.d)
Thanks!
Is the BUILD_LDFLAGS the source of my problem?
No. BUILD_LDFLAGS is used to build native packages, while you build a target package. In your case TARGET_LDFLAGS variable will be used as LDFLAGS source.
Here is a copy of my recipe bb file
Where does it come from? Did you write it from a template?
As I can see there is a recipe for alsa plugins, maybe you can add your plugin to this recipe?
You can also take as example the recipe for a2jmidid, it is close to what you are trying to do as I understand. It does nothing special, except for setting dependencies, getting sources, adding certain ld flags and passing resulting files to the package.
Regarding the Makefile (I suppose it is also your recipe):
First of all there is no need to have a separate Makefile for yocto.
#Yocto will pass in the CC flag so this is commented out. Otherwise the correct compiler won't be used
#CC = gcc # C compiler
You are passing CC from your .bb recipe (even twice: via EXTRA_OEMAKE and in do_compile). There is no need to comment out CC variable, as definitions inside Makefile have lower priority compared to definitions passed as command line arguments.
Why do you need INCLUDE_FLAGS variable? I don't understand what does it do (except for passing to gcc some flags for the third time).
Ultimately, you can go to the workdir, open file temp/log.do_compile and you will see which commands were executed to compile your plugin. Compare it to the settings you use to compile it manually, and you will see what is the difference between successful and unsuccessful builds.

Yocto/OpenEmbedded Recipe Including library paths from host

I have the luxury of dealing with the endless error and warning paradise that is OpenEmbedded. Good news is that I am finally getting somewhere with my recipe, but I am hitting an issue where my recipe is including include and library paths from my host machine. This as I am aware is unsafe for cross-compilation. Would any of you fine people take like quick look at my recipe and tell me if I'm doing anything dumb? I'd really appreciate it, as this is making me feel like I'm a complete moron.
Here's my OpenEmbedded Recipe:
#TODO fixup license type
#Built by Rob.
DESCRIPTION = "librem"
HOMEPAGE = ""
SECTION = "meta-miku"
DEPENDS = "zlib re"
LICENSE = "MIT"
LIC_FILES_CHKSUM = "file://${COMMON_LICENSE_DIR}/MIT;md5=0835ade698e0bcf8506ecda2f7b4f302"
# This tells bitbake where to find the files we're providing on the local filesystem
FILESEXTRAPATHS_prepend := "${THISDIR}/${PN}-${PV}:"
S = "${WORKDIR}/rem-0.5.2"
INSANE_SKIP_${PN}-dev += "dev-elf"
#INSANE_SKIP_${PN} += "installed-vs-shipped"
SRC_URI = "https://github.com/creytiv/rem/archive/v0.5.2.tar.gz"
SRC_URI[md5sum] = "4d63ab174fb7957b6805fd0de6991fd2"
SRC_URI[sha256sum] = "cef1b29631a35926982502f0eecc0950d40d2585241d0598ff18e70e2dfcfcb6"
do_compile() {
oe_runmake ROOT=${STAGING_DIR_HOST} OFLAGS="--sysroot=${STAGING_DIR_HOST}"
}
do_install () {
oe_runmake install ROOT=${STAGING_DIR_HOST} OFLAGS="--sysroot=${STAGING_DIR_HOST}" DESTDIR=${D}${libdir}
install -d ${D}${libdir}/
install -m 0644 ${S}/librem.a ${D}${libdir}/librem.a
install -m 0644 ${S}/librem.so ${D}${libdir}/librem.so
install -d ${D}${libdir}/pkgconfig
install -m 0644 ${S}/librem.pc ${D}${libdir}/pkgconfig/librem.pc
}
And here are my warnings:
WARNING: rem-1.0-r0 do_package: QA Issue: rem: Files/directories were installed but not shipped in any package:
/usr/lib64/usr/include
/usr/lib64/usr/include/rem
/usr/lib64/usr/include/rem/rem_auconv.h
/usr/lib64/usr/include/rem/rem_fir.h
/usr/lib64/usr/include/rem/rem_aumix.h
/usr/lib64/usr/include/rem/rem_video.h
/usr/lib64/usr/include/rem/rem_audio.h
/usr/lib64/usr/include/rem/rem_vidconv.h
/usr/lib64/usr/include/rem/rem_dtmf.h
/usr/lib64/usr/include/rem/rem_aubuf.h
/usr/lib64/usr/include/rem/rem_au.h
/usr/lib64/usr/include/rem/rem_dsp.h
/usr/lib64/usr/include/rem/rem_vidmix.h
/usr/lib64/usr/include/rem/rem_vid.h
/usr/lib64/usr/include/rem/rem_goertzel.h
/usr/lib64/usr/include/rem/rem_auresamp.h
/usr/lib64/usr/include/rem/rem_autone.h
/usr/lib64/usr/include/rem/rem_g711.h
/usr/lib64/usr/include/rem/rem_aufile.h
/usr/lib64/usr/include/rem/rem.h
/usr/lib64/usr/lib/librem.a
/usr/lib64/usr/lib/librem.so
/usr/lib64/usr/lib/pkgconfig
/usr/lib64/usr/lib/pkgconfig/librem.pc
Please set FILES such that these items are packaged. Alternatively if they are unneeded, avoid installing them or delete them within do_install.
rem: 24 installed and not shipped files. [installed-vs-shipped]
WARNING: rem-1.0-r0 do_package_qa: QA Issue: rem: The compile log indicates that host include and/or library paths were used.
Please check the log '/media/rob/a72581e8-3ca3-4dc1-b3b8-6db5464de098/qc_openEmbedded/apps_proc/build/tmp-glibc/work/aarch64-linaro-linux/rem/1.0-r0/temp/log.do_compile' for more information. [compile-host-path]
WARNING: rem-1.0-r0 do_package_qa: QA Issue: No GNU_HASH in the elf binary: '/media/rob/a72581e8-3ca3-4dc1-b3b8-6db5464de098/qc_openEmbedded/apps_proc/build/tmp-glibc/work/aarch64-linaro-linux/rem/1.0-r0/packages-split/rem-dev/usr/lib64/librem.so' [ldflags]
NOTE: Tasks Summary: Attempted 420 tasks of which 407 didn't need to be rerun and all succeeded.
NOTE: Writing buildhistory
Summary: There were 4 WARNING messages shown.
It is exactly what the warning is telling you in your bitbake output warning. The files are processed and installed however there is no reference to them in the output hence why they are not shipped.
Please set FILES such that these items are packaged. Alternatively if
they are unneeded, avoid installing them or delete them within
do_install. rem: 24 installed and not shipped files.
[installed-vs-shipped]
Include the files in your Yocto recipe:
#TODO fixup license type
#Built by Rob.
DESCRIPTION = "librem"
HOMEPAGE = ""
SECTION = "meta-miku"
DEPENDS = "zlib re"
LICENSE = "MIT"
LIC_FILES_CHKSUM = "file://${COMMON_LICENSE_DIR}/MIT;md5=0835ade698e0bcf8506ecda2f7b4f302"
# This tells bitbake where to find the files we're providing on the local filesystem
FILESEXTRAPATHS_prepend := "${THISDIR}/${PN}-${PV}:"
S = "${WORKDIR}/rem-0.5.2"
INSANE_SKIP_${PN}-dev += "dev-elf"
#INSANE_SKIP_${PN} += "installed-vs-shipped"
SRC_URI = "https://github.com/creytiv/rem/archive/v0.5.2.tar.gz"
SRC_URI[md5sum] = "4d63ab174fb7957b6805fd0de6991fd2"
SRC_URI[sha256sum] = "cef1b29631a35926982502f0eecc0950d40d2585241d0598ff18e70e2dfcfcb6"
do_compile() {
oe_runmake ROOT=${STAGING_DIR_HOST} OFLAGS="--sysroot=${STAGING_DIR_HOST}"
}
do_install () {
oe_runmake install ROOT=${STAGING_DIR_HOST} OFLAGS="--sysroot=${STAGING_DIR_HOST}" DESTDIR=${D}${libdir}
install -d ${D}${libdir}/
install -m 0644 ${S}/librem.a ${D}${libdir}/librem.a
install -m 0644 ${S}/librem.so ${D}${libdir}/librem.so
install -d ${D}${libdir}/pkgconfig
install -m 0644 ${S}/librem.pc ${D}${libdir}/pkgconfig/librem.pc
}
FILES_${PN} += "\
/usr/lib64/usr/include \
/usr/lib64/usr/include/rem \
/usr/lib64/usr/include/rem/rem_auconv.h \
/usr/lib64/usr/include/rem/rem_fir.h \
/usr/lib64/usr/include/rem/rem_aumix.h \
/usr/lib64/usr/include/rem/rem_video.h \
/usr/lib64/usr/include/rem/rem_audio.h \
/usr/lib64/usr/include/rem/rem_vidconv.h \
/usr/lib64/usr/include/rem/rem_dtmf.h \
/usr/lib64/usr/include/rem/rem_aubuf.h \
/usr/lib64/usr/include/rem/rem_au.h \
/usr/lib64/usr/include/rem/rem_dsp.h \
/usr/lib64/usr/include/rem/rem_vidmix.h \
/usr/lib64/usr/include/rem/rem_vid.h \
/usr/lib64/usr/include/rem/rem_goertzel.h \
/usr/lib64/usr/include/rem/rem_auresamp.h \
/usr/lib64/usr/include/rem/rem_autone.h \
/usr/lib64/usr/include/rem/rem_g711.h \
/usr/lib64/usr/include/rem/rem_aufile.h \
/usr/lib64/usr/include/rem/rem.h \
/usr/lib64/usr/lib/librem.a \
/usr/lib64/usr/lib/librem.so \
/usr/lib64/usr/lib/pkgconfig \
/usr/lib64/usr/lib/pkgconfig/librem.pc \
"
or alternatively the easier way would just be to use a wildcard which catches everything
FILES_${PN} += "/usr/lib64/usr/*"

Yocto build not including files in sdcard image

I am trying to build an SDK into my sysroot on my yocto build. However when i compile my build i get no errors and everything appears to have worked fine.
When i flash my SD card and run it on my board and go to look for my files, they arent there.
here is my .bb file which is used to install the SDK i want to use.
giffgaff-connectDESCRIPTION = "azure"
HOMEPAGE = "https://github.com/Azure/azure-iot-sdk-c"
LICENSE = "MIT"
SECTION = "applications"
PRIORITY = "optional"
DEPENDS = "mono"
LIC_FILES_CHKSUM = "file://${WORKDIR}/git/LICENSE;md5=4283671594edec4c13aeb073c219237a"
SRCREV = "${AUTOREV}"
SRC_URI = "git://git#bitbucket.org/condecosoftware/azure-iot-sdk-c;protocol=ssh;branch=master"
COMPATIBLE_MACHINE = "imx6qsabresd"
S = "${WORKDIR}"
ALLOW_EMPTY_${PN} = "1"
do_compile() {
echo libdir: ${libdir}
echo Files : FILES_${PN}
echo "compiler: ${CC}"
echo "sysroot: ${STAGING_DIR_TARGET}"
export SYSROOT=${STAGING_DIR_TARGET}
cd ${WORKDIR}/git/build_all/linux/
./build.sh --toolchain-file toolchain-yocto.cmake -cl --sysroot=${STAGING_DIR_TARGET} --install-path-prefix ${STAGING_DIR_TARGET}
cd ../..
cmake -P cmake/iotsdk_linux/cmake_install.cmake
}
do_install() {
cd git
pwd
echo ${D}
echo ${libdir}
install -d 0755 ${D}${libdir}
install -m 0755 ./cmake/iotsdk_linux/umqtt/libumqtt.a ${D}${libdir}/
install -m 0755 ./cmake/iotsdk_linux/uamqp/libuamqp.a ${D}${libdir}/
install -m 0755 ./cmake/iotsdk_linux/c-utility/libaziotsharedutil.a ${D}${libdir}/
install -m 0755 ./cmake/iotsdk_linux/iothub_client/libiothub_client_http_transport.a ${D}${libdir}/
install -m 0755 ./cmake/iotsdk_linux/iothub_client/libiothub_client.a ${D}${libdir}/
install -m 0755 ./cmake/iotsdk_linux/iothub_client/libiothub_client_amqp_ws_transport.a ${D}${libdir}/
install -m 0755 ./cmake/iotsdk_linux/iothub_client/libiothub_client_amqp_transport.a ${D}${libdir}/
install -m 0755 ./cmake/iotsdk_linux/iothub_client/libiothub_client_mqtt_transport.a ${D}${libdir}/
install -m 0755 ./cmake/iotsdk_linux/iothub_client/libiothub_client_mqtt_ws_transport.a ${D}${libdir}/
install -m 0755 ./cmake/iotsdk_linux/serializer/libserializer.a ${D}${libdir}/
install -m 0755 ./cmake/iotsdk_linux/iothub_service_client/libiothub_service_client.a ${D}${libdir}/
}
do_fetch_extra(){
cd ${WORKDIR}/git/
git submodule update --init --recursive
}
addtask fetch_extra after do_unpack before do_patch
Any help would be great appreciated. Thanks
Have you tried ${WORKDIR} variable? This variable holds the pathname of the work directory of recipe being build. So every file fetched from git can be accessed from there, I presume. For example:
install -m 0755 ${WORKDIR}/cmake/iotsdk_linux/umqtt/libumqtt.a ${D}${libdir}/
Please let me know if it works.
You will probably need to add
PACKAGES =+ "${PN}-staticdev"
FILES_${PN}-staticdev += "${libdir}/*.a"
to ship every files you installed into your image.
You can also add every files one by one instead of wildcard.
Some remarks:
For git submodules, you can use gitsm:// url, it will initialize every submodules.
You can also put the following instruction to avoid doing some change dir in recipe.
S = "${WORKDIR}/git"
By the way, you can look this OE recipe for Azure from Intel meta-iot-cloud layer. It is python recipe, but it depends on C iot sdk, it can be inspiring:
https://github.com/intel-iot-devkit/meta-iot-cloud/blob/master/recipes-azure/azure-iot-sdk/azure-iot-sdk_1.1.23.bb