Release

Version added 2018-03-07 20:32:00| Modified 11-Apr-2018

Now that you have developed the service and verified its execution, you are ready to add it to the webOS image and then flash it to the target device.

 

Add Service to Build Recipe

Add the web app to the packagergoup recipe file.

  • Update the file : packagegroup-webos-extended.bb

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

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

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

For more details, please see Yocto project reference manual.

 

Build WebOS Image

Build the webOS image so that it includes the JS service.

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

 

Flash Image to Target Device

Flash the updated webOS image to the SD card.

Path of webOS image : build-webos/BUILD/deploy/images/raspberrypi3/webos-image-raspberrypi3-master-yyyymmddhhmmss.rpi-sdimg

build-webos/BUILD/deploy/images/raspberrypi3$ sudo dd bs=4M if=webos-image-raspberrypi3-master-yyyymmddhhmmss.rpi-sdimg of=/dev/sdc

After booting the target device, connect to target with SSH and call "com.example.service.js" and check "ls-monitor". You will see that the service is executed as a dynamic type.

root@raspberrypi3:/# luna-send -n 1 -f luna://com.example.service.js/hello '{}'
{
    "answer": "Hello, JS Service!!",
    "returnValue": true
}
root@raspberrypi3:/# ls-monitor -l | grep example
931           com.example.service.js            /usr/bin/node                          dynamic                 MUe02Jj1
Except as noted, this content is licensed under Creative Commons Attribution 4.0 and sample code is licensed under Apache License 2.0.