Source-Changes archive
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]
CVS commit: src/sbin/ccdconfig
Module Name: src
Committed By: kre
Date: Fri Feb 20 21:09:37 UTC 2026
Modified Files:
src/sbin/ccdconfig: ccd.conf.5 ccdconfig.8 ccdconfig.c
Log Message:
bin/59861 fix ccdconfig -g (and much more)
This change is (roughly) based upon the patch provided in the PR by
ssszcmawo at gmail, but with many changes, and additions.
First, make ccdconfig -g not include the ccd size in its output.
It is supposed to produce the format defined for the config file,
so a ccd can be manually configured, and then the entry for it
added to /etc/ccd.conf later so it will be configured again at
each reboot. The size is computed based upon the devices,
it is not an input parameter, and hence does not belong in the output.
Nevertheless, being able to observe the size is useful for understanding
the ccd, so add a new -p option which does include the size in its output.
While here, add an option (-h) allow the size to be output in the form
generated by humanize_number(3) for better human comprehension.
Also add an option (-s), to output the flags as strings (only with -p,
not -g), so humans don't need to remember which bit in the flags means
what. Implement more human friendly names for the flags, and make them
case independent (whoever would specify "CCDF_UNIFORM" when "2" would do,
provided one remembers that 2 is the right value - now "uniform" can
replace it). Use the friendly names in -s output.
And also, since the config file (and command line) allows the NAME=wedge-label
form of device specification, rather than /dev/dkN (almost always better,
as the dkN numbers aren't always stable across reboots), add another option
(-W, like df) to replace the device name in output (both -p and -g) with
the appropriate NAME= string, when one exists. But as wedge labels can
contain almost anything, also add another option (-w) which will ignore
any wedge labels that contain characters which would confuse parsing (space,
tab, or newline).
To make it easier to have a preferred set of options to use, allow the
(new) CCDCONFIG environment variable to specify any of these new options
(and -v) - but not the "action" options (-c -C -u -U), which should always
be specified on the command line. To allow this to work, add another
few options to reverse the effects of -h -s -v -W (etc).
There is a little more, including sorting the output from -g and -p
when no ccd args are given (ie: all) so the output is generated in ccd
unit number order, rather than in LIFO order, which was how it used to
appear (most recently configured first).
The man page (ccdconfig(8)) has been updated, minor changes also made
to ccd.conf(5). One change of note there, all [ ] (meaning optional)
around ellipses (meaning "previous may be repeated") removed, there is
no need to say "the previous thing may optionally be optionally repeated".
(The same change was applied to the usage message.)
Since this is all "new feature" type stuff (the removal of the size from
ccdconfig -g perhaps excepted), no pullups are planned, ccdconfig(8) says
the new stuff was first added in NetBSD 12.0.
Note that since this need not be frozen until -12 is actually released
(and since -11 isn't out yet, that will be some time) any of the new
stuff can be revised/changed/removed if it seems that something could be
better, or is unnecessary, etc.
To generate a diff of this commit:
cvs rdiff -u -r1.5 -r1.6 src/sbin/ccdconfig/ccd.conf.5
cvs rdiff -u -r1.27 -r1.28 src/sbin/ccdconfig/ccdconfig.8
cvs rdiff -u -r1.59 -r1.60 src/sbin/ccdconfig/ccdconfig.c
Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.
Home |
Main Index |
Thread Index |
Old Index