* [OE-core][PATCH v3] wic/engine: error on old host debugfs for standalone directory copy
@ 2026-02-11 13:11 Daniel Dragomir
2026-02-21 21:48 ` Yoann Congal
0 siblings, 1 reply; 3+ messages in thread
From: Daniel Dragomir @ 2026-02-11 13:11 UTC (permalink / raw)
To: openembedded-core
When wic is used in standalone mode, it relies on host tools such as
debugfs. For directory host->image copies into ext* partitions, wic
uses scripted debugfs "-f" input with multiple mkdir/write commands.
Older host debugfs versions (< 1.46.5) may behave unreliably in this
mode and can silently miss files. This does not affect builds using
debugfs from OE where the version is known to be sufficiently new.
Add a debugfs version check and emit an error when an older host
debugfs is detected. The error is shown once per run and halts execution.
Changes in v2:
- adjust the last working debugfs version to 1.46.5
Changes in v3:
- switch debugfs check from warning to error
Signed-off-by: Daniel Dragomir <daniel.dragomir@windriver.com>
---
scripts/lib/wic/engine.py | 29 +++++++++++++++++++++++++++++
1 file changed, 29 insertions(+)
diff --git a/scripts/lib/wic/engine.py b/scripts/lib/wic/engine.py
index 565a0db38a..8ca8ed0dbd 100644
--- a/scripts/lib/wic/engine.py
+++ b/scripts/lib/wic/engine.py
@@ -220,6 +220,34 @@ def wic_list(args, scripts_path):
return False
+_DEBUGFS_VERSION = None
+
+def debugfs_version_check(debugfs_path, min_ver=(1, 46, 5)):
+ global _DEBUGFS_VERSION
+
+ if _DEBUGFS_VERSION is None:
+ out = ""
+ for flag in ("-V", "-v"):
+ try:
+ out = exec_cmd(f"{debugfs_path} {flag}")
+ break
+ except Exception:
+ continue
+
+ import re
+ m = re.search(r"(\d+)\.(\d+)\.(\d+)", out or "")
+ _DEBUGFS_VERSION = tuple(map(int, m.groups())) if m else None
+
+ ver = _DEBUGFS_VERSION
+
+ if ver is not None and ver < min_ver:
+ raise WicError(
+ "Sorry, debugfs 1.46.5 or later is required for this script. "
+ "Older versions of debugfs can make directory copies into ext* partitions "
+ "via scripted debugfs (-f) unreliable or broken. Detected version: %s"
+ % (".".join(map(str, ver)) if ver else "unknown")
+ )
+
class Disk:
def __init__(self, imagepath, native_sysroot, fstypes=('fat', 'ext')):
@@ -334,6 +362,7 @@ class Disk:
if self.partitions[pnum].fstype.startswith('ext'):
if isinstance(src, str): # host to image case
if os.path.isdir(src):
+ debugfs_version_check(self.debugfs)
base = os.path.abspath(src)
base_parent = os.path.dirname(base)
cmds = []
--
2.25.1
^ permalink raw reply related [flat|nested] 3+ messages in thread
* Re: [OE-core][PATCH v3] wic/engine: error on old host debugfs for standalone directory copy
2026-02-11 13:11 [OE-core][PATCH v3] wic/engine: error on old host debugfs for standalone directory copy Daniel Dragomir
@ 2026-02-21 21:48 ` Yoann Congal
2026-02-22 21:34 ` Daniel Dragomir
0 siblings, 1 reply; 3+ messages in thread
From: Yoann Congal @ 2026-02-21 21:48 UTC (permalink / raw)
To: daniel.dragomir, openembedded-core
On Wed Feb 11, 2026 at 2:11 PM CET, Daniel via lists.openembedded.org Dragomir wrote:
> When wic is used in standalone mode, it relies on host tools such as
> debugfs. For directory host->image copies into ext* partitions, wic
> uses scripted debugfs "-f" input with multiple mkdir/write commands.
>
> Older host debugfs versions (< 1.46.5) may behave unreliably in this
> mode and can silently miss files. This does not affect builds using
> debugfs from OE where the version is known to be sufficiently new.
>
> Add a debugfs version check and emit an error when an older host
> debugfs is detected. The error is shown once per run and halts execution.
>
> Changes in v2:
> - adjust the last working debugfs version to 1.46.5
>
> Changes in v3:
> - switch debugfs check from warning to error
Hello,
We missed it during review and this patch has now merge with a minor
problem: the "Changes in" notes are part of the merged commit message.
While precious during review and patch iteration, this info is not
useful once the patch has merged.
For the next patches, please put these notes below the "---" line. This
will prevent them to appear in the final merged commit.
Thanks!
>
> Signed-off-by: Daniel Dragomir <daniel.dragomir@windriver.com>
> ---
> scripts/lib/wic/engine.py | 29 +++++++++++++++++++++++++++++
> 1 file changed, 29 insertions(+)
>
> diff --git a/scripts/lib/wic/engine.py b/scripts/lib/wic/engine.py
> index 565a0db38a..8ca8ed0dbd 100644
> --- a/scripts/lib/wic/engine.py
> +++ b/scripts/lib/wic/engine.py
> @@ -220,6 +220,34 @@ def wic_list(args, scripts_path):
>
> return False
>
> +_DEBUGFS_VERSION = None
> +
> +def debugfs_version_check(debugfs_path, min_ver=(1, 46, 5)):
> + global _DEBUGFS_VERSION
> +
> + if _DEBUGFS_VERSION is None:
> + out = ""
> + for flag in ("-V", "-v"):
> + try:
> + out = exec_cmd(f"{debugfs_path} {flag}")
> + break
> + except Exception:
> + continue
> +
> + import re
> + m = re.search(r"(\d+)\.(\d+)\.(\d+)", out or "")
> + _DEBUGFS_VERSION = tuple(map(int, m.groups())) if m else None
> +
> + ver = _DEBUGFS_VERSION
> +
> + if ver is not None and ver < min_ver:
> + raise WicError(
> + "Sorry, debugfs 1.46.5 or later is required for this script. "
> + "Older versions of debugfs can make directory copies into ext* partitions "
> + "via scripted debugfs (-f) unreliable or broken. Detected version: %s"
> + % (".".join(map(str, ver)) if ver else "unknown")
> + )
> +
>
> class Disk:
> def __init__(self, imagepath, native_sysroot, fstypes=('fat', 'ext')):
> @@ -334,6 +362,7 @@ class Disk:
> if self.partitions[pnum].fstype.startswith('ext'):
> if isinstance(src, str): # host to image case
> if os.path.isdir(src):
> + debugfs_version_check(self.debugfs)
> base = os.path.abspath(src)
> base_parent = os.path.dirname(base)
> cmds = []
--
Yoann Congal
Smile ECS
^ permalink raw reply [flat|nested] 3+ messages in thread
* Re: [OE-core][PATCH v3] wic/engine: error on old host debugfs for standalone directory copy
2026-02-21 21:48 ` Yoann Congal
@ 2026-02-22 21:34 ` Daniel Dragomir
0 siblings, 0 replies; 3+ messages in thread
From: Daniel Dragomir @ 2026-02-22 21:34 UTC (permalink / raw)
To: Yoann Congal, openembedded-core
On 2/21/26 23:48, Yoann Congal wrote:
> CAUTION: This email comes from a non Wind River email account!
> Do not click links or open attachments unless you recognize the sender and know the content is safe.
>
> On Wed Feb 11, 2026 at 2:11 PM CET, Daniel via lists.openembedded.org Dragomir wrote:
>> When wic is used in standalone mode, it relies on host tools such as
>> debugfs. For directory host->image copies into ext* partitions, wic
>> uses scripted debugfs "-f" input with multiple mkdir/write commands.
>>
>> Older host debugfs versions (< 1.46.5) may behave unreliably in this
>> mode and can silently miss files. This does not affect builds using
>> debugfs from OE where the version is known to be sufficiently new.
>>
>> Add a debugfs version check and emit an error when an older host
>> debugfs is detected. The error is shown once per run and halts execution.
>>
>> Changes in v2:
>> - adjust the last working debugfs version to 1.46.5
>>
>> Changes in v3:
>> - switch debugfs check from warning to error
>
> Hello,
>
> We missed it during review and this patch has now merge with a minor
> problem: the "Changes in" notes are part of the merged commit message.
> While precious during review and patch iteration, this info is not
> useful once the patch has merged.
>
> For the next patches, please put these notes below the "---" line. This
> will prevent them to appear in the final merged commit.
>
> Thanks!
I understand. Sorry about that.
I'll add the notes correctly next time.
Daniel
>>
>> Signed-off-by: Daniel Dragomir <daniel.dragomir@windriver.com>
>> ---
>> scripts/lib/wic/engine.py | 29 +++++++++++++++++++++++++++++
>> 1 file changed, 29 insertions(+)
>>
>> diff --git a/scripts/lib/wic/engine.py b/scripts/lib/wic/engine.py
>> index 565a0db38a..8ca8ed0dbd 100644
>> --- a/scripts/lib/wic/engine.py
>> +++ b/scripts/lib/wic/engine.py
>> @@ -220,6 +220,34 @@ def wic_list(args, scripts_path):
>>
>> return False
>>
>> +_DEBUGFS_VERSION = None
>> +
>> +def debugfs_version_check(debugfs_path, min_ver=(1, 46, 5)):
>> + global _DEBUGFS_VERSION
>> +
>> + if _DEBUGFS_VERSION is None:
>> + out = ""
>> + for flag in ("-V", "-v"):
>> + try:
>> + out = exec_cmd(f"{debugfs_path} {flag}")
>> + break
>> + except Exception:
>> + continue
>> +
>> + import re
>> + m = re.search(r"(\d+)\.(\d+)\.(\d+)", out or "")
>> + _DEBUGFS_VERSION = tuple(map(int, m.groups())) if m else None
>> +
>> + ver = _DEBUGFS_VERSION
>> +
>> + if ver is not None and ver < min_ver:
>> + raise WicError(
>> + "Sorry, debugfs 1.46.5 or later is required for this script. "
>> + "Older versions of debugfs can make directory copies into ext* partitions "
>> + "via scripted debugfs (-f) unreliable or broken. Detected version: %s"
>> + % (".".join(map(str, ver)) if ver else "unknown")
>> + )
>> +
>>
>> class Disk:
>> def __init__(self, imagepath, native_sysroot, fstypes=('fat', 'ext')):
>> @@ -334,6 +362,7 @@ class Disk:
>> if self.partitions[pnum].fstype.startswith('ext'):
>> if isinstance(src, str): # host to image case
>> if os.path.isdir(src):
>> + debugfs_version_check(self.debugfs)
>> base = os.path.abspath(src)
>> base_parent = os.path.dirname(base)
>> cmds = []
>
>
> --
> Yoann Congal
> Smile ECS
>
^ permalink raw reply [flat|nested] 3+ messages in thread
end of thread, other threads:[~2026-02-22 21:34 UTC | newest]
Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2026-02-11 13:11 [OE-core][PATCH v3] wic/engine: error on old host debugfs for standalone directory copy Daniel Dragomir
2026-02-21 21:48 ` Yoann Congal
2026-02-22 21:34 ` Daniel Dragomir
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox