3 # Copyright 2011 GRNET S.A. All rights reserved.
5 # Redistribution and use in source and binary forms, with or without
6 # modification, are permitted provided that the following conditions
9 # 1. Redistributions of source code must retain the above copyright
10 # notice, this list of conditions and the following disclaimer.
12 # 2. Redistributions in binary form must reproduce the above copyright
13 # notice, this list of conditions and the following disclaimer in the
14 # documentation and/or other materials provided with the distribution.
16 # THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND
17 # ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
18 # IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
19 # ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE
20 # FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
21 # DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
22 # OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
23 # HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
24 # LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
25 # OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
28 # The views and conclusions contained in the software and documentation are
29 # those of the authors and should not be interpreted as representing official
30 # policies, either expressed or implied, of GRNET S.A.
32 . @commondir@/common.sh
36 # terminate helper vm when the script exits
37 CLEANUP+=("telinit 0")
39 if [ ! -b $FLOPPY_DEV ]; then
40 log_error "Floppy device is not present!"
43 floppy=$(mktemp -d --tmpdir floppy.XXXXXXXX)
44 CLEANUP+=("rmdir $floppy")
46 mount $FLOPPY_DEV $floppy
47 CLEANUP+=("umount $floppy")
49 if [ -f $floppy/rules ]; then
52 log_error "Floppy does not contain \`rules\' file"
55 # Image mount point...
56 target=$(mktemp -d --tmpdir target.XXXXXXXX)
57 CLEANUP+=("rmdir $target")
59 export SNF_IMAGE_TARGET=$target
61 if [ ! -d "@tasksdir@" ]; then
62 log_error "snf-image/tasks directory is missing"
65 RUN_PARTS=$(which run-parts)
66 if [ -z "$RUN_PARTS" ]; then
67 log_error "run-parts programe is missing from the system"
70 echo "Execute all snf-image tasks...."
71 $RUN_PARTS -v --exit-on-error "@tasksdir@"
73 echo "SUCCESS" > $RESULT
81 # vim: set sta sts=4 shiftwidth=4 sw=4 et ai :