Check for mke2fs in sbin dirs, configure path into linuxdisk plugin
authorHilko Bengen <bengen@debian.org>
Fri, 28 Feb 2020 13:16:06 +0000 (14:16 +0100)
committerHilko Bengen <bengen@debian.org>
Fri, 10 May 2024 10:38:26 +0000 (12:38 +0200)
Gbp-Pq: Name 0004-Check-for-mke2fs-in-sbin-dirs-configure-path-into-li.patch

configure.ac
plugins/linuxdisk/filesystem.c

index d37ef485296745c57fd3851885b07a66f1e36dbc..02664dc4f0524649c56de276297d0bf2c85bce85 100644 (file)
@@ -1483,11 +1483,14 @@ AC_ARG_ENABLE([linuxdisk],
     [],
     [enable_linuxdisk=check])
 
+AC_PATH_PROG([MKE2FS], [mke2fs], [no], [$PATH:/usr/local/sbin:/usr/sbin:/sbin])
+AC_DEFINE_UNQUOTED([MKE2FS], ["$MKE2FS"], [path to mke2fs binary])
+
 mke2fs_with_d=no
 AS_IF([test "$enable_linuxdisk" != "no"], [
     AC_MSG_CHECKING([for mke2fs supporting the -d option])
-    AS_IF([mke2fs -V >/dev/null 2>&1], [
-        AS_IF([LANG=C mke2fs -d 2>&1 | grep -sq "option requires an argument"], [
+    AS_IF([$MKE2FS -V >/dev/null 2>&1], [
+        AS_IF([LANG=C $MKE2FS -d 2>&1 | grep -sq "option requires an argument"], [
             mke2fs_with_d=yes
         ])
     ])
index 3e4e2f3a5abc1d8c9e9d1f55d02be44d3f52b911..92b064ea2ed810747240b443eaaa47030475898c 100644 (file)
@@ -219,7 +219,7 @@ mke2fs (const char *filename)
     return -1;
   }
 
-  fprintf (fp, "mke2fs -q -F -t %s ", type);
+  fprintf (fp, MKE2FS " -q -F -t %s ", type);
   if (label) {
     fprintf (fp, "-L ");
     shell_quote (label, fp);