svn commit: r345680 - head/sys/conf

Bruce Evans brde at optusnet.com.au
Tue Sep 3 14:05:57 UTC 2019


On Thu, 28 Mar 2019, Ravi Pokala wrote:

> -----Original Message-----
> From: <owner-src-committers at freebsd.org> on behalf of Kyle Evans <kevans at FreeBSD.org>
> Date: 2019-03-28, Thursday at 21:00
> To: <src-committers at freebsd.org>, <svn-src-all at freebsd.org>, <svn-src-head at freebsd.org>
> Subject: svn commit: r345680 - head/sys/conf
>
>> Author: kevans
>> Date: Fri Mar 29 04:00:46 2019
>> New Revision: 345680
>> URL: https://svnweb.freebsd.org/changeset/base/345680
>>
>> Log:
>>   NOTES: Use non-default value for BOOT_TAG
>
> Why?
>
> (I was on IRC when jhb debugged this, but I didn't quite get it; and of course lots of us *weren't* on IRC at the time.)

Because NOTES is primarily for generating LINT, and LINT's reason for
existence is to test as many cases as possible.  Testing the default cases
again is not very useful, so by convention NOTES never configures defaults,
except of course where it is broken.  This commit is to fix 1 broken place.

Not repeating the default is also good for NOTES' secondary purpose of
documentation.  Defaults are easy to find by grepping the source code for
them if there is no documentation.  Changing defaults to valid and useful
values requires understanding more of the source if there is no documentation.

>> Modified: head/sys/conf/NOTES
>> ==============================================================================
>> --- head/sys/conf/NOTES	Fri Mar 29 03:25:20 2019	(r345679)
>> +++ head/sys/conf/NOTES	Fri Mar 29 04:00:46 2019	(r345680)
>> @@ -150,7 +150,7 @@ options 	BOOTHOWTO=RB_MULTIPLE
>>  #
>>  # Default boot tag; may use 'kern.boot_tag' loader tunable to override.  The
>>  # current boot's tag is also exposed via the 'kern.boot_tag' sysctl.
>> -options 	BOOT_TAG=\"---<<BOOT>>---\"
>> +options 	BOOT_TAG=\"\"

Useful variations are not always easy to invent.  I usually just add 1 for
numeric values.  This example is useful.  It kills the boot tag.  It gives
an empty tag, and the kernel does extra work to avoid printing a newline
after an empty tag.

>>  # Maximum boot tag size the kernel's static buffer should accomodate.  Maximum
>>  # size for both BOOT_TAG and the assocated tunable.
>>  options 	BOOT_TAG_SZ=32

This bug remains unfixed.  32 is the default.  This option shouldn't exist.
Instead, just use size strlen(BOOT_TAG) + 1 for the static string and keep
the dynamic string in the environment.  The string is only used once, and
msgbufinit() already has to check both the static string and the environment
to find the right string (it does this by fetching the dynamic string to
overwrite the static string, but it is easier to not use a tunable or
support a sysctl and just keep the dynamic string in the environment).

Bruce




More information about the svn-src-head mailing list