The Linux Kernel Mailing List
 help / color / mirror / Atom feed
* retry [PATCH] partition : add support for sysv68 partitions
@ 2007-04-13 13:55 Philippe De Muyter
  2007-05-08 20:21 ` Geert Uytterhoeven
  0 siblings, 1 reply; 8+ messages in thread
From: Philippe De Muyter @ 2007-04-13 13:55 UTC (permalink / raw)
  To: linux-kernel

Hi all,

Add support for the Motorola sysv68 disk partition table (slices in motorola
doc).

Signed-off-by: Philippe De Muyter <phdm@macqel.be>

diff -r 1b54f1d81bc5 fs/partitions/Kconfig
--- a/fs/partitions/Kconfig	Thu Apr 12 15:44:52 2007 -0700
+++ b/fs/partitions/Kconfig	Fri Apr 13 15:51:58 2007 +0200
@@ -236,3 +236,12 @@ config EFI_PARTITION
 	help
 	  Say Y here if you would like to use hard disks under Linux which
 	  were partitioned using EFI GPT.
+
+config SYSV68_PARTITION
+	bool "SYSV68 partition table support" if PARTITION_ADVANCED
+	default y if M68K
+	help
+	  Say Y here if you would like to be able to read the hard disk
+	  partition table format used by Motorola Delta machines (using
+	  sysv68).
+	  Otherwise, say N.
diff -r 1b54f1d81bc5 fs/partitions/Makefile
--- a/fs/partitions/Makefile	Thu Apr 12 15:44:52 2007 -0700
+++ b/fs/partitions/Makefile	Fri Apr 13 15:51:58 2007 +0200
@@ -17,3 +17,4 @@ obj-$(CONFIG_IBM_PARTITION) += ibm.o
 obj-$(CONFIG_IBM_PARTITION) += ibm.o
 obj-$(CONFIG_EFI_PARTITION) += efi.o
 obj-$(CONFIG_KARMA_PARTITION) += karma.o
+obj-$(CONFIG_SYSV68_PARTITION) += sysv68.o
diff -r 1b54f1d81bc5 fs/partitions/check.c
--- a/fs/partitions/check.c	Thu Apr 12 15:44:52 2007 -0700
+++ b/fs/partitions/check.c	Fri Apr 13 15:51:58 2007 +0200
@@ -34,6 +34,7 @@
 #include "ultrix.h"
 #include "efi.h"
 #include "karma.h"
+#include "sysv68.h"
 
 #ifdef CONFIG_BLK_DEV_MD
 extern void md_autodetect_dev(dev_t dev);
@@ -104,6 +105,9 @@ static int (*check_part[])(struct parsed
 #endif
 #ifdef CONFIG_KARMA_PARTITION
 	karma_partition,
+#endif
+#ifdef CONFIG_SYSV68_PARTITION
+	sysv68_partition,
 #endif
 	NULL
 };
diff -r 1b54f1d81bc5 fs/partitions/sysv68.c
--- /dev/null	Thu Jan  1 00:00:00 1970 +0000
+++ b/fs/partitions/sysv68.c	Fri Apr 13 15:51:58 2007 +0200
@@ -0,0 +1,92 @@
+/*
+ *  fs/partitions/sysv68.c
+ *
+ *  Copyright (C) 2007 Philippe De Muyter <phdm@macqel.be>
+ */
+
+#include "check.h"
+#include "sysv68.h"
+
+/*
+ *	Volume ID structure: on first 256-bytes sector of disk
+ */
+
+struct	volumeid {
+	u8	vid_unused[248];
+	u8	vid_mac[8];	/* ASCII string "MOTOROLA" */
+};
+
+/*
+ *	config block: second 256-bytes sector on disk
+ */
+
+struct dkconfig {
+	u8	ios_unused0[128];
+	__be32	ios_slcblk;	/* Slice table block number */
+	__be16	ios_slccnt;	/* Number of entries in slice table */
+	u8	ios_unused1[122];
+};
+
+/*
+ *	combined volumeid and dkconfig block
+ */
+
+struct dkblk0 {
+	struct volumeid dk_vid;
+	struct dkconfig dk_ios;
+};
+
+/*
+ *	Slice Table Structure
+ */
+
+struct slice {
+	__be32	nblocks;		/* slice size (in blocks) */
+	__be32	blkoff;			/* block offset of slice */
+};
+
+
+int sysv68_partition(struct parsed_partitions *state, struct block_device *bdev)
+{
+	int i, slices;
+	int slot = 1;
+	Sector sect;
+	unsigned char *data;
+	struct dkblk0 *b;
+	struct slice *slice;
+
+	data = read_dev_sector(bdev, 0, &sect);
+	if (!data)
+		return -1;
+
+	b = (struct dkblk0 *) data;
+	if (memcmp(b->dk_vid.vid_mac, "MOTOROLA", sizeof(b->dk_vid.vid_mac))) {
+		put_dev_sector(sect);
+		return 0;
+	}
+	slices = be16_to_cpu(b->dk_ios.ios_slccnt);
+	i = be32_to_cpu(b->dk_ios.ios_slcblk);
+	put_dev_sector(sect);
+
+	data = read_dev_sector(bdev, i, &sect);
+	if (!data)
+		return -1;
+
+	slices -= 1; /* last slice is the whole disk */
+	printk("sysV68: %s(s%u)", state->name, slices);
+	slice = (struct slice *)data;
+	for (i = 0 ; i < slices; i++, slice++) {
+		if (slot == state->limit)
+		        break;
+		if (be32_to_cpu(slice->nblocks)) {
+			put_partition(state, slot,
+				be32_to_cpu(slice->blkoff),
+				be32_to_cpu(slice->nblocks));
+			printk("(s%u)", i);
+		}
+		slot++;
+	}
+	printk("\n");
+	put_dev_sector(sect);
+	return 1;
+}
diff -r 1b54f1d81bc5 fs/partitions/sysv68.h
--- /dev/null	Thu Jan  1 00:00:00 1970 +0000
+++ b/fs/partitions/sysv68.h	Fri Apr 13 15:51:58 2007 +0200
@@ -0,0 +1,1 @@
+extern int sysv68_partition(struct parsed_partitions *state, struct block_device *bdev);

^ permalink raw reply	[flat|nested] 8+ messages in thread

* Re: retry [PATCH] partition : add support for sysv68 partitions
  2007-04-13 13:55 retry [PATCH] partition : add support for sysv68 partitions Philippe De Muyter
@ 2007-05-08 20:21 ` Geert Uytterhoeven
  2007-05-09  7:24   ` Philippe De Muyter
                     ` (2 more replies)
  0 siblings, 3 replies; 8+ messages in thread
From: Geert Uytterhoeven @ 2007-05-08 20:21 UTC (permalink / raw)
  To: Philippe De Muyter
  Cc: Linus Torvalds, Andrew Morton, Linux/m68k,
	Linux Kernel Development

	Hi Philippe,

On Fri, 13 Apr 2007, Philippe De Muyter wrote:
> Add support for the Motorola sysv68 disk partition table (slices in motorola
> doc).
> 
> Signed-off-by: Philippe De Muyter <phdm@macqel.be>
> 
> diff -r 1b54f1d81bc5 fs/partitions/Kconfig
> --- a/fs/partitions/Kconfig	Thu Apr 12 15:44:52 2007 -0700
> +++ b/fs/partitions/Kconfig	Fri Apr 13 15:51:58 2007 +0200
> @@ -236,3 +236,12 @@ config EFI_PARTITION
>  	help
>  	  Say Y here if you would like to use hard disks under Linux which
>  	  were partitioned using EFI GPT.
> +
> +config SYSV68_PARTITION
> +	bool "SYSV68 partition table support" if PARTITION_ADVANCED
> +	default y if M68K
        ^^^^^^^^^^^^^^^^^
> +	help
> +	  Say Y here if you would like to be able to read the hard disk
> +	  partition table format used by Motorola Delta machines (using
> +	  sysv68).
> +	  Otherwise, say N.

Bummer, I saw your patch before, but I never noticed the `default y if M68K'.

Can you please tell me on which platforms SYSV68 partition tables are commonly
used (I guess the Motorola MVME boards?), so we can enable it by default on a
more sensible subset of M68K?

Gr{oetje,eeting}s,

						Geert

--
Geert Uytterhoeven -- There's lots of Linux beyond ia32 -- geert@linux-m68k.org

In personal conversations with technical people, I call myself a hacker. But
when I'm talking to journalists I just say "programmer" or something like that.
							    -- Linus Torvalds

^ permalink raw reply	[flat|nested] 8+ messages in thread

* Re: retry [PATCH] partition : add support for sysv68 partitions
  2007-05-08 20:21 ` Geert Uytterhoeven
@ 2007-05-09  7:24   ` Philippe De Muyter
  2007-05-09  7:47     ` Geert Uytterhoeven
  2007-05-09 10:31   ` Wouter Verhelst
  2007-05-09 21:13   ` [PATCH] Let SYSV68_PARTITION default to yes on VME only Geert Uytterhoeven
  2 siblings, 1 reply; 8+ messages in thread
From: Philippe De Muyter @ 2007-05-09  7:24 UTC (permalink / raw)
  To: Geert Uytterhoeven
  Cc: Linus Torvalds, Andrew Morton, Linux/m68k,
	Linux Kernel Development

Hi Geert,

On Tue, May 08, 2007 at 10:21:12PM +0200, Geert Uytterhoeven wrote:
> 	Hi Philippe,
> 
> On Fri, 13 Apr 2007, Philippe De Muyter wrote:
> > Add support for the Motorola sysv68 disk partition table (slices in motorola
> > doc).
> > 
> > Signed-off-by: Philippe De Muyter <phdm@macqel.be>
> > 
> > diff -r 1b54f1d81bc5 fs/partitions/Kconfig
> > --- a/fs/partitions/Kconfig	Thu Apr 12 15:44:52 2007 -0700
> > +++ b/fs/partitions/Kconfig	Fri Apr 13 15:51:58 2007 +0200
> > @@ -236,3 +236,12 @@ config EFI_PARTITION
> >  	help
> >  	  Say Y here if you would like to use hard disks under Linux which
> >  	  were partitioned using EFI GPT.
> > +
> > +config SYSV68_PARTITION
> > +	bool "SYSV68 partition table support" if PARTITION_ADVANCED
> > +	default y if M68K
>         ^^^^^^^^^^^^^^^^^
> > +	help
> > +	  Say Y here if you would like to be able to read the hard disk
> > +	  partition table format used by Motorola Delta machines (using
> > +	  sysv68).
> > +	  Otherwise, say N.
> 
> Bummer, I saw your patch before, but I never noticed the `default y if M68K'.
> 
> Can you please tell me on which platforms SYSV68 partition tables are commonly
> used (I guess the Motorola MVME boards?), so we can enable it by default on a

The Motorola VME boards are the only ones I am aware of.  I must also add
that the partitions themselves are sysv partitions.

> more sensible subset of M68K?

Feel free to replace or suppress the `default' directive.  I actually wrote
that for a i586 laptop to access/reinstall disks of sysV68 machines using
a USB/SCSI adapter, but I don't think `default y' is a good idea :).

What do you think of
	`default y if VME'
or
	`default y if M68K && SYSV_FS'

Best regards 

Philippe

^ permalink raw reply	[flat|nested] 8+ messages in thread

* Re: retry [PATCH] partition : add support for sysv68 partitions
  2007-05-09  7:24   ` Philippe De Muyter
@ 2007-05-09  7:47     ` Geert Uytterhoeven
  2007-05-09  8:20       ` Philippe De Muyter
  0 siblings, 1 reply; 8+ messages in thread
From: Geert Uytterhoeven @ 2007-05-09  7:47 UTC (permalink / raw)
  To: Philippe De Muyter
  Cc: Linus Torvalds, Andrew Morton, Linux/m68k,
	Linux Kernel Development

On Wed, 9 May 2007, Philippe De Muyter wrote:
> On Tue, May 08, 2007 at 10:21:12PM +0200, Geert Uytterhoeven wrote:
> > On Fri, 13 Apr 2007, Philippe De Muyter wrote:
> > > Add support for the Motorola sysv68 disk partition table (slices in motorola
> > > doc).
> > > 
> > > Signed-off-by: Philippe De Muyter <phdm@macqel.be>
> > > 
> > > diff -r 1b54f1d81bc5 fs/partitions/Kconfig
> > > --- a/fs/partitions/Kconfig	Thu Apr 12 15:44:52 2007 -0700
> > > +++ b/fs/partitions/Kconfig	Fri Apr 13 15:51:58 2007 +0200
> > > @@ -236,3 +236,12 @@ config EFI_PARTITION
> > >  	help
> > >  	  Say Y here if you would like to use hard disks under Linux which
> > >  	  were partitioned using EFI GPT.
> > > +
> > > +config SYSV68_PARTITION
> > > +	bool "SYSV68 partition table support" if PARTITION_ADVANCED
> > > +	default y if M68K
> >         ^^^^^^^^^^^^^^^^^
> > > +	help
> > > +	  Say Y here if you would like to be able to read the hard disk
> > > +	  partition table format used by Motorola Delta machines (using
> > > +	  sysv68).
> > > +	  Otherwise, say N.
> > 
> > Bummer, I saw your patch before, but I never noticed the `default y if M68K'.
> > 
> > Can you please tell me on which platforms SYSV68 partition tables are commonly
> > used (I guess the Motorola MVME boards?), so we can enable it by default on a
> 
> The Motorola VME boards are the only ones I am aware of.  I must also add
> that the partitions themselves are sysv partitions.
> 
> > more sensible subset of M68K?
> 
> Feel free to replace or suppress the `default' directive.  I actually wrote
> that for a i586 laptop to access/reinstall disks of sysV68 machines using
> a USB/SCSI adapter, but I don't think `default y' is a good idea :).
> 
> What do you think of
> 	`default y if VME'
> or
> 	`default y if M68K && SYSV_FS'

I prefer `default y if VME'.

BTW, perhaps PPC based Motorola MVME boards use SYSV68 partition tables,
too?

Gr{oetje,eeting}s,

						Geert

--
Geert Uytterhoeven -- There's lots of Linux beyond ia32 -- geert@linux-m68k.org

In personal conversations with technical people, I call myself a hacker. But
when I'm talking to journalists I just say "programmer" or something like that.
							    -- Linus Torvalds

^ permalink raw reply	[flat|nested] 8+ messages in thread

* Re: retry [PATCH] partition : add support for sysv68 partitions
  2007-05-09  7:47     ` Geert Uytterhoeven
@ 2007-05-09  8:20       ` Philippe De Muyter
  2007-05-09 13:47         ` Michael Schmitz
  0 siblings, 1 reply; 8+ messages in thread
From: Philippe De Muyter @ 2007-05-09  8:20 UTC (permalink / raw)
  To: Geert Uytterhoeven
  Cc: Linus Torvalds, Andrew Morton, Linux/m68k,
	Linux Kernel Development

Hi Geert,

> > What do you think of
> > 	`default y if VME'
> > or
> > 	`default y if M68K && SYSV_FS'
> 
> I prefer `default y if VME'.
> 
> BTW, perhaps PPC based Motorola MVME boards use SYSV68 partition tables,
> too?

No, the PPC based Motorola MVME boards use the (currently not supported by
linux) AIX partition tables, as do also the motorola powerstack machines.

The m88k based Motorola MVME boards use the sysV68 partition tables, but
m88k is not yet supported by linux.

Incidentally, what is the problem you have with SYSV68_PARTITION ?
On my i586 machine, code size is 434 bytes for sysv68.o + 4 bytes more in
check.c

Philippe

^ permalink raw reply	[flat|nested] 8+ messages in thread

* Re: retry [PATCH] partition : add support for sysv68 partitions
  2007-05-08 20:21 ` Geert Uytterhoeven
  2007-05-09  7:24   ` Philippe De Muyter
@ 2007-05-09 10:31   ` Wouter Verhelst
  2007-05-09 21:13   ` [PATCH] Let SYSV68_PARTITION default to yes on VME only Geert Uytterhoeven
  2 siblings, 0 replies; 8+ messages in thread
From: Wouter Verhelst @ 2007-05-09 10:31 UTC (permalink / raw)
  To: Geert Uytterhoeven
  Cc: Philippe De Muyter, Linus Torvalds, Andrew Morton, Linux/m68k,
	Linux Kernel Development

On Tue, May 08, 2007 at 10:21:12PM +0200, Geert Uytterhoeven wrote:
> 	Hi Philippe,
> On Fri, 13 Apr 2007, Philippe De Muyter wrote:
> > Add support for the Motorola sysv68 disk partition table (slices in motorola
> > doc).
> > 
> > Signed-off-by: Philippe De Muyter <phdm@macqel.be>
> > 
> > diff -r 1b54f1d81bc5 fs/partitions/Kconfig
> > --- a/fs/partitions/Kconfig	Thu Apr 12 15:44:52 2007 -0700
> > +++ b/fs/partitions/Kconfig	Fri Apr 13 15:51:58 2007 +0200
> > @@ -236,3 +236,12 @@ config EFI_PARTITION
> >  	help
> >  	  Say Y here if you would like to use hard disks under Linux which
> >  	  were partitioned using EFI GPT.
> > +
> > +config SYSV68_PARTITION
> > +	bool "SYSV68 partition table support" if PARTITION_ADVANCED
> > +	default y if M68K
>         ^^^^^^^^^^^^^^^^^
> > +	help
> > +	  Say Y here if you would like to be able to read the hard disk
> > +	  partition table format used by Motorola Delta machines (using
> > +	  sysv68).
> > +	  Otherwise, say N.
> 
> Bummer, I saw your patch before, but I never noticed the `default y if M68K'.
> 
> Can you please tell me on which platforms SYSV68 partition tables are commonly
> used (I guess the Motorola MVME boards?), 

I guess so. I have a disk for my MVME167 lying around here somewhere
with SYSV/68 on it. If you want, I can verify what exact machines it
runs on, but I guess "every 68k MVME" is a safe enough bet.

-- 
Shaw's Principle:
	Build a system that even a fool can use, and only a fool will
	want to use it.

^ permalink raw reply	[flat|nested] 8+ messages in thread

* Re: retry [PATCH] partition : add support for sysv68 partitions
  2007-05-09  8:20       ` Philippe De Muyter
@ 2007-05-09 13:47         ` Michael Schmitz
  0 siblings, 0 replies; 8+ messages in thread
From: Michael Schmitz @ 2007-05-09 13:47 UTC (permalink / raw)
  To: Philippe De Muyter
  Cc: Geert Uytterhoeven, Linus Torvalds, Andrew Morton, Linux/m68k,
	Linux Kernel Development

> > > 	`default y if M68K && SYSV_FS'
> >
> > I prefer `default y if VME'.
> >
>
> Incidentally, what is the problem you have with SYSV68_PARTITION ?
> On my i586 machine, code size is 434 bytes for sysv68.o + 4 bytes more in
> check.c

Traditionally, we have always been very conservative about enabling more
than the absolute minimum in partition format support. Some formats can be
erroneously identified by the check code if you don't get the ordering
right (the case I know about, MSDOS partitions vs. Atari TOS/GEM
partitions, hinges on a particular checksum being calculated in the atari
code). I've moved the msdos checker to the bottom of the list more often
than I can keep track of...

If sysv68 cannot be confused with any other format, no harm done by
enabling it by default. Otherwise, things may get interesting.

	Michael

^ permalink raw reply	[flat|nested] 8+ messages in thread

* [PATCH] Let SYSV68_PARTITION default to yes on VME only
  2007-05-08 20:21 ` Geert Uytterhoeven
  2007-05-09  7:24   ` Philippe De Muyter
  2007-05-09 10:31   ` Wouter Verhelst
@ 2007-05-09 21:13   ` Geert Uytterhoeven
  2 siblings, 0 replies; 8+ messages in thread
From: Geert Uytterhoeven @ 2007-05-09 21:13 UTC (permalink / raw)
  To: Linus Torvalds, Andrew Morton
  Cc: Philippe De Muyter, Linux/m68k, Linux Kernel Development

Don't enable SYSV68 partition table support on all m68k boxes by default,
only on Motorola VME boards.

Signed-off-by: Geert Uytterhoeven <geert@linux-m68k.org>
Cc: Philippe De Muyter <phdm@macqel.be>
---
 fs/partitions/Kconfig |    2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

--- linux-m68k-2.6.21.orig/fs/partitions/Kconfig
+++ linux-m68k-2.6.21/fs/partitions/Kconfig
@@ -239,7 +239,7 @@ config EFI_PARTITION
 
 config SYSV68_PARTITION
 	bool "SYSV68 partition table support" if PARTITION_ADVANCED
-	default y if M68K
+	default y if VME
 	help
 	  Say Y here if you would like to be able to read the hard disk
 	  partition table format used by Motorola Delta machines (using

Gr{oetje,eeting}s,

						Geert

--
Geert Uytterhoeven -- There's lots of Linux beyond ia32 -- geert@linux-m68k.org

In personal conversations with technical people, I call myself a hacker. But
when I'm talking to journalists I just say "programmer" or something like that.
							    -- Linus Torvalds

^ permalink raw reply	[flat|nested] 8+ messages in thread

end of thread, other threads:[~2007-05-09 21:13 UTC | newest]

Thread overview: 8+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2007-04-13 13:55 retry [PATCH] partition : add support for sysv68 partitions Philippe De Muyter
2007-05-08 20:21 ` Geert Uytterhoeven
2007-05-09  7:24   ` Philippe De Muyter
2007-05-09  7:47     ` Geert Uytterhoeven
2007-05-09  8:20       ` Philippe De Muyter
2007-05-09 13:47         ` Michael Schmitz
2007-05-09 10:31   ` Wouter Verhelst
2007-05-09 21:13   ` [PATCH] Let SYSV68_PARTITION default to yes on VME only Geert Uytterhoeven

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox