[PATCH] Ignore partition table on device

From: Jonathan Schleifer
Date: Sat Jun 02 2007 - 15:02:51 EST


Hello.

This patch adds a new kernel parameter (ignore_partitions=device) to
the kernel. It is useful when using a fake RAID with dmraid so that
Linux won't complain about attemps to access the drive beyond its
boundaries when udev and/or hald are started.

--- linux-2.6.21.1/fs/partitions/check.c.orig 2007-06-02 14:19:26.000000000 +0200
+++ linux-2.6.21.1/fs/partitions/check.c 2007-06-02 15:16:22.000000000 +0200
@@ -39,6 +39,14 @@
extern void md_autodetect_dev(dev_t dev);
#endif

+static char * __initdata ignore_dev;
+static int __init ignore_dev_fn(char *str)
+{
+ ignore_dev = str;
+ return 1;
+}
+__setup("ignore_partitions=", ignore_dev_fn);
+
int warn_no_part = 1; /*This is ugly: should make genhd removable media aware*/

static int (*check_part[])(struct parsed_partitions *, struct block_device *) = {
@@ -165,6 +173,13 @@
sprintf(state->name, "p");

state->limit = hd->minors;
+
+ if (ignore_dev != NULL && !strcmp(state->name, ignore_dev)) {
+ memset(&state->parts, 0, sizeof(state->parts));
+ printk(" partition table ignored.\n");
+ return state;
+ }
+
i = res = err = 0;
while (!res && check_part[i]) {
memset(&state->parts, 0, sizeof(state->parts));

--
Jonathan
-
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/