Add kern.geom.part.separator tunable. This makes it possible
to specify an optional separator to insert before partition name;
eg if it's set to "c/", you'll get "ada0c/s1" instead of "ada0s1". (It cannot be set to just “/“, since ada0 is a device node, not a directory.)
Details
- Reviewers
imp - Group Reviewers
manpages - Commits
- rS355705: Add kern.geom.part.separator tunable. This makes it possible
Diff Detail
- Repository
- rS FreeBSD src repository - subversion
- Lint
Lint Passed - Unit
No Test Coverage - Build Status
Buildable 27278 Build 25540: arc lint + arc unit
Event Timeline
There are lots of places in the system that will break when this is not '' . What are your plans on fixing those?
It’s empty by default; if user needs it I suppose it’s their responsibility to update paths in eg fstab. Or do you mean there are some scripts/binaries that hardcode it?
I mean there's at least a dozen places that assume they can construct a path to a slice from a path to the dev and don't know about this. It's better than it used to be, but I'll bet there's still a lot of breakage.
/* * Fill in the devid, now that we've labeled the disk. */ (void) snprintf(buf, sizeof (buf), "%ss%d", path, slice); if ((fd = open(buf, O_RDONLY)) < 0) { (void) fprintf(stderr, gettext("cannot open '%s': %s\n"), buf, strerror(errno)); return (-1); }
is one example, this one is from cddl/contrib/opensolaris/cmd/zpool/zpool_vdev.c
It seems to be under '#ifdef illumos', though. FWIW, "zpool create", "zpool import" etc seem to work just fine with separator set to "c/".
We should try to find these cases and clean them up. I wouldn't expect there to be too many, since everything should be using GEOM to create partitions etc.
lib/geom/part/gpart.8 | ||
---|---|---|
1264 ↗ | (On Diff #63823) | "that will be inserted between GEOM name and partition name", is that what you mean? |
lib/geom/part/gpart.8 | ||
---|---|---|
1264 ↗ | (On Diff #63823) | Yes, that is what is meant here. The later sentence can be improved as well: "Note that setting this variable may break software which assumes a particular naming scheme." |
FWIW, grepping for that pattern only brings up the one hit Warner has already mentioned, and it's already under #ifdef illumos:
% grep -r '%ss%d' * cddl/contrib/opensolaris/cmd/zpool/zpool_vdev.c: (void) snprintf(buf, sizeof (buf), "%ss%d", path, slice);
So long as you commit to fixing any bugs we find later, I think we're OK.
The only other code that might be an issue is the part editor. I think it might do the right thing, but if you have the means to test it with your change, that would be great