xserver-nodm-init_3.0.bb 2.7 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172
  1. SUMMARY = "Simple Xserver Init Script (no dm)"
  2. LICENSE = "GPLv2"
  3. LIC_FILES_CHKSUM = "file://COPYING;md5=751419260aa954499f7abaabaa882bbe"
  4. SECTION = "x11"
  5. PR = "r31"
  6. SRC_URI = "file://xserver-nodm \
  7. file://Xserver \
  8. file://X11 \
  9. file://gplv2-license.patch \
  10. file://xserver-nodm.service.in \
  11. file://xserver-nodm.conf.in \
  12. file://capability.conf \
  13. "
  14. S = "${WORKDIR}"
  15. # Since we refer to ROOTLESS_X which is normally enabled per-machine
  16. PACKAGE_ARCH = "${MACHINE_ARCH}"
  17. inherit update-rc.d systemd features_check
  18. REQUIRED_DISTRO_FEATURES = "x11 ${@oe.utils.conditional('ROOTLESS_X', '1', 'pam', '', d)}"
  19. PACKAGECONFIG ??= "blank"
  20. # dpms and screen saver will be on only if 'blank' is in PACKAGECONFIG
  21. PACKAGECONFIG[blank] = ""
  22. PACKAGECONFIG[nocursor] = ""
  23. do_install() {
  24. install -d ${D}${sysconfdir}/default
  25. install xserver-nodm.conf.in ${D}${sysconfdir}/default/xserver-nodm
  26. install -d ${D}${sysconfdir}/xserver-nodm
  27. install Xserver ${D}${sysconfdir}/xserver-nodm/Xserver
  28. install -d ${D}${sysconfdir}/X11/Xsession.d
  29. install X11/Xsession.d/* ${D}${sysconfdir}/X11/Xsession.d/
  30. install X11/Xsession ${D}${sysconfdir}/X11/
  31. BLANK_ARGS="${@bb.utils.contains('PACKAGECONFIG', 'blank', '', '-s 0 -dpms', d)}"
  32. NO_CURSOR_ARG="${@bb.utils.contains('PACKAGECONFIG', 'nocursor', '-nocursor', '', d)}"
  33. if [ "${ROOTLESS_X}" = "1" ] ; then
  34. XUSER_HOME="/home/xuser"
  35. XUSER="xuser"
  36. install -D capability.conf ${D}${sysconfdir}/security/capability.conf
  37. sed -i "s:@USER@:${XUSER}:" ${D}${sysconfdir}/security/capability.conf
  38. else
  39. XUSER_HOME=${ROOT_HOME}
  40. XUSER="root"
  41. fi
  42. sed -i "s:@HOME@:${XUSER_HOME}:; s:@USER@:${XUSER}:; s:@BLANK_ARGS@:${BLANK_ARGS}:" \
  43. ${D}${sysconfdir}/default/xserver-nodm
  44. sed -i "s:@NO_CURSOR_ARG@:${NO_CURSOR_ARG}:" ${D}${sysconfdir}/default/xserver-nodm
  45. if ${@bb.utils.contains('DISTRO_FEATURES','systemd','true','false',d)}; then
  46. install -d ${D}${systemd_unitdir}/system
  47. install -m 0644 ${WORKDIR}/xserver-nodm.service.in ${D}${systemd_unitdir}/system/xserver-nodm.service
  48. sed -i "s:@USER@:${XUSER}:" ${D}${systemd_unitdir}/system/xserver-nodm.service
  49. fi
  50. if ${@bb.utils.contains('DISTRO_FEATURES','sysvinit','true','false',d)}; then
  51. install -d ${D}${sysconfdir}/init.d
  52. install xserver-nodm ${D}${sysconfdir}/init.d
  53. fi
  54. }
  55. RDEPENDS_${PN} = "xinit ${@oe.utils.conditional('ROOTLESS_X', '1', 'xuser-account libcap libcap-bin', '', d)}"
  56. INITSCRIPT_NAME = "xserver-nodm"
  57. INITSCRIPT_PARAMS = "start 9 5 . stop 20 0 1 2 3 6 ."
  58. SYSTEMD_SERVICE_${PN} = "xserver-nodm.service"
  59. RCONFLICTS_${PN} = "xserver-common (< 1.34-r9) x11-common"