[PATCH v4] wic/plugins: gate root= with rootdev check for efi, pcbios and partition

22 views
Skip to first unread message

Gourav Singh

unread,
May 28, 2026, 2:38:41 AMMay 28
to isar-...@googlegroups.com, cedric.h...@siemens.com, jan.k...@siemens.com, felix.mo...@siemens.com, Gourav Singh
Checks for creator.rootdev (or cr.rootdev) being None were missing
and would cause the kernel command line to contain "root=None". When
using the Discoverable Partitions Specification, no root= parameter
should appear on the kernel command line, as root=None is not valid.

This fix mirrors the same change applied to the upstream wic plugins:
https://lists.yoctoproject.org/g/yocto-patches/topic/wic_patch_v2_wic_plugins/119493445

Signed-off-by: Cedric Hombourger <cedric.h...@siemens.com>
Signed-off-by: Gourav Singh <goura...@siemens.com>
---
.../wic/plugins/source/bootimg-efi-isar.py | 7 ++++---
.../wic/plugins/source/bootimg-pcbios-isar.py | 20 ++++++++++++++-----
scripts/lib/wic/plugins/source/bootimg-efi.py | 7 ++++---
.../wic/plugins/source/bootimg-partition.py | 11 ++++++++--
.../lib/wic/plugins/source/bootimg-pcbios.py | 10 ++++++++--
5 files changed, 40 insertions(+), 15 deletions(-)

diff --git a/meta/scripts/lib/wic/plugins/source/bootimg-efi-isar.py b/meta/scripts/lib/wic/plugins/source/bootimg-efi-isar.py
index 6bc78d42..28b6af63 100644
--- a/meta/scripts/lib/wic/plugins/source/bootimg-efi-isar.py
+++ b/meta/scripts/lib/wic/plugins/source/bootimg-efi-isar.py
@@ -104,7 +104,7 @@ class BootimgEFIPlugin(SourcePlugin):
(get_bitbake_var("KERNEL_IMAGETYPE"), get_bitbake_var("INITRAMFS_LINK_NAME"))

label = source_params.get('label')
- label_conf = "root=%s" % creator.rootdev
+ label_conf = "root=%s" % creator.rootdev if creator.rootdev else ""
if label:
label_conf = "LABEL=%s" % label

@@ -201,7 +201,8 @@ class BootimgEFIPlugin(SourcePlugin):
boot_conf += "linux /%s\n" % kernel

label = source_params.get('label')
- label_conf = "LABEL=Boot root=%s" % creator.rootdev
+ label_conf = "LABEL=Boot"
+ label_conf += (" root=%s" % creator.rootdev) if creator.rootdev else ""
if label:
label_conf = "LABEL=%s" % label

@@ -366,7 +367,7 @@ class BootimgEFIPlugin(SourcePlugin):

with tempfile.TemporaryDirectory() as tmp_dir:
label = source_params.get('label')
- label_conf = "root=%s" % creator.rootdev
+ label_conf = "root=%s" % creator.rootdev if creator.rootdev else ""
if label:
label_conf = "LABEL=%s" % label

diff --git a/meta/scripts/lib/wic/plugins/source/bootimg-pcbios-isar.py b/meta/scripts/lib/wic/plugins/source/bootimg-pcbios-isar.py
index d5040b72..bb126df8 100644
--- a/meta/scripts/lib/wic/plugins/source/bootimg-pcbios-isar.py
+++ b/meta/scripts/lib/wic/plugins/source/bootimg-pcbios-isar.py
@@ -140,14 +140,24 @@ class BootimgPcbiosIsarPlugin(SourcePlugin):

syslinux_conf += "KERNEL " + kernel + "\n"

- syslinux_conf += "APPEND label=boot root=%s %s\n" % \
- (creator.rootdev, bootloader.append)
+ parts = ["label=boot"]
+ if creator.rootdev:
+ parts.append("root=%s" % creator.rootdev)
+ if bootloader.append:
+ parts.append(bootloader.append)
+
+ syslinux_conf += "APPEND %s\n" % " ".join(parts)

# if we are using an initrd, smuggle it in
if initrd:
- syslinux_conf = syslinux_conf.replace(
- " root=%s " % (creator.rootdev),
- " root=%s initrd=%s " % (creator.rootdev, initrd))
+ if creator.rootdev:
+ syslinux_conf = syslinux_conf.replace(
+ "root=%s" % creator.rootdev,
+ "root=%s initrd=%s" % (creator.rootdev, initrd))
+ else:
+ syslinux_conf = syslinux_conf.replace(
+ " label=boot ",
+ " label=boot initrd=%s " % initrd)

logger.debug("Writing syslinux config %s/hdd/boot/syslinux.cfg",
cr_workdir)
diff --git a/scripts/lib/wic/plugins/source/bootimg-efi.py b/scripts/lib/wic/plugins/source/bootimg-efi.py
index 13a9cddf..c18a1e71 100644
--- a/scripts/lib/wic/plugins/source/bootimg-efi.py
+++ b/scripts/lib/wic/plugins/source/bootimg-efi.py
@@ -95,7 +95,7 @@ class BootimgEFIPlugin(SourcePlugin):
(get_bitbake_var("KERNEL_IMAGETYPE"), get_bitbake_var("INITRAMFS_LINK_NAME"))

label = source_params.get('label')
- label_conf = "root=%s" % creator.rootdev
+ label_conf = "root=%s" % creator.rootdev if creator.rootdev else ""
if label:
label_conf = "LABEL=%s" % label

@@ -180,7 +180,8 @@ class BootimgEFIPlugin(SourcePlugin):
boot_conf += "linux /%s\n" % kernel

label = source_params.get('label')
- label_conf = "LABEL=Boot root=%s" % creator.rootdev
+ label_conf = "LABEL=Boot"
+ label_conf += (" root=%s" % creator.rootdev) if creator.rootdev else ""
if label:
label_conf = "LABEL=%s" % label

@@ -316,7 +317,7 @@ class BootimgEFIPlugin(SourcePlugin):

with tempfile.TemporaryDirectory() as tmp_dir:
label = source_params.get('label')
- label_conf = "root=%s" % creator.rootdev
+ label_conf = "root=%s" % creator.rootdev if creator.rootdev else ""
if label:
label_conf = "LABEL=%s" % label

diff --git a/scripts/lib/wic/plugins/source/bootimg-partition.py b/scripts/lib/wic/plugins/source/bootimg-partition.py
index 94183174..ebddcb90 100644
--- a/scripts/lib/wic/plugins/source/bootimg-partition.py
+++ b/scripts/lib/wic/plugins/source/bootimg-partition.py
@@ -153,8 +153,15 @@ class BootimgPartitionPlugin(SourcePlugin):
if has_dtb:
extlinux_conf += " fdtdir %s\n" % fdt_dir
bootloader = cr.ks.bootloader
- extlinux_conf += "append root=%s rootwait %s\n" \
- % (cr.rootdev, bootloader.append if bootloader.append else '')
+
+ # Check if rootdev exists
+ parts = ["rootwait"]
+ if cr.rootdev:
+ parts.insert(0, "root=%s" % cr.rootdev)
+ if bootloader.append:
+ parts.append(bootloader.append)
+
+ extlinux_conf += "append %s\n" % " ".join(parts)

install_cmd = "install -d %s/extlinux/" % hdddir
exec_cmd(install_cmd)
diff --git a/scripts/lib/wic/plugins/source/bootimg-pcbios.py b/scripts/lib/wic/plugins/source/bootimg-pcbios.py
index a207a835..5d5d5c23 100644
--- a/scripts/lib/wic/plugins/source/bootimg-pcbios.py
+++ b/scripts/lib/wic/plugins/source/bootimg-pcbios.py
@@ -125,8 +125,14 @@ class BootimgPcbiosPlugin(SourcePlugin):
kernel = "/" + get_bitbake_var("KERNEL_IMAGETYPE")
syslinux_conf += "KERNEL " + kernel + "\n"

- syslinux_conf += "APPEND label=boot root=%s %s\n" % \
- (creator.rootdev, bootloader.append)
+ # Check if rootdev exists
+ parts = ["label=boot"]
+ if creator.rootdev:
+ parts.append("root=%s" % creator.rootdev)
+ if bootloader.append:
+ parts.append(bootloader.append)
+
+ syslinux_conf += "APPEND %s\n" % " ".join(parts)

logger.debug("Writing syslinux config %s/hdd/boot/syslinux.cfg",
cr_workdir)
--
2.39.5

Jan Kiszka

unread,
May 28, 2026, 2:59:10 AMMay 28
to Gourav Singh, isar-...@googlegroups.com, cedric.h...@siemens.com, felix.mo...@siemens.com
On 28.05.26 08:38, Gourav Singh wrote:
> Checks for creator.rootdev (or cr.rootdev) being None were missing
> and would cause the kernel command line to contain "root=None". When
> using the Discoverable Partitions Specification, no root= parameter
> should appear on the kernel command line, as root=None is not valid.
>
> This fix mirrors the same change applied to the upstream wic plugins:
> https://lists.yoctoproject.org/g/yocto-patches/topic/wic_patch_v2_wic_plugins/119493445

I would recommend to split the upstream changes from the isar-only bits,
first bumping our imported wic bits to a well-definied upstream
revision, then adding what is needed to our forks.

Jan
--
Siemens AG, Foundational Technologies
Linux Expert Center

Singh, Gourav

unread,
Jun 24, 2026, 9:21:43 AM (12 days ago) Jun 24
to Kiszka, Jan, isar-...@googlegroups.com, Hombourger, Cedric, MOESSBAUER, Felix, Koturappa, Hemanth
Hi Jan,

Sorry for the late reply.

While working on the WIC plugins update, I noticed that because WIC has moved to the standalone project, updating to newer upstream content introduces path/layout changes in addition to normal file updates.
In Isar, this shows up as old paths under `scripts/lib/wic` / `meta*/scripts/lib/wic` versus newer upstream-style locations (`src/wic`, `example-wks`, etc.). Also, the WIC entrypoint is now `cli.py` instead
of the old `scripts/wic` style entrypoint, so Isar invocation paths are impacted too.

Could you please suggest which direction you would prefer:
- keep Isar's current path layout as much as possible, or
- migrate to the newer upstream path/entrypoint layout during the bump?

Reference: standalone WIC repository: https://git.yoctoproject.org/wic/

Thanks,
Gourav

-----Original Message-----
From: Kiszka, Jan (FT RPD CED) <jan.k...@siemens.com>
Sent: 28 May 2026 12:29
To: Singh, Gourav (FT FDS CES LX PBU 2) <goura...@siemens.com>; isar-...@googlegroups.com
Cc: Hombourger, Cedric (FT FDS CES LX) <cedric.h...@siemens.com>; Moessbauer, Felix (FT RPD CED OES-DE) <felix.mo...@siemens.com>
Subject: Re: [PATCH v4] wic/plugins: gate root= with rootdev check for efi, pcbios and partition

On 28.05.26 08:38, Gourav Singh wrote:
> Checks for creator.rootdev (or cr.rootdev) being None were missing and
> would cause the kernel command line to contain "root=None". When using
> the Discoverable Partitions Specification, no root= parameter should
> appear on the kernel command line, as root=None is not valid.
>
> This fix mirrors the same change applied to the upstream wic plugins:
> https://eur01.safelinks.protection.outlook.com/?url=https%3A%2F%2Flist
> s.yoctoproject.org%2Fg%2Fyocto-patches%2Ftopic%2Fwic_patch_v2_wic_plug
> ins%2F119493445&data=05%7C02%7Cgouravsingh%40siemens.com%7C51d7b4dcce2
> 64dab437c08debc869951%7C38ae3bcd95794fd4addab42e1495d55a%7C1%7C0%7C639
> 155483489937296%7CUnknown%7CTWFpbGZsb3d8eyJFbXB0eU1hcGkiOnRydWUsIlYiOi
> IwLjAuMDAwMCIsIlAiOiJXaW4zMiIsIkFOIjoiTWFpbCIsIldUIjoyfQ%3D%3D%7C0%7C%
> 7C%7C&sdata=mDDkNdufN2mWSSvVxGqO%2Ba2agMVACXqgU0EBnQX5GaM%3D&reserved=
> 0

MOESSBAUER, Felix

unread,
Jun 24, 2026, 9:50:35 AM (12 days ago) Jun 24
to Singh, Gourav, Kiszka, Jan, isar-...@googlegroups.com, Hombourger, Cedric, Koturappa, Hemanth
On Wed, 2026-06-24 at 13:21 +0000, Singh, Gourav (FT FDS CES LX PBU 2)
wrote:

> Hi Jan,
>
> Sorry for the late reply.
>
> While working on the WIC plugins update, I noticed that because WIC has moved to the standalone project, updating to newer upstream content introduces path/layout changes in addition to normal file updates.
> In Isar, this shows up as old paths under `scripts/lib/wic` / `meta*/scripts/lib/wic` versus newer upstream-style locations (`src/wic`, `example-wks`, etc.). Also, the WIC entrypoint is now `cli.py` instead
> of the old `scripts/wic` style entrypoint, so Isar invocation paths are impacted too.
>
> Could you please suggest which direction you would prefer:
> - keep Isar's current path layout as much as possible, or
> - migrate to the newer upstream path/entrypoint layout during the bump?

Hi,

for now we should stick to isar's current layout, but still propose the
patch upstream.

We definitely have some technical dept here, as isar is still a mono
repo. In the mid term, we need to:

- carve out bitbake and reference the upstream version (which also
means we either have to mirror and patch or avoid patches altogether)
- Decouple the target environment from the build environment, i.e. run
the wic OUTSIDE of the target chroot to not depend on an ancient python
version inside it.
- work on the build performance. It is horribly slow compared to OE
with a shared hash equiv server

OT: We further need to fix the do_rootfs_install parts, which are not
idempotent. This became a bigger issue with the SBOMs, as they might
lack checksums on partial rebuilds due to the dropped apt-cache
(working on an isolated patch for this).

On the Debian side, we need to add support for dep822...

Best regards,
Felix

Reply all
Reply to author
Forward
0 new messages