~kgunn72/mir/snappy-packaging-with-secprofile

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
#!/bin/bash

# Wait for the tty to be brought up (we want to steal VT from it, not have it
# be stolen by agetty)

ttycount=0

while ! pidof /sbin/agetty; do
    sleep 0.1
    ttycount=`expr $ttycount + 1`
      if [ "$ttycount" -gt 50 ]
      then
        break
      fi
done


sleep 1 # give it a moment to come up

# OK, now we can start the server
mir_demo_server --window-manager fullscreen --file /run/mir_socket --vt 1 $@ &

# Can't use --arw-file with vivid version of mir_demo_server_minimal...

mircount=0
while ! [ -S /run/mir_socket ]; do
    sleep 0.1
    mircount=`expr $mircount + 1`
      if [ "$mircount" -gt 50 ]
      then
        break
      fi
done
sleep 5 # race with mir for chmod'ing the socket
chmod a+rw /run/mir_socket

wait