Version added 07-Mar-2018| Modified 15-Oct-2018

Now you are ready to package the native service in the webOS image.

Add Service to Build Recipe

Add the service to the package recipe file.

  • Update the file :

  • Directory : build-webos/meta-webosose/meta-webos/recipes-core/packagegroups

  • Updates to be made: Add the service name to RDEPENDS _ $ {PN} =

RDEPENDS_${PN} = " \
    activitymanager \
    audiod \
    com.example.service.native \
    ${VIRTUAL-RUNTIME_appinstalld} \

For more details, please see Yocto project reference manual.

Modify Systemd Execution List on webos-initscripts

Modify the webos-initscripts component which is responsible for systemd configuration in webOS. Through this process, you can learn how to modify a built-in component in webOS.

  1. Download the webos-initscripts component source from GitHub ( to your local system.

    In this document, we download the webos-initscripts component to ~/project/webOS/webos-initscripts.

    ~/project/webOS$ git clone
  2. Specify the order of execution of the newly created native service.

    In this example, adding the service to the last line ensures that it is executed last.

    • Update the file :

    • Directory : ~/project/webOS/webos-initscripts/files/systemd/targets

    • Updates : Add the service name (com.example.service.native.service) to the last line.

      Wants=nyx-utils.service \
      	      second-screen-gateway.service \
  3. Specify the path of the webos-initscripts local source directory in the build.

    • Update the file : webos-local.conf

    • Directory : build-webos

      INHERIT += "externalsrc"
      EXTERNALSRC_pn-com.example.service.native = "/home/username/project/webOS/com.example.service.native/"
      EXTERNALSRC_BUILD_pn-com.example.service.native = "/home/username/project/webOS/com.example.service.native/build/"
      PR_append_pn-com.example.service.native =".local0"
      EXTERNALSRC_pn-webos-initscripts = "/home/username/project/webOS/webos-initscripts/"
      EXTERNALSRC_BUILD_pn-webos-initscripts = "/home/username/project/webOS/webos-initscripts/build"
      PR_append_pn-webos-initscripts =".local0"
  4. Build webos-initscripts on build-webos.

    We can check webos-initscripts on local directory if built successfully.

    build-webos$ source oe-init-build-env
    build-webos$ bitbake webos-initscripts

Build the webOS and Flash it on Target

  1. Build the webos-image.

    build-webos$ source oe-init-build-env
    build-webos$ bitbake webos-image
  2. Flash the generated webos-image to SD card.

    build-webos/BUILD/deploy/images/raspberrypi3$ sudo dd bs=4M if=webos-image-raspberrypi3-master-yyyymmddhhmmss.rpi-sdimg of=/dev/sdc
  3. After booting, connect to target with SSH.

    If you look at the service list with ls-monitor, you can see com.example.service.native is executed as static type.

    $ ssh root@
    root@raspberrypi3:~# ls-monitor -l | grep example
    542           com.example.service.native        /usr/sbin/com.example.service.native    static                  4dTPKKQI
Except as noted, this content is licensed under Creative Commons Attribution 4.0 and sample code is licensed under Apache License 2.0.