stages: 2/04-iso: Do not include kernel build/source tree in the LiveCD
[dragora.git] / recipes / data / hierarchyfs / post-install.multidir
blob42a2e329657f17ff996aa8053e689540e6d7dbd3
2 # Ownerships and permissions
4 chown root:games  usr/games usr/share/games usr/local/games var/games
5 chown root:log    var/log
6 chown root:mail   var/mail
7 chown root:lp     var/spool/lpd
8 chown root:news   var/spool/news
10 chmod 775         var/log
11 chmod 2775        var/mail
12 chmod 1777        var/tmp
14 # Force symlink creation for "/var/run -> /run" and "/var/lock -> /run/lock"
16     cd var || exit 1
17     rm -rf run lock
18     ln -sf /run/lock .
19     ln -sf /run .
22 chmod 555         proc sys
23 chmod 750         root
24 chmod 1777        tmp run/lock
25 chmod 775         usr/games usr/share/games usr/local/games var/games
27 # Create character special files, if needed
28 test -c dev/console || mknod -m 600 dev/console c 5 1
29 test -c dev/null || mknod -m 666 dev/null c 1 3
31 # Create shm directory if does not exist
32 test -e dev/shm || mkdir -p dev/shm
34 # Create file records for logins and logouts
35 touch \
36  var/log/btmp var/log/lastlog var/log/faillog var/log/wtmp var/run/utmp
38 chgrp utmp  var/log/lastlog var/run/utmp
39 chmod 664   var/log/lastlog var/run/utmp
40 chmod 600   var/log/btmp
42 # Make symlinks at 'rootdir'
44 for link_name in bin sbin
46     if test ! -L $link_name
47     then
48         rm -f $link_name
49         ln -s -f usr/${link_name} $link_name
50     fi
51 done
52 unset link_name
55     cd opt || exit 1
56     ln -sf ../etc/opt etc
59     cd usr || exit 1
60     ln -sf share/doc   doc
61     ln -sf share/info  info
62     ln -sf share/man   man
65     cd usr/local || exit 1
66     ln -sf share/doc   doc
67     ln -sf share/info  info
68     ln -sf share/man   man
71     cd var/spool || exit 1
72     ln -sf ../mail mail
75 # Offer a compatible "X11R6 symlink"
76 test -L usr/X11R6 || ( cd usr && ln -sf . X11R6 )
78 libSuffix=X
80 if test "$libSuffix" != X
81 then
82      rmdir lib usr/lib usr/local/lib 2> /dev/null
84      # Make default library path using 'libSuffix', linking
85      # canonical path "lib" to the library suffix directory
86      for directory in usr usr/local
87      do
88          (
89              cd "$directory" || exit 1
90              test -d lib${libSuffix} || mkdir -p lib${libSuffix}
91              if test ! -L lib
92              then
93                  rm -f lib
94                  ln -s -f lib${libSuffix} lib
95              fi
96          )
97      done
98      unset directory
99      # This is for the 'rootdir'
100      (
101          cd . || exit 1
102          if test ! -L lib${libSuffix}
103          then
104              rm -f lib${libSuffix}
105              ln -s -f usr/lib${libSuffix} lib${libSuffix}
106          fi
107          if test ! -L lib
108          then
109              rm -f lib
110              ln -s -f lib${libSuffix} lib
111          fi
112      )
113 else
114     # Make canonical paths for usr/lib, usr/local/lib, with a
115     # symlink of "/lib -> usr/lib" if 'libSuffix' is empty
116     for directory in usr/lib usr/local/lib
117     do
118         test -e $directory || mkdir -p $directory
119     done
120     unset directory
121     if test ! -L lib || test ! -e lib
122     then
123         rm -f lib
124         ln -s -f usr/lib lib
125     fi
128 # Re-create pkgconfig directory
129 test -e usr/lib/pkgconfig || mkdir -p usr/lib/pkgconfig
130 test -e usr/local/lib/pkgconfig || mkdir -p usr/local/lib/pkgconfig
132 for directory in usr/share usr/local/share
134     ( cd $directory && ln -sf ../lib/pkgconfig . )
135 done
136 unset directory