<?xml version="1.0" encoding="UTF-8"?>
<rss xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns:taxo="http://purl.org/rss/1.0/modules/taxonomy/" version="2.0">
  <channel>
    <title>i.MX Processors中的主题 Building mDNS in Yocto</title>
    <link>https://community.nxp.com/t5/i-MX-Processors/Building-mDNS-in-Yocto/m-p/1233022#M169678</link>
    <description>&lt;P&gt;Hi All,&lt;/P&gt;&lt;P&gt;Can someone help me in setting up the recipe to build mDNS in Yocto and/or&lt;BR /&gt;correct any other mistakes I may have made?&lt;BR /&gt;I previously successfully built mDNS and got it running in Linaro embedded&lt;BR /&gt;Linux.&lt;BR /&gt;This is a pretty detailed post, to try to err on the side of giving enough&lt;BR /&gt;information. As one responder wrote in a forum message that I saw recently:&lt;BR /&gt;"Welcome to Yocto. Here's your bottle of whiskey and Advil..."&lt;/P&gt;&lt;P&gt;Building in Linaro Linux: I had obtained this .tar of mDNS from Apple:&lt;BR /&gt;&lt;A href="https://opensource.apple.com/tarballs/mDNSResponder/mDNSResponder-878.200.35.tar.gz" target="_blank"&gt;https://opensource.apple.com/tarballs/mDNSResponder/mDNSResponder-878.200.35.tar.gz&lt;/A&gt;&lt;BR /&gt;Following this got it going: &lt;A href="https://github.com/balaji-reddy/mDNSResponder" target="_blank"&gt;https://github.com/balaji-reddy/mDNSResponder&lt;/A&gt; .&lt;BR /&gt;I made a base folder /mDNS/ for my mDNS stuff and extracted the .tar there,&lt;BR /&gt;creating an mDNSResponder-878.200.35/ folder. I did cd into that.&lt;BR /&gt;It build readily for me in Linaro using the command: make os="linux" -C "mDNSPosix"&lt;/P&gt;&lt;P&gt;I got 8 files in /mDNS/mDNSR-878.200.35/mDNSPosix/build/prod/ :&lt;BR /&gt;40,592 libdns_sd.so&lt;BR /&gt;55,960 libnss_mdns-0.2.so&lt;BR /&gt;370,288 mDNSClientPosix&lt;BR /&gt;448,608 mdnsd&lt;BR /&gt;374,616 mDNSIdentify&lt;BR /&gt;387,904 mDNSNetMonitor&lt;BR /&gt;373,960 mDNSProxyResponderPosix&lt;BR /&gt;379,768 mDNSResponderPosix&lt;BR /&gt;Then, still in mDNSResponder-878.200.35/, I did:&lt;BR /&gt;make install os="linux" -C "mDNSPosix"&lt;/P&gt;&lt;P&gt;Among other things, this install starts a demon running. It also copies&lt;BR /&gt;libdns_sd.so, and libnss_mdns-0.2.so to /lib/, which should be in the path.&lt;BR /&gt;These lines are included in the install output:&lt;BR /&gt;--------------------------------------------------------------&lt;BR /&gt;Starting Apple Darwin Multicast DNS / DNS Service Discovery daemon: mdnsd.&lt;BR /&gt;/usr/sbin/mdnsd installed&lt;BR /&gt;--------------------------------------------------------------&lt;/P&gt;&lt;P&gt;For Yocto, I figured I would add the copy of libdns_sd.so to the /lib/ folder in&lt;BR /&gt;the destination to my recipe so I could link another module to it before I ran&lt;BR /&gt;the make install, which has to be done running on the target. But if I build&lt;BR /&gt;that other module in Yocto, I think I should add copying it to /lib/ under my&lt;BR /&gt;tmp/work/ dir, not D, the destination. My do_install line:&lt;BR /&gt;install -m 0755 ${S}/mDNSResponder-878.200.35/mDNSPosix/build/prod/libdns_sd.so ${D}${base_libdir}&lt;BR /&gt;is for copying it to /lib/ in D. How would I correctly write that line to copy&lt;BR /&gt;it to /lib/ under ~/Yocto/imx-yocto-bsp/build-wayland/tmp/work/aarch64-poky-linux/?&lt;/P&gt;&lt;P&gt;The Yocto low-level folder isn't very important; I just felt that I wanted a&lt;BR /&gt;Yocto folder under my home dir to hold my Yocto stuff. I created imx-yocto-bsp&lt;BR /&gt;following the i.MX_Yocto_Project_User's_Guide.pdf.&lt;/P&gt;&lt;P&gt;First, I had followed the i.MX_Yocto_Project_User's_Guide.pdf, "IMXLXYOCTOUG"&lt;BR /&gt;from the the imx-yocto-L5.4.47_2.2.0 download, to get my basic system, which&lt;BR /&gt;worked. I got that from: &lt;A href="http://www.nxp.com/imx8mnanoevk" target="_blank"&gt;www.nxp.com/imx8mnanoevk&lt;/A&gt; -&amp;gt;&lt;BR /&gt;&lt;A href="https://www.nxp.com/design/development-boards/i-mx-evaluation-and-development-boards/evaluation-kit-for-the-i-mx-8m-nano-applications-processor:8MNANOD4-EVK" target="_blank"&gt;https://www.nxp.com/design/development-boards/i-mx-evaluation-and-development-boards/evaluation-kit-for-the-i-mx-8m-nano-applications-processor:8MNANOD4-EVK&lt;/A&gt;&lt;BR /&gt;And downloaded and unpacked this .zip described in the next three lines:&lt;BR /&gt;L5.4.47_2.2.0_LINUX_DOCS (REV L5.4.47_2.2.0 ) UPDATED&lt;BR /&gt;i.MX L5.4.47_2.2.0 for Linux BSP Documentation. Includes Release Notes, User Guide.&lt;BR /&gt;ZIP 11.6 MB 03 Nov 2020 L5.4.47_2.2.0_LINUX_DOCS [ English ]&lt;BR /&gt;I'm doing this for the i.MX 8M nano eval board.&lt;BR /&gt;The build-wayland folder in my path above is my build folder.&lt;BR /&gt;I had done the following line to get that.&lt;BR /&gt;~/Yocto/imx-yocto-bsp$ DISTRO=fsl-imx-wayland MACHINE=imx8mnddr4evk source imx-setup-release.sh -b build-wayland&lt;BR /&gt;One result of that was to end up with the directory changed to the build-wayland&lt;BR /&gt;folder. It turned out it was the right thing to do to stay in that folder for&lt;BR /&gt;subsequent steps in the i.MX_Yocto_Project_User's_Guide.pdf, such as my&lt;BR /&gt;"bitbake imx-image-multimedia" command that I did; I don't believe the .pdf made&lt;BR /&gt;that clear.&lt;/P&gt;&lt;P&gt;So I previously got this working on a Linux host PC running Ubuntu 18.04.4&lt;BR /&gt;"Bionic Beaver" and flashed the resulting images onto my i.MX 8M nano board.&lt;BR /&gt;One line of many I see in my UART output is:&lt;BR /&gt;Welcome to NXP i.MX Release Distro 5.4-zeus (zeus)!&lt;BR /&gt;I followed the following very good tutorial and also added a helloworld layer as&lt;BR /&gt;it shows and had helloworld working on my target board after flashing the built&lt;BR /&gt;.wic image from the host:&lt;BR /&gt;&lt;A href="https://medium.com/the-innovation/how-to-prepare-a-helloworld-c-recipe-with-yocto-project-1f74c296a777" target="_blank"&gt;https://medium.com/the-innovation/how-to-prepare-a-helloworld-c-recipe-with-yocto-project-1f74c296a777&lt;/A&gt;&lt;BR /&gt;It is a good tutorial, for one thing, because it clearly describes the directory&lt;BR /&gt;structure and can be followed. Be careful about a typo that the author&lt;BR /&gt;put in, however. He starts out spelling helloworld.c as hello-world.c in his&lt;BR /&gt;Steps 5 and 6 then switches to helloworld.c in his Step 7. You have to catch&lt;BR /&gt;that and fix the spelling in your work when you notice the switch.&lt;/P&gt;&lt;P&gt;I used the structure that he, George Calin, showed, to make my mdns layer.&lt;/P&gt;&lt;P&gt;In my build folder, build-wayland, I created meta-mdns-so alongside the&lt;BR /&gt;meta-helloworld-app folder that I had created following the tutorial. I used&lt;BR /&gt;similar steps as given in the tutorial, including&lt;BR /&gt;bitbake-layers create-layer meta-mdns-so&lt;BR /&gt;bitbake-layers add-layer meta-mdns-so&lt;/P&gt;&lt;P&gt;This got me through Step 4 in the tutorial in a similar manner.&lt;BR /&gt;This created the following tree in meta-mdns-so (one dash indented per level):&lt;/P&gt;&lt;P&gt;conf&lt;BR /&gt;-layer.conf&lt;BR /&gt;COPYING.MIT&lt;BR /&gt;README&lt;BR /&gt;recipes-example&lt;BR /&gt;-mdns&lt;BR /&gt;--files&lt;BR /&gt;---mDNSResponder-878.200.35.tar.gz&lt;BR /&gt;--mDNSResponder_878.200.35.bb&lt;/P&gt;&lt;P&gt;Note that items followed by items that are more indented are directories.&lt;/P&gt;&lt;P&gt;Putting mDNSResponder-878.200.35.tar.gz under files I found out from&lt;BR /&gt;&lt;A href="https://wiki.yoctoproject.org/wiki/Building_your_own_recipes_from_first_principles" target="_blank"&gt;https://wiki.yoctoproject.org/wiki/Building_your_own_recipes_from_first_principles&lt;/A&gt;&lt;BR /&gt;However the information here is about seven years old and background info links&lt;BR /&gt;have rotted.&lt;BR /&gt;There's more information in the Yocto Mega Manual at&lt;BR /&gt;&lt;A href="https://www.yoctoproject.org/docs/3.0/mega-manual/mega-manual.html" target="_blank"&gt;https://www.yoctoproject.org/docs/3.0/mega-manual/mega-manual.html&lt;/A&gt; .&lt;BR /&gt;See "7.3.21.3. Makefile-Based Package"&lt;/P&gt;&lt;P&gt;Here's the recipe in mDNSResponder_878.200.35.bb that I came up with for my&lt;BR /&gt;first try:&lt;BR /&gt;----------------------------------------------------------------------&lt;BR /&gt;DESCRIPTION = "The mDNS component"&lt;BR /&gt;PRIORITY = "optional"&lt;BR /&gt;SECTION = "protocols"&lt;BR /&gt;LICENSE = "MIT"&lt;BR /&gt;LIC_FILES_CHKSUM = "file://${COMMON_LICENSE_DIR}/MIT;md5=0835ade698e0bcf8506ecda2f7b4f302"&lt;BR /&gt;SRC_URI = "file://mDNSResponder-878.200.35.tar.gz"&lt;BR /&gt;# S = "${WORKDIR}"&lt;BR /&gt;# -Shouldn't set S because BitBake expects the source to be in a dir called&lt;BR /&gt;# mDNSResponder-878.200.35 in the work dir.&lt;BR /&gt;# Don't need a do_compile step since by default BitBake starts the make command&lt;BR /&gt;# to compile the application.&lt;BR /&gt;# But need additional make options&lt;BR /&gt;EXTRA_OEMAKE = "'os="linux"' '-C "mDNSPosix"'"&lt;BR /&gt;do_install() {&lt;BR /&gt;install -d ${D}${base_libdir}&lt;BR /&gt;install -m 0755 ${WORKDIR}/mDNSResponder-878.200.35/mDNSPosix/build/prod/libdns_sd.so ${D}${base_libdir}&lt;BR /&gt;}&lt;BR /&gt;----------------------------------------------------------------------&lt;BR /&gt;I did bitbake mdns in ~/Yocto/imx-yocto-bsp/build-wayland$ .&lt;/P&gt;&lt;P&gt;When coming back to this work in a fresh terminal window I always do&lt;BR /&gt;~/Yocto/imx-yocto-bsp$ source setup-environment build-wayland&lt;BR /&gt;It puts me in my build-wayland folder: ~/Yocto/imx-yocto-bsp/build-wayland$&lt;/P&gt;&lt;P&gt;The bitbake seemed to do the compile fine, and I got content under:&lt;BR /&gt;~/Yocto/imx-yocto-bsp/build-wayland/tmp/work# find -iname *mdns*&lt;BR /&gt;Found lots, including this folder:&lt;BR /&gt;./aarch64-poky-linux/mdns/878.200.35-r0/&lt;/P&gt;&lt;P&gt;As in the helloworld tutorial:&lt;BR /&gt;Step 10. Add package to conf/local.conf in variable IMAGE_INSTALL and set the&lt;BR /&gt;details for next image&lt;BR /&gt;I added:&lt;BR /&gt;IMAGE_INSTALL_append=" mdns" after the line, 'CONF_VERSION' = "1"'.&lt;/P&gt;&lt;P&gt;I did the bitbake from my build dir: bitbake imx-image-multimedia&lt;/P&gt;&lt;P&gt;Under my deploy folder, in&lt;BR /&gt;~/Yocto/imx-yocto-bsp/build-wayland/tmp/deploy/images/imx8mnddr4evk/, I got&lt;BR /&gt;imx-image-multimedia-imx8mnddr4evk-20210211215119.rootfs.wic.bz2&lt;BR /&gt;With the up-to-date timestamp of 2021/02/11 (Thurs) 21:51:19 (0000 UTC).&lt;/P&gt;&lt;P&gt;Flashing it onto my i.MX 8M nano board, it&lt;BR /&gt;-didn't have libdns_sd.so in the /lib/ folder&lt;BR /&gt;-didn't have a /mDNSR-878.200.35 folder in root.&lt;BR /&gt;-find -iname *mdns* doesn't find mDNSR-878.200.35; finds a screenful of files.&lt;BR /&gt;-the /mDNSR-878.200.35/mDNSPosix/build/prod/ folder with its 8 build artifacts&lt;BR /&gt;wasn't there.&lt;/P&gt;&lt;P&gt;However, on the bitbake host, the 8 build artifacts were found:&lt;BR /&gt;~/Yocto/imx-yocto-bsp/build-wayland/tmp/work/aarch64-poky-linux/mdns/878.200.35-r0/mDNSResponder-878.200.35/mDNSPosix/build/prod# ls -l&lt;BR /&gt;total 9452&lt;BR /&gt;-rwxr-xr-x 1 159200 Feb 11 16:07 libdns_sd.so&lt;BR /&gt;-rwxr-xr-x 1 239856 Feb 11 16:07 libnss_mdns-0.2.so&lt;BR /&gt;-rwxr-xr-x 1 1504904 Feb 11 16:07 mDNSClientPosix&lt;BR /&gt;-rwxr-xr-x 1 1750944 Feb 11 16:07 mdnsd&lt;BR /&gt;-rwxr-xr-x 1 1481136 Feb 11 16:07 mDNSIdentify&lt;BR /&gt;-rwxr-xr-x 1 1525392 Feb 11 16:07 mDNSNetMonitor&lt;BR /&gt;-rwxr-xr-x 1 1493112 Feb 11 16:07 mDNSProxyResponderPosix&lt;BR /&gt;-rwxr-xr-x 1 1511048 Feb 11 16:07 mDNSResponderPosix&lt;/P&gt;&lt;P&gt;I concluded that the compile part was fine but my do_install command was wrong.&lt;BR /&gt;Can someone correct my recipe for me?&lt;/P&gt;&lt;P&gt;For my second try I changed only the do_install() in the recipe to this:&lt;BR /&gt;--------------------------------------------------------------------------------&lt;BR /&gt;do_install() {&lt;BR /&gt;install -t ${S} ${D}&lt;BR /&gt;install -d ${D}${base_libdir}&lt;BR /&gt;install -m 0755 ${S}/mDNSResponder-878.200.35/mDNSPosix/build/prod/libdns_sd.so ${D}${base_libdir}&lt;BR /&gt;}&lt;BR /&gt;--------------------------------------------------------------------------------&lt;BR /&gt;That's two changes, first copying from S to D to try to get the&lt;BR /&gt;mDNSResponder-878.200.35/ dir copied over to the destination, and then trying&lt;BR /&gt;the "install - m" command from S rather than WORKDIR.&lt;/P&gt;&lt;P&gt;Retrying the bitbake: bitbake imx-image-multimedia, it indicated at the end that&lt;BR /&gt;all 6968 tasks didn't need to be rerun.&lt;/P&gt;&lt;P&gt;I tried: ~/Yocto/imx-yocto-bsp/build-wayland$ bitbake -c clean mdns -- and got:&lt;BR /&gt;NOTE: Tasks Summary: Attempted 1 tasks of which 0 didn't need to be rerun and&lt;BR /&gt;all succeeded.&lt;/P&gt;&lt;P&gt;~/Yocto/imx-yocto-bsp/build-wayland$ bitbake imx-image-multimedia -- got:&lt;BR /&gt;NOTE: Tasks Summary: Attempted 6968 tasks of which 6967 didn't need to be rerun&lt;BR /&gt;and all succeeded.&lt;BR /&gt;It typically flashes and erases a bunch of activity, which it did this time. It&lt;BR /&gt;might be nice to have that remaining displayed to be able to study it.&lt;/P&gt;&lt;P&gt;It didn't update anything in:&lt;BR /&gt;~/Yocto/imx-yocto-bsp/build-wayland/tmp/deploy/images/imx8mnddr4evk#&lt;BR /&gt;No longer had mDNSResponder-878.200.35/ in&lt;BR /&gt;~/Yocto/imx-yocto-bsp/build-wayland/tmp/work/aarch64-poky-linux/mdns/878.200.35-r0/ .&lt;/P&gt;&lt;P&gt;I tried: bitbake -c cleansstate mdns -- got:&lt;BR /&gt;NOTE: Tasks Summary: Attempted 2 tasks of which 0 didn't need to be rerun and&lt;BR /&gt;all succeeded.&lt;/P&gt;&lt;P&gt;Did: ~/Yocto/imx-yocto-bsp/build-wayland$ bitbake imx-image-multimedia&lt;BR /&gt;-Got the typical bitbake output, then:&lt;BR /&gt;Sstate summary: Wanted 6 Found 0 Missed 6 Current 2580 (0% match, 99% complete)&lt;BR /&gt;NOTE: Tasks Summary: Attempted 6968 tasks of which 6954 didn't need to be rerun&lt;BR /&gt;and all succeeded.&lt;BR /&gt;This time I saw do_compile of mdns and 878.200.25 etc.&lt;/P&gt;&lt;P&gt;Again had mDNSResponder-878.200.35 in&lt;BR /&gt;~/Yocto/imx-yocto-bsp/build-wayland/tmp/work/aarch64-poky-linux/mdns/878.200.35-r0/.&lt;BR /&gt;Have the build artifacts in mDNSPosix in the host at:&lt;BR /&gt;~/Yocto/imx-yocto-bsp/build-wayland/tmp/work/aarch64-poky-linux/mdns/878.200.35-r0/mDNSResponder-878.200.35/mDNSPosix/build/prod/&lt;BR /&gt;Still don't have an updated image since Thurs Feb 11 in&lt;BR /&gt;~/Yocto/imx-yocto-bsp/build-wayland/tmp/deploy/images/imx8mnddr4evk/ .&lt;/P&gt;&lt;P&gt;Can someone correct my recipe and any other mistakes I may have made? Is it my&lt;BR /&gt;do_install()?&lt;/P&gt;&lt;P&gt;In my do_install(), I have:&lt;BR /&gt;install -m 0755 ${S}/mDNSResponder-878.200.35/mDNSPosix/build/prod/libdns_sd.so ${D}${base_libdir}&lt;BR /&gt;which is for copying it to /lib/ in D. How would I correctly write that line to&lt;BR /&gt;copy it to /lib/ under&lt;BR /&gt;~/Yocto/imx-yocto-bsp/build-wayland/tmp/work/aarch64-poky-linux/ for use to link&lt;BR /&gt;to the next module I have to build on the host?&lt;/P&gt;&lt;P&gt;In the meantime, I'll try deleting my&lt;BR /&gt;imx-image-multimedia-imx8mnddr4evk-20210211215119.rootfs.wic.bz2 and redoing the&lt;BR /&gt;bitbake.&lt;/P&gt;&lt;P&gt;Best regards,&lt;/P&gt;</description>
    <pubDate>Thu, 18 Feb 2021 16:50:48 GMT</pubDate>
    <dc:creator>microajim</dc:creator>
    <dc:date>2021-02-18T16:50:48Z</dc:date>
    <item>
      <title>Building mDNS in Yocto</title>
      <link>https://community.nxp.com/t5/i-MX-Processors/Building-mDNS-in-Yocto/m-p/1233022#M169678</link>
      <description>&lt;P&gt;Hi All,&lt;/P&gt;&lt;P&gt;Can someone help me in setting up the recipe to build mDNS in Yocto and/or&lt;BR /&gt;correct any other mistakes I may have made?&lt;BR /&gt;I previously successfully built mDNS and got it running in Linaro embedded&lt;BR /&gt;Linux.&lt;BR /&gt;This is a pretty detailed post, to try to err on the side of giving enough&lt;BR /&gt;information. As one responder wrote in a forum message that I saw recently:&lt;BR /&gt;"Welcome to Yocto. Here's your bottle of whiskey and Advil..."&lt;/P&gt;&lt;P&gt;Building in Linaro Linux: I had obtained this .tar of mDNS from Apple:&lt;BR /&gt;&lt;A href="https://opensource.apple.com/tarballs/mDNSResponder/mDNSResponder-878.200.35.tar.gz" target="_blank"&gt;https://opensource.apple.com/tarballs/mDNSResponder/mDNSResponder-878.200.35.tar.gz&lt;/A&gt;&lt;BR /&gt;Following this got it going: &lt;A href="https://github.com/balaji-reddy/mDNSResponder" target="_blank"&gt;https://github.com/balaji-reddy/mDNSResponder&lt;/A&gt; .&lt;BR /&gt;I made a base folder /mDNS/ for my mDNS stuff and extracted the .tar there,&lt;BR /&gt;creating an mDNSResponder-878.200.35/ folder. I did cd into that.&lt;BR /&gt;It build readily for me in Linaro using the command: make os="linux" -C "mDNSPosix"&lt;/P&gt;&lt;P&gt;I got 8 files in /mDNS/mDNSR-878.200.35/mDNSPosix/build/prod/ :&lt;BR /&gt;40,592 libdns_sd.so&lt;BR /&gt;55,960 libnss_mdns-0.2.so&lt;BR /&gt;370,288 mDNSClientPosix&lt;BR /&gt;448,608 mdnsd&lt;BR /&gt;374,616 mDNSIdentify&lt;BR /&gt;387,904 mDNSNetMonitor&lt;BR /&gt;373,960 mDNSProxyResponderPosix&lt;BR /&gt;379,768 mDNSResponderPosix&lt;BR /&gt;Then, still in mDNSResponder-878.200.35/, I did:&lt;BR /&gt;make install os="linux" -C "mDNSPosix"&lt;/P&gt;&lt;P&gt;Among other things, this install starts a demon running. It also copies&lt;BR /&gt;libdns_sd.so, and libnss_mdns-0.2.so to /lib/, which should be in the path.&lt;BR /&gt;These lines are included in the install output:&lt;BR /&gt;--------------------------------------------------------------&lt;BR /&gt;Starting Apple Darwin Multicast DNS / DNS Service Discovery daemon: mdnsd.&lt;BR /&gt;/usr/sbin/mdnsd installed&lt;BR /&gt;--------------------------------------------------------------&lt;/P&gt;&lt;P&gt;For Yocto, I figured I would add the copy of libdns_sd.so to the /lib/ folder in&lt;BR /&gt;the destination to my recipe so I could link another module to it before I ran&lt;BR /&gt;the make install, which has to be done running on the target. But if I build&lt;BR /&gt;that other module in Yocto, I think I should add copying it to /lib/ under my&lt;BR /&gt;tmp/work/ dir, not D, the destination. My do_install line:&lt;BR /&gt;install -m 0755 ${S}/mDNSResponder-878.200.35/mDNSPosix/build/prod/libdns_sd.so ${D}${base_libdir}&lt;BR /&gt;is for copying it to /lib/ in D. How would I correctly write that line to copy&lt;BR /&gt;it to /lib/ under ~/Yocto/imx-yocto-bsp/build-wayland/tmp/work/aarch64-poky-linux/?&lt;/P&gt;&lt;P&gt;The Yocto low-level folder isn't very important; I just felt that I wanted a&lt;BR /&gt;Yocto folder under my home dir to hold my Yocto stuff. I created imx-yocto-bsp&lt;BR /&gt;following the i.MX_Yocto_Project_User's_Guide.pdf.&lt;/P&gt;&lt;P&gt;First, I had followed the i.MX_Yocto_Project_User's_Guide.pdf, "IMXLXYOCTOUG"&lt;BR /&gt;from the the imx-yocto-L5.4.47_2.2.0 download, to get my basic system, which&lt;BR /&gt;worked. I got that from: &lt;A href="http://www.nxp.com/imx8mnanoevk" target="_blank"&gt;www.nxp.com/imx8mnanoevk&lt;/A&gt; -&amp;gt;&lt;BR /&gt;&lt;A href="https://www.nxp.com/design/development-boards/i-mx-evaluation-and-development-boards/evaluation-kit-for-the-i-mx-8m-nano-applications-processor:8MNANOD4-EVK" target="_blank"&gt;https://www.nxp.com/design/development-boards/i-mx-evaluation-and-development-boards/evaluation-kit-for-the-i-mx-8m-nano-applications-processor:8MNANOD4-EVK&lt;/A&gt;&lt;BR /&gt;And downloaded and unpacked this .zip described in the next three lines:&lt;BR /&gt;L5.4.47_2.2.0_LINUX_DOCS (REV L5.4.47_2.2.0 ) UPDATED&lt;BR /&gt;i.MX L5.4.47_2.2.0 for Linux BSP Documentation. Includes Release Notes, User Guide.&lt;BR /&gt;ZIP 11.6 MB 03 Nov 2020 L5.4.47_2.2.0_LINUX_DOCS [ English ]&lt;BR /&gt;I'm doing this for the i.MX 8M nano eval board.&lt;BR /&gt;The build-wayland folder in my path above is my build folder.&lt;BR /&gt;I had done the following line to get that.&lt;BR /&gt;~/Yocto/imx-yocto-bsp$ DISTRO=fsl-imx-wayland MACHINE=imx8mnddr4evk source imx-setup-release.sh -b build-wayland&lt;BR /&gt;One result of that was to end up with the directory changed to the build-wayland&lt;BR /&gt;folder. It turned out it was the right thing to do to stay in that folder for&lt;BR /&gt;subsequent steps in the i.MX_Yocto_Project_User's_Guide.pdf, such as my&lt;BR /&gt;"bitbake imx-image-multimedia" command that I did; I don't believe the .pdf made&lt;BR /&gt;that clear.&lt;/P&gt;&lt;P&gt;So I previously got this working on a Linux host PC running Ubuntu 18.04.4&lt;BR /&gt;"Bionic Beaver" and flashed the resulting images onto my i.MX 8M nano board.&lt;BR /&gt;One line of many I see in my UART output is:&lt;BR /&gt;Welcome to NXP i.MX Release Distro 5.4-zeus (zeus)!&lt;BR /&gt;I followed the following very good tutorial and also added a helloworld layer as&lt;BR /&gt;it shows and had helloworld working on my target board after flashing the built&lt;BR /&gt;.wic image from the host:&lt;BR /&gt;&lt;A href="https://medium.com/the-innovation/how-to-prepare-a-helloworld-c-recipe-with-yocto-project-1f74c296a777" target="_blank"&gt;https://medium.com/the-innovation/how-to-prepare-a-helloworld-c-recipe-with-yocto-project-1f74c296a777&lt;/A&gt;&lt;BR /&gt;It is a good tutorial, for one thing, because it clearly describes the directory&lt;BR /&gt;structure and can be followed. Be careful about a typo that the author&lt;BR /&gt;put in, however. He starts out spelling helloworld.c as hello-world.c in his&lt;BR /&gt;Steps 5 and 6 then switches to helloworld.c in his Step 7. You have to catch&lt;BR /&gt;that and fix the spelling in your work when you notice the switch.&lt;/P&gt;&lt;P&gt;I used the structure that he, George Calin, showed, to make my mdns layer.&lt;/P&gt;&lt;P&gt;In my build folder, build-wayland, I created meta-mdns-so alongside the&lt;BR /&gt;meta-helloworld-app folder that I had created following the tutorial. I used&lt;BR /&gt;similar steps as given in the tutorial, including&lt;BR /&gt;bitbake-layers create-layer meta-mdns-so&lt;BR /&gt;bitbake-layers add-layer meta-mdns-so&lt;/P&gt;&lt;P&gt;This got me through Step 4 in the tutorial in a similar manner.&lt;BR /&gt;This created the following tree in meta-mdns-so (one dash indented per level):&lt;/P&gt;&lt;P&gt;conf&lt;BR /&gt;-layer.conf&lt;BR /&gt;COPYING.MIT&lt;BR /&gt;README&lt;BR /&gt;recipes-example&lt;BR /&gt;-mdns&lt;BR /&gt;--files&lt;BR /&gt;---mDNSResponder-878.200.35.tar.gz&lt;BR /&gt;--mDNSResponder_878.200.35.bb&lt;/P&gt;&lt;P&gt;Note that items followed by items that are more indented are directories.&lt;/P&gt;&lt;P&gt;Putting mDNSResponder-878.200.35.tar.gz under files I found out from&lt;BR /&gt;&lt;A href="https://wiki.yoctoproject.org/wiki/Building_your_own_recipes_from_first_principles" target="_blank"&gt;https://wiki.yoctoproject.org/wiki/Building_your_own_recipes_from_first_principles&lt;/A&gt;&lt;BR /&gt;However the information here is about seven years old and background info links&lt;BR /&gt;have rotted.&lt;BR /&gt;There's more information in the Yocto Mega Manual at&lt;BR /&gt;&lt;A href="https://www.yoctoproject.org/docs/3.0/mega-manual/mega-manual.html" target="_blank"&gt;https://www.yoctoproject.org/docs/3.0/mega-manual/mega-manual.html&lt;/A&gt; .&lt;BR /&gt;See "7.3.21.3. Makefile-Based Package"&lt;/P&gt;&lt;P&gt;Here's the recipe in mDNSResponder_878.200.35.bb that I came up with for my&lt;BR /&gt;first try:&lt;BR /&gt;----------------------------------------------------------------------&lt;BR /&gt;DESCRIPTION = "The mDNS component"&lt;BR /&gt;PRIORITY = "optional"&lt;BR /&gt;SECTION = "protocols"&lt;BR /&gt;LICENSE = "MIT"&lt;BR /&gt;LIC_FILES_CHKSUM = "file://${COMMON_LICENSE_DIR}/MIT;md5=0835ade698e0bcf8506ecda2f7b4f302"&lt;BR /&gt;SRC_URI = "file://mDNSResponder-878.200.35.tar.gz"&lt;BR /&gt;# S = "${WORKDIR}"&lt;BR /&gt;# -Shouldn't set S because BitBake expects the source to be in a dir called&lt;BR /&gt;# mDNSResponder-878.200.35 in the work dir.&lt;BR /&gt;# Don't need a do_compile step since by default BitBake starts the make command&lt;BR /&gt;# to compile the application.&lt;BR /&gt;# But need additional make options&lt;BR /&gt;EXTRA_OEMAKE = "'os="linux"' '-C "mDNSPosix"'"&lt;BR /&gt;do_install() {&lt;BR /&gt;install -d ${D}${base_libdir}&lt;BR /&gt;install -m 0755 ${WORKDIR}/mDNSResponder-878.200.35/mDNSPosix/build/prod/libdns_sd.so ${D}${base_libdir}&lt;BR /&gt;}&lt;BR /&gt;----------------------------------------------------------------------&lt;BR /&gt;I did bitbake mdns in ~/Yocto/imx-yocto-bsp/build-wayland$ .&lt;/P&gt;&lt;P&gt;When coming back to this work in a fresh terminal window I always do&lt;BR /&gt;~/Yocto/imx-yocto-bsp$ source setup-environment build-wayland&lt;BR /&gt;It puts me in my build-wayland folder: ~/Yocto/imx-yocto-bsp/build-wayland$&lt;/P&gt;&lt;P&gt;The bitbake seemed to do the compile fine, and I got content under:&lt;BR /&gt;~/Yocto/imx-yocto-bsp/build-wayland/tmp/work# find -iname *mdns*&lt;BR /&gt;Found lots, including this folder:&lt;BR /&gt;./aarch64-poky-linux/mdns/878.200.35-r0/&lt;/P&gt;&lt;P&gt;As in the helloworld tutorial:&lt;BR /&gt;Step 10. Add package to conf/local.conf in variable IMAGE_INSTALL and set the&lt;BR /&gt;details for next image&lt;BR /&gt;I added:&lt;BR /&gt;IMAGE_INSTALL_append=" mdns" after the line, 'CONF_VERSION' = "1"'.&lt;/P&gt;&lt;P&gt;I did the bitbake from my build dir: bitbake imx-image-multimedia&lt;/P&gt;&lt;P&gt;Under my deploy folder, in&lt;BR /&gt;~/Yocto/imx-yocto-bsp/build-wayland/tmp/deploy/images/imx8mnddr4evk/, I got&lt;BR /&gt;imx-image-multimedia-imx8mnddr4evk-20210211215119.rootfs.wic.bz2&lt;BR /&gt;With the up-to-date timestamp of 2021/02/11 (Thurs) 21:51:19 (0000 UTC).&lt;/P&gt;&lt;P&gt;Flashing it onto my i.MX 8M nano board, it&lt;BR /&gt;-didn't have libdns_sd.so in the /lib/ folder&lt;BR /&gt;-didn't have a /mDNSR-878.200.35 folder in root.&lt;BR /&gt;-find -iname *mdns* doesn't find mDNSR-878.200.35; finds a screenful of files.&lt;BR /&gt;-the /mDNSR-878.200.35/mDNSPosix/build/prod/ folder with its 8 build artifacts&lt;BR /&gt;wasn't there.&lt;/P&gt;&lt;P&gt;However, on the bitbake host, the 8 build artifacts were found:&lt;BR /&gt;~/Yocto/imx-yocto-bsp/build-wayland/tmp/work/aarch64-poky-linux/mdns/878.200.35-r0/mDNSResponder-878.200.35/mDNSPosix/build/prod# ls -l&lt;BR /&gt;total 9452&lt;BR /&gt;-rwxr-xr-x 1 159200 Feb 11 16:07 libdns_sd.so&lt;BR /&gt;-rwxr-xr-x 1 239856 Feb 11 16:07 libnss_mdns-0.2.so&lt;BR /&gt;-rwxr-xr-x 1 1504904 Feb 11 16:07 mDNSClientPosix&lt;BR /&gt;-rwxr-xr-x 1 1750944 Feb 11 16:07 mdnsd&lt;BR /&gt;-rwxr-xr-x 1 1481136 Feb 11 16:07 mDNSIdentify&lt;BR /&gt;-rwxr-xr-x 1 1525392 Feb 11 16:07 mDNSNetMonitor&lt;BR /&gt;-rwxr-xr-x 1 1493112 Feb 11 16:07 mDNSProxyResponderPosix&lt;BR /&gt;-rwxr-xr-x 1 1511048 Feb 11 16:07 mDNSResponderPosix&lt;/P&gt;&lt;P&gt;I concluded that the compile part was fine but my do_install command was wrong.&lt;BR /&gt;Can someone correct my recipe for me?&lt;/P&gt;&lt;P&gt;For my second try I changed only the do_install() in the recipe to this:&lt;BR /&gt;--------------------------------------------------------------------------------&lt;BR /&gt;do_install() {&lt;BR /&gt;install -t ${S} ${D}&lt;BR /&gt;install -d ${D}${base_libdir}&lt;BR /&gt;install -m 0755 ${S}/mDNSResponder-878.200.35/mDNSPosix/build/prod/libdns_sd.so ${D}${base_libdir}&lt;BR /&gt;}&lt;BR /&gt;--------------------------------------------------------------------------------&lt;BR /&gt;That's two changes, first copying from S to D to try to get the&lt;BR /&gt;mDNSResponder-878.200.35/ dir copied over to the destination, and then trying&lt;BR /&gt;the "install - m" command from S rather than WORKDIR.&lt;/P&gt;&lt;P&gt;Retrying the bitbake: bitbake imx-image-multimedia, it indicated at the end that&lt;BR /&gt;all 6968 tasks didn't need to be rerun.&lt;/P&gt;&lt;P&gt;I tried: ~/Yocto/imx-yocto-bsp/build-wayland$ bitbake -c clean mdns -- and got:&lt;BR /&gt;NOTE: Tasks Summary: Attempted 1 tasks of which 0 didn't need to be rerun and&lt;BR /&gt;all succeeded.&lt;/P&gt;&lt;P&gt;~/Yocto/imx-yocto-bsp/build-wayland$ bitbake imx-image-multimedia -- got:&lt;BR /&gt;NOTE: Tasks Summary: Attempted 6968 tasks of which 6967 didn't need to be rerun&lt;BR /&gt;and all succeeded.&lt;BR /&gt;It typically flashes and erases a bunch of activity, which it did this time. It&lt;BR /&gt;might be nice to have that remaining displayed to be able to study it.&lt;/P&gt;&lt;P&gt;It didn't update anything in:&lt;BR /&gt;~/Yocto/imx-yocto-bsp/build-wayland/tmp/deploy/images/imx8mnddr4evk#&lt;BR /&gt;No longer had mDNSResponder-878.200.35/ in&lt;BR /&gt;~/Yocto/imx-yocto-bsp/build-wayland/tmp/work/aarch64-poky-linux/mdns/878.200.35-r0/ .&lt;/P&gt;&lt;P&gt;I tried: bitbake -c cleansstate mdns -- got:&lt;BR /&gt;NOTE: Tasks Summary: Attempted 2 tasks of which 0 didn't need to be rerun and&lt;BR /&gt;all succeeded.&lt;/P&gt;&lt;P&gt;Did: ~/Yocto/imx-yocto-bsp/build-wayland$ bitbake imx-image-multimedia&lt;BR /&gt;-Got the typical bitbake output, then:&lt;BR /&gt;Sstate summary: Wanted 6 Found 0 Missed 6 Current 2580 (0% match, 99% complete)&lt;BR /&gt;NOTE: Tasks Summary: Attempted 6968 tasks of which 6954 didn't need to be rerun&lt;BR /&gt;and all succeeded.&lt;BR /&gt;This time I saw do_compile of mdns and 878.200.25 etc.&lt;/P&gt;&lt;P&gt;Again had mDNSResponder-878.200.35 in&lt;BR /&gt;~/Yocto/imx-yocto-bsp/build-wayland/tmp/work/aarch64-poky-linux/mdns/878.200.35-r0/.&lt;BR /&gt;Have the build artifacts in mDNSPosix in the host at:&lt;BR /&gt;~/Yocto/imx-yocto-bsp/build-wayland/tmp/work/aarch64-poky-linux/mdns/878.200.35-r0/mDNSResponder-878.200.35/mDNSPosix/build/prod/&lt;BR /&gt;Still don't have an updated image since Thurs Feb 11 in&lt;BR /&gt;~/Yocto/imx-yocto-bsp/build-wayland/tmp/deploy/images/imx8mnddr4evk/ .&lt;/P&gt;&lt;P&gt;Can someone correct my recipe and any other mistakes I may have made? Is it my&lt;BR /&gt;do_install()?&lt;/P&gt;&lt;P&gt;In my do_install(), I have:&lt;BR /&gt;install -m 0755 ${S}/mDNSResponder-878.200.35/mDNSPosix/build/prod/libdns_sd.so ${D}${base_libdir}&lt;BR /&gt;which is for copying it to /lib/ in D. How would I correctly write that line to&lt;BR /&gt;copy it to /lib/ under&lt;BR /&gt;~/Yocto/imx-yocto-bsp/build-wayland/tmp/work/aarch64-poky-linux/ for use to link&lt;BR /&gt;to the next module I have to build on the host?&lt;/P&gt;&lt;P&gt;In the meantime, I'll try deleting my&lt;BR /&gt;imx-image-multimedia-imx8mnddr4evk-20210211215119.rootfs.wic.bz2 and redoing the&lt;BR /&gt;bitbake.&lt;/P&gt;&lt;P&gt;Best regards,&lt;/P&gt;</description>
      <pubDate>Thu, 18 Feb 2021 16:50:48 GMT</pubDate>
      <guid>https://community.nxp.com/t5/i-MX-Processors/Building-mDNS-in-Yocto/m-p/1233022#M169678</guid>
      <dc:creator>microajim</dc:creator>
      <dc:date>2021-02-18T16:50:48Z</dc:date>
    </item>
  </channel>
</rss>

