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() {
|
post_makeinstall_target() {
|
||||||
rm -rf $INSTALL/var/cache/xkb
|
rm -rf $INSTALL/var/cache/xkb
|
||||||
|
|
||||||
mkdir -p $INSTALL/lib/systemd
|
mkdir -p $INSTALL/lib/udev
|
||||||
cp -P $PKG_DIR/scripts/xorg-configure $INSTALL/lib/systemd
|
cp -P $PKG_DIR/scripts/xorg-configure $INSTALL/lib/udev
|
||||||
|
|
||||||
if [ -f $INSTALL/usr/lib/xorg/modules/extensions/libglx.so ]; then
|
if [ -f $INSTALL/usr/lib/xorg/modules/extensions/libglx.so ]; then
|
||||||
mv $INSTALL/usr/lib/xorg/modules/extensions/libglx.so \
|
mv $INSTALL/usr/lib/xorg/modules/extensions/libglx.so \
|
||||||
@ -193,5 +193,6 @@ post_makeinstall_target() {
|
|||||||
}
|
}
|
||||||
|
|
||||||
post_install() {
|
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.
|
# evironment variables that are not user defined.
|
||||||
################################################################################
|
################################################################################
|
||||||
|
|
||||||
################################################################################
|
DISPLAY=":0.0"
|
||||||
# setup $DISPLAY variable
|
export DISPLAY
|
||||||
################################################################################
|
|
||||||
|
|
||||||
DISPLAY=":0.0"
|
|
||||||
export DISPLAY
|
|
||||||
|
|
||||||
################################################################################
|
|
||||||
# setup functions
|
|
||||||
################################################################################
|
|
||||||
|
|
||||||
wait_for_xorg () {
|
|
||||||
while [ ! -f /tmp/.X0-lock ]; do
|
|
||||||
usleep 200000
|
|
||||||
done
|
|
||||||
}
|
|
@ -20,16 +20,16 @@
|
|||||||
# http://www.gnu.org/copyleft/gpl.html
|
# http://www.gnu.org/copyleft/gpl.html
|
||||||
################################################################################
|
################################################################################
|
||||||
|
|
||||||
|
. /etc/profile
|
||||||
|
|
||||||
################################################################################
|
################################################################################
|
||||||
# creating needed directories and symlinks
|
# 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/lib
|
||||||
mkdir -p /var/run
|
mkdir -p /var/run
|
||||||
|
|
||||||
logger -t Xorg "### starting Xorg with driver $1 ###"
|
|
||||||
|
|
||||||
##############################################################################
|
##############################################################################
|
||||||
# setup xorg.conf paths
|
# setup xorg.conf paths
|
||||||
@ -37,10 +37,10 @@ logger -t Xorg "### starting Xorg with driver $1 ###"
|
|||||||
|
|
||||||
logger -t Xorg "### setup xorg.conf paths ###"
|
logger -t Xorg "### setup xorg.conf paths ###"
|
||||||
|
|
||||||
XORG_CONF_USER="/storage/.config/xorg.conf"
|
XORG_CONF_USER="/storage/.config/xorg.conf"
|
||||||
XORG_CONF_USER_DRV="/storage/.config/xorg-$1.conf"
|
XORG_CONF_USER_DRV="/storage/.config/xorg-${xorg_driver}.conf"
|
||||||
XORG_CONF_DEFAULT="/etc/X11/xorg.conf"
|
XORG_CONF_DEFAULT="/etc/X11/xorg.conf"
|
||||||
XORG_CONF_DEFAULT_DRV="/etc/X11/xorg-$1.conf"
|
XORG_CONF_DEFAULT_DRV="/etc/X11/xorg-${xorg_driver}.conf"
|
||||||
|
|
||||||
##############################################################################
|
##############################################################################
|
||||||
# creating start options
|
# creating start options
|
||||||
@ -48,24 +48,24 @@ XORG_CONF_DEFAULT_DRV="/etc/X11/xorg-$1.conf"
|
|||||||
|
|
||||||
logger -t Xorg "### creating start options ###"
|
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
|
if [ "$DEBUG" = yes -o -f $HOME/.config/debug.xorg ]; then
|
||||||
XORG_ARGS="$XORG_ARGS -logverbose 6 -verbose 6"
|
XORG_ARGS="$XORG_ARGS -logverbose 6 -verbose 6"
|
||||||
else
|
else
|
||||||
XORG_ARGS="$XORG_ARGS -logverbose 0 -verbose 0"
|
XORG_ARGS="$XORG_ARGS -logverbose 0 -verbose 0"
|
||||||
fi
|
fi
|
||||||
|
|
||||||
# load user defined xorg.conf, if exist
|
# load user defined xorg.conf, if exist
|
||||||
if [ -f "$XORG_CONF_USER" ]; then
|
if [ -f "$XORG_CONF_USER" ]; then
|
||||||
XORG_ARGS="$XORG_ARGS -config $XORG_CONF_USER"
|
XORG_ARGS="$XORG_ARGS -config $XORG_CONF_USER"
|
||||||
elif [ -f "$XORG_CONF_USER_DRV" ]; then
|
elif [ -f "$XORG_CONF_USER_DRV" ]; then
|
||||||
XORG_ARGS="$XORG_ARGS -config $XORG_CONF_USER_DRV"
|
XORG_ARGS="$XORG_ARGS -config $XORG_CONF_USER_DRV"
|
||||||
elif [ -f "$XORG_CONF_DEFAULT" ]; then
|
elif [ -f "$XORG_CONF_DEFAULT" ]; then
|
||||||
XORG_ARGS="$XORG_ARGS -config $XORG_CONF_DEFAULT"
|
XORG_ARGS="$XORG_ARGS -config $XORG_CONF_DEFAULT"
|
||||||
elif [ -f "$XORG_CONF_DEFAULT_DRV" ]; then
|
elif [ -f "$XORG_CONF_DEFAULT_DRV" ]; then
|
||||||
XORG_ARGS="$XORG_ARGS -config $XORG_CONF_DEFAULT_DRV"
|
XORG_ARGS="$XORG_ARGS -config $XORG_CONF_DEFAULT_DRV"
|
||||||
fi
|
fi
|
||||||
|
|
||||||
##############################################################################
|
##############################################################################
|
||||||
# creating needed directories and symlinks
|
# creating needed directories and symlinks
|
||||||
@ -73,26 +73,26 @@ fi
|
|||||||
|
|
||||||
logger -t Xorg "### creating needed directories and symlinks ###"
|
logger -t Xorg "### creating needed directories and symlinks ###"
|
||||||
|
|
||||||
|
if [ "${xorg_driver}" = "nvidia" ]; then
|
||||||
if [ "$1" = "nvidia" ]; then
|
ln -sf /usr/lib/libGL_nvidia.so.1 /var/lib/libGL.so
|
||||||
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
|
||||||
ln -sf /usr/lib/xorg/modules/extensions/libglx_nvidia.so /var/lib/libglx.so
|
XORG_ARGS="$XORG_ARGS -ignoreABI"
|
||||||
elif [ "$1" = "fglrx" ]; then
|
elif [ "${xorg_driver}" = "fglrx" ]; then
|
||||||
ln -sf /usr/lib/fglrx /var/run/fglrx
|
ln -sf /usr/lib/fglrx /var/run/fglrx
|
||||||
ln -sf /usr/lib/libGL_fglrx.so.1 /var/lib/libGL.so
|
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
|
ln -sf /usr/lib/xorg/modules/extensions/libglx_fglrx.so /var/lib/libglx.so
|
||||||
elif [ "$1" = "fglrx-legacy" ]; then
|
elif [ "${xorg_driver}" = "fglrx-legacy" ]; then
|
||||||
ln -sf /usr/lib/fglrx-legacy /var/run/fglrx
|
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/libGL_fglrx.so.1 /var/lib/libGL.so
|
||||||
ln -sf /usr/lib/xorg/modules/extensions/libglx_fglrx.so /var/lib/libglx.so
|
ln -sf /usr/lib/xorg/modules/extensions/libglx_fglrx.so /var/lib/libglx.so
|
||||||
else
|
else
|
||||||
ln -sf /usr/lib/libGL_mesa.so.1 /var/lib/libGL.so
|
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
|
ln -sf /usr/lib/xorg/modules/extensions/libglx_mesa.so /var/lib/libglx.so
|
||||||
fi
|
fi
|
||||||
|
|
||||||
################################################################################
|
################################################################################
|
||||||
# setup xorg-settings.conf
|
# setup xorg-settings.conf
|
||||||
################################################################################
|
################################################################################
|
||||||
|
|
||||||
logger -t Xorg "### starting Xorg with '$DISPLAY vt01 $XORG_ARGS' ###"
|
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]
|
[Unit]
|
||||||
Description=Xorg Server
|
Description=Xorg Server
|
||||||
Conflicts=rescue.service rescue.target installer.target
|
Conflicts=rescue.service rescue.target installer.target
|
||||||
Requisite=graphical.target
|
Requires=graphical.target
|
||||||
After=multi-user.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]
|
[Service]
|
||||||
Environment=DISPLAY=:0.0
|
Environment=DISPLAY=:0.0
|
||||||
EnvironmentFile=/run/X11/xorg-settings.conf
|
EnvironmentFile=/run/X11/xorg-settings.conf
|
||||||
|
@ -27,20 +27,24 @@ GOTO="end_video"
|
|||||||
|
|
||||||
# check for drivers dont use the pci substem
|
# check for drivers dont use the pci substem
|
||||||
LABEL="subsystem_drivers"
|
LABEL="subsystem_drivers"
|
||||||
KERNEL=="dovefb", TAG+="systemd", ENV{SYSTEMD_WANTS}+="xorg-configure@dove.service"
|
KERNEL=="dovefb", ENV{xorg_driver}="dove", GOTO="configure_xorg"
|
||||||
KERNEL=="fglrx_pci", TAG+="systemd", ENV{SYSTEMD_WANTS}+="xorg-configure@fglrx.service"
|
KERNEL=="fglrx_pci", ENV{xorg_driver}="fglrx", GOTO="configure_xorg"
|
||||||
KERNEL=="fglrx_legacy_pci", TAG+="systemd", ENV{SYSTEMD_WANTS}+="xorg-configure@fglrx-legacy.service"
|
KERNEL=="fglrx_legacy_pci", ENV{xorg_driver}="fglrx-legacy", GOTO="configure_xorg"
|
||||||
KERNEL=="nvidia", TAG+="systemd", ENV{SYSTEMD_WANTS}+="xorg-configure@nvidia.service"
|
KERNEL=="nvidia", ENV{xorg_driver}="nvidia", GOTO="configure_xorg"
|
||||||
KERNEL=="vboxvideo", TAG+="systemd", ENV{SYSTEMD_WANTS}+="xorg-configure@vboxvideo.service"
|
KERNEL=="vboxvideo", ENV{xorg_driver}="vboxvideo", GOTO="configure_xorg"
|
||||||
KERNEL=="vmwgfx", TAG+="systemd", ENV{SYSTEMD_WANTS}+="xorg-configure@vmware.service"
|
KERNEL=="vmwgfx", ENV{xorg_driver}="vmware", GOTO="configure_xorg"
|
||||||
GOTO="end_video"
|
GOTO="end_video"
|
||||||
|
|
||||||
# check for drivers using the pci substem
|
# check for drivers using the pci substem
|
||||||
LABEL="subsystem_pci"
|
LABEL="subsystem_pci"
|
||||||
DRIVER=="i915", TAG+="systemd", ENV{SYSTEMD_WANTS}+="xorg-configure@i915.service"
|
DRIVER=="i915", ENV{xorg_driver}="i915", GOTO="configure_xorg"
|
||||||
DRIVER=="nouveau", TAG+="systemd", ENV{SYSTEMD_WANTS}+="xorg-configure@nouveau.service"
|
DRIVER=="nouveau", ENV{xorg_driver}="nouveau", GOTO="configure_xorg"
|
||||||
#DRIVER=="nvidia", TAG+="systemd", ENV{SYSTEMD_WANTS}+="xorg-configure@nvidia.service"
|
#DRIVER=="nvidia", ENV{xorg_driver}="nvidia", GOTO="configure_xorg"
|
||||||
DRIVER=="radeon", TAG+="systemd", ENV{SYSTEMD_WANTS}+="xorg-configure@radeon.service"
|
DRIVER=="radeon", ENV{xorg_driver}="radeon", GOTO="configure_xorg"
|
||||||
GOTO="end_video"
|
GOTO="end_video"
|
||||||
|
|
||||||
|
# configure Xorg
|
||||||
|
LABEL="configure_xorg"
|
||||||
|
ENV{xorg_driver}=="?*", RUN+="xorg-configure"
|
||||||
|
|
||||||
LABEL="end_video"
|
LABEL="end_video"
|
||||||
|
Loading…
x
Reference in New Issue
Block a user