static-dev-0.1.ebuild 1.1 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445
  1. # Copyright 1999-2015 Gentoo Foundation
  2. # Distributed under the terms of the GNU General Public License v2
  3. EAPI="5"
  4. DESCRIPTION="A skeleton, statically managed /dev"
  5. HOMEPAGE="https://bugs.gentoo.org/107875"
  6. SRC_URI=""
  7. LICENSE="GPL-2"
  8. SLOT="0"
  9. KEYWORDS="alpha amd64 arm hppa ia64 m68k ~mips ppc ppc64 s390 sh sparc x86"
  10. IUSE=""
  11. RDEPEND="sys-apps/makedev"
  12. DEPEND="${RDEPEND}"
  13. abort() {
  14. echo
  15. eerror "We have detected that you currently use udev or devfs or devtmpfs"
  16. eerror "and this ebuild cannot install to the same mount-point."
  17. die "Cannot install on udev/devfs tmpfs."
  18. }
  19. pkg_pretend() {
  20. if [[ ${MERGE_TYPE} == "buildonly" ]] ; then
  21. # User is just compiling which is fine -- all our checks are merge-time.
  22. return
  23. fi
  24. # We want to not clobber udev (tmpfs) or older devfs setups.
  25. if [[ -d ${ROOT}/dev/.udev || -c ${ROOT}/dev/.devfs ]] ; then
  26. abort
  27. fi
  28. # We also want to not clobber newer devtmpfs setups.
  29. if [[ ${ROOT} == "/" ]] && \
  30. ! awk '$2 == "/dev" && $3 == "devtmpfs" { exit 1 }' /proc/mounts ; then
  31. abort
  32. fi
  33. }
  34. pkg_postinst() {
  35. MAKEDEV -d "${ROOT}"/dev generic sg scd rtc hde hdf hdg hdh input audio video
  36. }