Permalink
Browse files

Support Desktop build

Change-Id: I3fbfc9f9516de4447d1f0edb72644861734379c6
  • Loading branch information...
1 parent 42a572b commit 9df7c4f7c480f0f41855d914ad0ab3f2b6377f99 @RS102839 RS102839 committed Aug 29, 2012
View
@@ -0,0 +1,29 @@
+# @@@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@@@
+
+# Common Eclipse project files
+.project
+.cproject
+
+# Ignore the build artifacts.
+BUILD*/
+/build
+release-*/
+debug-*/
+patches/
+
@@ -0,0 +1,14 @@
+{
+ "role": {
+ "exeName":"/usr/lib/luna/configurator",
+ "type": "privileged",
+ "allowedNames": ["com.palm.configurator"]
+ },
+ "permissions": [
+ {
+ "service":"com.palm.configurator",
+ "inbound":["*"],
+ "outbound":["*"]
+ }
+ ]
+}
@@ -0,0 +1,4 @@
+[D-BUS Service]
+Name=com.palm.configurator
+Exec=/usr/lib/luna/configurator -c {\"log\":{\"appender\":{\"type\":\"syslog\"},\"levels\":{\"configurator\":\"notice\"}}} service
+Type=dynamic
@@ -0,0 +1,14 @@
+# AM may crash or be stopped manually. Need to re-register the activities
+# in this case
+start on activitymanager-ready
+
+# Need to make sure that AM doesn't hang when it emits it's upstart signal
+# This is actually not safe, as it can cause upstart to eat the events.
+# The Activity Manager will call the configurator directly.
+service
+
+# The file cache & db kinds need to be configured first
+script
+ logger -s "Configuring activities asynchronously"
+ /usr/lib/luna/luna-send -n 1 palm://com.palm.configurator/run '{"types":["activities"]}'
+end script
@@ -0,0 +1,57 @@
+# not ideal - would like to start this on started mojodb and filecache-ready
+# but our upstart doesn't support this (0.5 needed AFAIK)
+start on stopped finish
+
+# AM may crash or be stopped manually. Need to re-register the activities
+# in this case
+# AM now starts the configurator directly though a service call
+# start on activitymanager-ready
+
+# Some activities can only be registered once first use has completed (otherwise activity
+# manager will launch apps during first use when they don't expect to be running).
+start on first-use-finished
+start on first-use-profile-created
+
+# Need to make sure that AM doesn't hang when it emits it's upstart signal
+# This is actually not safe, as it can cause upstart to eat the events.
+# The Activity Manager will call the configurator directly.
+# service
+
+# The file cache & db kinds need to be configured first
+script
+ if [ "x$UPSTART_EVENT" = "xstopped" ]; then
+ # This is the "stopped finish" event - first pass we register file cache and dbkinds
+ logger -s "Configuring dbkinds & filecache"
+ /usr/lib/luna/luna-send -n 1 palm://com.palm.configurator/run '{"types":["dbkinds","filecache"]}'
+ # This has to happen *after* the kinds are created.
+ logger -s "Configuring dbpermissions"
+ /usr/lib/luna/luna-send -n 1 palm://com.palm.configurator/run '{"types":["dbpermissions"]}'
+ fi
+
+ # Notify it is safe to run the activity manager if it hasn't started already
+ initctl emit datastore-initialized
+
+ # Now we configure activities doesn't matter if it hasn't started yet
+ # Rely on ls2 delivering the messages once it does
+
+ # The only time we care about the first use distiction is when we're registering
+ # activities - behaviour is the same - just the flag is different
+ #
+ # Don't do this. The Activity Manager will call the configurator directly
+ # to work around the upstart issue.
+
+ #POST_FIRST_USE=0
+ #if [ -f "/var/luna/preferences/ran-first-use" ] && [ -f "/var/luna/preferences/first-use-profile-created" ]; then
+ # POST_FIRST_USE=1
+ #fi
+
+ #if [ $POST_FIRST_USE -eq 1 ]; then
+ # logger -s "Configuring activities"
+ # luna-send -n 1 palm://com.palm.configurator/run '{"types":["activities"]}'
+ #else
+ # logger -s "Configuring activities prior to first-use"
+ # luna-send -n 1 palm://com.palm.configurator/run '{"types":["activities-first-use"]}'
+ #fi
+ logger -s "Configuring activities"
+ /usr/lib/luna/luna-send -n 1 palm://com.palm.configurator/run '{"types":["activities"]}'
+end script

0 comments on commit 9df7c4f

Please sign in to comment.