OpenSDE Packages Database (without history before r20070)
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

86 lines
2.3 KiB

  1. # --- SDE-COPYRIGHT-NOTE-BEGIN ---
  2. # This copyright note is auto-generated by ./scripts/Create-CopyPatch.
  3. #
  4. # Filename: package/.../udev/udev.conf
  5. # Copyright (C) 2007 - 2008 The OpenSDE Project
  6. #
  7. # More information can be found in the files COPYING and README.
  8. #
  9. # This program is free software; you can redistribute it and/or modify
  10. # it under the terms of the GNU General Public License as published by
  11. # the Free Software Foundation; version 2 of the License. A copy of the
  12. # GNU General Public License can be found in the file COPYING.
  13. # --- SDE-COPYRIGHT-NOTE-END ---
  14. if [ "$prefix_auto" = 1 ] ; then
  15. prefix=
  16. set_confopt
  17. fi
  18. udev_devices() {
  19. local devdir="$root/lib/udev/devices"
  20. echo "Creating base nodes ..."
  21. mkdir -p "$devdir"/{pts,shm,net}
  22. chmod 1777 "$devdir/shm"
  23. ln -snf /proc/self/fd "$devdir/fd"
  24. ln -snf /proc/self/fd/0 "$devdir/stdin"
  25. ln -snf /proc/self/fd/1 "$devdir/stdout"
  26. ln -snf /proc/self/fd/2 "$devdir/stderr"
  27. ln -snf /proc/kcore "$devdir/core"
  28. forced_mknod() {
  29. local mode=
  30. case "$1" in
  31. -m) mode="$2"; shift; shift ;;
  32. --mode=*) mode=${1#*=}; shift ;;
  33. esac
  34. rm -f "$1"
  35. mknod ${mode:+--mode=$mode} "$@"
  36. add_flist "$1"
  37. }
  38. forced_mkfifo() {
  39. local mode=
  40. case "$1" in
  41. -m) mode="$2"; shift; shift ;;
  42. esac
  43. rm -f "$1"
  44. mkfifo ${mode:+-m $mode} "$@"
  45. add_flist "$1"
  46. }
  47. forced_mknod -m 0666 "$devdir/null" c 1 3
  48. forced_mknod -m 0600 "$devdir/console" c 5 1
  49. forced_mkfifo -m 0666 "$devdir/log"
  50. }
  51. udev_rules() {
  52. local rulesd=$root$sysconfdir/udev/rules.d
  53. echo "Installing our .rules files..."
  54. for x in $confdir/rules/*.rules; do
  55. [ ! -e "etc/udev/rules.d/${x##*/}" ] || echo_warning "${x##*/}: conflict detected."
  56. install -v -m 644 $x $rulesd/
  57. done
  58. }
  59. hook_add postmake 5 'udev_devices'
  60. hook_add postmake 6 'udev_rules'
  61. var_append makeopt ' ' "LD=$CC"
  62. var_append makeopt ' ' 'DEBUG=true'
  63. # FIXME: For now we have to build it static by default because of our initrd!
  64. #if [ "$SDECFG_STATIC" == "1" ]; then
  65. var_append makeopt ' ' "VOLUME_ID_STATIC=true"
  66. var_append patchfiles ' ' "$confdir/no_libvolume_id_so.diff"
  67. #fi
  68. # list of extra helpers to build and install
  69. hook_add postpatch 5 "export extras=\$( ls -1d extras/* | grep -v '\.sh' | tr '\n' ' ' )"
  70. var_append makeopt ' ' 'EXTRAS="$extras"'
  71. var_append makeinstopt ' ' 'EXTRAS="$extras"'