Solved bsdinstall seems to install an old version into a jail

I updated my host from FreeBSD-14.0 to FreeBSD-14.1-RELEASE-p5 using
Code:
freebsd-update -r 14.1-RELEASE upgrade
freebsd-update install

Then I installed a new jail using bsdinstall like so:
Code:
bsdinstall jail /jail/bsd-chrome

When I enter the jail and run freebsd-version I get:
Code:
14.0-RELEASE

Obviosly an old version. However, when I try to update it via
Code:
freebsd-update -b /jail/bsd-chrome -r 14.1-RELEASE upgrade
I get the following message:
Code:
freebsd-update: Cannot upgrade from 14.1-RELEASE to itself

So it seems freebsd-version inside the jail reports an incorrect version?
 
My only jail is created and maintained using ports-mgmt/poudriere-devel for clean room builds of ports, so actually not tried myself. But in freebsd-update(8) manpage, there is
Code:
     -j jail        Operate on the given jail specified by jid or name.  (The
                    version of the installed userland is detected and the
                    --currently-running option is no more required.)
described. Wouldn't you need to use this instead of -b?
 
My only jail is created and maintained using ports-mgmt/poudriere-devel for clean room builds of ports, so actually not tried myself. But in freebsd-update(8) manpage, there is
Code:
     -j jail        Operate on the given jail specified by jid or name.  (The
                    version of the installed userland is detected and the
                    --currently-running option is no more required.)
described. Wouldn't you need to use this instead of -b?
Thank you! The following commands updated the jail:
Code:
freebsd-update -r 14.1-RELEASE -j bsd-chrome upgrade
freebsd-update -r 14.1-RELEASE -j bsd-chrome install
freebsd-update -r 14.1-RELEASE -j bsd-chrome install
The order of the command line parameters seems to be important!

However, I have still one question: Can I tweak bsdinstall to install the host's version of FreeBSD in the first place?
 
However, I have still one question: Can I tweak bsdinstall to install the host's version of FreeBSD in the first place?
Sorry, not sure, as I don't use freebsd-update for a long time.
Used several times when it was first MFC/MFS'ed into Release, but if I recall correctly, supports for jails was added long after I've stopped using it.
I'm using only source updates for years.
 
I updated my host from FreeBSD-14.0 to FreeBSD-14.1-RELEASE-p5 using
Code:
freebsd-update -r 14.1-RELEASE upgrade
freebsd-update install
If you only used these two commands once as indicated, it seems that you forgot the last of the two freebsd-update-install-s:
The upgrade phase only downloads and asks a few questions about the changes, it doesn't make any actual changes yet. The actual updating of files is done during the 'install' phases. So just run freebsd-update -r 13.0-RELEASE upgrade again.

The first time you run freebsd-update install only the kernel is updated. The second run of freebsd-update install will update the userland. The third and final freebsd-update install will remove any old libraries and other files that need to be removed.
You also don't mention any reboot.

freebsd-version(1):
Code:
[...]
DESCRIPTION
       The freebsd-version utility makes a best	effort to determine  the  ver-
       sion and	patch level of the installed kernel and	/ or userland.

Then I installed a new jail using bsdinstall like so:
Code:
bsdinstall jail /jail/bsd-chrome

When I enter the jail and run freebsd-version I get:
Code:
14.0-RELEASE
My guess it that bsdinstall makes an equal "best effort" attempt as to the intended version to be installed for the jail. That seems not to have worked out as expected because bdsinstall could only determine the 14.0 version of the host.

I would have liked (obviously not applicable to your current situation as you have already successfully upgraded the jail) to know:
  1. freebsd-version -kru outside the jail
  2. freebsd-version -kru inside the jail
 
[…]
I would have liked (obviously not applicable to your current situation as you have already successfully upgraded the jail) to know:
  1. freebsd-version -kru outside the jail
  2. freebsd-version -kru inside the jail

Here is the output from the above command outside the jail:
Code:
root@thinkle:~ # freebsd-version -kru
14.1-RELEASE-p5
14.1-RELEASE-p5
14.1-RELEASE-p5

Here is the output from the above command inside the jail:
Code:
root@bsd-chrome-pkg:/ # freebsd-version -kru
freebsd-version: unable to locate kernel
 
Here is the output from the above command inside the jail:
Code:
root@bsd-chrome-pkg:/ # freebsd-version -kru
freebsd-version: unable to locate kernel
The jail has no kernel but uses the host kernel. Just don't apply the option "k". The output might be as below.
Code:
# jexec fox freebsd-version -ru
14.1-RELEASE-p5
14.1-RELEASE-p6
 
Back
Top