[Date Prev][Date Next] [Thread Prev][Thread Next] [Date Index] [Thread Index]

Re: Debian version



Koler, Nethanel writes:

Hi
I am Nati, I am trying to find a variable that is configured in the linux- headers that can tell me on which Debian I am

Any reason for not using /etc/os-release instead?
IIRC this one is available on RHEL _and_ Debian systems.

For example in RedHat
After downloading the linux-headers
I can go to cd /usr/src/kernels/<header>/include/generated/uapi/linux
There there is a file called version.h
Where they define this variables

#define KERNEL_VERSION(a,b,c) (((a) << 16) + ((b) << 8) + (c))
#define RHEL_MAJOR 8
#define RHEL_MINOR 4

When I tried the same with Debian I got to a dead end
Can you please help me find something similar in the linux-headers for Debian?

I tried

$ grep -RF Debian /usr/src

and got a few hits, among those are

| .../include/generated/autoconf.h:#define CONFIG_CC_VERSION_TEXT "gcc-10 (Debian 10.2.1-6) 10.2.1 20210110"
| .../include/generated/compile.h:#define LINUX_COMPILER "gcc-10 (Debian 10.2.1-6) 10.2.1 20210110, GNU ld (GNU Binutils for Debian) 2.35.2"
| .../include/generated/compile.h:#define UTS_VERSION "#1 SMP Debian 5.10.46-5 (2021-09-23)"
| .../include/generated/package.h:#define LINUX_PACKAGE_ID " Debian 5.10.46-5"

If your goal is to evaluate them programatically during compile-time of a C project, this might not be ideal though, because all of the values I found seem to be strings.

HTH
Linux-Fan

öö

Attachment: pgpQcF4os9RBg.pgp
Description: PGP signature


Reply to: