From 219e576cc39946ba717ac7c8db5af912a44d3aad Mon Sep 17 00:00:00 2001 From: ynakamura Date: Wed, 28 Dec 2016 14:57:00 +0900 Subject: Add switch on/off script for cluster demo v2.0: (Tadao Tanikawa) Completely rebuilt. The mapviewer and mapvier-demo are installed into porter's image only because they need AGL CES2017 Demo mock-up. To enable mapviewer-demo, execute switch_on_mapviewer-demo.sh at /usr/AGL/mapviewer-demo then reboot porter. CAUTION: After enabling mapviewer-demo, without cluster mock up which connected directly to porter board, weston on the porter board would always crash immediately after booting. If you fall into that situation, disable mapviewer-demo following instructions below. To disable mapviewer-demo, execute switch_off_mapviewer-demo.sh at /usr/AGL/mapviewer-demo then reboot porter. v1.0: (Yusuke Nakamura) This addes script to enable/disable CES2017 cluster demo to /usr/AGL/cluster-demo. Once switch_on_cluster-demo.sh is executed, this enables a service for cluster demo and sets configurations for the dmeo. Change-Id: Ie10f35ff4168095c3b3c6572579a2c4799c04578 Signed-off-by: ynakamura Signed-off-by: Tadao Tanikawa --- recipes-demo-hmi/navigation/mapviewer-demo.bb | 42 ++++++++++++++++++++++ .../mapviewer-demo/switch_off_mapviewer-demo.sh | 5 +++ .../mapviewer-demo/switch_on_mapviewer-demo.sh | 6 ++++ .../mapviewer-demo/weston-mapviewer-demo.ini | 31 ++++++++++++++++ .../mapviewer-demo/weston-mapviewer-demo.service | 16 +++++++++ .../navigation/mapviewer/mapviewer-settings.sh | 23 ++++++++++++ .../navigation/mapviewer/mapviewer.service | 7 ++-- recipes-demo-hmi/navigation/mapviewer_%.bbappend | 11 ++++++ recipes-platform/images/agl-demo-platform.bb | 9 ++++- 9 files changed, 144 insertions(+), 6 deletions(-) create mode 100644 recipes-demo-hmi/navigation/mapviewer-demo.bb create mode 100755 recipes-demo-hmi/navigation/mapviewer-demo/switch_off_mapviewer-demo.sh create mode 100755 recipes-demo-hmi/navigation/mapviewer-demo/switch_on_mapviewer-demo.sh create mode 100644 recipes-demo-hmi/navigation/mapviewer-demo/weston-mapviewer-demo.ini create mode 100644 recipes-demo-hmi/navigation/mapviewer-demo/weston-mapviewer-demo.service create mode 100755 recipes-demo-hmi/navigation/mapviewer/mapviewer-settings.sh diff --git a/recipes-demo-hmi/navigation/mapviewer-demo.bb b/recipes-demo-hmi/navigation/mapviewer-demo.bb new file mode 100644 index 000000000..86e7f93d3 --- /dev/null +++ b/recipes-demo-hmi/navigation/mapviewer-demo.bb @@ -0,0 +1,42 @@ +SUMMARY = "Setting files of mapviewer for the AGL Demonstrator @ CES2017" +DESCRIPTION = "Setting files of mapviewer for the AGL Demonstrator @ CES2017" +LICENSE = "MIT" +LIC_FILES_CHKSUM = "file://${COREBASE}/LICENSE;md5=4d92cd373abda3937c2bc47fbc49d690 \ + file://${COREBASE}/meta/COPYING.MIT;md5=3da9cfbcb788c80a0384361b4de20420" + +SECTION = "apps" + +inherit systemd + +SRC_URI = " \ + file://switch_off_mapviewer-demo.sh \ + file://switch_on_mapviewer-demo.sh \ + file://weston-mapviewer-demo.ini \ + file://weston-mapviewer-demo.service \ + " + +do_install() { + # Map viewer demo + install -d ${D}/usr/AGL/${PN} + install -m 0755 ${WORKDIR}/switch_off_${PN}.sh ${D}/usr/AGL/${PN} + install -m 0755 ${WORKDIR}/switch_on_${PN}.sh ${D}/usr/AGL/${PN} + + install -d ${D}${sysconfdir}/xdg/weston + install -m 0644 ${WORKDIR}/weston-${PN}.ini ${D}${sysconfdir}/xdg/weston/weston-${PN}.ini + + install -d ${D}${systemd_system_unitdir} + install -m 0644 ${WORKDIR}/weston-mapviewer-demo.service ${D}${systemd_system_unitdir} +} + +## DO NOT ENABLE 'weston-mapviewer-demo.service' BY DEFAULT +## +## The 'weston-mapviewer-demo.service' is exclusive of default 'weston.ini', +## it should be enabled/disabled by 'switch_on_mapviewer-demo.sh'/'switch_off_mapviewer-demo.sh'. +## +#SYSTEMD_SERVICE_${PN} = "weston-mapviewer-demo.service" + +FILES_${PN} += " \ + ${systemd_system_unitdir} \ + /usr/AGL/${PN}/ \ + ${sysconfdir}/xdg/weston/${PN} \ + " diff --git a/recipes-demo-hmi/navigation/mapviewer-demo/switch_off_mapviewer-demo.sh b/recipes-demo-hmi/navigation/mapviewer-demo/switch_off_mapviewer-demo.sh new file mode 100755 index 000000000..22fa16c7c --- /dev/null +++ b/recipes-demo-hmi/navigation/mapviewer-demo/switch_off_mapviewer-demo.sh @@ -0,0 +1,5 @@ +#!/bin/sh + +/bin/systemctl disable weston-mapviewer-demo.service +/bin/systemctl enable weston.service +/bin/systemctl disable mapviewer.service diff --git a/recipes-demo-hmi/navigation/mapviewer-demo/switch_on_mapviewer-demo.sh b/recipes-demo-hmi/navigation/mapviewer-demo/switch_on_mapviewer-demo.sh new file mode 100755 index 000000000..f61cdc700 --- /dev/null +++ b/recipes-demo-hmi/navigation/mapviewer-demo/switch_on_mapviewer-demo.sh @@ -0,0 +1,6 @@ +#!/bin/sh + +/bin/systemctl disable weston.service +/bin/systemctl enable weston-mapviewer-demo.service +/bin/systemctl enable mapviewer.service + diff --git a/recipes-demo-hmi/navigation/mapviewer-demo/weston-mapviewer-demo.ini b/recipes-demo-hmi/navigation/mapviewer-demo/weston-mapviewer-demo.ini new file mode 100644 index 000000000..9845ed99c --- /dev/null +++ b/recipes-demo-hmi/navigation/mapviewer-demo/weston-mapviewer-demo.ini @@ -0,0 +1,31 @@ +[core] +backend=drm-backend.so +shell=ivi-shell.so +virtual=1 + +[ivi-shell] +ivi-module=ivi-controller.so,wl-shell-emulator.so +ivi-input-module=ivi-input-controller.so + +[media-ctl] +device=/dev/media1 +gl-fallback=false + +[output] +name=HDMI-A-1 +transform=270 +recorder=false + +[output] +# Disable LVDS +name=LVDS-1 +mode=off + +[output] +name=virtual1 +mode=1920x1080@60 +recorder=true +ip=192.168.20.99 +port=5005 +bitrate=300000 +crop=384x368@0x0 diff --git a/recipes-demo-hmi/navigation/mapviewer-demo/weston-mapviewer-demo.service b/recipes-demo-hmi/navigation/mapviewer-demo/weston-mapviewer-demo.service new file mode 100644 index 000000000..65275cc03 --- /dev/null +++ b/recipes-demo-hmi/navigation/mapviewer-demo/weston-mapviewer-demo.service @@ -0,0 +1,16 @@ +[Unit] +Description=Weston reference Wayland compositor +Conflicts=getty@tty1.service +After=dbus.service rc.pvr.service + +[Service] +ExecStartPre=/sbin/ifconfig eth0 192.168.20.93 +ExecStartPre=/bin/rm -rf /home/root/.cache/gstreamer-1.0 +#ExecStartPre=/bin/sleep 10 +ExecStart=/usr/bin/weston-launch -u root -- --idle-time=4294967 --gst-record --config=weston-mapviewer-demo.ini +ExecStop=/usr/bin/killall -s KILL weston +Type=simple + +[Install] +WantedBy=multi-user.target +Alias=weston.service diff --git a/recipes-demo-hmi/navigation/mapviewer/mapviewer-settings.sh b/recipes-demo-hmi/navigation/mapviewer/mapviewer-settings.sh new file mode 100755 index 000000000..d1ebb20b8 --- /dev/null +++ b/recipes-demo-hmi/navigation/mapviewer/mapviewer-settings.sh @@ -0,0 +1,23 @@ +#!/bin/sh +LMC=/usr/bin/LayerManagerControl +IFS=$'\n' + +SURFACEID=16777216 + +while : +do + /bin/sleep 1 + surfaces=() + for line in $($LMC get surfaces 2> /dev/null); do + if [ "X-" = "X$(echo $line | awk '{print $1}')" ]; then + surfaceid=$(echo $line | awk '{print $3}') + if [ "$surfaceid" = "$SURFACEID" ]; then + $LMC set surface $SURFACEID source region 0 0 384 368 + $LMC set surface $SURFACEID destination region 0 0 384 368 + $LMC set surface $SURFACEID visibility 1 + $LMC set layer 1000 render order $SURFACEID + exit + fi + fi + done +done diff --git a/recipes-demo-hmi/navigation/mapviewer/mapviewer.service b/recipes-demo-hmi/navigation/mapviewer/mapviewer.service index 5a78843c7..eba4a0dd0 100644 --- a/recipes-demo-hmi/navigation/mapviewer/mapviewer.service +++ b/recipes-demo-hmi/navigation/mapviewer/mapviewer.service @@ -11,12 +11,9 @@ Environment=NAVI_DATA_DIR=/var/mapdata/navi_data_UK/japan_TR9 XDG_RUNTIME_DIR=/r ExecStartPre=/bin/sleep 5 ExecStart=/usr/bin/mapview ExecStartPost=/usr/bin/LayerManagerControl create layer 1000 1920 1080 -ExecStartPost=/usr/bin/LayerManagerControl set layer 1000 render order 0x1000000 -ExecStartPost=/usr/bin/LayerManagerControl set surface 0x1000000 source region 0 0 384 368 -ExecStartPost=/usr/bin/LayerManagerControl set surface 0x000000 destination region 0 0 384 368 -ExecStartPost=/usr/bin/LayerManagerControl set screen 1 render order 1000 ExecStartPost=/usr/bin/LayerManagerControl set layer 1000 visibility 1 -ExecStartPost=/usr/bin/LayerManagerControl set surface 0x1000000 visibility 1 +ExecStartPost=/usr/bin/LayerManagerControl set screen 1 render order 1000 +ExecStartPost=/usr/AGL/mapviewer/mapviewer-settings.sh ExecStop=/usr/bin/killall -s KILL mapview Type=simple diff --git a/recipes-demo-hmi/navigation/mapviewer_%.bbappend b/recipes-demo-hmi/navigation/mapviewer_%.bbappend index 3049a6741..a4eebfb4f 100644 --- a/recipes-demo-hmi/navigation/mapviewer_%.bbappend +++ b/recipes-demo-hmi/navigation/mapviewer_%.bbappend @@ -1,6 +1,7 @@ FILESEXTRAPATHS_append := ":${THISDIR}/${PN}" SRC_URI_append = "\ + file://mapviewer-settings.sh \ file://mapviewer.service \ " @@ -9,12 +10,22 @@ inherit systemd SYSTEMD_PACKAGES = "${PN}" do_install_append() { + install -d ${D}/usr/AGL/${PN} + install -m 0755 ${WORKDIR}/mapviewer-settings.sh ${D}/usr/AGL/${PN}/ + # Install systemd unit files if ${@bb.utils.contains('DISTRO_FEATURES', 'systemd', 'true', 'false', d)}; then install -m 644 -p -D ${WORKDIR}/mapviewer.service ${D}${systemd_system_unitdir}/mapviewer.service fi } +## DO NOT ENABLE 'weston-mapviewer-demo.service' BY DEFAULT +## +## This should be enabled/disabled by 'switch_on_mapviewer-demo.sh'/'switch_off_mapviewer-demo.sh'. +## +#SYSTEMD_SERVICE_${PN} = "mapviewer.service" + FILES_${PN} += " \ ${systemd_system_unitdir}/mapviewer.service \ + /usr/AGL/mapviewer/ \ " diff --git a/recipes-platform/images/agl-demo-platform.bb b/recipes-platform/images/agl-demo-platform.bb index 4fd141c6e..2c9047e1e 100644 --- a/recipes-platform/images/agl-demo-platform.bb +++ b/recipes-platform/images/agl-demo-platform.bb @@ -52,6 +52,13 @@ IMAGE_MOST_HVAC_append_porter = " \ can-lin \ " +# mapviewer and mapviewer-demo requires AGL CES2017 demo mock-up +IMAGE_MAPVIEWER = " " +IMAGE_MAPVIEWER_append_porter = " \ + mapviewer \ + mapviewer-demo \ + " + IMAGE_AGL_APPS = " \ hvac \ mediaplayer \ @@ -70,7 +77,7 @@ IMAGE_INSTALL_append = " \ dhcp-client \ navigation \ poiapp \ - mapviewer \ + ${IMAGE_MAPVIEWER} \ ${IMAGE_MOST_HVAC} \ ${IMAGE_AGL_APPS} \ ${IMAGE_TTF_FONTS} \ -- cgit 1.2.3-korg