diff options
author | Tudor Florea <tudor.florea@enea.com> | 2015-10-09 22:59:03 +0200 |
---|---|---|
committer | Tudor Florea <tudor.florea@enea.com> | 2015-10-09 22:59:03 +0200 |
commit | 972dcfcdbfe75dcfeb777150c136576cf1a71e99 (patch) | |
tree | 97a61cd7e293d7ae9d56ef7ed0f81253365bb026 /meta/recipes-graphics/x11-common/xserver-nodm-init/xserver-nodm | |
download | poky-972dcfcdbfe75dcfeb777150c136576cf1a71e99.tar.gz |
initial commit for Enea Linux 5.0 arm
Signed-off-by: Tudor Florea <tudor.florea@enea.com>
Diffstat (limited to 'meta/recipes-graphics/x11-common/xserver-nodm-init/xserver-nodm')
-rwxr-xr-x | meta/recipes-graphics/x11-common/xserver-nodm-init/xserver-nodm | 64 |
1 files changed, 64 insertions, 0 deletions
diff --git a/meta/recipes-graphics/x11-common/xserver-nodm-init/xserver-nodm b/meta/recipes-graphics/x11-common/xserver-nodm-init/xserver-nodm new file mode 100755 index 0000000000..ef6c11c3f2 --- /dev/null +++ b/meta/recipes-graphics/x11-common/xserver-nodm-init/xserver-nodm | |||
@@ -0,0 +1,64 @@ | |||
1 | #!/bin/sh | ||
2 | # | ||
3 | ### BEGIN INIT INFO | ||
4 | # Provides: xserver | ||
5 | # Required-Start: $local_fs $remote_fs dbus | ||
6 | # Required-Stop: $local_fs $remote_fs | ||
7 | # Default-Start: 5 | ||
8 | # Default-Stop: 0 1 2 3 6 | ||
9 | ### END INIT INFO | ||
10 | |||
11 | killproc() { # kill the named process(es) | ||
12 | pid=`/bin/pidof $1` | ||
13 | [ "$pid" != "" ] && kill $pid | ||
14 | } | ||
15 | |||
16 | read CMDLINE < /proc/cmdline | ||
17 | for x in $CMDLINE; do | ||
18 | case $x in | ||
19 | x11=false) | ||
20 | echo "X Server disabled" | ||
21 | exit 0; | ||
22 | ;; | ||
23 | esac | ||
24 | done | ||
25 | |||
26 | case "$1" in | ||
27 | start) | ||
28 | . /etc/profile | ||
29 | username=root | ||
30 | echo "Starting Xserver" | ||
31 | if [ -f /etc/X11/Xusername ]; then | ||
32 | username=`cat /etc/X11/Xusername` | ||
33 | # setting for rootless X | ||
34 | chmod o+w /var/log | ||
35 | chmod g+r /dev/tty[0-3] | ||
36 | # hidraw device is probably needed | ||
37 | if [ -e /dev/hidraw0 ]; then | ||
38 | chmod o+rw /dev/hidraw* | ||
39 | fi | ||
40 | fi | ||
41 | # Using su rather than sudo as latest 1.8.1 cause failure [YOCTO #1211] | ||
42 | su -l -c '/etc/X11/Xserver&' $username | ||
43 | # Wait for the desktop to say its finished loading | ||
44 | # before loading the rest of the system | ||
45 | # dbus-wait org.matchbox_project.desktop Loaded | ||
46 | ;; | ||
47 | |||
48 | stop) | ||
49 | echo "Stopping XServer" | ||
50 | killproc xinit | ||
51 | ;; | ||
52 | |||
53 | restart) | ||
54 | $0 stop | ||
55 | sleep 1 | ||
56 | $0 start | ||
57 | ;; | ||
58 | |||
59 | *) | ||
60 | echo "usage: $0 { start | stop | restart }" | ||
61 | ;; | ||
62 | esac | ||
63 | |||
64 | exit 0 | ||