-
Notifications
You must be signed in to change notification settings - Fork 102
/
run-luna-sysmgr.sh
executable file
·96 lines (83 loc) · 2.66 KB
/
run-luna-sysmgr.sh
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
#!/bin/bash
# @@@LICENSE
#
# Copyright (c) 2012 Hewlett-Packard Development Company, L.P.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.
#
# LICENSE@@@
set -x
export SCRIPT_DIR=$PWD
source ./webos-desktop-common.sh
STAGING_DIR="${LUNA_STAGING}"
BIN_DIR="${STAGING_DIR}/bin"
LIB_DIR="${STAGING_DIR}/lib"
USRLIB_DIR="${STAGING_DIR}/usr/lib"
ETC_DIR="${STAGING_DIR}/etc"
REDIRECT=""
function terminateBrowserServer {
killall -q BrowserServer
}
if [ "$1" = "--help" ] ; then
echo "Usage: ./run-luna-sysmgr.sh [OPTION]"
echo "Runs the luna-sysmgr component."
echo " "
echo "Optional arguments:"
echo " --help display this help and exit"
echo " -q redirect console output to /tmp/webos/LunaSysMgr.log"
echo " "
exit
elif [ "$1" = "--version" ] ; then
echo "Desktop run script for Open webOS #7"
exit
elif [ "$1" = "-q" ] ; then
REDIRECT="-q"
elif [ -n "$1" ] ; then
echo "Parameter $1 not recognized"
exit
elif [ ! -d ${STAGING_DIR} ] || [ ! -x ${ROOTFS}/usr/lib/luna/LunaSysMgr ]; then
echo "First build luna-sysmgr"
exit
fi
DEB_BUILD_MULTIARCH=$(dpkg-architecture -qDEB_BUILD_MULTIARCH)
export LD_PRELOAD=/lib/${DEB_BUILD_MULTIARCH}/libSegFault.so
export LD_LIBRARY_PATH=${LIB_DIR}:${USRLIB_DIR}:${LD_LIBRARY_PATH}
export PATH=${BIN_DIR}:${PATH}
# Make Qt aware of this path (the qbsplugin is here)
export QT_PLUGIN_PATH=${LUNA_STAGING}/plugins
export QT_QPA_FONTDIR=${ROOTFS}/usr/share/fonts
# To catch the CTRL-C
trap terminateBrowserServer SIGINT
if [ -d /etc/palm ] && [ -h /etc/palm ] ; then
mkdir -p /tmp/webos
echo "Starting BrowserServer ..."
# Start the browser server
${BIN_DIR}/BrowserServer > /tmp/webos/BrowserServer.log &
echo "Starting LunaSysMgr ..."
export QT_QPA_PLATFORM=xcb
cd ${ROOTFS}
if [ -n "${REDIRECT}" ] ; then
./usr/lib/luna/LunaSysMgr > /tmp/webos/LunaSysMgr.log &
else
./usr/lib/luna/LunaSysMgr &
fi
sleep 2
if [ -n "${REDIRECT}" ] ; then
./usr/lib/luna/WebAppMgr > /tmp/webos/WebappMgr.log
else
./usr/lib/luna/WebAppMgr
fi
else
echo "First run the install script: sudo ./install-luna-sysmgr.sh"
fi
terminateBrowserServer