Skip site navigation (1)Skip section navigation (2)
Date:      Fri, 04 May 2018 23:08:08 -0700
From:      "Chris H" <bsd-lists@BSDforge.com>
To:        "current" <current@freebsd.org>, "Jeffrey Bouquet" <jbtakk@iherebuywisely.com>
Subject:   Re: OSVERSION
Message-ID:  <fd3a9984efaafd5058317df13c175bf6@udns.ultimatedns.net>
In-Reply-To: <1525469940.57768.288.camel@freebsd.org>

next in thread | previous in thread | raw e-mail | index | archive | help
On Fri, 04 May 2018 15:39:00 -0600 "Ian Lepore" <ian@freebsd=2Eorg> said

> On Fri, 2018-05-04 at 15:28 -0600, Alan Somers wrote:
> > On Fri, May 4, 2018 at 2:46 PM, Jeffrey Bouquet=20
> > wrote:
> >=20
> > >=20
> > > 12=2E0-CURRENT r332797 GENERIC amd64
> > > =2E=2E=2E=2E=2E=2E=2E=2E=2E=2E=2E=2E=2E=2E=2E=2E=2E=2E
> > > make: "/usr/ports/Mk/bsd=2Eport=2Emk" line 1171: Unable to
> > > determine OS version=2E Either define OSVERSION, or
> > > install /usr/include/sys/param=2Eh=2E=2E=2E
> > > =2E=2E=2E=2E=2E=2E=2E=2E=2E=2E=2E=2E=2E=2E=2E=2E=2E=2E=2E=2E=2E=2E=2E=2E=2E=2E=2E=2E=2E=2E
> > > then , with param=2Eh in place
> > >=20
> > > =2E=2E=2E=2E=2E=2E=2E=2E=2E=2E=2E=2E=2E=2E=2E=2E=2E=2E=2E=2E=2E=2E=2E=2E=2E=2E=2E=2E=2E=2E
> > > port builds, pkgdb -u, and=C2=A0=C2=A0portsdb -u all fail with:
> > > =2E=2E=2E=2E=2E=2E=2E=2E=2E=2E=2E=2E=2E=2E=2E=2E=2E=2E=2E=2E=2E=2E=2E=2E=2E=2E=2E=2E=2E=2E
> > > line 1200: UNAME_r (12=2E0-CURRENT) and OSVERSION (12=2E0-CURRENT) do not
> > agree
> > > on major version number=2E
> > > =2E=2E=2E=2E=2E=2E=2E=2E=2E=2E=2E=2E=2E=2E=2E=2E=2E=2E=2E=2E=2E=2E=2E=2E=2E=2E
> > > Can I set that in sh or tcsh or zsh?
> > > =2E=2E=2E=2E=2E=2E=2E=2E=2E=2E=2E=2E=2E=2E=2E=2E=2E=2E=2E=2E=2E=2E=2E=2E=2E
> > >=20
> > Looks like you're running ports in a jail=2E=C2=A0=C2=A0The best way to d=
o that is to
> > set OSVERSION in /etc/make=2Econf=2E=C2=A0=C2=A0Some jail managers will eve=
n do that for
> > you=2E=C2=A0=C2=A0It should look a little like this:
> >=20
> > =C2=A0> cat /etc/make=2Econf
> > OSVERSION+=3D1100122
> > UNAME_ENV+=3D=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0OSVERSION=3D${OSVERSION}
> > UNAME_ENV+=3D=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0UNAME_s=3DFreeBSD
> > UNAME_ENV+=3D=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0UNAME_r=3D11=2E0-RELEASE
> > UNAME_ENV+=3D=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0UNAME_v=3D"${UNAME_s} ${UNAM=
E_r}"
> > =2EMAKEFLAGS:=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0${UNAME_ENV}
> > MAKE_ENV+=3D=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0${UNAME_ENV}
> > CONFIGURE_ENV+=3D ${UNAME_ENV}
> > SCRIPTS_ENV+=3D=C2=A0=C2=A0=C2=A0${UNAME_ENV}
>=20
> If you're running a freebsd 11 jail on a freebsd 12 host, the best
> solution is to set osrelease and osreldate in your jail config to
> reflect the 11=2Ex userland you want the jail to implement=2E Then all the
> values returned by uname and various sysctls will be consistently
> correct within the jail=2E For example, on a 10=2E3 host I have a jail:
>=20
> fb8 {
> =C2=A0=C2=A0=C2=A0=C2=A0host=2Ehostname =3D "${name}=2Ehippie=2Elan";
> =C2=A0=C2=A0=C2=A0=C2=A0ip4=2Eaddr =3D 172=2E22=2E42=2E241;
> =C2=A0=C2=A0=C2=A0=C2=A0persist =3D true;
> =C2=A0=C2=A0=C2=A0=C2=A0devfs_ruleset =3D 100;
> =C2=A0=C2=A0=C2=A0=C2=A0osrelease=3D"8=2E4-STABLE";
> =C2=A0=C2=A0=C2=A0=C2=A0osreldate=3D 804507;
> }
>=20
> -- Ian
+1
I do exactly the same in my jails to better isolate them from the host=2E
In fact, you can even lie about what (os)version you're using, if you
need to=2E :-)

--Chris
> _______________________________________________
> freebsd-current@freebsd=2Eorg mailing list
> https://lists=2Efreebsd=2Eorg/mailman/listinfo/freebsd-current
> To unsubscribe, send any mail to "freebsd-current-unsubscribe@freebsd=2Eorg=
"





Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?fd3a9984efaafd5058317df13c175bf6>