* [PATCH v2] wic/rootfs-u-boot: Allow to set root with source_params
@ 2021-08-03 11:06 Q. Gylstorff
2021-08-11 13:44 ` Anton Mikanovich
0 siblings, 1 reply; 4+ messages in thread
From: Q. Gylstorff @ 2021-08-03 11:06 UTC (permalink / raw)
To: isar-users; +Cc: Quirin Gylstorff
From: Quirin Gylstorff <quirin.gylstorff@siemens.com>
If the root device needs to be modified during boot it needs
to be set as source parameter in the wic file similar to efi
boot.
Signed-off-by: Quirin Gylstorff <quirin.gylstorff@siemens.com>
---
Changes V2:
- remove autoformatted code
meta/scripts/lib/wic/plugins/source/rootfs-u-boot.py | 9 ++++++++-
1 file changed, 8 insertions(+), 1 deletion(-)
diff --git a/meta/scripts/lib/wic/plugins/source/rootfs-u-boot.py b/meta/scripts/lib/wic/plugins/source/rootfs-u-boot.py
index 15acb57..0b4f9ee 100644
--- a/meta/scripts/lib/wic/plugins/source/rootfs-u-boot.py
+++ b/meta/scripts/lib/wic/plugins/source/rootfs-u-boot.py
@@ -60,6 +60,13 @@ class RootfsUBootPlugin(RootfsPlugin):
(rootfs_dir, image_rootfs_dir))
real_rootfs_dir = image_rootfs_dir
+ root_dev = cr.rootdev
+ if not root_dev:
+ root_dev = source_params.get("root", None)
+ if not root_dev:
+ raise WicError("root not defined, exiting.")
+ root_dev = root_dev.replace(":", "=")
+
u_boot_script = os.path.join(real_rootfs_dir,
"etc/default/u-boot-script")
if not os.path.exists(u_boot_script):
@@ -70,7 +77,7 @@ class RootfsUBootPlugin(RootfsPlugin):
cfg.write('# Generated by wic, rootfs-u-boot plugin\n')
cfg.write('ROOT_PARTITION="%d"\n' % part.realnum)
cfg.write('KERNEL_ARGS="root=%s %s"\n' % \
- (cr.rootdev, cr.ks.bootloader.append or ""))
+ (root_dev, cr.ks.bootloader.append or ""))
no_initrd = source_params.get('no_initrd') or ''
cfg.write('NO_INITRD="%s"\n' % no_initrd)
overlays = source_params.get('overlays') or ''
--
2.20.1
^ permalink raw reply [flat|nested] 4+ messages in thread
* Re: [PATCH v2] wic/rootfs-u-boot: Allow to set root with source_params
2021-08-03 11:06 [PATCH v2] wic/rootfs-u-boot: Allow to set root with source_params Q. Gylstorff
@ 2021-08-11 13:44 ` Anton Mikanovich
2021-08-11 14:43 ` Jan Kiszka
0 siblings, 1 reply; 4+ messages in thread
From: Anton Mikanovich @ 2021-08-11 13:44 UTC (permalink / raw)
To: Q. Gylstorff, isar-users
03.08.2021 14:06, Q. Gylstorff wrote:
> From: Quirin Gylstorff <quirin.gylstorff@siemens.com>
>
> If the root device needs to be modified during boot it needs
> to be set as source parameter in the wic file similar to efi
> boot.
>
> Signed-off-by: Quirin Gylstorff <quirin.gylstorff@siemens.com>
I think we also need to add a new platform with u-boot based wic image
to have this functionality covered by CI.
--
Anton Mikanovich
Promwad Ltd.
External service provider of ilbers GmbH
Maria-Merian-Str. 8
85521 Ottobrunn, Germany
+49 (89) 122 67 24-0
Commercial register Munich, HRB 214197
General Manager: Baurzhan Ismagulov
^ permalink raw reply [flat|nested] 4+ messages in thread
* Re: [PATCH v2] wic/rootfs-u-boot: Allow to set root with source_params
2021-08-11 13:44 ` Anton Mikanovich
@ 2021-08-11 14:43 ` Jan Kiszka
2021-08-11 15:42 ` Anton Mikanovich
0 siblings, 1 reply; 4+ messages in thread
From: Jan Kiszka @ 2021-08-11 14:43 UTC (permalink / raw)
To: Anton Mikanovich, Q. Gylstorff, isar-users
On 11.08.21 15:44, Anton Mikanovich wrote:
> 03.08.2021 14:06, Q. Gylstorff wrote:
>> From: Quirin Gylstorff <quirin.gylstorff@siemens.com>
>>
>> If the root device needs to be modified during boot it needs
>> to be set as source parameter in the wic file similar to efi
>> boot.
>>
>> Signed-off-by: Quirin Gylstorff <quirin.gylstorff@siemens.com>
>
> I think we also need to add a new platform with u-boot based wic image
> to have this functionality covered by CI.
>
Nope, we already have plenty of them:
$ git grep -c rootfs-u-boot meta-isar/scripts/lib/wic/canned-wks/
meta-isar/scripts/lib/wic/canned-wks/bananapi.wks:1
meta-isar/scripts/lib/wic/canned-wks/de0-nano-soc.wks.in:1
meta-isar/scripts/lib/wic/canned-wks/nanopi-neo.wks.in:1
meta-isar/scripts/lib/wic/canned-wks/sifive-fu540.wks:1
meta-isar/scripts/lib/wic/canned-wks/stm32mp15x.wks.in:1
Jan
--
Siemens AG, T RDA IOT
Corporate Competence Center Embedded Linux
^ permalink raw reply [flat|nested] 4+ messages in thread
* Re: [PATCH v2] wic/rootfs-u-boot: Allow to set root with source_params
2021-08-11 14:43 ` Jan Kiszka
@ 2021-08-11 15:42 ` Anton Mikanovich
0 siblings, 0 replies; 4+ messages in thread
From: Anton Mikanovich @ 2021-08-11 15:42 UTC (permalink / raw)
To: Jan Kiszka, Q. Gylstorff, isar-users
11.08.2021 17:43, Jan Kiszka wrote:
> On 11.08.21 15:44, Anton Mikanovich wrote:
>> I think we also need to add a new platform with u-boot based wic image
>> to have this functionality covered by CI.
>>
> Nope, we already have plenty of them:
>
> $ git grep -c rootfs-u-boot meta-isar/scripts/lib/wic/canned-wks/
> meta-isar/scripts/lib/wic/canned-wks/bananapi.wks:1
> meta-isar/scripts/lib/wic/canned-wks/de0-nano-soc.wks.in:1
> meta-isar/scripts/lib/wic/canned-wks/nanopi-neo.wks.in:1
> meta-isar/scripts/lib/wic/canned-wks/sifive-fu540.wks:1
> meta-isar/scripts/lib/wic/canned-wks/stm32mp15x.wks.in:1
>
> Jan
>
Adding root definition in sourceparams of any existing wks is also ok.
--
Anton Mikanovich
Promwad Ltd.
External service provider of ilbers GmbH
Maria-Merian-Str. 8
85521 Ottobrunn, Germany
+49 (89) 122 67 24-0
Commercial register Munich, HRB 214197
General Manager: Baurzhan Ismagulov
^ permalink raw reply [flat|nested] 4+ messages in thread
end of thread, other threads:[~2021-08-11 15:42 UTC | newest]
Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2021-08-03 11:06 [PATCH v2] wic/rootfs-u-boot: Allow to set root with source_params Q. Gylstorff
2021-08-11 13:44 ` Anton Mikanovich
2021-08-11 14:43 ` Jan Kiszka
2021-08-11 15:42 ` Anton Mikanovich
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox