mesa_start-dm.sh 2.3 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980
  1. #!/bin/sh
  2. read_config() {
  3. FILE=$1
  4. KEY=$2
  5. LINE=$(grep "^$KEY=" $FILE)
  6. VALUE=${LINE#$KEY=}
  7. }
  8. DISPLAY_MANAGER=xdm
  9. XCURSOR_THEME=
  10. PLYMOUTH_TRANSITION=false
  11. test -r /etc/default/xdm && . /etc/default/xdm
  12. test -r /etc/conf.d/xdm && . /etc/conf.d/xdm
  13. DM_PATH=
  14. DESKTOP_FILE=/usr/share/display-managers/$DISPLAY_MANAGER.desktop
  15. if [ -f $DESKTOP_FILE ]; then
  16. read_config $DESKTOP_FILE Exec
  17. DM_PATH=$VALUE
  18. read_config $DESKTOP_FILE X-Pardus-XCursorTheme
  19. test -n "$VALUE" && XCURSOR_THEME=$VALUE
  20. read_config $DESKTOP_FILE X-Pardus-PlymouthTransition
  21. test -n "$VALUE" && PLYMOUTH_TRANSITION=$VALUE
  22. fi
  23. test -x "$DM_PATH" || DM_PATH=/usr/bin/xdm
  24. PATH=/sbin:/usr/sbin:/bin:/usr/bin
  25. test -f /etc/env.d/03locale && . /etc/env.d/03locale
  26. export LC_ALL PATH XCURSOR_THEME
  27. if [ "x$1" = "x--boot" ]; then
  28. for x in `grep -o -e "xorg=\w*" /proc/cmdline`; do
  29. case "$x" in
  30. xorg=safe)
  31. MESA_LIBGL=/usr/lib/mesa/libGL.so.1.2.0
  32. if [ "$(readlink /etc/alternatives/libGL)" != "$MESA_LIBGL" ]; then
  33. /usr/sbin/alternatives --set libGL /usr/lib/mesa/libGL.so.1.2.0
  34. /sbin/ldconfig -X
  35. fi
  36. DRIVER=vesa
  37. test -c /dev/fb0 && DRIVER=fbdev
  38. export XORGCONFIG=/usr/share/X11/xorg-safe-$DRIVER.conf
  39. ;;
  40. xorg=probe)
  41. test -f /etc/X11/xorg.conf && mv -f /etc/X11/xorg.conf /etc/X11/xorg.conf.$(date +%Y%m%d)
  42. ;;
  43. esac
  44. done
  45. fi
  46. # Trigger events against a locale change. This is needed for
  47. # determining the default keymap.
  48. udevadm trigger --property-match=ID_INPUT_KEYBOARD=1
  49. # Start first boot wizard if needed
  50. if test -f /etc/yali/yali.conf -a -x /usr/bin/start-yali && \
  51. grep -e "^installation *= *firstboot" /etc/yali/yali.conf; then
  52. /usr/bin/start-yali
  53. # First boot wizard removes itself after the last screen. If it
  54. # still exists at this time, this would mean a reboot or shutdown
  55. # requested by the user. In this case, we will not start the
  56. # display manager.
  57. test -f /usr/bin/start-yali && exit 0
  58. sleep 1
  59. fi
  60. if [ "$PLYMOUTH_TRANSITION" != "true" ]; then
  61. test -x /bin/plymouth && /bin/plymouth --ping && /bin/plymouth quit
  62. fi
  63. exec $DM_PATH -nodaemon