diff --git a/configure.ac b/configure.ac index 3bf0814..5778a8d 100644 --- a/configure.ac +++ b/configure.ac @@ -48,10 +48,12 @@ AS_IF([test "x$enable_debug" = "xyes"], AM_CONDITIONAL([DEBUG], [test x$enable_debug = x"yes"]) # Checks for commands -AC_CHECK_PROG([RESIZE2FS], [resize2fs], [yes]) -if test x"$RESIZE2FS" != x"yes" ; then +AC_PATH_PROG([RESIZE2FS], [resize2fs], [no], [$PATH:/sbin:/usr/sbin]) +if test x"$RESIZE2FS" == x"no" ; then AC_MSG_ERROR([Please install resize2fs.]) fi +AC_SUBST(RESIZE2FS) +AC_DEFINE_UNQUOTED([RESIZEFS_PATH], ["$RESIZE2FS"], [Path to resize2fs binary]) # Options AC_ARG_WITH([systemdsystemunitdir], AS_HELP_STRING([--with-systemdsystemunitdir=DIR], diff --git a/src/disk.c b/src/disk.c index c7c680b..2129abb 100644 --- a/src/disk.c +++ b/src/disk.c @@ -32,6 +32,9 @@ files in the program, then also delete it here. ***/ +#ifdef HAVE_CONFIG_H + #include "config.h" +#endif #include @@ -178,7 +181,7 @@ gboolean disk_resize_grow(const gchar* disk_path) { } //FIXME using libparted algorithms - snprintf(command, LINE_MAX, "resize2fs %s", partition_path); + snprintf(command, LINE_MAX, RESIZEFS_PATH " %s", partition_path); exec_task(command); result = true;