All of lore.kernel.org
 help / color / mirror / Atom feed
* util-linux breakage with v2.24.2 on Alpha
@ 2014-06-08 10:42 Tobias Klausmann
  2014-06-08 12:25 ` Ruediger Meier
  2014-06-08 13:32 ` [PATCH] libfdisk: fix bsd_translate_fstype() for alpha Ruediger Meier
  0 siblings, 2 replies; 8+ messages in thread
From: Tobias Klausmann @ 2014-06-08 10:42 UTC (permalink / raw)
  To: util-linux

Hey,

I am one of the Gentoo maintainers for the Alpha arch. As of
util-linux 2.24, the build broke reliably:

  CC       libfdisk/src/libfdisk_la-bsd.lo
libfdisk/src/bsd.c: In function ‘bsd_translate_fstype’:
libfdisk/src/bsd.c:790:10: error: ‘BSD_FS_MSDOS’ undeclared (first use in this function)
   return BSD_FS_MSDOS;
          ^

This is due to the this section in include/pt-bsd.h:

/* this is annoying, but it's also the way it is :-( */                         
#ifdef __alpha__                                                                
#define BSD_FS_EXT2     8               /* ext2 file system */                  #else                                                                           
#define BSD_FS_MSDOS    8               /* MS-DOS file system */                
#endif                                                                          
                                                                                
The problem is that libfdisk/src/bsd.c still uses that macro, even
when compiling util-linux on Alpha. 

Regards,
Tobias

PS: I'm not susbscribed to the list, so please CC me on replies.

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

* Re: util-linux breakage with v2.24.2 on Alpha
  2014-06-08 10:42 util-linux breakage with v2.24.2 on Alpha Tobias Klausmann
@ 2014-06-08 12:25 ` Ruediger Meier
  2014-06-08 12:44   ` Tobias Klausmann
  2014-06-08 13:32 ` [PATCH] libfdisk: fix bsd_translate_fstype() for alpha Ruediger Meier
  1 sibling, 1 reply; 8+ messages in thread
From: Ruediger Meier @ 2014-06-08 12:25 UTC (permalink / raw)
  To: util-linux; +Cc: Tobias Klausmann

On Sunday 08 June 2014, Tobias Klausmann wrote:
> Hey,
>
> I am one of the Gentoo maintainers for the Alpha arch. As of
> util-linux 2.24, the build broke reliably:
>
>   CC       libfdisk/src/libfdisk_la-bsd.lo
> libfdisk/src/bsd.c: In function bsd_translate_fstype:
> libfdisk/src/bsd.c:790:10: error: BSD_FS_MSDOS undeclared (first use
> in this function) return BSD_FS_MSDOS;
>           ^

Looks like you have to ignore this case on alpha:

diff --git a/libfdisk/src/bsd.c b/libfdisk/src/bsd.c
index a81afd2..df0fc13 100644
--- a/libfdisk/src/bsd.c
+++ b/libfdisk/src/bsd.c
@@ -773,8 +773,10 @@ static int bsd_translate_fstype (int linux_type)
        case 0x06: /* DOS 16-bit >=32M */
        case 0xe1: /* DOS access       */
        case 0xe3: /* DOS R/O          */
+#if !defined (__alpha__)
        case 0xf2: /* DOS secondary    */
                return BSD_FS_MSDOS;
+#endif
        case 0x07: /* OS/2 HPFS        */
                return BSD_FS_HPFS;
        default

> This is due to the this section in include/pt-bsd.h:
>
> /* this is annoying, but it's also the way it is :-( */
> #ifdef __alpha__
> #define BSD_FS_EXT2     8               /* ext2 file system */       
>           #else #define BSD_FS_MSDOS    8               /* MS-DOS
> file system */ #endif
>
> The problem is that libfdisk/src/bsd.c still uses that macro, even
> when compiling util-linux on Alpha.
>
> Regards,
> Tobias
>
> PS: I'm not susbscribed to the list, so please CC me on replies.
> --
> To unsubscribe from this list: send the line "unsubscribe util-linux"
> in the body of a message to majordomo@vger.kernel.org
> More majordomo info at  http://vger.kernel.org/majordomo-info.html

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

* Re: util-linux breakage with v2.24.2 on Alpha
  2014-06-08 12:25 ` Ruediger Meier
@ 2014-06-08 12:44   ` Tobias Klausmann
  0 siblings, 0 replies; 8+ messages in thread
From: Tobias Klausmann @ 2014-06-08 12:44 UTC (permalink / raw)
  To: Ruediger Meier

Hi! 

On Sun, 08 Jun 2014, Ruediger Meier wrote:
> On Sunday 08 June 2014, Tobias Klausmann wrote:
> > Hey,
> >
> > I am one of the Gentoo maintainers for the Alpha arch. As of
> > util-linux 2.24, the build broke reliably:
> >
> >   CC       libfdisk/src/libfdisk_la-bsd.lo
> > libfdisk/src/bsd.c: In function bsd_translate_fstype:
> > libfdisk/src/bsd.c:790:10: error: BSD_FS_MSDOS undeclared (first use
> > in this function) return BSD_FS_MSDOS;
> >           ^
> 
> Looks like you have to ignore this case on alpha:
> 
> diff --git a/libfdisk/src/bsd.c b/libfdisk/src/bsd.c
> index a81afd2..df0fc13 100644
> --- a/libfdisk/src/bsd.c
> +++ b/libfdisk/src/bsd.c
> @@ -773,8 +773,10 @@ static int bsd_translate_fstype (int linux_type)
>         case 0x06: /* DOS 16-bit >=32M */
>         case 0xe1: /* DOS access       */
>         case 0xe3: /* DOS R/O          */
> +#if !defined (__alpha__)
>         case 0xf2: /* DOS secondary    */
>                 return BSD_FS_MSDOS;
> +#endif
>         case 0x07: /* OS/2 HPFS        */
>                 return BSD_FS_HPFS;
>         default

This seems to work when used against
404891fa9ea6a7ca86a838e809fc0b168169c286 aka tag v2.24.2:

$ make -j4 fdisk
[...]
  CCLD     libcommon.la
  CCLD     libuuid.la
  CCLD     libblkid.la
copying selected object files to avoid basename conflicts...
  CCLD     libfdisk.la
  CCLD     fdisk
$ sudo ./fdisk -l sda
Password: 
Disk /dev/sda: 17 GiB, 18209320960 bytes, 35565080 sectors
Geometry: 64 heads, 32 sectors/track, 17365 cylinders
Units: sectors of 1 * 512 = 512 bytes
Sector size (logical/physical): 512 bytes / 512 bytes
I/O size (minimum/optimal): 512 bytes / 512 bytes
Disklabel type: bsd
partitions: 3

#     Start       End      Size Type     fsize bsize cpg
a      4096   1959935   1955840 swap                 
b   1959936  35563519  33603584 ext2                 
c         0  35563519  35563520 unused   0     0     

I'll get the patch into our distro for now. I presume this will
be picked up for one of the next versions of u-l?

Regards,
Tobias

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

* [PATCH] libfdisk: fix bsd_translate_fstype() for alpha
  2014-06-08 10:42 util-linux breakage with v2.24.2 on Alpha Tobias Klausmann
  2014-06-08 12:25 ` Ruediger Meier
@ 2014-06-08 13:32 ` Ruediger Meier
  2014-06-08 13:44   ` Dave Reisner
  2014-06-09  8:43   ` Karel Zak
  1 sibling, 2 replies; 8+ messages in thread
From: Ruediger Meier @ 2014-06-08 13:32 UTC (permalink / raw)
  To: util-linux; +Cc: Tobias Klausmann

From: Ruediger Meier <ruediger.meier@ga-group.nl>

Reported-by: Tobias Klausmann <klausman@schwarzvogel.de>
Signed-off-by: Ruediger Meier <ruediger.meier@ga-group.nl>
---
 libfdisk/src/bsd.c | 2 ++
 1 file changed, 2 insertions(+)

diff --git a/libfdisk/src/bsd.c b/libfdisk/src/bsd.c
index a81afd2..df0fc13 100644
--- a/libfdisk/src/bsd.c
+++ b/libfdisk/src/bsd.c
@@ -773,8 +773,10 @@ static int bsd_translate_fstype (int linux_type)
 	case 0x06: /* DOS 16-bit >=32M */
 	case 0xe1: /* DOS access       */
 	case 0xe3: /* DOS R/O          */
+#if !defined (__alpha__)
 	case 0xf2: /* DOS secondary    */
 		return BSD_FS_MSDOS;
+#endif
 	case 0x07: /* OS/2 HPFS        */
 		return BSD_FS_HPFS;
 	default:
-- 
1.8.4.5


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

* Re: [PATCH] libfdisk: fix bsd_translate_fstype() for alpha
  2014-06-08 13:32 ` [PATCH] libfdisk: fix bsd_translate_fstype() for alpha Ruediger Meier
@ 2014-06-08 13:44   ` Dave Reisner
  2014-06-08 14:09     ` Tobias Klausmann
  2014-06-09  8:43   ` Karel Zak
  1 sibling, 1 reply; 8+ messages in thread
From: Dave Reisner @ 2014-06-08 13:44 UTC (permalink / raw)
  To: Ruediger Meier; +Cc: util-linux, Tobias Klausmann

On Sun, Jun 08, 2014 at 03:32:48PM +0200, Ruediger Meier wrote:
> From: Ruediger Meier <ruediger.meier@ga-group.nl>
> 
> Reported-by: Tobias Klausmann <klausman@schwarzvogel.de>
> Signed-off-by: Ruediger Meier <ruediger.meier@ga-group.nl>
> ---
>  libfdisk/src/bsd.c | 2 ++
>  1 file changed, 2 insertions(+)
> 
> diff --git a/libfdisk/src/bsd.c b/libfdisk/src/bsd.c
> index a81afd2..df0fc13 100644
> --- a/libfdisk/src/bsd.c
> +++ b/libfdisk/src/bsd.c
> @@ -773,8 +773,10 @@ static int bsd_translate_fstype (int linux_type)
>  	case 0x06: /* DOS 16-bit >=32M */
>  	case 0xe1: /* DOS access       */
>  	case 0xe3: /* DOS R/O          */
> +#if !defined (__alpha__)
>  	case 0xf2: /* DOS secondary    */
>  		return BSD_FS_MSDOS;
> +#endif

What would be the harm on defining this for platforms which don't
include it? Why is a partition type excluded from this architecture?

>  	case 0x07: /* OS/2 HPFS        */
>  		return BSD_FS_HPFS;
>  	default:
> -- 
> 1.8.4.5
> 
> --
> To unsubscribe from this list: send the line "unsubscribe util-linux" in
> the body of a message to majordomo@vger.kernel.org
> More majordomo info at  http://vger.kernel.org/majordomo-info.html

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

* Re: [PATCH] libfdisk: fix bsd_translate_fstype() for alpha
  2014-06-08 13:44   ` Dave Reisner
@ 2014-06-08 14:09     ` Tobias Klausmann
  2014-06-08 15:06       ` Ruediger Meier
  0 siblings, 1 reply; 8+ messages in thread
From: Tobias Klausmann @ 2014-06-08 14:09 UTC (permalink / raw)
  To: util-linux

Hi! 

On Sun, 08 Jun 2014, Dave Reisner wrote:

> On Sun, Jun 08, 2014 at 03:32:48PM +0200, Ruediger Meier wrote:
> > From: Ruediger Meier <ruediger.meier@ga-group.nl>
> > 
> > Reported-by: Tobias Klausmann <klausman@schwarzvogel.de>
> > Signed-off-by: Ruediger Meier <ruediger.meier@ga-group.nl>
> > ---
> >  libfdisk/src/bsd.c | 2 ++
> >  1 file changed, 2 insertions(+)
> > 
> > diff --git a/libfdisk/src/bsd.c b/libfdisk/src/bsd.c
> > index a81afd2..df0fc13 100644
> > --- a/libfdisk/src/bsd.c
> > +++ b/libfdisk/src/bsd.c
> > @@ -773,8 +773,10 @@ static int bsd_translate_fstype (int linux_type)
> >  	case 0x06: /* DOS 16-bit >=32M */
> >  	case 0xe1: /* DOS access       */
> >  	case 0xe3: /* DOS R/O          */
> > +#if !defined (__alpha__)
> >  	case 0xf2: /* DOS secondary    */
> >  		return BSD_FS_MSDOS;
> > +#endif
> 
> What would be the harm on defining this for platforms which don't
> include it? Why is a partition type excluded from this architecture?

For some reason, 8 has two meanings: BSD_FS_MSDOS almost
everywhere, but BSD_FS_EXT2 on Alpha. I'm not well-versed enough
in the code to be sure whether the case above (0xf2) is a "can't
happen" on Alpha).

It may be that the better approach would be to return an error
condition or something entirely different, including BSD_FS_EXT2. 

For the Alphas I have access to, the patch from Ruediger works
just fine.

Regards,
Tobias


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

* Re: [PATCH] libfdisk: fix bsd_translate_fstype() for alpha
  2014-06-08 14:09     ` Tobias Klausmann
@ 2014-06-08 15:06       ` Ruediger Meier
  0 siblings, 0 replies; 8+ messages in thread
From: Ruediger Meier @ 2014-06-08 15:06 UTC (permalink / raw)
  To: Tobias Klausmann; +Cc: util-linux

On Sunday 08 June 2014, Tobias Klausmann wrote:
> Hi!
>
> On Sun, 08 Jun 2014, Dave Reisner wrote:
> > On Sun, Jun 08, 2014 at 03:32:48PM +0200, Ruediger Meier wrote:
> > > From: Ruediger Meier <ruediger.meier@ga-group.nl>
> > >
> > > Reported-by: Tobias Klausmann <klausman@schwarzvogel.de>
> > > Signed-off-by: Ruediger Meier <ruediger.meier@ga-group.nl>
> > > ---
> > >  libfdisk/src/bsd.c | 2 ++
> > >  1 file changed, 2 insertions(+)
> > >
> > > diff --git a/libfdisk/src/bsd.c b/libfdisk/src/bsd.c
> > > index a81afd2..df0fc13 100644
> > > --- a/libfdisk/src/bsd.c
> > > +++ b/libfdisk/src/bsd.c
> > > @@ -773,8 +773,10 @@ static int bsd_translate_fstype (int
> > > linux_type) case 0x06: /* DOS 16-bit >=32M */
> > >  	case 0xe1: /* DOS access       */
> > >  	case 0xe3: /* DOS R/O          */
> > > +#if !defined (__alpha__)
> > >  	case 0xf2: /* DOS secondary    */
> > >  		return BSD_FS_MSDOS;
> > > +#endif
> >
> > What would be the harm on defining this for platforms which don't
> > include it? Why is a partition type excluded from this
> > architecture?
>
> For some reason, 8 has two meanings: BSD_FS_MSDOS almost
> everywhere, but BSD_FS_EXT2 on Alpha. I'm not well-versed enough
> in the code to be sure whether the case above (0xf2) is a "can't
> happen" on Alpha).

It can happen on alpha! But there is no better translation than the 
default BSD_FS_OTHER. Like most of the other MBR partition types have 
no translation for BSD.

> It may be that the better approach would be to return an error
> condition or something entirely different, including BSD_FS_EXT2.

Type EXT2 can't come from MBR because there is no such type in 
include/pt-mbr.h.

The real stupidness which makes the other code look confusing happens in 
include/pt-bsd.h. The comment says it:

/* this is annoying, but it's also the way it is :-( */
#ifdef __alpha__
#define BSD_FS_EXT2     8               /* ext2 file system */
#else
#define BSD_FS_MSDOS    8               /* MS-DOS file system */
#endif

BSD partition specs say "8" means usually EXT2 but only on alpha it 
means MSDOS. This makes these partion tables incompatible between hosts 
of different arch. But there are even more reasons why BSD partions are 
not arch independent. It was probably bad designed long time ago.

In theory we could add all combinatons of fdisk features like
 - create BSD partions to be used on alpha
 - create BSD partions to be used on big endian
 - etc.

But this would be probably over the top. Currently we only support BSD 
partitions for the arch we are running.

BTW on Linux these partition types are AFAIK not really used anyway. The 
FS type is usually determined from the data inside the partition. 
That's why we don't have special partition types for all kind of linux 
filesystems, just 83=Linux but I guess even this one is not needed, 
except to make partition tables more human readable (if the type was 
set correctly at all when partion was created).


cu,
Rudi

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

* Re: [PATCH] libfdisk: fix bsd_translate_fstype() for alpha
  2014-06-08 13:32 ` [PATCH] libfdisk: fix bsd_translate_fstype() for alpha Ruediger Meier
  2014-06-08 13:44   ` Dave Reisner
@ 2014-06-09  8:43   ` Karel Zak
  1 sibling, 0 replies; 8+ messages in thread
From: Karel Zak @ 2014-06-09  8:43 UTC (permalink / raw)
  To: Ruediger Meier; +Cc: util-linux, Tobias Klausmann

On Sun, Jun 08, 2014 at 03:32:48PM +0200, Ruediger Meier wrote:
> From: Ruediger Meier <ruediger.meier@ga-group.nl>
> 
> Reported-by: Tobias Klausmann <klausman@schwarzvogel.de>
> Signed-off-by: Ruediger Meier <ruediger.meier@ga-group.nl>
> ---
>  libfdisk/src/bsd.c | 2 ++
>  1 file changed, 2 insertions(+)

 Applied, thanks.

-- 
 Karel Zak  <kzak@redhat.com>
 http://karelzak.blogspot.com

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

end of thread, other threads:[~2014-06-09  8:44 UTC | newest]

Thread overview: 8+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2014-06-08 10:42 util-linux breakage with v2.24.2 on Alpha Tobias Klausmann
2014-06-08 12:25 ` Ruediger Meier
2014-06-08 12:44   ` Tobias Klausmann
2014-06-08 13:32 ` [PATCH] libfdisk: fix bsd_translate_fstype() for alpha Ruediger Meier
2014-06-08 13:44   ` Dave Reisner
2014-06-08 14:09     ` Tobias Klausmann
2014-06-08 15:06       ` Ruediger Meier
2014-06-09  8:43   ` Karel Zak

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.