summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorRichard W.M. Jones <rjones@redhat.com>2010-12-06 12:22:58 +0000
committerRichard W.M. Jones <rjones@redhat.com>2010-12-06 12:22:58 +0000
commit72e9f7c254ff235ab25dc42952e7069099ad35da (patch)
treee1d2cd7996569705b3c21c655be1e48080615fa0
parent60baadc1b201d35b30f23220a44994964936820d (diff)
downloadfebootstrap-72e9f7c254ff235ab25dc42952e7069099ad35da.tar.gz
febootstrap-72e9f7c254ff235ab25dc42952e7069099ad35da.tar.xz
febootstrap-72e9f7c254ff235ab25dc42952e7069099ad35da.zip
configure: Check for insmod.static and fail if not present.
This is not packaged on Debian/Ubuntu, but we require it. Fail with a useful error message if it is not available.
-rw-r--r--README5
-rw-r--r--configure.ac16
-rw-r--r--helper/ext2initrd.c4
3 files changed, 22 insertions, 3 deletions
diff --git a/README b/README
index 6545756..b2288c0 100644
--- a/README
+++ b/README
@@ -40,6 +40,11 @@ Requirements
/sbin/mke2fs
- These are part of e2fsprogs.
+ /sbin/insmod.static
+ - This is part of module-init-tools. Note that Debian does NOT
+ package this, you have to build it yourself (or copy the file
+ from a Fedora machine which also works ...)
+
Optional
--------
(but you will need a package manager for your Linux distro)
diff --git a/configure.ac b/configure.ac
index d1b334d..21dd340 100644
--- a/configure.ac
+++ b/configure.ac
@@ -64,7 +64,21 @@ dnl For Debian handler.
AC_CHECK_PROG(APTITUDE,[aptitude],[aptitude],[no])
AC_CHECK_PROG(DPKG,[dpkg],[dpkg],[no])
-dnl Required e2fsprogs, libs.
+dnl Required programs, libraries.
+AC_PATH_PROG([INSMODSTATIC],[insmod.static],[no])
+if test "x$INSMODSTATIC" = "xno" ; then
+ AC_MSG_FAILURE([insmod.static program not found
+
+Is /sbin in your current path?
+
+Note that Debian/Ubuntu do not package this file from module-init-tools.
+Sorry, please fix your distribution. In the meantime you can copy
+/sbin/insmod.static from a Fedora machine.
+])
+fi
+AC_DEFINE_UNQUOTED([INSMODSTATIC],["$INSMODSTATIC"],
+ [Full path to the insmod.static program.])
+
AC_PATH_PROG([MKE2FS],[mke2fs],[no])
if test "x$MKE2FS" = "xno" ; then
AC_MSG_FAILURE([mke2fs program not found (is /sbin in your current path?)])
diff --git a/helper/ext2initrd.c b/helper/ext2initrd.c
index c981232..f10aef2 100644
--- a/helper/ext2initrd.c
+++ b/helper/ext2initrd.c
@@ -144,12 +144,12 @@ ext2_make_initrd (const char *modpath, const char *initrd)
free_module_deps ();
/* Copy in insmod static binary. */
- cmd = xasprintf ("cp /sbin/insmod.static %s", dir);
+ cmd = xasprintf ("cp %s %s", INSMODSTATIC, dir);
if (verbose >= 2) fprintf (stderr, "%s\n", cmd);
r = system (cmd);
if (r == -1 || WEXITSTATUS (r) != 0)
error (EXIT_FAILURE, 0,
- "ext2_make_initrd: copy /sbin/insmod.static failed");
+ "ext2_make_initrd: copy %s failed", INSMODSTATIC);
free (cmd);
/* Copy in the init program, linked into this program as a data blob. */