Hi, This was working on 12.1 at least, but due to new syntax additions this broke file name read. Cheers, Franco
Can you add an example failing command line
Sorry, was in a hurry yesterday: # touch th:is # mkimg -s gpt -o out:ok -p freebsd-ufs:=th:is mkimg: partition 1: No such file or directory There's two possible workarounds at the moment: use relative paths if the directory contains a colon or use a symbolic link if the file name contains it. If you do # touch th and run the prior command you can see that it does find the file now and fails with mkimg: writing metadata: Device not configured as expected. Cheers, Franco
manu it looks like this comes from 8f3c71c85e5f
I have made a Github PR to try fixing this bug [https://github.com/freebsd/freebsd-src/pull/2041] It uses stat() to check if the entire string exists as a file. If so, use it directly without splitting. If the full string is not a valid file, fall back to splitting at the right-most colon using strrchr().
A commit in branch main references this bug: URL: https://cgit.FreeBSD.org/src/commit/?id=50c1240ebfaf920ad12f05eb16d00f8b5b9d72e0 commit 50c1240ebfaf920ad12f05eb16d00f8b5b9d72e0 Author: Aaditya Singh <aadityavksingh@gmail.com> AuthorDate: 2026-02-21 18:13:54 +0000 Commit: Warner Losh <imp@FreeBSD.org> CommitDate: 2026-04-16 06:05:21 +0000 mkimg: Fix parsing of filenames containing colons When using PART_KIND_FILE (-p type:=filename), mkimg uses a colon to separate an optional offset (e.g., filename:offset). strsep() was being used to split the string at the first colon. This caused failures when the filename itself contained a colon (e.g., "th:is"). This patch uses stat() to check if the entire string exists as a file. If so, use it directly without splitting. If the full string is not a valid file, fall back to splitting at the right-most colon using strrchr(). Uses errc() to fail and exit immediately when an existing directory is input instead of a file in PART_KIND_FILE mode. PR: 257960 Signed-off-by: Aaditya Singh <aadityavksingh@gmail.com> Reviewed by: jlduran Pull Request: https://github.com/freebsd/freebsd-src/pull/2041 usr.bin/mkimg/mkimg.c | 24 +++++++++++++++++++++--- 1 file changed, 21 insertions(+), 3 deletions(-)
The status of this bug ought to be changed now
A commit in branch stable/15 references this bug: URL: https://cgit.FreeBSD.org/src/commit/?id=8aaf8771e2543690d60aa0d008f250d151f450cb commit 8aaf8771e2543690d60aa0d008f250d151f450cb Author: Aaditya Singh <aadityavksingh@gmail.com> AuthorDate: 2026-02-21 18:13:54 +0000 Commit: Colin Percival <cperciva@FreeBSD.org> CommitDate: 2026-10-28 01:11:42 +0000 mkimg: Fix parsing of filenames containing colons When using PART_KIND_FILE (-p type:=filename), mkimg uses a colon to separate an optional offset (e.g., filename:offset). strsep() was being used to split the string at the first colon. This caused failures when the filename itself contained a colon (e.g., "th:is"). This patch uses stat() to check if the entire string exists as a file. If so, use it directly without splitting. If the full string is not a valid file, fall back to splitting at the right-most colon using strrchr(). Uses errc() to fail and exit immediately when an existing directory is input instead of a file in PART_KIND_FILE mode. PR: 257960 Signed-off-by: Aaditya Singh <aadityavksingh@gmail.com> Reviewed by: jlduran Pull Request: https://github.com/freebsd/freebsd-src/pull/2041 (cherry picked from commit 50c1240ebfaf920ad12f05eb16d00f8b5b9d72e0) usr.bin/mkimg/mkimg.c | 24 +++++++++++++++++++++--- 1 file changed, 21 insertions(+), 3 deletions(-)