udev-init-scripts-27.ebuild 1.8 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465
  1. # Copyright 1999-2015 Gentoo Foundation
  2. # Distributed under the terms of the GNU General Public License v2
  3. EAPI=5
  4. if [ "${PV}" = "9999" ]; then
  5. EGIT_REPO_URI="git://anongit.gentoo.org/proj/udev-gentoo-scripts.git"
  6. inherit git-r3
  7. else
  8. SRC_URI="https://dev.gentoo.org/~williamh/dist/${P}.tar.bz2"
  9. KEYWORDS="alpha amd64 arm arm64 hppa ia64 m68k ~mips ppc ppc64 s390 sh sparc x86"
  10. fi
  11. inherit eutils
  12. DESCRIPTION="udev startup scripts for openrc"
  13. HOMEPAGE="https://www.gentoo.org"
  14. LICENSE="GPL-2"
  15. SLOT="0"
  16. IUSE=""
  17. RESTRICT="test"
  18. RDEPEND=">=virtual/udev-180
  19. !<sys-fs/udev-186
  20. !<sys-apps/openrc-0.13"
  21. DEPEND="${RDEPEND}"
  22. src_prepare() {
  23. epatch_user
  24. }
  25. pkg_postinst() {
  26. # Add udev to the sysinit runlevel automatically if this is
  27. # the first install of this package.
  28. if [[ -z ${REPLACING_VERSIONS} ]]; then
  29. if [[ ! -d ${ROOT%/}/etc/runlevels/sysinit ]]; then
  30. mkdir -p "${ROOT%/}"/etc/runlevels/sysinit
  31. fi
  32. if [[ -x ${ROOT%/}/etc/init.d/udev ]]; then
  33. ln -s /etc/init.d/udev "${ROOT%/}"/etc/runlevels/sysinit/udev
  34. fi
  35. fi
  36. # Warn the user about adding udev to their sysinit runlevel
  37. if [[ -e ${ROOT%/}/etc/runlevels/sysinit ]]; then
  38. if [[ ! -e ${ROOT%/}/etc/runlevels/sysinit/udev ]]; then
  39. ewarn
  40. ewarn "You need to add udev to the sysinit runlevel."
  41. ewarn "If you do not do this,"
  42. ewarn "your system will not be able to boot!"
  43. ewarn "Run this command:"
  44. ewarn "\trc-update add udev sysinit"
  45. fi
  46. fi
  47. if ! has_version "sys-fs/eudev[rule-generator]" && \
  48. [[ -x $(type -P rc-update) ]] && rc-update show | grep udev-postmount | grep -qs 'boot\|default\|sysinit'; then
  49. ewarn "The udev-postmount service has been removed because the reasons for"
  50. ewarn "its existance have been removed upstream."
  51. ewarn "Please remove it from your runlevels."
  52. fi
  53. }