[yocto] Using devtool for adding a systemd service

Zoran Stojsavljevic zoran.stojsavljevic at gmail.com
Fri Nov 10 03:41:16 PST 2017


It is, after all, interesting question, you posted here, Alan!

I did something else, very different than you - I did the following!

[user at 192 poky]$ pwd
/home/user/YOCTO/oe_core_embedded/poky
[user at 192 poky]$ find . -name systemd*
./scripts/lib/wic/canned-wks/systemd-bootdisk.wks
./meta-yocto-bsp/lib/oeqa/selftest/cases/systemd_boot.py
./build/tmp/sysroots-components/core2-64/at-spi2-core/usr/lib/systemd
./build/tmp/sysroots-components/core2-64/rpm/usr/lib/rpm-plugins/systemd_
inhibit.so
./meta/lib/oeqa/runtime/cases/systemd.py
./meta/classes/systemd.bbclass
./meta/classes/systemd-boot.bbclass
./meta/recipes-devtools/systemd-bootchart
./meta/recipes-devtools/systemd-bootchart/systemd-bootchart_231.bb
./meta/recipes-core/systemd
./meta/recipes-core/systemd/systemd_234.bb
./meta/recipes-core/systemd/systemd-machine-units_1.0.bb
./meta/recipes-core/systemd/systemd-serialgetty
./meta/recipes-core/systemd/systemd.inc
./meta/recipes-core/systemd/systemd-boot_234.bb
./meta/recipes-core/systemd/systemd-compat-units.bb
./meta/recipes-core/systemd/systemd-systemctl-native.bb
./meta/recipes-core/systemd/systemd
./meta/recipes-core/systemd/systemd-systemctl
./meta/recipes-core/systemd/systemd-serialgetty.bb
[user at 192 poky]$

But we have there both packages??? We do, we do?!

*./meta/recipes-core/systemd/systemd*
*./meta/recipes-core/systemd/systemd-systemctl*

So, systemd is still present as package in basic poky master tree:
./meta/recipes-core/systemd/systemd
./meta/recipes-core/systemd/systemd-systemctl

And, here are the heads from tree posted from the qemux86-64 target
(/etc/build/):

-----------------------
Build Configuration:  |
-----------------------
DISTRO = poky
DISTRO_VERSION = 2.4
-----------------------
Layer Revisions:      |
-----------------------
meta                  = rocko:65d23bd7986615fdfb0f1717b615534a2a14ab80 --
modified
meta-poky         = rocko:65d23bd7986615fdfb0f1717b615534a2a14ab80 --
modified
meta-yocto-bsp = rocko:65d23bd7986615fdfb0f1717b615534a2a14ab80 -- modified

And, when I queried on the QEMU (qemux86-64) target both systemd and
systemctl, I get nothing (at all), which is VERY strange!?
Target CLI transcript follows:

sh-4.4# uname -r
4.12.12-yocto-standard
sh-4.4# which systemd
sh-4.4# which systemctl
sh-4.4#

Do we really have problem here, YOCTO maintainers??? Please, could you post
sound and logical explanation for NOT having these services in the default
YOCTO?

Thank you,
Zoran

On Fri, Nov 10, 2017 at 11:07 AM, Alan Martinovic <alan.martinovic at senic.com
> wrote:

> Hi,
> I need to add a systemd service that needs no additional sources
> compiled, but just needs an available command executed at boot.
>
> I've created a basis for the recipe in my layer:
>
> nrf52-usb-systemd/
> |-- files
> |   `-- btattach-nrf-acm.service
> `-- nrf52-usb-systemd.bb
>
>
> together with a recipe template (nrf52-usb-systemd.bb)
> for which I don't know if works yet.
>
>   SUMMARY = "Writes patterns to the fb device"
>   LICENSE = "MIT"
>   LIC_FILES_CHKSUM = "file://COPYING.MIT;md5=
> 3da9cfbcb788c80a0384361b4de20420"
>
>   inherit systemd
>
>   REQUIRED_DISTRO_FEATURES= "systemd"
>
>   SRC_URI = "file://btattach-nrf-acm.service"
>
>   do_install () {
>
>       install -m 0644 ${WORKDIR}/btattach-nrf-acm.service
> ${D}${sysconfdir}/systemd/system
>    }
>
>   NATIVE_SYSTEMD_SUPPORT = "1"
>   SYSTEMD_PACKAGES = "${PN}"
>   SYSTEMD_SERVICE_${PN} = "fb-draw.service"
>
>
> I'm not sure I got the install command right and
> if the service file is making it way to the proper location.
>
> Instead of building the whole image, flashing and checking
> it out, I would like to test how devtool could help here.
>
> I execute:
>
> devtool build nrf52-usb-systemd
>
> this results in a creation of a workspace with the sources files.
> What I am not seeing is a creation of a device sysroot which would
> show me that the do_install was correctly written.
>
> Given that the device sysroot directory on the host would be called
> "sysroot" was hoping to be able do confirm that the following took
> place
>
> ${D}${sysconfdir}/systemd/system -> .sysroot/etc/ssytemd/system
>
> and confirming there is a
>
> .sysroot/etc/ssytemd/system/btattach-nrf-acm.service
>
>
> Is this possible with devtool, or am I misinterpreting
> what it's purpose is?
>
>
> --
> _______________________________________________
> yocto mailing list
> yocto at yoctoproject.org
> https://lists.yoctoproject.org/listinfo/yocto
>
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.yoctoproject.org/pipermail/yocto/attachments/20171110/db6a25eb/attachment.html>


More information about the yocto mailing list