Bug 276765 - sysutils/u-boot-starfive-visionfive2: errors from gpart add command
Summary: sysutils/u-boot-starfive-visionfive2: errors from gpart add command
Status: Closed FIXED
Alias: None
Product: Ports & Packages
Classification: Unclassified
Component: Individual Port(s) (show other bugs)
Version: Latest
Hardware: Any Any
: --- Affects Only Me
Assignee: Mitchell Horne
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2024-02-01 13:02 UTC by rdunkle
Modified: 2024-02-01 17:06 UTC (History)
1 user (show)

See Also:
bugzilla: maintainer-feedback? (uboot)


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description rdunkle 2024-02-01 13:02:52 UTC
the port instructions show
gpart add -l spl -t !2E54B353-1271-4842-806F-E436D6AF6985 -b 2m -s 2m da2
gpart add -l uboot -t !BC13C2FF-59E6-4262-A352-B275FD6F7172 -b 4m -s 4m da2

On FreeBSD 14 stable I get errors from -t  (partition type)
gpart(8) does not show those options
I used:
gpart add -l spl   -t hifive-bbl -b 2m -s 2m da0
gpart add -l uboot -t hifive-fsbl -b 4m -s 4m da0
Comment 1 Mitchell Horne freebsd_committer freebsd_triage 2024-02-01 15:12:53 UTC
(In reply to rdunkle from comment #0)

What is the actual error message printed when executing the commands?

Also, what is your shell? For zsh I needed to append a backslash to the !, to escape it:

$ gpart add -l spl -t \!2E54B353-1271-4842-806F-E436D6AF6985 -b 2m -s 2m da2
Comment 2 rdunkle 2024-02-01 15:50:27 UTC
# gpart create -s gpt da0
da0 created
# gpart add -l spl -t !2E54B353-1271-4842-806F-E436D6AF6985 -b 2m -s 2m da0
2E54B353: Event not found.
# gpart add -l uboot -t !BC13C2FF-59E6-4262-A352-B275FD6F7172 -b 4m -s 4m da0
BC13C2FF: Event not found.

# gpart add -l spl -t \!2E54B353-1271-4842-806F-E436D6AF6985 -b 2m -s 2m da0
da0p1 added

OK,  I understand the problem is the need to escape the type.
Comment 3 rdunkle 2024-02-01 15:51:19 UTC
# echo $SHELL
/bin/csh
Comment 4 Mitchell Horne freebsd_committer freebsd_triage 2024-02-01 16:06:29 UTC
(In reply to rdunkle from comment #2)

Thanks for confirming. I tested and it works equally across different shells when escaped unconditionally. So, I will update the package description.
Comment 5 commit-hook freebsd_committer freebsd_triage 2024-02-01 16:16:01 UTC
A commit in branch main references this bug:

URL: https://cgit.FreeBSD.org/ports/commit/?id=7fb860ab8aa0f3ac3688d44fdc4364c8358f3413

commit 7fb860ab8aa0f3ac3688d44fdc4364c8358f3413
Author:     Mitchell Horne <mhorne@FreeBSD.org>
AuthorDate: 2024-02-01 16:09:13 +0000
Commit:     Mitchell Horne <mhorne@FreeBSD.org>
CommitDate: 2024-02-01 16:09:13 +0000

    sysutils/u-boot-starfive-visionfive2: fix description

    Some interactive shells (csh, zsh) will try to interpret the '!' at the
    beginning of the partition type as a previous command. Unconditionally
    escape this in the example commands, as it can be a source of confusion.

    PR:             276765
    Reported by:    rdunkle@smallcatbrain.com
    Sponsored by:   The FreeBSD Foundation

 sysutils/u-boot-starfive-visionfive2/Makefile  | 2 ++
 sysutils/u-boot-starfive-visionfive2/pkg-descr | 4 ++--
 2 files changed, 4 insertions(+), 2 deletions(-)