NetBSD-Bugs archive
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]
Re: kern/60810: /usr/src/sys/conf/osrelease.h -s behavior does not match description
> On Sep 28, 2026, at 7:55 PM, Robert Elz via gnats <gnats-admin%NetBSD.org@localhost> wrote:
>
> The following reply was made to PR kern/60810; it has been noted by GNATS.
>
> From: Robert Elz <kre%munnari.OZ.AU@localhost>
> To: gnats-bugs%netbsd.org@localhost, kern-bug-people%netbsd.org@localhost, netbsd-bugs%netbsd.org@localhost
> Cc:
> Subject: Re: kern/60810: /usr/src/sys/conf/osrelease.h -s behavior does not match description
> Date: Tue, 29 Sep 2026 06:50:37 +0700
>
> But why would anyone want to be doing that using the output from
> osversion.sh ... that is a script never installed anywhere, used
> during kernel config to build a new vers.c file for the kernel when
> needed. That usage only uses the script with no args. I gather
> the -k option might be used for module building for that kernel.
The reason why someone might want to be doing that is for the reason
I explained in my last message. If you're trying to cross-build
using pkgsrc, then you'd want to find a source for the value of
CROSS_OPSYS_VERSION such that you wouldn't have to change your
/etc/mk.conf every time you happen to update your target system
sources to a new OS version. Sure, you could parse it from
__NetBSD_Version__ yourself, but if there were a script that already
did that parsing for you, then why wouldn't you use it? (This is, of
course, assuming that this person wouldn't be aware of corner case
differences between the two formats)
> Certainly I wouldn't expect it to be used in anything
> even slightly related to pkgsrc (which generally builds for base
> versions, NetBSD 10.0 (not 10.1 10.2 ...) and wouldn't want the minor
> version or patch in any case).
See above for its relevance to pkgsrc.
The official builds target *.0 releases, sure. But *.0 releases
are not the only OS versions that pkgsrc is meant to build for.
> How about we just delete the -s option completely? It doesn't seem
> to be used, or useful.
I'll leave that decision to other people.
> | Noted. However, when it appears to be the same format as what another
> | variable (CROSS_OPSYS_VERSION) uses, it can be tempting to use it.
>
> It isn't, CROSS_OPSYS_VERSION for xx.99.yy where yy >= 100 wants
> xx.99.99 (xx9999). osversion.sh uses whatever the comment happens to
> claim that the patch number is for the pp part (xx99102).
>
> Just forget osrelease.sh even exists - it isn't a documented part of
> NetBSD, just a script that is used to assist with kernel builds.
>
> It hasn't been changed since 2012. I see no reason to change
> anything about it now.
>
> kre
Very well, I can drop the request to change it. However I still
think it would be a good idea to more precisely document the
given format in the comments, so that people don't make the
mistake of using it in the way that I described with pkgsrc.
But if that suggestion is also rejected, then this PR might
as well be closed.
Home |
Main Index |
Thread Index |
Old Index