dragora-installer: apply fixes and minor changes
[dragora.git] / recipes / data / hierarchyfs / post-install.multidir
blobf2241a64aa80d0e5578cc3c29321a3133a039b88
1 # Ownerships and permissions
3 chown root:games  usr/games usr/share/games usr/local/games var/games
4 chown root:log    var/log
5 chown root:mail   var/mail
6 chown root:lp     var/spool/lpd
7 chown root:news   var/spool/news
9 chmod 775         var/log var/run
10 chmod 2775        var/mail
11 chmod 1777        var/lock var/tmp
13 chmod 555         proc sys
14 chmod 750         root
15 chmod 1777        tmp
16 chmod 775         usr/games usr/share/games usr/local/games var/games
18 # Create character special files, if needed
19 test -c dev/console || mknod -m 600 dev/console c 5 1
20 test -c dev/null || mknod -m 666 dev/null c 1 3
22 # Create shm directory if does not exist
23 test -e dev/shm || mkdir -p dev/shm
25 # Create file records for logins and logouts
26 touch var/log/btmp var/log/lastlog var/log/faillog var/log/wtmp \
27       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
33 # Make symlinks at 'rootdir'
35 for link in bin lib sbin
37     if test ! -e $link
38     then
39         ln -sf usr/${link} $link
40     fi
41 done
42 unset link
45     cd opt || exit 1
46     ln -sf ../etc/opt etc
49     cd usr || exit 1
50     ln -sf share/doc   doc
51     ln -sf share/info  info
52     ln -sf share/man   man
55     cd usr/share || exit 1
56     ln -sf ../lib/pkgconfig pkgconfig
59     cd usr/local || exit 1
60     ln -sf share/doc   doc
61     ln -sf share/info  info
62     ln -sf share/man   man
65     cd usr/local/share || exit 1
66     ln -sf ../lib/pkgconfig pkgconfig
69     cd var/spool || exit 1
70     ln -sf ../mail mail
73 libSuffix=X
75 if test "$libSuffix" != X
76 then
77     if test ! -e usr/lib${libSuffix}
78     then
79         (
80             cd usr || exit 1
81             rmdir lib/pkgconfig lib/ 2> /dev/null
83             mkdir -p lib${libSuffix}
84             ln -s -f lib${libSuffix} lib
85         )
86     fi
87     if test ! -e usr/local/lib${libSuffix}
88     then
89         (
90             cd usr/local || exit 1
91             rmdir lib/pkgconfig lib/ 2> /dev/null
93             mkdir -p lib${libSuffix}
94             ln -s -f lib${libSuffix} lib
95         )
96     fi
98     # Re-create pkgconfig directory
100     mkdir -p usr/lib/pkgconfig usr/local/lib/pkgconfig
102     rm -f lib
103     ln -s usr/lib${libSuffix} lib