post-install.multidir 3.1 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138
  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
  8. chmod 2775 var/mail
  9. chmod 1777 var/tmp
  10. # Force symlink creation for "/var/run -> /run" and "/var/lock -> /run/lock"
  11. (
  12. cd var || exit 1
  13. rm -rf run lock
  14. ln -sf /run/lock .
  15. ln -sf /run .
  16. )
  17. chmod 555 proc sys
  18. chmod 750 root
  19. chmod 1777 tmp run/lock
  20. chmod 775 usr/games usr/share/games usr/local/games var/games
  21. # Create character special files, if needed
  22. test -c dev/console || mknod -m 600 dev/console c 5 1
  23. test -c dev/null || mknod -m 666 dev/null c 1 3
  24. # Create shm directory if does not exist
  25. test -e dev/shm || mkdir -p dev/shm
  26. # Create file records for logins and logouts
  27. touch \
  28. var/log/btmp var/log/lastlog var/log/faillog var/log/wtmp var/run/utmp
  29. chgrp utmp var/log/lastlog var/run/utmp
  30. chmod 664 var/log/lastlog var/run/utmp
  31. chmod 600 var/log/btmp
  32. # Make symlinks at 'rootdir'
  33. for link_name in bin sbin
  34. do
  35. if test ! -L $link_name
  36. then
  37. rm -f $link_name
  38. ln -s -f usr/${link_name} $link_name
  39. fi
  40. done
  41. unset link_name
  42. (
  43. cd opt || exit 1
  44. ln -sf ../etc/opt etc
  45. )
  46. (
  47. cd usr || exit 1
  48. ln -sf share/doc doc
  49. ln -sf share/info info
  50. ln -sf share/man man
  51. )
  52. (
  53. cd usr/local || exit 1
  54. ln -sf share/doc doc
  55. ln -sf share/info info
  56. ln -sf share/man man
  57. )
  58. (
  59. cd var/spool || exit 1
  60. ln -sf ../mail mail
  61. )
  62. # Offer a compatible "X11R6 symlink"
  63. test -L usr/X11R6 || ( cd usr && ln -sf . X11R6 )
  64. libSuffix=X
  65. if test "$libSuffix" != X
  66. then
  67. rmdir lib usr/lib usr/local/lib 2> /dev/null
  68. # Make default library path using 'libSuffix', linking
  69. # canonical path "lib" to the library suffix directory
  70. for directory in usr usr/local
  71. do
  72. (
  73. cd "$directory" || exit 1
  74. test -d lib${libSuffix} || mkdir -p lib${libSuffix}
  75. if test ! -L lib
  76. then
  77. rm -f lib
  78. ln -s -f lib${libSuffix} lib
  79. fi
  80. )
  81. done
  82. unset directory
  83. # This is for the 'rootdir'
  84. (
  85. cd . || exit 1
  86. if test ! -L lib${libSuffix}
  87. then
  88. rm -f lib${libSuffix}
  89. ln -s -f usr/lib${libSuffix} lib${libSuffix}
  90. fi
  91. if test ! -L lib
  92. then
  93. rm -f lib
  94. ln -s -f lib${libSuffix} lib
  95. fi
  96. )
  97. else
  98. # Make canonical paths for usr/lib, usr/local/lib, with a
  99. # symlink of "/lib -> usr/lib" if 'libSuffix' is empty
  100. for directory in usr/lib usr/local/lib
  101. do
  102. test -e $directory || mkdir -p $directory
  103. done
  104. unset directory
  105. if test ! -L lib || test ! -e lib
  106. then
  107. rm -f lib
  108. ln -s -f usr/lib lib
  109. fi
  110. fi
  111. # Re-create pkgconfig directory
  112. test -e usr/lib/pkgconfig || mkdir -p usr/lib/pkgconfig
  113. test -e usr/local/lib/pkgconfig || mkdir -p usr/local/lib/pkgconfig
  114. for directory in usr/share usr/local/share
  115. do
  116. ( cd $directory && ln -sf ../lib/pkgconfig . )
  117. done
  118. unset directory