summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorHilko Bengen <bengen@hilluzination.de>2011-06-05 01:02:49 +0200
committerRichard W.M. Jones <rjones@redhat.com>2011-06-06 14:13:35 +0100
commit07489a4a44634768e79216aeb1d3ae422fd244c9 (patch)
tree0affe68a9169dea183fd9d04283566bab6601d0f
parente56ae34bcfc3e355dc591b4bd99bbe8e593d33af (diff)
downloadfebootstrap-07489a4a44634768e79216aeb1d3ae422fd244c9.tar.gz
febootstrap-07489a4a44634768e79216aeb1d3ae422fd244c9.tar.xz
febootstrap-07489a4a44634768e79216aeb1d3ae422fd244c9.zip
febootstrap/helper/init: Add translations for errno
-rw-r--r--helper/init.c19
1 files changed, 18 insertions, 1 deletions
diff --git a/helper/init.c b/helper/init.c
index 0ca3135..34a8450 100644
--- a/helper/init.c
+++ b/helper/init.c
@@ -40,6 +40,23 @@
extern long init_module (void *, unsigned long, const char *);
+/* translation taken from module-init-tools/insmod.c */
+static const char *moderror(int err)
+{
+ switch (err) {
+ case ENOEXEC:
+ return "Invalid module format";
+ case ENOENT:
+ return "Unknown symbol in module";
+ case ESRCH:
+ return "Module has wrong symbol version";
+ case EINVAL:
+ return "Invalid parameters";
+ default:
+ return strerror(err);
+ }
+}
+
/* Leave this enabled for now. When we get more confident in the boot
* process we can turn this off or make it configurable.
*/
@@ -210,7 +227,7 @@ insmod (const char *filename)
close (fd);
if (init_module (buf, st.st_size, "") != 0) {
- fprintf (stderr, "insmod: init_module: %s: %m\n", filename);
+ fprintf (stderr, "insmod: init_module: %s: %s\n", filename, moderror (errno));
/* However ignore the error because this can just happen because
* of a missing device.
*/