Re: [PATCH] add blockconsole version 1.1

From: JÃrn Engel
Date: Mon Jul 23 2012 - 17:16:16 EST


On Mon, 23 July 2012 15:33:16 +0100, Tvrtko Ursulin wrote:
> On Thursday 12 Jul 2012 18:46:34 JÃrn Engel wrote:
> > Console driver similar to netconsole, except it writes to a block
> > device. Can be useful in a setup where netconsole, for whatever
> > reasons, is impractical.
>
> Perhaps you need to add a word or two about limitations compared to netconsole
> in documentation because it is quite significant difference in reliability? I
> mean so it is not assumed it is analogous to netconsole but just a different
> underlying media. I don't know if someone would expect it, but better said
> than not.

Given that I don't even know the limitations, that's a bit tough. As
a general rule, I would always prefer netconsole. It appears to be
more reliable than blockconsole and beats serial console by half a
lightyear. But as a fallback when netconsole is not realistic,
blockconsole has proven useful.

> I second the notion that logging to partitions would be useful.

Below is a compile-tested patch to do that. Feel free to give it a
spin and fix any bugs.

> Also, and I haven't checked what the swap format is, if it could somehow be
> integrated together that could be useful.

That appears to be slightly less likely than crossbreeding a rabbit
with a chicken. Is there something obvious I have missed?

JÃrn

--
The story so far:
In the beginning the Universe was created. This has made a lot
of people very angry and been widely regarded as a bad move.
-- Douglas Adams

[PATCH 2/2] bcon: Add a module parameter to support partitions

The usual methods of hooking into the partition scanner does not work
for partitions. Allow those who care to pass in a module parameter.

Signed-off-by: Joern Engel <joern@xxxxxxxxx>
---
drivers/block/blockconsole.c | 9 +++++++++
1 file changed, 9 insertions(+)

diff --git a/drivers/block/blockconsole.c b/drivers/block/blockconsole.c
index 09f239c..91c27ce 100644
--- a/drivers/block/blockconsole.c
+++ b/drivers/block/blockconsole.c
@@ -10,6 +10,7 @@
#include <linux/kref.h>
#include <linux/kthread.h>
#include <linux/mm.h>
+#include <linux/moduleparam.h>
#include <linux/mount.h>
#include <linux/random.h>
#include <linux/slab.h>
@@ -543,6 +544,14 @@ static void bcon_create_fuzzy(const char *name)
}
}

+static int bcon_setup(const char *val, struct kernel_param *kp)
+{
+ bcon_create_fuzzy(val);
+ return 0;
+}
+
+module_param_call(device, bcon_setup, NULL, NULL, 0200);
+
static DEFINE_SPINLOCK(device_lock);
static char scanned_devices[80];

--
1.7.10.4

--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/