diff options
author | Daniel M. Weeks <dan@danweeks.net> | 2014-04-07 18:39:16 -0400 |
---|---|---|
committer | Linus Torvalds <torvalds@linux-foundation.org> | 2014-04-07 19:36:11 -0400 |
commit | 6aa7a29aa8378fa868fabef6a84b0a40d5d9d677 (patch) | |
tree | 42db878266aeaa77a8af91d3ddbbdc8ece3f83a1 /lib | |
parent | 16caed319604609a5579df132fce362a456170d7 (diff) |
initramfs: debug detected compression method
This can greatly aid in narrowing down the real source of initramfs
problems such as failures related to the compression of the in-kernel
initramfs when an external initramfs is in use as well. Existing errors
are ambiguous as to which initramfs is a problem and why.
[akpm@linux-foundation.org: use pr_debug()]
Signed-off-by: Daniel M. Weeks <dan@danweeks.net>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
Diffstat (limited to 'lib')
-rw-r--r-- | lib/decompress.c | 3 |
1 files changed, 3 insertions, 0 deletions
diff --git a/lib/decompress.c b/lib/decompress.c index 4d1cd0397aab..86069d74c062 100644 --- a/lib/decompress.c +++ b/lib/decompress.c | |||
@@ -16,6 +16,7 @@ | |||
16 | #include <linux/types.h> | 16 | #include <linux/types.h> |
17 | #include <linux/string.h> | 17 | #include <linux/string.h> |
18 | #include <linux/init.h> | 18 | #include <linux/init.h> |
19 | #include <linux/printk.h> | ||
19 | 20 | ||
20 | #ifndef CONFIG_DECOMPRESS_GZIP | 21 | #ifndef CONFIG_DECOMPRESS_GZIP |
21 | # define gunzip NULL | 22 | # define gunzip NULL |
@@ -61,6 +62,8 @@ decompress_fn __init decompress_method(const unsigned char *inbuf, int len, | |||
61 | if (len < 2) | 62 | if (len < 2) |
62 | return NULL; /* Need at least this much... */ | 63 | return NULL; /* Need at least this much... */ |
63 | 64 | ||
65 | pr_debug("Compressed data magic: %#.2x %#.2x\n", inbuf[0], inbuf[1]); | ||
66 | |||
64 | for (cf = compressed_formats; cf->name; cf++) { | 67 | for (cf = compressed_formats; cf->name; cf++) { |
65 | if (!memcmp(inbuf, cf->magic, 2)) | 68 | if (!memcmp(inbuf, cf->magic, 2)) |
66 | break; | 69 | break; |