increase the version number of Dragora
[dragora.git] / stages / 1 / 01-hierarchyfs
blob7c6e85434eb678a0c1ef8c9d48ebf02f8acc9491
1 # Build script for the filesystem layout (Dragora).
3 # Copyright (c) 2014-2017 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 -- "${rootdir}/usr/bin" "${rootdir}/etc" "${rootdir}/var/log"
24     cd -- "${rootdir}"
25     ln -sf usr/bin bin
28 # Handle lib<equal> directory for the multi directory support
29 if test -n "$libSuffix"
30 then
31     echo "Handling lib<equal> for ${rootdir}/usr/lib${libSuffix} ..."
32     (
33         cd -- "${rootdir}"/usr
34         mkdir -p lib${libSuffix}
35         ln -s -f lib${libSuffix} lib
36     )
38     # Make symlink of compatibility for / at $rootdir
39     cd -- "$rootdir"
40     rm -f lib
41     ln -s usr/lib${libSuffix} lib
43     echo "Making compatibility for ${rootdir}/tools/lib${libSuffix} ..."
44     cd tools
45     mkdir -p lib${libSuffix}
46     ln -s -f lib${libSuffix} lib
47 else
48     mkdir -p -- "${rootdir}/lib" "${rootdir}/tools/lib" "${rootdir}/usr/lib"
51 # Save the value of 'libSuffix'
53 if test -n "$libSuffix"
54 then
55     mkdir -p /tools/etc
56     echo "$libSuffix" > /tools/etc/stage1_is-multi-directory