# freebsd-update fetch & install, reverted my patch level from p4 to p3, but reports it's p5?



## StressTest (Dec 2, 2022)

Something very odd just occurred on my laptop when I performed a freebsd-update fetch & install.  When I did the fetch it reported that there was a new patch (I was already on p4), so I then performed the "freebsd-update install" as usual and then did a reboot.

When I checked it using uname -a, it reports that it's at p3, despite it reporting it's at p5 when I rerun "freebsd-update fetch".

As you can see in the last line, it's stating it's at p5:

```
# freebsd-update fetch
Looking up update.FreeBSD.org mirrors... 2 mirrors found.
Fetching metadata signature for 13.1-RELEASE from update1.freebsd.org... done.
Fetching metadata index... done.
Inspecting system... done.
Preparing to download files... done.
No updates needed to update system to 13.1-RELEASE-p5.
```

But when I run a uname -a or look in System Info, it reports:

```
# uname -a
FreeBSD super 13.1-RELEASE-p3 FreeBSD 13.1-RELEASE-p3 GENERIC amd64
```

Is anyone else seeing this?

What could be causing this issue?  Is it a typo within the patch itself?

Any and all help would be appreciated.

Thank you in advance,

StressTest


----------



## SirDice (Dec 2, 2022)

What does `freebsd-version -urk` output?


----------



## StressTest (Dec 2, 2022)

Weird, this is what I get:


```
# freebsd-version -urk
13.1-RELEASE-p3
13.1-RELEASE-p3
13.1-RELEASE-p5
```

It's as if my fourth patch is gone, but this is what I had prior to doing the patch to 5.

Any ideas SirDice ?

StressTest


----------



## SirDice (Dec 2, 2022)

p4 and p5 didn't involve the kernel.


----------



## StressTest (Dec 4, 2022)

Just so I understand this correctly... Are you saying that the updates or patch didn't have anything to do with modifying the kernel so it doesn't register a change in the revision number of the patch itself?  That does make sense, and why the system info still see's it as P3 since it changed the kernel at that point.

Thanks for you replies,

StressTest


----------



## richardtoohey2 (Dec 4, 2022)

Yes that’s right.

If a security patch means code changes in the kernel source then there will be a new kernel binary built and that will get updated version information.

p4 and p5 were fixes outside of the kernel so no version change for the kernel.


----------



## richardtoohey2 (Dec 5, 2022)

Here's an upgrade to p5
	
	



```
Fetching 55 patches.....10....20....30....40....50.. done.
Applying patches... done.
The following files will be updated as part of updating to
13.1-RELEASE-p5:
/bin/freebsd-version
/rescue/[
/rescue/bectl
/rescue/bsdlabel
/rescue/bunzip2
/rescue/bzcat
/rescue/bzip2
/rescue/camcontrol
/rescue/cat
/rescue/ccdconfig
/rescue/chflags
/rescue/chgrp
/rescue/chio
/rescue/chmod
/rescue/chown
/rescue/chroot
/rescue/clri
/rescue/cp
/rescue/csh
/rescue/date
/rescue/dd
/rescue/devfs
/rescue/df
/rescue/dhclient
/rescue/disklabel
/rescue/dmesg
/rescue/dump
/rescue/dumpfs
/rescue/dumpon
/rescue/echo
/rescue/ed
/rescue/ex
/rescue/expr
/rescue/fastboot
/rescue/fasthalt
/rescue/fdisk
/rescue/fsck
/rescue/fsck_4.2bsd
/rescue/fsck_ffs
/rescue/fsck_msdosfs
/rescue/fsck_ufs
/rescue/fsdb
/rescue/fsirand
/rescue/gbde
/rescue/geom
/rescue/getfacl
/rescue/glabel
/rescue/gpart
/rescue/groups
/rescue/gunzip
/rescue/gzcat
/rescue/gzip
/rescue/halt
/rescue/head
/rescue/hostname
/rescue/id
/rescue/ifconfig
/rescue/init
/rescue/ipf
/rescue/iscsictl
/rescue/iscsid
/rescue/kenv
/rescue/kill
/rescue/kldconfig
/rescue/kldload
/rescue/kldstat
/rescue/kldunload
/rescue/ldconfig
/rescue/less
/rescue/link
/rescue/ln
/rescue/ls
/rescue/lzcat
/rescue/lzma
/rescue/md5
/rescue/mdconfig
/rescue/mdmfs
/rescue/mkdir
/rescue/mknod
/rescue/more
/rescue/mount
/rescue/mount_cd9660
/rescue/mount_msdosfs
/rescue/mount_nfs
/rescue/mount_nullfs
/rescue/mount_udf
/rescue/mount_unionfs
/rescue/mt
/rescue/mv
/rescue/nc
/rescue/newfs
/rescue/newfs_msdos
/rescue/nos-tun
/rescue/pgrep
/rescue/ping
/rescue/ping6
/rescue/pkill
/rescue/poweroff
/rescue/ps
/rescue/pwd
/rescue/rcorder
/rescue/rdump
/rescue/realpath
/rescue/reboot
/rescue/red
/rescue/rescue
/rescue/restore
/rescue/rm
/rescue/rmdir
/rescue/route
/rescue/routed
/rescue/rrestore
/rescue/rtquery
/rescue/rtsol
/rescue/savecore
/rescue/sed
/rescue/setfacl
/rescue/sh
/rescue/shutdown
/rescue/sleep
/rescue/spppcontrol
/rescue/stty
/rescue/swapon
/rescue/sync
/rescue/sysctl
/rescue/tail
/rescue/tar
/rescue/tcsh
/rescue/tee
/rescue/test
/rescue/tunefs
/rescue/umount
/rescue/unlink
/rescue/unlzma
/rescue/unxz
/rescue/unzstd
/rescue/vi
/rescue/whoami
/rescue/xz
/rescue/xzcat
/rescue/zcat
/rescue/zdb
/rescue/zfs
/rescue/zpool
/rescue/zstd
/rescue/zstdcat
/rescue/zstdmt
/sbin/ping
/sbin/ping6
/usr/bin/asn1_compile
/usr/bin/hxtool
/usr/bin/kadmin
/usr/bin/kcc
/usr/bin/kdestroy
/usr/bin/klist
/usr/bin/kswitch
/usr/include/krb5.h
/usr/include/krb5_ccapi.h
/usr/lib/libasn1.a
/usr/lib/libasn1.so.11
/usr/lib/libasn1_p.a
/usr/lib/libgssapi_krb5.a
/usr/lib/libgssapi_krb5.so.10
/usr/lib/libgssapi_krb5_p.a
/usr/lib/libgssapi_ntlm.a
/usr/lib/libgssapi_ntlm.so.10
/usr/lib/libgssapi_ntlm_p.a
/usr/lib/libgssapi_spnego.a
/usr/lib/libgssapi_spnego.so.10
/usr/lib/libgssapi_spnego_p.a
/usr/lib/libhdb.a
/usr/lib/libhdb.so.11
/usr/lib/libhdb_p.a
/usr/lib/libhx509.a
/usr/lib/libhx509.so.11
/usr/lib/libhx509_p.a
/usr/lib/libkadm5clnt.a
/usr/lib/libkadm5clnt.so.11
/usr/lib/libkadm5clnt_p.a
/usr/lib/libkadm5srv.a
/usr/lib/libkadm5srv.so.11
/usr/lib/libkadm5srv_p.a
/usr/lib/libkafs5.a
/usr/lib/libkafs5.so.11
/usr/lib/libkafs5_p.a
/usr/lib/libkdc.a
/usr/lib/libkdc.so.11
/usr/lib/libkdc_p.a
/usr/lib/libkrb5.a
/usr/lib/libkrb5.so.11
/usr/lib/libkrb5_p.a
/usr/lib/libprivateheimipcc.a
/usr/lib/libprivateheimipcc.so.11
/usr/lib/libprivateheimipcc_p.a
/usr/lib/libwind.a
/usr/lib/libwind.so.11
/usr/lib/libwind_p.a
/usr/libexec/hpropd
/usr/libexec/ipropd-master
/usr/libexec/kadmind
/usr/libexec/kcm
/usr/sbin/kstash
/usr/sbin/ktutil
```

So there's a new binary for freebsd-version (at the top) - so that will have p5 as its version.  This is so that freebsd-version can report the userland/non-kernel version of p5.

But there is no new kernel binary file for p5, so the kernel version is still the binary built for p3.

Well that's my understanding of things, anyway.


----------



## StressTest (Dec 15, 2022)

Thank you, that makes perfect sense to me, but appreciate the confirmation.


----------



## jcd (Jan 2, 2023)

I am seeing exactly the same thing, plus:

`lsof: WARNING: compiled for FreeBSD release 13.1-RELEASE-p5; this is 13.1-RELEASE-p3.`

Feels odd to me.

Anyone?


----------



## SirDice (Jan 2, 2023)

All perfectly fine and correct:

```
dice@maelcum:~ % freebsd-version -urk
13.1-RELEASE-p3
13.1-RELEASE-p3
13.1-RELEASE-p5
```


----------



## jcd (Jan 3, 2023)

So, should `lsof` be complaining?


----------



## SirDice (Jan 3, 2023)

Did you build it from ports or did you install the package? If you built the port try rebuilding that.


----------



## jcd (Jan 4, 2023)

I would say ports but, given that this system was recently updated all the way from 10-2.RELEASE to 13.1-RELEASE, to be sure I just removed and reinstalled `lsof` using `pkg` and the warning persists.


----------



## mer (Jan 4, 2023)

I see the same warning on a purely package system.
So -p3 is the version of running kernel, lsof I think may talk to kernel interfaces so it may "be important".

Is it possible that the package builds are done after a kernel build is done?  I think there was a recent thread about this and something popped up about a config file that had p5 and if you rebuilt the kernel from source it would show up as -p5 in freebsd-version.  That's why I'm asking "are packages built against a kernel that is built from source?"

Anyway it's a warning that appears to be non-fatal and is probably just lsof code "noisy printf debug"


----------

