Skip site navigation (1)Skip section navigation (2)
Date:      Tue, 31 Dec 2024 08:40:57 +0000
From:      bugzilla-noreply@freebsd.org
To:        ports-bugs@FreeBSD.org
Subject:   [Bug 283755] ports-mgmt/pkg: pkg-upgrade(8) - version comparison new kernel modules ("kmods") failure
Message-ID:  <bug-283755-7788@https.bugs.freebsd.org/bugzilla/>

next in thread | raw e-mail | index | archive | help
https://bugs.freebsd.org/bugzilla/show_bug.cgi?id=3D283755

            Bug ID: 283755
           Summary: ports-mgmt/pkg: pkg-upgrade(8) - version comparison
                    new kernel modules ("kmods") failure
           Product: Ports & Packages
           Version: Latest
          Hardware: amd64
                OS: Any
            Status: New
          Severity: Affects Only Me
          Priority: ---
         Component: Individual Port(s)
          Assignee: pkg@FreeBSD.org
          Reporter: erichanskrs@gmail.com
             Flags: maintainer-feedback?(pkg@FreeBSD.org)
          Assignee: pkg@FreeBSD.org

Forum reference starting at:
https://forums.freebsd.org/threads/possible-solution-to-the-drm-kmod-kernel=
-mismatch-after-upgrade-from-bapt.96058/page-2#post-684474

On 14.2-RELEASE version number comparison by pkg-upgrade(8)=20
does not work as expected with graphics/drm-61-kmod.

It is unclear if this version comparison issue reaches beyond=20
this drm-61-kmod example but, IMO, this is probable, especially=20
for the kernel modules where this is intended for.

This issue occurs when upgrading from 14.1-RELEASE to=20
14.2-RELEASE and applying the changes to the pkg .conf file=20
as mentioned in the anouncement on the ports mailinglist=20
"CFT: repository for kernel modules"=20
https://lists.freebsd.org/archives/freebsd-ports/2024-December/006997.html

However, this issue can also be shown to occur on=20
14.2-RELEASE (irrespective of upgrading) as is shown=20
in the command sequence below.

Furthermore "CFT: repository for kernel modules" states:
   The goal of this change is that the kernel module for=20
   14.2 is at a higher version from the kernel module=20
   from 14.1 which means will force reinstalling=20
   considering this is an upgrade.

Necessary for this was an extension to the version numbering as announced in
"kmod: append osversion to the portversion":
https://github.com/freebsd/freebsd-ports/commit/a5fc087131e66513d1c74f8427c=
924afff580a15

The aforementioned "will force reinstalling" is inline with the=20
documented comparison semantics as detailed in=20
"5.2.2. Versions, DISTVERSION or PORTVERSION"
https://docs.freebsd.org/en/books/porters-handbook/book/#makefile-versions

For example for drm-61-kmod version numbers:
   # pkg version -t 6.1.92.1401000_3  6.1.92.1402000_3=20
   <


The command sequence below details the unexpected failure to=20
upgrade the package drm-61-kmod on 14.2-RELEASE after applying=20
the advised changes to the pkg .conf file.

[1](0) # uname -a
FreeBSD q210 14.2-RELEASE FreeBSD 14.2-RELEASE releng/14.2-n269506-c8918d6c=
7412
GENERIC amd64
[2](0) # pkg -v
1.21.3
[3](0) # pkg info drm-61-kmod
pkg: No package(s) matching drm-61-kmod
[4](1) # cd /usr/local/etc/pkg/repos/
[5](0) # grep -v '^#' FreeBSD.conf

FreeBSD: {
        url: pkg+https://pkg.freebsd.org/${ABI}/latest,
}

FreeBSD-kmods: {
        enabled: no,
        url: pkg+https://pkg.freebsd.org/${ABI}/kmods_latest_${VERSION_MINO=
R},
        signature_type: "fingerprints",
        fingerprints: "/usr/share/keys/pkg",
        mirror_type: "srv",
}
[6](0) # pkg -vv | sed -n '/^Repositories:/,$ p'      <-- start with scan f=
or
"kmods" repository disabled
Repositories:
  FreeBSD: {
    url             : "pkg+https://pkg.freebsd.org/FreeBSD:14:amd64/latest",
    enabled         : yes,
    priority        : 0,
    mirror_type     : "SRV",
    signature_type  : "FINGERPRINTS",
    fingerprints    : "/usr/share/keys/pkg"
  }
  FreeBSD-kmods: {
    url             :
"pkg+https://pkg.freebsd.org/FreeBSD:14:amd64/kmods_latest_2",
    enabled         : no,
    priority        : 0,
    mirror_type     : "SRV",
    signature_type  : "FINGERPRINTS",
    fingerprints    : "/usr/share/keys/pkg"
  }
[7](0) # pkg install drm-61-kmod
Updating FreeBSD repository catalogue...
FreeBSD repository is up to date.
All repositories are up to date.
Checking integrity... done (0 conflicting)
The following 1 package(s) will be affected (of 0 checked):

New packages to be INSTALLED:
        drm-61-kmod: 6.1.92.1401000_3 [FreeBSD]

Number of packages to be installed: 1

The process will require 17 MiB more space.

Proceed with this action? [y/N]: y
[1/1] Installing drm-61-kmod-6.1.92.1401000_3...
[1/1] Extracting drm-61-kmod-6.1.92.1401000_3: 100%
=3D=3D=3D=3D=3D
Message from drm-61-kmod-6.1.92.1401000_3:

--
The drm-61-kmod port can be enabled for amdgpu (for AMD
GPUs starting with the HD7000 series / Tahiti) or i915kms (for Intel
APUs starting with HD3000 / Sandy Bridge) through kld_list in
/etc/rc.conf. radeonkms for older AMD GPUs can be loaded and there are
some positive reports if EFI boot is NOT enabled.

For amdgpu: kld_list=3D"amdgpu"
For Intel: kld_list=3D"i915kms"
For radeonkms: kld_list=3D"radeonkms"

Please ensure that all users requiring graphics are members of the
"video" group.

Please note that this package was built for FreeBSD 14.1.
If this is not your current running version, please rebuild
it from ports to prevent panics when loading the module.
[8](0) # pkg info drm-61-kmod | grep  Version        <-- the version specif=
ic
to 14.1-RELEASE is installed
Version        : 6.1.92.1401000_3
[9](0) # sed -i.org '/FreeBSD-kmods:/,$ s/enabled:*.no,/enabled: yes,/'
FreeBSD.conf   <-- a ".org" backup of the original FreeBSD.conf is made
[10](0) # pkg -vv | sed -n '/^Repositories:/,$ p'    <-- "kmods" repository=
 is
enabled
Repositories:
  FreeBSD: {
    url             : "pkg+https://pkg.freebsd.org/FreeBSD:14:amd64/latest",
    enabled         : yes,
    priority        : 0,
    mirror_type     : "SRV",
    signature_type  : "FINGERPRINTS",
    fingerprints    : "/usr/share/keys/pkg"
  }
  FreeBSD-kmods: {
    url             :
"pkg+https://pkg.freebsd.org/FreeBSD:14:amd64/kmods_latest_2",
    enabled         : yes,
    priority        : 0,
    mirror_type     : "SRV",
    signature_type  : "FINGERPRINTS",
    fingerprints    : "/usr/share/keys/pkg"
  }
[11](0) # pkg update
Updating FreeBSD repository catalogue...
FreeBSD repository is up to date.
Updating FreeBSD-kmods repository catalogue...
FreeBSD-kmods repository is up to date.
All repositories are up to date.
[12](0) # pkg upgrade
Updating FreeBSD repository catalogue...
FreeBSD repository is up to date.
Updating FreeBSD-kmods repository catalogue...
FreeBSD-kmods repository is up to date.
All repositories are up to date.
Checking for upgrades (15 candidates): 100%
Processing candidates (15 candidates): 100%
Checking integrity... done (0 conflicting)
Your packages are up to date.
[13](0) # pkg version -vRL=3D                <-- attempts to recognise an u=
pgrade
fail
Updating FreeBSD repository catalogue...
FreeBSD repository is up to date.
Updating FreeBSD-kmods repository catalogue...
FreeBSD-kmods repository is up to date.
All repositories are up to date.
[14](0) # pkg delete drm-61-kmod        <-- delete the "14.1 version"
Checking integrity... done (0 conflicting)
Deinstallation has been requested for the following 1 packages (of 0 packag=
es
in the universe):

Installed packages to be REMOVED:
        drm-61-kmod: 6.1.92.1401000_3

Number of packages to be removed: 1

The operation will free 17 MiB.

Proceed with deinstalling packages? [y/N]: y
[1/1] Deinstalling drm-61-kmod-6.1.92.1401000_3...
[1/1] Deleting files for drm-61-kmod-6.1.92.1401000_3: 100%
[15](0) # pkg install drm-61-kmod
Updating FreeBSD repository catalogue...
FreeBSD repository is up to date.
Updating FreeBSD-kmods repository catalogue...
FreeBSD-kmods repository is up to date.
All repositories are up to date.
Checking integrity... done (0 conflicting)
The following 1 package(s) will be affected (of 0 checked):

New packages to be INSTALLED:
        drm-61-kmod: 6.1.92.1402000_3 [FreeBSD-kmods]

Number of packages to be installed: 1

The process will require 17 MiB more space.

Proceed with this action? [y/N]: y
[1/1] Installing drm-61-kmod-6.1.92.1402000_3...
[1/1] Extracting drm-61-kmod-6.1.92.1402000_3: 100%
=3D=3D=3D=3D=3D
Message from drm-61-kmod-6.1.92.1402000_3:

--
The drm-61-kmod port can be enabled for amdgpu (for AMD
GPUs starting with the HD7000 series / Tahiti) or i915kms (for Intel
APUs starting with HD3000 / Sandy Bridge) through kld_list in
/etc/rc.conf. radeonkms for older AMD GPUs can be loaded and there are
some positive reports if EFI boot is NOT enabled.

For amdgpu: kld_list=3D"amdgpu"
For Intel: kld_list=3D"i915kms"
For radeonkms: kld_list=3D"radeonkms"

Please ensure that all users requiring graphics are members of the
"video" group.

Please note that this package was built for FreeBSD 14.2.
If this is not your current running version, please rebuild
it from ports to prevent panics when loading the module.
[16](0) # pkg info drm-61-kmod | grep  Version    <-- drm-61-kmod version
specific to 14.2-RELEASE is installed
Version        : 6.1.92.1402000_3
[17](0) # pkg version -t 6.1.92.1401000_3  6.1.92.1402000_3     <-- this sh=
ows
how pkg-upgrade should compare version numbers
<
[18](0) #

--=20
You are receiving this mail because:
You are the assignee for the bug.=



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