mirror of
https://github.com/LibreELEC/LibreELEC.tv.git
synced 2025-07-29 13:46:49 +00:00
xorg-server: rework systemd start scripts, cleanup
Signed-off-by: Stephan Raue <stephan@openelec.tv>
This commit is contained in:
parent
27db1fa71e
commit
eea8b11d3c
@ -170,8 +170,8 @@ pre_configure_target() {
|
||||
post_makeinstall_target() {
|
||||
rm -rf $INSTALL/var/cache/xkb
|
||||
|
||||
mkdir -p $INSTALL/lib/systemd
|
||||
cp -P $PKG_DIR/scripts/xorg-configure $INSTALL/lib/systemd
|
||||
mkdir -p $INSTALL/lib/udev
|
||||
cp -P $PKG_DIR/scripts/xorg-configure $INSTALL/lib/udev
|
||||
|
||||
if [ -f $INSTALL/usr/lib/xorg/modules/extensions/libglx.so ]; then
|
||||
mv $INSTALL/usr/lib/xorg/modules/extensions/libglx.so \
|
||||
@ -193,5 +193,6 @@ post_makeinstall_target() {
|
||||
}
|
||||
|
||||
post_install() {
|
||||
enable_service xorg-server.service
|
||||
# enable_service xorg-server.service
|
||||
enable_service xorg-server.path
|
||||
}
|
||||
|
@ -23,19 +23,5 @@
|
||||
# evironment variables that are not user defined.
|
||||
################################################################################
|
||||
|
||||
################################################################################
|
||||
# setup $DISPLAY variable
|
||||
################################################################################
|
||||
|
||||
DISPLAY=":0.0"
|
||||
export DISPLAY
|
||||
|
||||
################################################################################
|
||||
# setup functions
|
||||
################################################################################
|
||||
|
||||
wait_for_xorg () {
|
||||
while [ ! -f /tmp/.X0-lock ]; do
|
||||
usleep 200000
|
||||
done
|
||||
}
|
||||
DISPLAY=":0.0"
|
||||
export DISPLAY
|
@ -20,16 +20,16 @@
|
||||
# http://www.gnu.org/copyleft/gpl.html
|
||||
################################################################################
|
||||
|
||||
. /etc/profile
|
||||
|
||||
################################################################################
|
||||
# creating needed directories and symlinks
|
||||
################################################################################
|
||||
|
||||
logger -t Xorg "creating needed directories and symlinks for driver: "$1""
|
||||
logger -t Xorg "creating needed directories and symlinks for driver: "${xorg_driver}""
|
||||
|
||||
mkdir -p /var/lib
|
||||
mkdir -p /var/run
|
||||
|
||||
logger -t Xorg "### starting Xorg with driver $1 ###"
|
||||
mkdir -p /var/lib
|
||||
mkdir -p /var/run
|
||||
|
||||
##############################################################################
|
||||
# setup xorg.conf paths
|
||||
@ -37,10 +37,10 @@ logger -t Xorg "### starting Xorg with driver $1 ###"
|
||||
|
||||
logger -t Xorg "### setup xorg.conf paths ###"
|
||||
|
||||
XORG_CONF_USER="/storage/.config/xorg.conf"
|
||||
XORG_CONF_USER_DRV="/storage/.config/xorg-$1.conf"
|
||||
XORG_CONF_DEFAULT="/etc/X11/xorg.conf"
|
||||
XORG_CONF_DEFAULT_DRV="/etc/X11/xorg-$1.conf"
|
||||
XORG_CONF_USER="/storage/.config/xorg.conf"
|
||||
XORG_CONF_USER_DRV="/storage/.config/xorg-${xorg_driver}.conf"
|
||||
XORG_CONF_DEFAULT="/etc/X11/xorg.conf"
|
||||
XORG_CONF_DEFAULT_DRV="/etc/X11/xorg-${xorg_driver}.conf"
|
||||
|
||||
##############################################################################
|
||||
# creating start options
|
||||
@ -48,24 +48,24 @@ XORG_CONF_DEFAULT_DRV="/etc/X11/xorg-$1.conf"
|
||||
|
||||
logger -t Xorg "### creating start options ###"
|
||||
|
||||
XORG_ARGS="-s 0 -noreset -allowMouseOpenFail"
|
||||
XORG_ARGS="-s 0 -noreset -allowMouseOpenFail"
|
||||
|
||||
if [ "$DEBUG" = yes -o -f $HOME/.config/debug.xorg ]; then
|
||||
XORG_ARGS="$XORG_ARGS -logverbose 6 -verbose 6"
|
||||
else
|
||||
XORG_ARGS="$XORG_ARGS -logverbose 0 -verbose 0"
|
||||
fi
|
||||
if [ "$DEBUG" = yes -o -f $HOME/.config/debug.xorg ]; then
|
||||
XORG_ARGS="$XORG_ARGS -logverbose 6 -verbose 6"
|
||||
else
|
||||
XORG_ARGS="$XORG_ARGS -logverbose 0 -verbose 0"
|
||||
fi
|
||||
|
||||
# load user defined xorg.conf, if exist
|
||||
if [ -f "$XORG_CONF_USER" ]; then
|
||||
XORG_ARGS="$XORG_ARGS -config $XORG_CONF_USER"
|
||||
elif [ -f "$XORG_CONF_USER_DRV" ]; then
|
||||
XORG_ARGS="$XORG_ARGS -config $XORG_CONF_USER_DRV"
|
||||
elif [ -f "$XORG_CONF_DEFAULT" ]; then
|
||||
XORG_ARGS="$XORG_ARGS -config $XORG_CONF_DEFAULT"
|
||||
elif [ -f "$XORG_CONF_DEFAULT_DRV" ]; then
|
||||
XORG_ARGS="$XORG_ARGS -config $XORG_CONF_DEFAULT_DRV"
|
||||
fi
|
||||
# load user defined xorg.conf, if exist
|
||||
if [ -f "$XORG_CONF_USER" ]; then
|
||||
XORG_ARGS="$XORG_ARGS -config $XORG_CONF_USER"
|
||||
elif [ -f "$XORG_CONF_USER_DRV" ]; then
|
||||
XORG_ARGS="$XORG_ARGS -config $XORG_CONF_USER_DRV"
|
||||
elif [ -f "$XORG_CONF_DEFAULT" ]; then
|
||||
XORG_ARGS="$XORG_ARGS -config $XORG_CONF_DEFAULT"
|
||||
elif [ -f "$XORG_CONF_DEFAULT_DRV" ]; then
|
||||
XORG_ARGS="$XORG_ARGS -config $XORG_CONF_DEFAULT_DRV"
|
||||
fi
|
||||
|
||||
##############################################################################
|
||||
# creating needed directories and symlinks
|
||||
@ -73,26 +73,26 @@ fi
|
||||
|
||||
logger -t Xorg "### creating needed directories and symlinks ###"
|
||||
|
||||
|
||||
if [ "$1" = "nvidia" ]; then
|
||||
ln -sf /usr/lib/libGL_nvidia.so.1 /var/lib/libGL.so
|
||||
ln -sf /usr/lib/xorg/modules/extensions/libglx_nvidia.so /var/lib/libglx.so
|
||||
elif [ "$1" = "fglrx" ]; then
|
||||
ln -sf /usr/lib/fglrx /var/run/fglrx
|
||||
ln -sf /usr/lib/libGL_fglrx.so.1 /var/lib/libGL.so
|
||||
ln -sf /usr/lib/xorg/modules/extensions/libglx_fglrx.so /var/lib/libglx.so
|
||||
elif [ "$1" = "fglrx-legacy" ]; then
|
||||
ln -sf /usr/lib/fglrx-legacy /var/run/fglrx
|
||||
ln -sf /usr/lib/libGL_fglrx.so.1 /var/lib/libGL.so
|
||||
ln -sf /usr/lib/xorg/modules/extensions/libglx_fglrx.so /var/lib/libglx.so
|
||||
else
|
||||
ln -sf /usr/lib/libGL_mesa.so.1 /var/lib/libGL.so
|
||||
ln -sf /usr/lib/xorg/modules/extensions/libglx_mesa.so /var/lib/libglx.so
|
||||
fi
|
||||
if [ "${xorg_driver}" = "nvidia" ]; then
|
||||
ln -sf /usr/lib/libGL_nvidia.so.1 /var/lib/libGL.so
|
||||
ln -sf /usr/lib/xorg/modules/extensions/libglx_nvidia.so /var/lib/libglx.so
|
||||
XORG_ARGS="$XORG_ARGS -ignoreABI"
|
||||
elif [ "${xorg_driver}" = "fglrx" ]; then
|
||||
ln -sf /usr/lib/fglrx /var/run/fglrx
|
||||
ln -sf /usr/lib/libGL_fglrx.so.1 /var/lib/libGL.so
|
||||
ln -sf /usr/lib/xorg/modules/extensions/libglx_fglrx.so /var/lib/libglx.so
|
||||
elif [ "${xorg_driver}" = "fglrx-legacy" ]; then
|
||||
ln -sf /usr/lib/fglrx-legacy /var/run/fglrx
|
||||
ln -sf /usr/lib/libGL_fglrx.so.1 /var/lib/libGL.so
|
||||
ln -sf /usr/lib/xorg/modules/extensions/libglx_fglrx.so /var/lib/libglx.so
|
||||
else
|
||||
ln -sf /usr/lib/libGL_mesa.so.1 /var/lib/libGL.so
|
||||
ln -sf /usr/lib/xorg/modules/extensions/libglx_mesa.so /var/lib/libglx.so
|
||||
fi
|
||||
|
||||
################################################################################
|
||||
# setup xorg-settings.conf
|
||||
################################################################################
|
||||
|
||||
logger -t Xorg "### starting Xorg with '$DISPLAY vt01 $XORG_ARGS' ###"
|
||||
echo "X11_ARGS=\"$XORG_ARGS\"" >> /run/X11/xorg-settings.conf
|
||||
echo "X11_ARGS=\"$XORG_ARGS\"" >> /run/X11/xorg-settings.conf
|
||||
|
@ -1,8 +0,0 @@
|
||||
[Unit]
|
||||
Description=Xorg Server configuration
|
||||
Before=graphical.target
|
||||
|
||||
[Service]
|
||||
ExecStart=/lib/systemd/xorg-configure %I
|
||||
RemainAfterExit=yes
|
||||
Type=oneshot
|
@ -0,0 +1,8 @@
|
||||
[Unit]
|
||||
Description=Xorg server configfile watcher
|
||||
|
||||
[Path]
|
||||
PathExists=/run/X11/xorg-settings.conf
|
||||
|
||||
[Install]
|
||||
WantedBy=graphical.target
|
@ -1,14 +1,9 @@
|
||||
[Unit]
|
||||
Description=Xorg Server
|
||||
Conflicts=rescue.service rescue.target installer.target
|
||||
Requisite=graphical.target
|
||||
Requires=graphical.target
|
||||
After=multi-user.target
|
||||
|
||||
# On OpenELEC X11 is on tty1. We explicitly cancel the getty here to
|
||||
# avoid any races around that.
|
||||
#Conflicts=getty@tty1.service
|
||||
#After=getty@tty1.service
|
||||
|
||||
[Service]
|
||||
Environment=DISPLAY=:0.0
|
||||
EnvironmentFile=/run/X11/xorg-settings.conf
|
||||
|
@ -27,20 +27,24 @@ GOTO="end_video"
|
||||
|
||||
# check for drivers dont use the pci substem
|
||||
LABEL="subsystem_drivers"
|
||||
KERNEL=="dovefb", TAG+="systemd", ENV{SYSTEMD_WANTS}+="xorg-configure@dove.service"
|
||||
KERNEL=="fglrx_pci", TAG+="systemd", ENV{SYSTEMD_WANTS}+="xorg-configure@fglrx.service"
|
||||
KERNEL=="fglrx_legacy_pci", TAG+="systemd", ENV{SYSTEMD_WANTS}+="xorg-configure@fglrx-legacy.service"
|
||||
KERNEL=="nvidia", TAG+="systemd", ENV{SYSTEMD_WANTS}+="xorg-configure@nvidia.service"
|
||||
KERNEL=="vboxvideo", TAG+="systemd", ENV{SYSTEMD_WANTS}+="xorg-configure@vboxvideo.service"
|
||||
KERNEL=="vmwgfx", TAG+="systemd", ENV{SYSTEMD_WANTS}+="xorg-configure@vmware.service"
|
||||
KERNEL=="dovefb", ENV{xorg_driver}="dove", GOTO="configure_xorg"
|
||||
KERNEL=="fglrx_pci", ENV{xorg_driver}="fglrx", GOTO="configure_xorg"
|
||||
KERNEL=="fglrx_legacy_pci", ENV{xorg_driver}="fglrx-legacy", GOTO="configure_xorg"
|
||||
KERNEL=="nvidia", ENV{xorg_driver}="nvidia", GOTO="configure_xorg"
|
||||
KERNEL=="vboxvideo", ENV{xorg_driver}="vboxvideo", GOTO="configure_xorg"
|
||||
KERNEL=="vmwgfx", ENV{xorg_driver}="vmware", GOTO="configure_xorg"
|
||||
GOTO="end_video"
|
||||
|
||||
# check for drivers using the pci substem
|
||||
LABEL="subsystem_pci"
|
||||
DRIVER=="i915", TAG+="systemd", ENV{SYSTEMD_WANTS}+="xorg-configure@i915.service"
|
||||
DRIVER=="nouveau", TAG+="systemd", ENV{SYSTEMD_WANTS}+="xorg-configure@nouveau.service"
|
||||
#DRIVER=="nvidia", TAG+="systemd", ENV{SYSTEMD_WANTS}+="xorg-configure@nvidia.service"
|
||||
DRIVER=="radeon", TAG+="systemd", ENV{SYSTEMD_WANTS}+="xorg-configure@radeon.service"
|
||||
DRIVER=="i915", ENV{xorg_driver}="i915", GOTO="configure_xorg"
|
||||
DRIVER=="nouveau", ENV{xorg_driver}="nouveau", GOTO="configure_xorg"
|
||||
#DRIVER=="nvidia", ENV{xorg_driver}="nvidia", GOTO="configure_xorg"
|
||||
DRIVER=="radeon", ENV{xorg_driver}="radeon", GOTO="configure_xorg"
|
||||
GOTO="end_video"
|
||||
|
||||
# configure Xorg
|
||||
LABEL="configure_xorg"
|
||||
ENV{xorg_driver}=="?*", RUN+="xorg-configure"
|
||||
|
||||
LABEL="end_video"
|
||||
|
Loading…
x
Reference in New Issue
Block a user