Date: Fri, 29 Mar 2019 17:40:05 +1100 (EST) From: Bruce Evans <brde@optusnet.com.au> To: Ravi Pokala <rpokala@freebsd.org> Cc: Kyle Evans <kevans@freebsd.org>, src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: Re: svn commit: r345680 - head/sys/conf Message-ID: <20190329164644.X957@besplex.bde.org> In-Reply-To: <CAF5D833-B3C3-4AD6-9B77-0363C56E93E9@panasas.com> References: <201903290400.x2T40kp7013212@repo.freebsd.org> <CAF5D833-B3C3-4AD6-9B77-0363C56E93E9@panasas.com>
next in thread | previous in thread | raw e-mail | index | archive | help
On Thu, 28 Mar 2019, Ravi Pokala wrote: > -----Original Message----- > From: <owner-src-committers@freebsd.org> on behalf of Kyle Evans <kevans@FreeBSD.org> > Date: 2019-03-28, Thursday at 21:00 > To: <src-committers@freebsd.org>, <svn-src-all@freebsd.org>, <svn-src-head@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
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?20190329164644.X957>