public inbox for util-linux@vger.kernel.org
 help / color / mirror / Atom feed
* [PATCH] sfdisk: suppress Linux-irrelevant warnings with -L
@ 2014-05-26 16:28 Petr Uzel
  2014-05-27 14:43 ` Karel Zak
  2014-05-31 14:25 ` Ruediger Meier
  0 siblings, 2 replies; 4+ messages in thread
From: Petr Uzel @ 2014-05-26 16:28 UTC (permalink / raw)
  To: util-linux; +Cc: Roberto Angelino, Holger Hetterich, Stanislav Brabec

Sfdisk prints out a warning about extended partition not
starting at a cylinder boundary. Since this is irrelevant
for linux, the -L option should suppress this warning.

Signed-off-by: Petr Uzel <petr.uzel@suse.cz>
---
 disk-utils/sfdisk.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/disk-utils/sfdisk.c b/disk-utils/sfdisk.c
index 3c55d5e..12162af 100644
--- a/disk-utils/sfdisk.c
+++ b/disk-utils/sfdisk.c
@@ -1383,7 +1383,7 @@ extended_partition(char *dev, int fd, struct part_desc *ep, struct disk_desc *z)
 		      "from %lld to %lld\n"
 		      "(For listing purposes only. "
 		      "Do not change its contents.)"), ep->start, start);
-	} else {
+	} else if (!Linux) {
 	    warnx(_("Warning: extended partition does not start at a "
 		      "cylinder boundary.\n"
 		      "DOS and Linux will interpret the contents differently."));
-- 
1.8.4.5


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

* Re: [PATCH] sfdisk: suppress Linux-irrelevant warnings with -L
  2014-05-26 16:28 [PATCH] sfdisk: suppress Linux-irrelevant warnings with -L Petr Uzel
@ 2014-05-27 14:43 ` Karel Zak
  2014-05-31 14:25 ` Ruediger Meier
  1 sibling, 0 replies; 4+ messages in thread
From: Karel Zak @ 2014-05-27 14:43 UTC (permalink / raw)
  To: Petr Uzel
  Cc: util-linux, Roberto Angelino, Holger Hetterich, Stanislav Brabec

On Mon, May 26, 2014 at 06:28:03PM +0200, Petr Uzel wrote:
>  disk-utils/sfdisk.c | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)

 Applied, thanks.

    Karel

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

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

* Re: [PATCH] sfdisk: suppress Linux-irrelevant warnings with -L
  2014-05-26 16:28 [PATCH] sfdisk: suppress Linux-irrelevant warnings with -L Petr Uzel
  2014-05-27 14:43 ` Karel Zak
@ 2014-05-31 14:25 ` Ruediger Meier
  2014-06-02  7:49   ` Karel Zak
  1 sibling, 1 reply; 4+ messages in thread
From: Ruediger Meier @ 2014-05-31 14:25 UTC (permalink / raw)
  To: Petr Uzel
  Cc: util-linux, Roberto Angelino, Holger Hetterich, Stanislav Brabec

On Monday 26 May 2014, Petr Uzel wrote:
> Sfdisk prints out a warning about extended partition not
> starting at a cylinder boundary. Since this is irrelevant
> for linux, the -L option should suppress this warning.

I would really like to have -L enabled by default on linux. Project name
is util-LINUX and if we even run it on linux, why being still bothered 
per default?

BTW we have some more warnings of this kind in libfdisk/src/dos.c
where we don't have option -L:

/* Same physical / logical beginning? */
if (cxt->geom.cylinders <= 1024
    && (pbc != lbc || pbh != lbh || pbs != lbs)) {
       fdisk_warnx(cxt, _("Partition %zu: different physical/logical "
               "beginnings (non-Linux?): "
               "phys=(%d, %d, %d), logical=(%d, %d, %d)"),
                partition + 1,
                pbc, pbh, pbs,
                lbc, lbh, lbs);
}


> Signed-off-by: Petr Uzel <petr.uzel@suse.cz>
> ---
>  disk-utils/sfdisk.c | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
>
> diff --git a/disk-utils/sfdisk.c b/disk-utils/sfdisk.c
> index 3c55d5e..12162af 100644
> --- a/disk-utils/sfdisk.c
> +++ b/disk-utils/sfdisk.c
> @@ -1383,7 +1383,7 @@ extended_partition(char *dev, int fd, struct
> part_desc *ep, struct disk_desc *z) "from %lld to %lld\n"
>  		      "(For listing purposes only. "
>  		      "Do not change its contents.)"), ep->start, start);
> -	} else {
> +	} else if (!Linux) {
>  	    warnx(_("Warning: extended partition does not start at a "
>  		      "cylinder boundary.\n"
>

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

* Re: [PATCH] sfdisk: suppress Linux-irrelevant warnings with -L
  2014-05-31 14:25 ` Ruediger Meier
@ 2014-06-02  7:49   ` Karel Zak
  0 siblings, 0 replies; 4+ messages in thread
From: Karel Zak @ 2014-06-02  7:49 UTC (permalink / raw)
  To: Ruediger Meier
  Cc: Petr Uzel, util-linux, Roberto Angelino, Holger Hetterich,
	Stanislav Brabec

On Sat, May 31, 2014 at 04:25:32PM +0200, Ruediger Meier wrote:
> On Monday 26 May 2014, Petr Uzel wrote:
> > Sfdisk prints out a warning about extended partition not
> > starting at a cylinder boundary. Since this is irrelevant
> > for linux, the -L option should suppress this warning.
> 
> I would really like to have -L enabled by default on linux. Project name
> is util-LINUX and if we even run it on linux, why being still bothered 
> per default?

sfdisk code sucks and it's necessary to rewrite it to use libfdisk
(sfdisk is the last remaining fdisk), I'd like to do this change in
v2.26.

> BTW we have some more warnings of this kind in libfdisk/src/dos.c
> where we don't have option -L:
> 
> /* Same physical / logical beginning? */
> if (cxt->geom.cylinders <= 1024
>     && (pbc != lbc || pbh != lbh || pbs != lbs)) {
>        fdisk_warnx(cxt, _("Partition %zu: different physical/logical "
>                "beginnings (non-Linux?): "
>                "phys=(%d, %d, %d), logical=(%d, %d, %d)"),
>                 partition + 1,
>                 pbc, pbh, pbs,
>                 lbc, lbh, lbs);
> }

this code is for DOS compatible mode which is disabled by default

    Karel

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

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

end of thread, other threads:[~2014-06-02  7:49 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2014-05-26 16:28 [PATCH] sfdisk: suppress Linux-irrelevant warnings with -L Petr Uzel
2014-05-27 14:43 ` Karel Zak
2014-05-31 14:25 ` Ruediger Meier
2014-06-02  7:49   ` Karel Zak

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