[PATCH 0/1] add bg_env tools support for md configured raid systems

29 views
Skip to first unread message

Erdem Kahraman

unread,
Dec 11, 2024, 2:43:18 AM12/11/24
to efibootg...@googlegroups.com, Erdem Kahraman
Add bg_env tools support for md configured raid systems:

- Enhance bg_printenv and bg_setenv tools to handle md RAID devices with partition numbers
- Fix device probing for /dev/md127p1 type partitions
- Improve compatibility with md RAID configurations

Resolves: Lack of support for partitioned md RAID devices

Erdem Kahraman (1):
add bg_env tools support for md configured raid systems

env/env_config_partitions.c | 3 ++-
1 file changed, 2 insertions(+), 1 deletion(-)

--
2.39.5

Erdem Kahraman

unread,
Dec 11, 2024, 2:43:19 AM12/11/24
to efibootg...@googlegroups.com, Erdem Kahraman
Signed-off-by: Erdem Kahraman <erdem.k...@siemens.com>
---
env/env_config_partitions.c | 3 ++-
1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/env/env_config_partitions.c b/env/env_config_partitions.c
index eae7be1..870f8d3 100644
--- a/env/env_config_partitions.c
+++ b/env/env_config_partitions.c
@@ -129,7 +129,8 @@ bool probe_config_partitions(CONFIG_PART *cfgpart, bool search_all_devices)
}
if (strncmp("/dev/mmcblk", dev->path, 11) == 0 ||
strncmp("/dev/loop", dev->path, 9) == 0 ||
- strncmp("/dev/nvme", dev->path, 9) == 0) {
+ strncmp("/dev/nvme", dev->path, 9) == 0) ||
+ strncmp("/dev/md", dev->path, 7) == 0 {
(void)snprintf(devpath, 4096, "%sp%u",
dev->path, part->num);
} else {
--
2.39.5

Jan Kiszka

unread,
Dec 11, 2024, 4:33:05 AM12/11/24
to Erdem Kahraman, efibootg...@googlegroups.com
You are missing a brief commit message here, telling us why we need this
change. You had that in the first version of the patch.

Apropos versioning: Please mark follow-up submissions like this:

[PATCH v3 1/1] ...
Good news: patch format is technically fine now!

Jan

--
Siemens AG, Foundational Technologies
Linux Expert Center

Erdem Kahraman

unread,
Dec 11, 2024, 4:45:54 AM12/11/24
to efibootg...@googlegroups.com, Erdem Kahraman
This change adds support for md configured RAID systems in the bg_env tools.
It ensures that the tool correctly identifies and handles RAID partitions
configured with md.

Signed-off-by: Erdem Kahraman <erdem.k...@siemens.com>
---
env/env_config_partitions.c | 3 ++-
1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/env/env_config_partitions.c b/env/env_config_partitions.c
index eae7be1..870f8d3 100644
--- a/env/env_config_partitions.c
+++ b/env/env_config_partitions.c
@@ -129,7 +129,8 @@ bool probe_config_partitions(CONFIG_PART *cfgpart, bool search_all_devices)
}
if (strncmp("/dev/mmcblk", dev->path, 11) == 0 ||
strncmp("/dev/loop", dev->path, 9) == 0 ||
- strncmp("/dev/nvme", dev->path, 9) == 0) {
+ strncmp("/dev/nvme", dev->path, 9) == 0) ||
+ strncmp("/dev/md", dev->path, 7) == 0 {
(void)snprintf(devpath, 4096, "%sp%u",
dev->path, part->num);
} else {
--
2.39.5

Jan Kiszka

unread,
Dec 11, 2024, 5:52:55 AM12/11/24
to Erdem Kahraman, efibootg...@googlegroups.com
Unfortunately, this version was now white-space mangled again. I fixed
that up and applied it nevertheless, but please take care next time.

Jan Kiszka

unread,
Dec 11, 2024, 5:57:03 AM12/11/24
to Erdem Kahraman, efibootg...@googlegroups.com
On 11.12.24 11:52, 'Jan Kiszka' via EFI Boot Guard wrote:
> On 11.12.24 10:45, 'Erdem Kahraman' via EFI Boot Guard wrote:
>> This change adds support for md configured RAID systems in the bg_env tools.
>> It ensures that the tool correctly identifies and handles RAID partitions
>> configured with md.
>>
>> Signed-off-by: Erdem Kahraman <erdem.k...@siemens.com>
>> ---
>> env/env_config_partitions.c | 3 ++-
>> 1 file changed, 2 insertions(+), 1 deletion(-)
>>
>> diff --git a/env/env_config_partitions.c b/env/env_config_partitions.c
>> index eae7be1..870f8d3 100644
>> --- a/env/env_config_partitions.c
>> +++ b/env/env_config_partitions.c
>> @@ -129,7 +129,8 @@ bool probe_config_partitions(CONFIG_PART *cfgpart, bool search_all_devices)
>> }
>> if (strncmp("/dev/mmcblk", dev->path, 11) == 0 ||
>> strncmp("/dev/loop", dev->path, 9) == 0 ||
>> - strncmp("/dev/nvme", dev->path, 9) == 0) {
>> + strncmp("/dev/nvme", dev->path, 9) == 0) ||
^^^

Also fixed this up now - simple patches tend to be send untested ;)

Jan
Reply all
Reply to author
Forward
0 new messages