#!/bin/sh # Start the X session once per boot, through poky's xserver-nodm chain: # /etc/xserver-nodm/Xserver -> xinit -> /etc/X11/Xsession -> x-session-manager. # Run from /etc/inittab under busybox init, or from /.bashrc when bash is PID 1. # The opt-out xserver-nodm's own init script honours. for x in $(cat /proc/cmdline); do [ "$x" = "x11=false" ] && exit 0 done # Once per boot. /tmp is a tmpfs, so the stamp goes with a reboot; set -C makes # the create atomic, so two callers cannot both start a server. (set -C; : > /tmp/.brintos-x11-started) 2>/dev/null || exit 0 # Xorg will not start without its log file, and /var/log points into # /var/volatile, which nothing on this image mounts yet (BRINTOS-2993 owns the # volatiles). Once something does, this block does nothing. if [ ! -d /var/log/ ]; then mount -t tmpfs -o mode=0755,nodev,nosuid tmpfs /var/volatile && mkdir -p /var/volatile/log /var/volatile/tmp fi LOG=/var/log/xserver-nodm.log [ -d /var/log/ ] || LOG=/tmp/xserver-nodm.log /etc/xserver-nodm/Xserver >"$LOG" 2>&1