Revision 58453ea9

b/Makefile.am
7 7
windows_support=no
8 8
endif
9 9

  
10
if PROGMONSUPPORT
11
progress_monitor_support=yes
12
else
13
progress_monitor_support=no
14
endif
15

  
10 16
osdir=$(OS_DIR)/$(OS_NAME)
11 17
defaultdir=$(DEFAULT_DIR)
12 18
configdir=${sysconfdir}/ganeti/instance-image
......
48 54
	   -e 's|@SFDISK[@]|$(SFDISK)|g' \
49 55
	   -e 's|@QEMU_IMG[@]|$(QEMU_IMG)|g' \
50 56
	   -e 's|@windows_support[@]|$(windows_support)|g' \
57
	   -e 's|@progress_monitor_support[@]|$(progress_monitor_support)|g' \
51 58
	   -e 's|@NTFSCLONE[@]|$(NTFSCLONE)|g' \
52 59
	   -e 's|@NTFSRESIZE[@]|$(NTFSRESIZE)|g' \
53 60
	   -e 's|@XMLSTARLET[@]|$(XMLSTARLET)|g' \
54
	   -e 's|@INSTALL_MBR[@]|$(INSTALL_MBR)|g'
61
	   -e 's|@INSTALL_MBR[@]|$(INSTALL_MBR)|g' \
62
	   -e 's|@PROGRESS_MONITOR[@]|$(PROGRESS_MONITOR)|g'
55 63
	   
56 64

  
57 65
toolsbuilddir: $(builddir)/tools
b/common.sh.in
29 29
NTFSRESIZE="@NTFSRESIZE@"
30 30
XMLSTARLET="@XMLSTARLET@"
31 31
INSTALL_MBR="@INSTALL_MBR@"
32
PROGRESS_MONITOR="@PROGRESS_MONITOR@"
32 33

  
33 34
windows_support="@windows_support@"
35
progress_monitor_support="@progress_monitor_support@"
34 36

  
35 37
CLEANUP=( )
36 38

  
b/configure.ac
10 10
AC_ARG_ENABLE(windows_support,
11 11
              AS_HELP_STRING([--disable-windows-support],
12 12
                             [disable Windows support]),
13
                             , enable_windows_support=yes)
13
              , enable_windows_support=yes)
14 14
AM_CONDITIONAL(WINSUPPORT, [test "x$enable_windows_support" = "xyes"])
15 15

  
16

  
17
# --with-progress-monitor
18
AC_ARG_WITH([progress-monitor],
19
  [AS_HELP_STRING([--with-progress-monitor=PRGRM_PATH],
20
    [path to progress-monitor program]
21
    [[snf-progress-monitor]])],
22
    [if test "$withval" = "yes" ; then
23
    AC_PATH_PROG(PROGRESS_MONITOR, [snf-progress-monitor], [], [$PATH:/usr/sbin:/sbin])
24
    if test -z "$PROGRESS_MONITOR" ; then
25
        AC_MSG_FAILURE([Could not find snf-progress-monitor.])
26
    fi
27
   else
28
       PROGRESS_MONITOR="$withval"
29
   fi],
30
   [AC_MSG_NOTICE(progress-monitor support not enabled)]
31
)
32

  
33
AM_CONDITIONAL(PROGMONSUPPORT, [test -n "$PROGRESS_MONITOR"])
34

  
16 35
# --with-os-dir=...
17 36
AC_ARG_WITH([os-dir],
18 37
  [AS_HELP_STRING([--with-os-dir=DIR],
b/create
36 36
    OS_FAMILY="windows"
37 37
fi
38 38

  
39
MONITOR="" #Empty if progress monitor support is disabled
40
if [ "progress_monitor_support" = "yes" ]; then
41
    IMAGE_SIZE="$(stat -L -c %s ${IMAGE_FILE})"
42
    MONITOR="$PROGRESS_MONITOR -i ${INSTANCE_NAME} -r ${IMAGE_SIZE}"
43
fi
44

  
39 45
if [ "$OS_FAMILY" = "linux" ]; then
40 46
    . common_linux.sh
41 47
elif [ "$OS_FAMILY" = "windows" ]; then
......
107 113

  
108 114
    if [ "${IMAGE_TYPE}" = "ntfsclone" ] ; then
109 115
        # Restore the ntfs image
110
        $NTFSCLONE --restore-image --overwrite $root_dev $IMAGE_FILE > /dev/null
116
        $MONITOR $NTFSCLONE --restore-image --overwrite $root_dev $IMAGE_FILE \
117
            > /dev/null
111 118
        # Resize it to take over the whole patition
112 119
        $NTFSRESIZE -P $root_dev
113 120

  
......
121 128
        tar pzxf $IMAGE_FILE -C $TARGET
122 129
    elif [ "${IMAGE_TYPE}" = "dump" ] ; then
123 130
        root_dump="${IMAGE_FILE}"
124
        ( cd ${TARGET}; $RESTORE -r -y -f ${root_dump} > /dev/null )
131
        ( cd ${TARGET}; $MONITOR $RESTORE -r -y -f ${root_dump} > /dev/null )
125 132

  
126 133
        if [ -n "${boot_dev}" ] ; then
127 134
            boot_dump="${IMAGE_FILE/root.dump/boot.dump}"

Also available in: Unified diff