recipes: optimize lzlib and plzip
[dragora.git] / stages / 1 / 01-hierarchyfs
blob13d415b8a39b3be7d41afded8654074e467c62f2
1 # Build script for the filesystem layout (Dragora).
3 # Copyright (c) 2014-2018 Matias Fonzo, <selk@dragora.org>.
5 # Licensed under the Apache License, Version 2.0 (the "License");
6 # you may not use this file except in compliance with the License.
7 # You may obtain a copy of the License at
9 #    http://www.apache.org/licenses/LICENSE-2.0
11 # Unless required by applicable law or agreed to in writing, software
12 # distributed under the License is distributed on an "AS IS" BASIS,
13 # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
14 # See the License for the specific language governing permissions and
15 # limitations under the License.
17 # These steps here are to satisfy "13-symlinks", the complete
18 # steps are done from "recipes/config/hierarchyfs".
20 echo "Creating minimal structure of directories for 'rootdir' ..."
22 mkdir -p -- \
23  "${rootdir}/tmp" "${rootdir}/usr/bin" "${rootdir}/etc" "${rootdir}/var/log"
25     cd -- "${rootdir}"
26     chmod 1777 tmp
27     ln -sf usr/bin bin
30 # Handle lib<equal> directory for the multi directory support
31 if test -n "$libSuffix"
32 then
33     echo "Handling lib<equal> for ${rootdir}/usr/lib${libSuffix} ..."
34     (
35         cd -- "${rootdir}"/usr
36         mkdir -p lib${libSuffix}
37         ln -s -f lib${libSuffix} lib
38     )
40     # Make symlink of compatibility for / at $rootdir
41     cd -- "$rootdir"
42     rm -f lib
43     ln -s usr/lib${libSuffix} lib
45     echo "Making compatibility for ${rootdir}/tools/lib${libSuffix} ..."
46     cd tools
47     mkdir -p lib${libSuffix}
48     ln -s -f lib${libSuffix} lib
49 else
50     mkdir -p -- "${rootdir}/lib" "${rootdir}/tools/lib" "${rootdir}/usr/lib"
53 # Save the value of 'libSuffix'
55 if test -n "$libSuffix"
56 then
57     mkdir -p /tools/etc
58     echo "$libSuffix" > /tools/etc/stage1_is-multi-directory