mail archive of the barebox mailing list
 help / color / mirror / Atom feed
* [PATCH] Make number of GPT partitions a configurable option
@ 2014-01-08  2:45 Santosh Sivaraj
  2014-01-08 14:07 ` Sascha Hauer
  0 siblings, 1 reply; 7+ messages in thread
From: Santosh Sivaraj @ 2014-01-08  2:45 UTC (permalink / raw)
  To: barebox

Theoritically there is no limit for the partitions that can be created
based on EFI/GPT, so make the number of partitions that can be visible
in barebox a configurable option.

Signed-off-by: Santosh Sivaraj <santosh@fossix.org>
---
 common/partitions/Kconfig  | 5 +++++
 common/partitions/parser.h | 2 +-
 2 files changed, 6 insertions(+), 1 deletion(-)

diff --git a/common/partitions/Kconfig b/common/partitions/Kconfig
index 90238ad..f3353dd 100644
--- a/common/partitions/Kconfig
+++ b/common/partitions/Kconfig
@@ -31,3 +31,8 @@ config PARTITION_DISK_EFI_GPT_COMPARE
 	depends on PARTITION_DISK_EFI
 	default y
 	bool "EFI: GPT: compare primary and Alternate GPT header for validity"
+
+config MAX_PARTITIONS
+	depends on PARTITION_DISK_EFI
+	int "Maximum of partitions needed to be supported on a GPT"
+	default 8
diff --git a/common/partitions/parser.h b/common/partitions/parser.h
index 8d39452..d1154d7 100644
--- a/common/partitions/parser.h
+++ b/common/partitions/parser.h
@@ -11,7 +11,7 @@
 #include <filetype.h>
 #include <linux/list.h>
 
-#define MAX_PARTITION		8
+#define MAX_PARTITION		CONFIG_MAX_PARTITIONS
 #define MAX_PARTITION_NAME	38
 
 struct partition {
-- 
1.8.4.2
 

_______________________________________________
barebox mailing list
barebox@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/barebox

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

* Re: [PATCH] Make number of GPT partitions a configurable option
  2014-01-08  2:45 [PATCH] Make number of GPT partitions a configurable option Santosh Sivaraj
@ 2014-01-08 14:07 ` Sascha Hauer
  2014-01-09  7:29   ` Jean-Christophe PLAGNIOL-VILLARD
  0 siblings, 1 reply; 7+ messages in thread
From: Sascha Hauer @ 2014-01-08 14:07 UTC (permalink / raw)
  To: Santosh Sivaraj; +Cc: barebox

Hi Santosh,

On Wed, Jan 08, 2014 at 08:15:39AM +0530, Santosh Sivaraj wrote:
> Theoritically there is no limit for the partitions that can be created
> based on EFI/GPT, so make the number of partitions that can be visible
> in barebox a configurable option.
> 
> Signed-off-by: Santosh Sivaraj <santosh@fossix.org>
> ---
>  common/partitions/Kconfig  | 5 +++++
>  common/partitions/parser.h | 2 +-
>  2 files changed, 6 insertions(+), 1 deletion(-)
> 
> diff --git a/common/partitions/Kconfig b/common/partitions/Kconfig
> index 90238ad..f3353dd 100644
> --- a/common/partitions/Kconfig
> +++ b/common/partitions/Kconfig
> @@ -31,3 +31,8 @@ config PARTITION_DISK_EFI_GPT_COMPARE
>  	depends on PARTITION_DISK_EFI
>  	default y
>  	bool "EFI: GPT: compare primary and Alternate GPT header for validity"
> +
> +config MAX_PARTITIONS
> +	depends on PARTITION_DISK_EFI
> +	int "Maximum of partitions needed to be supported on a GPT"
> +	default 8

Can we instead allocate the partitions dynamically? This limitation to
eight partitions we currently have is not nice, but making it
configurable is not a proper fix.

Sascha

-- 
Pengutronix e.K.                           |                             |
Industrial Linux Solutions                 | http://www.pengutronix.de/  |
Peiner Str. 6-8, 31137 Hildesheim, Germany | Phone: +49-5121-206917-0    |
Amtsgericht Hildesheim, HRA 2686           | Fax:   +49-5121-206917-5555 |

_______________________________________________
barebox mailing list
barebox@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/barebox

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

* Re: [PATCH] Make number of GPT partitions a configurable option
  2014-01-08 14:07 ` Sascha Hauer
@ 2014-01-09  7:29   ` Jean-Christophe PLAGNIOL-VILLARD
       [not found]     ` <20140109160641.GA7102@san0.fossix.org>
  0 siblings, 1 reply; 7+ messages in thread
From: Jean-Christophe PLAGNIOL-VILLARD @ 2014-01-09  7:29 UTC (permalink / raw)
  To: Sascha Hauer; +Cc: barebox

On 15:07 Wed 08 Jan     , Sascha Hauer wrote:
> Hi Santosh,
> 
> On Wed, Jan 08, 2014 at 08:15:39AM +0530, Santosh Sivaraj wrote:
> > Theoritically there is no limit for the partitions that can be created
> > based on EFI/GPT, so make the number of partitions that can be visible
> > in barebox a configurable option.
> > 
> > Signed-off-by: Santosh Sivaraj <santosh@fossix.org>
> > ---
> >  common/partitions/Kconfig  | 5 +++++
> >  common/partitions/parser.h | 2 +-
> >  2 files changed, 6 insertions(+), 1 deletion(-)
> > 
> > diff --git a/common/partitions/Kconfig b/common/partitions/Kconfig
> > index 90238ad..f3353dd 100644
> > --- a/common/partitions/Kconfig
> > +++ b/common/partitions/Kconfig
> > @@ -31,3 +31,8 @@ config PARTITION_DISK_EFI_GPT_COMPARE
> >  	depends on PARTITION_DISK_EFI
> >  	default y
> >  	bool "EFI: GPT: compare primary and Alternate GPT header for validity"
> > +
> > +config MAX_PARTITIONS
> > +	depends on PARTITION_DISK_EFI
> > +	int "Maximum of partitions needed to be supported on a GPT"
> > +	default 8
> 
> Can we instead allocate the partitions dynamically? This limitation to
> eight partitions we currently have is not nice, but making it
> configurable is not a proper fix.

agreed but a limit will be good too

Best Regards,
J.
> 
> Sascha
> 
> -- 
> Pengutronix e.K.                           |                             |
> Industrial Linux Solutions                 | http://www.pengutronix.de/  |
> Peiner Str. 6-8, 31137 Hildesheim, Germany | Phone: +49-5121-206917-0    |
> Amtsgericht Hildesheim, HRA 2686           | Fax:   +49-5121-206917-5555 |
> 
> _______________________________________________
> barebox mailing list
> barebox@lists.infradead.org
> http://lists.infradead.org/mailman/listinfo/barebox

_______________________________________________
barebox mailing list
barebox@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/barebox

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

* Re: [PATCH] Make number of GPT partitions a configurable option
       [not found]     ` <20140109160641.GA7102@san0.fossix.org>
@ 2014-01-09 16:29       ` Santosh Sivaraj
  2014-01-10  8:02         ` Sascha Hauer
  0 siblings, 1 reply; 7+ messages in thread
From: Santosh Sivaraj @ 2014-01-09 16:29 UTC (permalink / raw)
  To: Jean-Christophe PLAGNIOL-VILLARD; +Cc: barebox

* Santosh Sivaraj <santosh@fossix.org> wrote (on 2014-01-09 21:36:41 +0530):

adding list, missed it.

> * Jean-Christophe PLAGNIOL-VILLARD <plagnioj@jcrosoft.com> wrote (on 2014-01-09 08:29:14 +0100):
> 
> > On 15:07 Wed 08 Jan     , Sascha Hauer wrote:
> > > Hi Santosh,
> > > 
> > > On Wed, Jan 08, 2014 at 08:15:39AM +0530, Santosh Sivaraj wrote:
> > > > Theoritically there is no limit for the partitions that can be created
> > > > based on EFI/GPT, so make the number of partitions that can be visible
> > > > in barebox a configurable option.
> > > > 
> > > > Signed-off-by: Santosh Sivaraj <santosh@fossix.org>
> > > > ---
> > > >  common/partitions/Kconfig  | 5 +++++
> > > >  common/partitions/parser.h | 2 +-
> > > >  2 files changed, 6 insertions(+), 1 deletion(-)
> > > > 
> > > > diff --git a/common/partitions/Kconfig b/common/partitions/Kconfig
> > > > index 90238ad..f3353dd 100644
> > > > --- a/common/partitions/Kconfig
> > > > +++ b/common/partitions/Kconfig
> > > > @@ -31,3 +31,8 @@ config PARTITION_DISK_EFI_GPT_COMPARE
> > > >  	depends on PARTITION_DISK_EFI
> > > >  	default y
> > > >  	bool "EFI: GPT: compare primary and Alternate GPT header for validity"
> > > > +
> > > > +config MAX_PARTITIONS
> > > > +	depends on PARTITION_DISK_EFI
> > > > +	int "Maximum of partitions needed to be supported on a GPT"
> > > > +	default 8
> > > 
> > > Can we instead allocate the partitions dynamically? This limitation to
> > > eight partitions we currently have is not nice, but making it
> > > configurable is not a proper fix.
> > 
> > agreed but a limit will be good too
> > 
> > Best Regards,
> > J.
> > > 
> > > Sascha
> > > 
> 
> We could keep a configurable maximum, with a high default, but do the allocation
> dynamically. I will try to send in a patch, we can discuss how it needs to be
> done over it.
> 
> Thanks,
> Santosh

-- 

_______________________________________________
barebox mailing list
barebox@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/barebox

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

* Re: [PATCH] Make number of GPT partitions a configurable option
  2014-01-09 16:29       ` Santosh Sivaraj
@ 2014-01-10  8:02         ` Sascha Hauer
  2014-01-10  8:24           ` Jean-Christophe PLAGNIOL-VILLARD
  0 siblings, 1 reply; 7+ messages in thread
From: Sascha Hauer @ 2014-01-10  8:02 UTC (permalink / raw)
  To: Santosh Sivaraj; +Cc: barebox

On Thu, Jan 09, 2014 at 09:59:33PM +0530, Santosh Sivaraj wrote:
> * Santosh Sivaraj <santosh@fossix.org> wrote (on 2014-01-09 21:36:41 +0530):
> 
> adding list, missed it.
> > > > 
> > > > Can we instead allocate the partitions dynamically? This limitation to
> > > > eight partitions we currently have is not nice, but making it
> > > > configurable is not a proper fix.
> > > 
> > > agreed but a limit will be good too
> > > 
> > > Best Regards,
> > > J.
> > > > 
> > > > Sascha
> > > > 
> > 
> > We could keep a configurable maximum, with a high default, but do the allocation
> > dynamically. I will try to send in a patch, we can discuss how it needs to be
> > done over it.

It shouldn't be configurable in Kconfig. That's not a question a user
should have to answer when configuring barebox. I high default would be
fine with me though since memory usually is an infinite resource in
barebox.

Sascha

-- 
Pengutronix e.K.                           |                             |
Industrial Linux Solutions                 | http://www.pengutronix.de/  |
Peiner Str. 6-8, 31137 Hildesheim, Germany | Phone: +49-5121-206917-0    |
Amtsgericht Hildesheim, HRA 2686           | Fax:   +49-5121-206917-5555 |

_______________________________________________
barebox mailing list
barebox@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/barebox

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

* Re: [PATCH] Make number of GPT partitions a configurable option
  2014-01-10  8:02         ` Sascha Hauer
@ 2014-01-10  8:24           ` Jean-Christophe PLAGNIOL-VILLARD
  2014-01-10  8:49             ` Sascha Hauer
  0 siblings, 1 reply; 7+ messages in thread
From: Jean-Christophe PLAGNIOL-VILLARD @ 2014-01-10  8:24 UTC (permalink / raw)
  To: Sascha Hauer; +Cc: barebox

On 09:02 Fri 10 Jan     , Sascha Hauer wrote:
> On Thu, Jan 09, 2014 at 09:59:33PM +0530, Santosh Sivaraj wrote:
> > * Santosh Sivaraj <santosh@fossix.org> wrote (on 2014-01-09 21:36:41 +0530):
> > 
> > adding list, missed it.
> > > > > 
> > > > > Can we instead allocate the partitions dynamically? This limitation to
> > > > > eight partitions we currently have is not nice, but making it
> > > > > configurable is not a proper fix.
> > > > 
> > > > agreed but a limit will be good too
> > > > 
> > > > Best Regards,
> > > > J.
> > > > > 
> > > > > Sascha
> > > > > 
> > > 
> > > We could keep a configurable maximum, with a high default, but do the allocation
> > > dynamically. I will try to send in a patch, we can discuss how it needs to be
> > > done over it.
> 
> It shouldn't be configurable in Kconfig. That's not a question a user
> should have to answer when configuring barebox. I high default would be
> fine with me though since memory usually is an infinite resource in
> barebox.

I'm more thiking of a broken EFI GPT that have 1000s of partition

do we really need to handle that

Best Regards,
J.
> 
> Sascha
> 
> -- 
> Pengutronix e.K.                           |                             |
> Industrial Linux Solutions                 | http://www.pengutronix.de/  |
> Peiner Str. 6-8, 31137 Hildesheim, Germany | Phone: +49-5121-206917-0    |
> Amtsgericht Hildesheim, HRA 2686           | Fax:   +49-5121-206917-5555 |

_______________________________________________
barebox mailing list
barebox@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/barebox

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

* Re: [PATCH] Make number of GPT partitions a configurable option
  2014-01-10  8:24           ` Jean-Christophe PLAGNIOL-VILLARD
@ 2014-01-10  8:49             ` Sascha Hauer
  0 siblings, 0 replies; 7+ messages in thread
From: Sascha Hauer @ 2014-01-10  8:49 UTC (permalink / raw)
  To: Jean-Christophe PLAGNIOL-VILLARD; +Cc: barebox

On Fri, Jan 10, 2014 at 09:24:24AM +0100, Jean-Christophe PLAGNIOL-VILLARD wrote:
> On 09:02 Fri 10 Jan     , Sascha Hauer wrote:
> > On Thu, Jan 09, 2014 at 09:59:33PM +0530, Santosh Sivaraj wrote:
> > > * Santosh Sivaraj <santosh@fossix.org> wrote (on 2014-01-09 21:36:41 +0530):
> > > 
> > > adding list, missed it.
> > > > > > 
> > > > > > Can we instead allocate the partitions dynamically? This limitation to
> > > > > > eight partitions we currently have is not nice, but making it
> > > > > > configurable is not a proper fix.
> > > > > 
> > > > > agreed but a limit will be good too
> > > > > 
> > > > > Best Regards,
> > > > > J.
> > > > > > 
> > > > > > Sascha
> > > > > > 
> > > > 
> > > > We could keep a configurable maximum, with a high default, but do the allocation
> > > > dynamically. I will try to send in a patch, we can discuss how it needs to be
> > > > done over it.
> > 
> > It shouldn't be configurable in Kconfig. That's not a question a user
> > should have to answer when configuring barebox. I high default would be
> > fine with me though since memory usually is an infinite resource in
> > barebox.
> 
> I'm more thiking of a broken EFI GPT that have 1000s of partition
> 
> do we really need to handle that

Indeed it seems we can assume that something is wrong when a device has
1000s of partitions. So where do we set the border? 64?

Sascha

-- 
Pengutronix e.K.                           |                             |
Industrial Linux Solutions                 | http://www.pengutronix.de/  |
Peiner Str. 6-8, 31137 Hildesheim, Germany | Phone: +49-5121-206917-0    |
Amtsgericht Hildesheim, HRA 2686           | Fax:   +49-5121-206917-5555 |

_______________________________________________
barebox mailing list
barebox@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/barebox

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

end of thread, other threads:[~2014-01-10  8:50 UTC | newest]

Thread overview: 7+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2014-01-08  2:45 [PATCH] Make number of GPT partitions a configurable option Santosh Sivaraj
2014-01-08 14:07 ` Sascha Hauer
2014-01-09  7:29   ` Jean-Christophe PLAGNIOL-VILLARD
     [not found]     ` <20140109160641.GA7102@san0.fossix.org>
2014-01-09 16:29       ` Santosh Sivaraj
2014-01-10  8:02         ` Sascha Hauer
2014-01-10  8:24           ` Jean-Christophe PLAGNIOL-VILLARD
2014-01-10  8:49             ` Sascha Hauer

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