Skip to content

[issue]: porteus-hook.sh vtFindFlag is set in pipeline subshell, so fallback patch always runs #3532

@gkapetanakis

Description

@gkapetanakis

Official FAQ

  • I have checked the official FAQ.

Ventoy Version

1.1.10

What about latest release

Yes. I have tried the latest release, but the bug still exist.

Try alternative boot mode

No. I didn't try these alternative boot modes.

BIOS Mode

Both

Partition Style

MBR

Disk Capacity

N/A

Disk Manufacturer

N/A

Image file checksum (if applicable)

None

Image file download link (if applicable)

No response

What happened?

There appears to be a shell logic bug in IMG/cpio/ventoy/hook/debian/porteus-hook.sh.

In this block:

grep ... | awk ... | while read vtline; do
# ...
vtFindFlag=1
done

vtFindFlag is modified inside a pipeline loop (subshell in busybox ash), then checked outside the loop. So vtFindFlag remains 0 outside, and the fallback branch runs even when files were already found/patched.

Expected behavior: vtFindFlag should reflect whether any match was found before deciding to run fallback logic.

Suggested fix ideas (I can create a PR):

  • Avoid pipeline subshell for the loop (e.g. iterate over temp file/list)

Relevant file:

  • IMG/cpio/ventoy/hook/debian/porteus-hook.sh

Thank you!

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions