root / example / hooks / linux / overlays @ 981845ed
History | View | Annotate | Download (1.3 kB)
1 | 84472880 | Lance Albertson | #!/bin/bash |
---|---|---|---|
2 | 84472880 | Lance Albertson | |
3 | 84472880 | Lance Albertson | # Copyright (C) 2010 Oregon State University |
4 | 84472880 | Lance Albertson | # |
5 | 84472880 | Lance Albertson | # This program is free software; you can redistribute it and/or modify |
6 | 84472880 | Lance Albertson | # it under the terms of the GNU General Public License as published by |
7 | 84472880 | Lance Albertson | # the Free Software Foundation; either version 2 of the License, or |
8 | 84472880 | Lance Albertson | # (at your option) any later version. |
9 | 84472880 | Lance Albertson | # |
10 | 84472880 | Lance Albertson | # This program is distributed in the hope that it will be useful, but |
11 | 84472880 | Lance Albertson | # WITHOUT ANY WARRANTY; without even the implied warranty of |
12 | 84472880 | Lance Albertson | # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU |
13 | 84472880 | Lance Albertson | # General Public License for more details. |
14 | 84472880 | Lance Albertson | # |
15 | 84472880 | Lance Albertson | # You should have received a copy of the GNU General Public License |
16 | 84472880 | Lance Albertson | # along with this program; if not, write to the Free Software |
17 | 84472880 | Lance Albertson | # Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA |
18 | 84472880 | Lance Albertson | # 02110-1301, USA. |
19 | 84472880 | Lance Albertson | # |
20 | 84472880 | Lance Albertson | # Copy files from an overlay directory into an instance. This assumes the same |
21 | 84472880 | Lance Albertson | # filesystem structure as the system. |
22 | 84472880 | Lance Albertson | |
23 | 84472880 | Lance Albertson | set -e |
24 | 84472880 | Lance Albertson | |
25 | 84472880 | Lance Albertson | . common.sh |
26 | 7be1e51e | Nikos Skalkotos | . common_linux.sh |
27 | 84472880 | Lance Albertson | |
28 | 84472880 | Lance Albertson | debug set -x |
29 | 84472880 | Lance Albertson | |
30 | 84472880 | Lance Albertson | if [ -z "${TARGET}" -o ! -d "${TARGET}" ] ; then |
31 | 84472880 | Lance Albertson | log_error "Missing target directory" |
32 | 84472880 | Lance Albertson | exit 1 |
33 | 84472880 | Lance Albertson | fi |
34 | 84472880 | Lance Albertson | |
35 | 84472880 | Lance Albertson | if [ -n "${OVERLAY}" ] ; then |
36 | 84472880 | Lance Albertson | local overlay="${OVERLAYS_DIR}/${OVERLAY}" |
37 | 84472880 | Lance Albertson | if [ ! -d "${overlay}" ] ; then |
38 | 84472880 | Lance Albertson | log_error "${overlay} not found" |
39 | 84472880 | Lance Albertson | fi |
40 | 84472880 | Lance Albertson | # copy overlay files into target instance |
41 | 84472880 | Lance Albertson | cp -a ${overlay} ${TARGET} |
42 | 84472880 | Lance Albertson | fi |
43 | 84472880 | Lance Albertson | |
44 | 84472880 | Lance Albertson | exit 0 |