Skip to contentSkip to conversation

Make number of GPT partitions a configurable option

PATCH In review Santosh Sivaraj 3 participants 7 messages Jan 8, 2014 – Jan 10, 2014 1 message not in the archive

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 Make number of GPT partitions a configurable option

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.

---
 common/partitions/Kconfig  | 5 +++++
 common/partitions/parser.h | 2 +-
 2 files changed, 6 insertions(+), 1 deletion(-)
common/partitions/Kconfig +5 -0
index 90238ad..f3353dd 100644
@@ -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
common/partitions/parser.h +1 -1
index 8d39452..d1154d7 100644
@@ -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 {
Signature · 7 lines
1.8.4.2
 

_______________________________________________
barebox mailing list
[email protected]
http://lists.infradead.org/mailman/listinfo/barebox
#1 lore raw

Hi Santosh,

Quoted 15 lines · Santosh Sivaraj

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.

---
 common/partitions/Kconfig  | 5 +++++
 common/partitions/parser.h | 2 +-
 2 files changed, 6 insertions(+), 1 deletion(-)
common/partitions/Kconfig +0 -0
index 90238ad..f3353dd 100644

common/partitions/Kconfig config PARTITION_DISK_EFI_GPT_COMPARE · line 38

Quoted 8 lines
common/partitions/Kconfig +5 -0
@@ -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

Signature · 9 lines
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
[email protected]
http://lists.infradead.org/mailman/listinfo/barebox
#2 lore raw
Quoted 22 lines · Sascha Hauer

Hi Santosh,

Quoted 19 lines · Santosh Sivaraj

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.

---
 common/partitions/Kconfig  | 5 +++++
 common/partitions/parser.h | 2 +-
 2 files changed, 6 insertions(+), 1 deletion(-)
common/partitions/Kconfig +1 -0
index 90238ad..f3353dd 100644
@@ -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"
+
Quoted 8 lines

common/partitions/Kconfig config PARTITION_DISK_EFI_GPT_COMPARE · line 38

Quoted 4 lines
common/partitions/Kconfig +4 -0
+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.

Quoted 13 lines

Sascha

Signature · 9 lines
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
[email protected]
http://lists.infradead.org/mailman/listinfo/barebox

_______________________________________________
barebox mailing list
[email protected]
http://lists.infradead.org/mailman/listinfo/barebox

A message that is not in the archive (sent off-list or not yet received): [email protected]

#4 lore raw

* Santosh Sivaraj <[email protected]> wrote (on 2014-01-09 21:36:41 +0530):

adding list, missed it.

Quoted 48 lines

* Jean-Christophe PLAGNIOL-VILLARD <[email protected]> wrote (on 2014-01-09 08:29:14 +0100):

Quoted 32 lines · Sascha Hauer
Quoted 22 lines

Hi Santosh,

Quoted 19 lines · Santosh Sivaraj

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.

---
 common/partitions/Kconfig  | 5 +++++
 common/partitions/parser.h | 2 +-
 2 files changed, 6 insertions(+), 1 deletion(-)
common/partitions/Kconfig +1 -0
index 90238ad..f3353dd 100644
@@ -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"
+
Quoted 8 lines

common/partitions/Kconfig config PARTITION_DISK_EFI_GPT_COMPARE · line 38

Quoted 4 lines
common/partitions/Kconfig +4 -0
+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.

Quoted 7 lines

agreed but a limit will be good too

Best Regards,
J.

Quoted 3 lines

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

Signature · 4 lines
_______________________________________________
barebox mailing list
[email protected]
http://lists.infradead.org/mailman/listinfo/barebox
#5 lore raw
Quoted 19 lines · Santosh Sivaraj

* Santosh Sivaraj <[email protected]> wrote (on 2014-01-09 21:36:41 +0530):

adding list, missed it.

Quoted 16 lines
Quoted 12 lines
Quoted 4 lines

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.

Quoted 3 lines

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

Signature · 9 lines
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
[email protected]
http://lists.infradead.org/mailman/listinfo/barebox
#6 lore raw
Quoted 17 lines · Sascha Hauer
Quoted 16 lines · Santosh Sivaraj

* Santosh Sivaraj <[email protected]> wrote (on 2014-01-09 21:36:41 +0530):

adding list, missed it.

Quoted 13 lines
Quoted 12 lines
Quoted 4 lines

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.

Quoted 3 lines

Sascha

Quoted 8 lines
Quoted 3 lines
Quoted 3 lines

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.

Quoted 8 lines

Sascha

Signature · 4 lines
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
[email protected]
http://lists.infradead.org/mailman/listinfo/barebox

#7 lore raw
Quoted 22 lines · Jean-Christophe PLAGNIOL-VILLARD
Quoted 21 lines · Sascha Hauer
Quoted 19 lines · Santosh Sivaraj

* Santosh Sivaraj <[email protected]> wrote (on 2014-01-09 21:36:41 +0530):

adding list, missed it.

Quoted 16 lines
Quoted 12 lines
Quoted 4 lines

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.

Quoted 3 lines

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.

Quoted 8 lines
Quoted 4 lines

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

Signature · 9 lines
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
[email protected]
http://lists.infradead.org/mailman/listinfo/barebox