fix typos, some refinements
[lunaix-os.git] / lunaix-os / scripts / mkrootfs-layout
1 #!/usr/bin/env bash
2
3 base="$1"
4 content="$2"
5
6 if [ -z "$base" ]; then
7     echo "please specify the working directory"
8     exit 2
9 fi
10
11 cd "$base" || exit 2
12
13 echo "creating basic layout."
14
15 mkdir bin dev sys task mnt lib usr \
16     || has_err=1
17
18 if [ -n "${content}" ]; then
19     echo "copying contents"
20
21     cp -R "${content}"/* .
22 else
23     echo "Note: no content is specified, only basic layout is created"\
24          "You may need to add them later"
25     has_err=1
26 fi
27
28 echo "ownership set to root:root"
29
30 chown -R root:root . \
31     || has_err=1
32
33 exit "${has_err:-0}"