~lool/ubuntu/saucy/lxc-android-config/set-display-mir

« back to all changes in this revision

Viewing changes to etc/init/boot-hooks/set-display-mir.conf

  • Committer: Loïc Minier
  • Date: 2013-10-08 22:48:47 UTC
  • Revision ID: loic.minier@ubuntu.com-20131008224847-c4dl8m6an3b96hqf
Add set-display-mir boot-hook to create .display-mir file on boot, unless
the hook already ran; switches the default to Mir for users of SF on
system-upgrades; this should only run once on upgrades, but the current
boot-hooks don't allow this with a dep on other jobs.

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
# set-display-mir - creates .display-mir file once
 
2
 
 
3
author "Loïc Minier <loic.minier@ubuntu.com>"
 
4
description "Creates .display-mir file once"
 
5
 
 
6
# start when first boot-hooks event is emitted and before lxc-android-config
 
7
# starts as it disables SurfaceFlinger based on the Mir flag
 
8
start on boot-hooks and starting lxc-android-config
 
9
 
 
10
# NOT a task as otherwise this would block restarting lxc-android-config
 
11
 
 
12
setuid phablet
 
13
setgid phablet
 
14
chdir /home/phablet
 
15
env FLAG=.set-display-mir-done
 
16
env DISPLAY_MIR=.display-mir
 
17
 
 
18
# work needs to be done in pre-start as this really is a job with nothing to
 
19
# start
 
20
pre-start script
 
21
    # XXX this is what we should be using, but this job gets started with
 
22
    # "WHEN=every-boot" and then doesn't get the second event for
 
23
    # "WHEN=new-version"
 
24
    #if [ "$WHEN" = "new-version" ] && [ ! -e "$FLAG" ]; then
 
25
    if [ ! -e "$FLAG" ]; then
 
26
        touch "$DISPLAY_MIR" "$FLAG"
 
27
    fi
 
28
end script
 
29