Skip site navigation (1)Skip section navigation (2)
Date:      Wed, 03 Dec 2025 21:54:14 +0000
From:      bugzilla-noreply@freebsd.org
To:        bugs@FreeBSD.org
Subject:   [Bug 291377] gpart: "gpart list --libxo=json" duplicates attribute keys
Message-ID:  <bug-291377-227@https.bugs.freebsd.org/bugzilla/>

index | next in thread | raw e-mail

https://bugs.freebsd.org/bugzilla/show_bug.cgi?id=291377

            Bug ID: 291377
           Summary: gpart: "gpart list --libxo=json" duplicates attribute
                    keys
           Product: Base System
           Version: 16.0-CURRENT
          Hardware: Any
                OS: Any
            Status: New
          Severity: Affects Some People
          Priority: ---
         Component: bin
          Assignee: bugs@FreeBSD.org
          Reporter: asomers@FreeBSD.org

JSON forbids duplicating a field name, at least if you care about the value of
the first instance of the field.  But currently, "gpart list --libxo=json" will
print multiple "attrib" fields if a provider has multiple attributes set.  For
example:

somers@fbsd-head ~> sudo gpart set -i 1 -a bootonce vtbd0
bootonce set on vtbd0p1
somers@fbsd-head ~> gpart show vtbd0
=>       40  155189168  vtbd0  GPT  (74G)
         40          8         - free -  (4.0K)
         48       1024      1  freebsd-boot  [bootonce,bootme]  (512K)
       1072  146800640      2  freebsd-ufs  (70G)
  146801712    8387488      3  freebsd-swap  (4.0G)
  155189200          8         - free -  (4.0K)
somers@fbsd-head ~> > gpart list --libxo=json,pretty
...
        {
          "name": "vtbd0p1",
          "mediasize": 524288,
          "sectorsize": 512,
          "stripesize": 8192,
          "stripeoffset": 0,
          "mode": "r0w0e0",
          "efimedia":
"HD(1,GPT,b8949974-4a7e-11e9-ba65-e03f4944d7b6,0x30,0x400)
",
          "rawuuid": "b8949974-4a7e-11e9-ba65-e03f4944d7b6",
          "rawtype": "83bd6b9d-7f41-11dc-be0b-001560b84f0f",
          "attrib": "bootonce",
          "attrib": "bootme",
          "label": "",
          "length": "524288",
          "offset": "24576",
          "type": "freebsd-boot",
          "index": "1",
          "end": "1071",
          "start": "48"
        },
...

Notice the two "attrib" fields.  They should be changed to a single field.

-- 
You are receiving this mail because:
You are the assignee for the bug.

home | help

Want to link to this message? Use this
URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?bug-291377-227>