Bug 223470 - freebsd-update: Cannot identify running kernel (/boot removed from jails)
Summary: freebsd-update: Cannot identify running kernel (/boot removed from jails)
Status: New
Alias: None
Product: Base System
Classification: Unclassified
Component: bin (show other bugs)
Version: 11.1-RELEASE
Hardware: Any Any
: --- Affects Only Me
Assignee: freebsd-bugs (Nobody)
URL:
Keywords: needs-patch, needs-qa
Depends on:
Blocks:
 
Reported: 2017-11-06 11:48 UTC by Mathieu Arnold
Modified: 2022-04-28 11:34 UTC (History)
8 users (show)

See Also:
koobs: mfc-stable12?
koobs: mfc-stable11?


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Mathieu Arnold freebsd_committer freebsd_triage 2017-11-06 11:48:28 UTC
To conserve disk space, I removed /boot from most of my jails, and when I do that, freebsd-update refuses to run saying that "Cannot identify running kernel".
Comment 1 Ed Maste freebsd_committer freebsd_triage 2017-11-20 19:38:51 UTC
freebsd-update fetches the kern.bootfile sysctl, then checks that the corresponding directory exists.

The security.jail.jailed sysctl can be used to determine if we are running in a jail; FreeBSD-update could check that sysctl and ignore failure to find a kernel if so. We should still update the kernel if found, but silently ignore if not.
Comment 2 Colin Percival freebsd_committer freebsd_triage 2019-03-12 23:00:13 UTC
Drop freebsd-update PRs which were assigned to me.  I'm not working on this code any more.
Comment 3 Ozgur Karatas 2019-03-31 01:49:41 UTC
Hello,

this is not a bug. freebsd-update fetch command doesn't know your freebsd version because no zfs release to /boot.

firstly run:

$ zpool list
$ zfs list

if you are seen boot run:

$ zpool import bootpool

you can try it:

$ freebsd-update fetch

Regards

Ozgur
Comment 4 Mathieu Arnold freebsd_committer freebsd_triage 2019-04-09 13:38:39 UTC
A jail does not have any bootable filesystem, it is a jail.
Comment 5 Dries Michiels freebsd_committer freebsd_triage 2019-04-09 16:59:01 UTC
It would be indeed much cleaner if freebsd-update natively supported jails without a /boot. Although as a workaround you can use the following:

freebsd-update --currently-running "RELEASE VERSION YOU RUN IN THE JAIL"
Comment 6 Mathieu Arnold freebsd_committer freebsd_triage 2019-04-18 16:52:51 UTC
# freebsd-update --currently-running 12.0 fetch install
src component not installed, skipped
Cannot identify running kernel
#
Comment 7 Dries Michiels freebsd_committer freebsd_triage 2019-04-27 14:40:58 UTC
Have you tried this too:
freebsd-update --currently-running 12.0-RELEASE fetch install
Comment 8 Piotr Pawel Stefaniak freebsd_committer freebsd_triage 2021-10-03 21:14:27 UTC
It looks like c76da1f01064 fixes this (but doesn't close yet).
Comment 9 Dan Langille freebsd_committer freebsd_triage 2022-04-09 22:40:42 UTC
I've hit this issue after updating a jail from FreeBSD 12.2 to 12.3

root@aws-1-ingress01:/ # file /bin/sh
/bin/sh: ELF 64-bit LSB executable, x86-64, version 1 (FreeBSD), dynamically linked, interpreter /libexec/ld-elf.so.1, for FreeBSD 12.3, FreeBSD-style, stripped
root@aws-1-ingress01:/ # sudo freebsd-update fetch install
src component not installed, skipped
Cannot identify running kernel
root@aws-1-ingress01:/ # freebsd-version -ur
12.3-RELEASE-p5
12.3-RELEASE-p5
root@aws-1-ingress01:/ #