post-install.multidir 2.2 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106
  1. # Ownerships and permissions
  2. chown root:games usr/games usr/share/games usr/local/games var/games
  3. chown root:log var/log
  4. chown root:mail var/mail
  5. chown root:lp var/spool/lpd
  6. chown root:news var/spool/news
  7. chmod 775 var/log var/run
  8. chmod 2775 var/mail
  9. chmod 1777 var/lock var/tmp
  10. chmod 555 proc sys
  11. chmod 750 root
  12. chmod 1777 tmp
  13. chmod 775 usr/games usr/share/games usr/local/games var/games
  14. # Create character special files, if needed
  15. test -c dev/console || mknod -m 600 dev/console c 5 1
  16. test -c dev/null || mknod -m 666 dev/null c 1 3
  17. # Create shm directory if does not exist
  18. test -e dev/shm || mkdir -p dev/shm
  19. # Create file records for logins and logouts
  20. touch var/log/btmp var/log/lastlog var/log/faillog var/log/wtmp \
  21. var/run/utmp
  22. chgrp utmp var/log/lastlog var/run/utmp
  23. chmod 664 var/log/lastlog var/run/utmp
  24. chmod 600 var/log/btmp
  25. # Make symlinks at 'rootdir'
  26. for link in bin lib sbin
  27. do
  28. if test ! -e $link
  29. then
  30. ln -sf usr/${link} $link
  31. fi
  32. done
  33. unset link
  34. (
  35. cd opt || exit 1
  36. ln -sf ../etc/opt etc
  37. )
  38. (
  39. cd usr || exit 1
  40. ln -sf share/doc doc
  41. ln -sf share/info info
  42. ln -sf share/man man
  43. )
  44. (
  45. cd usr/share || exit 1
  46. ln -sf ../lib/pkgconfig pkgconfig
  47. )
  48. (
  49. cd usr/local || exit 1
  50. ln -sf share/doc doc
  51. ln -sf share/info info
  52. ln -sf share/man man
  53. )
  54. (
  55. cd usr/local/share || exit 1
  56. ln -sf ../lib/pkgconfig pkgconfig
  57. )
  58. (
  59. cd var/spool || exit 1
  60. ln -sf ../mail mail
  61. )
  62. libSuffix=X
  63. if test "$libSuffix" != X
  64. then
  65. if test ! -e usr/lib${libSuffix}
  66. then
  67. (
  68. cd usr || exit 1
  69. rmdir lib/pkgconfig lib/ 2> /dev/null
  70. mkdir -p lib${libSuffix}
  71. ln -s -f lib${libSuffix} lib
  72. )
  73. fi
  74. if test ! -e usr/local/lib${libSuffix}
  75. then
  76. (
  77. cd usr/local || exit 1
  78. rmdir lib/pkgconfig lib/ 2> /dev/null
  79. mkdir -p lib${libSuffix}
  80. ln -s -f lib${libSuffix} lib
  81. )
  82. fi
  83. # Re-create pkgconfig directory
  84. mkdir -p usr/lib/pkgconfig usr/local/lib/pkgconfig
  85. rm -f lib
  86. ln -s usr/lib${libSuffix} lib
  87. fi