git.annexia.org
/
febootstrap.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
|
inline
| side by side (parent:
e56ae34
)
febootstrap/helper/init: Add translations for errno
author
Hilko Bengen
<bengen@hilluzination.de>
Sat, 4 Jun 2011 23:02:49 +0000
(
01:02
+0200)
committer
Richard W.M. Jones
<rjones@redhat.com>
Mon, 6 Jun 2011 13:13:35 +0000
(14:13 +0100)
helper/init.c
patch
|
blob
|
history
diff --git
a/helper/init.c
b/helper/init.c
index
0ca3135
..
34a8450
100644
(file)
--- a/
helper/init.c
+++ b/
helper/init.c
@@
-40,6
+40,23
@@
extern long init_module (void *, unsigned long, const char *);
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.
*/
/* 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) {
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.
*/
/* However ignore the error because this can just happen because
* of a missing device.
*/