You are not logged in.

#1 2020-03-13 18:32:48

regid
Member
Registered: 2016-06-06
Posts: 158

Following the wiki to determine the kernel EXTRAVERSION component

I am trying to follow the wiki Compile kernel module#Module compilation paragraph in order to find out the value of the EXTRAVERSION component of the current kernel version, and got confused. Can it be that the wiki refers to older arch kernels?

The wiki wrote:

In order to compile and load our module cleanly, we must find the value of the EXTRAVERSION component of the current kernel version number so we can match the version number exactly in our kernel source. EXTRAVERSION is a variable set in the kernel top-level Makefile, but the Makefile in a vanilla kernel source will have EXTRAVERSION empty; it is set only as part of the Arch kernel build process. If relevant, the value of the current kernel's EXTRAVERSION (usually -1) can be found by looking at the output of the uname -r command. The string between the third kernel version number and -ARCH (the Arch-specific setting for LOCALVERSION as set in the kernel .config file). For example, with a kernel version of 4.9.65-1-ARCH, the EXTRAVERSION is -1.

In my case:

$ grep ^EXTRAVERSION Makefile
EXTRAVERSION = -arch1
$ uname -r
5.5.8-arch1-1-custom
$ grep LOCALVERSION .config
CONFIG_LOCALVERSION=""
CONFIG_LOCALVERSION_AUTO=y
$ grep '.' local*
localversion.10-pkgrel:-1
localversion.20-pkgname:-custom

Does -arch1 the EXTRAVERSION in my case?

Last edited by regid (2020-03-13 18:38:17)


pantum-p1000-p2000-p3000-m5100-m5200-ppd-driver (AUR): PPDs, drivers, for Pantum P1000, P2000, P3000, M5100, M5200 printers.
powerofforreboot.efi (AUR): Utilities to be used from within a UEFI boot manager or shell.

Offline

#2 2020-03-13 18:45:37

WorMzy
Forum Moderator
From: Scotland
Registered: 2010-06-16
Posts: 9,502
Website

Re: Following the wiki to determine the kernel EXTRAVERSION component

Mod note: Moving to Creating & Modifying Packages


Sakura:-
Mobo: MSI X299 TOMAHAWK ARCTIC // Processor: Intel Core i7-7820X 3.6GHz // GFX: nVidia GeForce GTX 970 // RAM: 32GB (4x 8GB) Corsair DDR4 (@ 3000MHz) // Storage: 1x 3TB HDD, 5x 1TB HDD, 2x 120GB SSD, 1x 275GB M2 SSD

Making lemonade from lemons since 2015.

Offline

#3 2020-03-13 19:04:01

graysky
Wiki Maintainer
From: :wq
Registered: 2008-12-01
Posts: 9,925
Website

Re: Following the wiki to determine the kernel EXTRAVERSION component

Highly recommend you create a PKGBUILD for the out-of-tree kernel module you want to build (or a dkms version) instead of following that advice.


CPU-optimized Linux-ck packages @ Repo-ck  • AUR packagesZsh and other configs

Offline

#4 2020-03-13 19:18:14

eschwartz
Trusted User/Bug Wrangler
Registered: 2014-08-08
Posts: 3,134

Re: Following the wiki to determine the kernel EXTRAVERSION component

The core/linux kernel doesn't actually use -ARCH, which goes to show how out of date that wiki page is. On the other hand, it sometimes feels like whether it uses -ARCH or not depends on the phase of the moon. Sometimes we have -arch1, sometimes we have -ARCH, sometimes we have both.

Current status:
The -zen kernel uses 1 & 2
The stock kernel uses 1
The -hardened kernel uses 2

Alternative kernels, both custom as well as some popular ones in the AUR, use eclectic choices most likely influenced by when they copied from the kernel, filtered through months or years of poking to see what works.

My advice: just give up on this as a bad job, use the same infrastructure dkms uses for out of tree kernel modules:

make -c /lib/modules/5.5.8-arch1-1-custom/build M=$PWD modules

Even for in-tree modules it should work fine, and it will always match the actual installed kernel with that name.


Managing AUR repos The Right Way -- aurpublish (now a standalone tool)

Offline

Board footer

Powered by FluxBB