LinuxQuestions.org
Visit Jeremy's Blog.
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Software > Linux - Kernel
User Name
Password
Linux - Kernel This forum is for all discussion relating to the Linux kernel.

Notices

Reply
 
Search this Thread
Old 11-28-2011, 10:45 AM   #16
JZL240I-U
Senior Member
 
Registered: Apr 2003
Location: Germany
Distribution: openSuSE 13.1 / 12.3_64-KDE, Ubuntu 14.04, Fedora 20, Mint 17, Chakra
Posts: 3,642

Original Poster
Rep: Reputation: Disabled

It is indeed "hard wired". The make file of the kernel package under construction contains the major descriptor of the kernel (which might be edited at ones own risk ) to which a further description can be attached at some point during preparations of a kernel compilation run with the command
Code:
make-kpgp --append-to-version="your-string-here"
Where and how it is read out by "uname" is not quite clear (yet) .
 
Old 01-05-2012, 01:18 AM   #17
JZL240I-U
Senior Member
 
Registered: Apr 2003
Location: Germany
Distribution: openSuSE 13.1 / 12.3_64-KDE, Ubuntu 14.04, Fedora 20, Mint 17, Chakra
Posts: 3,642

Original Poster
Rep: Reputation: Disabled
And then one can edit the makefile in the main directory of the kernel sources and amend the fourth line which contains the variable "EXTRAVERSION". Herein goes the value of the string to be appended to the normal kernel descriptor. This can also be done more comfortable during the normal configuration AFAIR. I guess I'll be back (again)...
 
Old 03-21-2013, 03:13 PM   #18
oldscratch
LQ Newbie
 
Registered: Apr 2008
Location: South Carolina
Distribution: Red Hat, Scientific Linux, CentOS, and Ubuntu
Posts: 27

Rep: Reputation: 13
Old thread, I know, but if anyone still cares:

Code:
cat /proc/sys/kernel/osrelease
will give you the same output as:

Code:
uname -r
I'm not 100% certain that the uname system call actually gets its information from that file, but it may be a good enough answer.
 
Old 03-22-2013, 02:02 AM   #19
JZL240I-U
Senior Member
 
Registered: Apr 2003
Location: Germany
Distribution: openSuSE 13.1 / 12.3_64-KDE, Ubuntu 14.04, Fedora 20, Mint 17, Chakra
Posts: 3,642

Original Poster
Rep: Reputation: Disabled
Sure. But /proc is an ephemeral file system, created during boot. So it must get its information from somewhere, where the kernel version is stored permanently. I'm still looking where and how it is done. The kernel maintainers would know it, of course -- and one day I will, too .

Thanks for answering and adding information .

Last edited by JZL240I-U; 03-25-2013 at 09:50 AM.
 
Old 03-22-2013, 09:39 AM   #20
sundialsvcs
Guru
 
Registered: Feb 2004
Location: SE Tennessee, USA
Distribution: Gentoo, LFS
Posts: 5,227

Rep: Reputation: 1062Reputation: 1062Reputation: 1062Reputation: 1062Reputation: 1062Reputation: 1062Reputation: 1062Reputation: 1062
/proc, /sys and so-forth are actually APIs!

In other words ... when you (say) do ls /proc/*, the kernel in real-time sends back a "list of 'files' and 'directories'" to you ... making it up on-the-spot.

Now, if you do ls /proc/pid, the same thing happens again: after determining that what you're asking for is actually any of your business , the kernel sends back a list of files and directories. Or, in the case of a particular "file," textual information.

It is, compared to most other operating systems, "effin' brilliant." Any program or script can get any sort of information that it wants (that is allowed to have), using perfectly-ordinary techniques like it would use if those files and directories actually existed. But, there is no physical set of files or directories that actually exists anywhere. The illusion is complete, but it is completely an illusion.

Last edited by sundialsvcs; 03-22-2013 at 09:41 AM.
 
Old 03-23-2013, 07:17 AM   #21
oldscratch
LQ Newbie
 
Registered: Apr 2008
Location: South Carolina
Distribution: Red Hat, Scientific Linux, CentOS, and Ubuntu
Posts: 27

Rep: Reputation: 13
Quote:
Sure. But /proc is an ephemeral file system
Well, yeah, but that's how you interface with the running kernel, and if you want to know about the current running kernel, that's where you'll need to look.

Quote:
So it must get its information from somwhere, where the kernel version is stored permanently.
Right, its stored as a literal value in the kernel binary, and in the kernel config files in /boot:

Code:
[root@bigdaddy boot]# grep "kernel version" config*
config-2.6.32-220.el6.x86_64:# Linux kernel version: 2.6.32-220.el6.x86_64
config-2.6.32-358.2.1.el6.x86_64:# Linux kernel version: 2.6.32-358.2.1.el6.x86_64
[root@bigdaddy boot]#
But that doesn't really tell you anything about which kernel is actually running right now.
 
Old 03-25-2013, 02:43 AM   #22
JZL240I-U
Senior Member
 
Registered: Apr 2003
Location: Germany
Distribution: openSuSE 13.1 / 12.3_64-KDE, Ubuntu 14.04, Fedora 20, Mint 17, Chakra
Posts: 3,642

Original Poster
Rep: Reputation: Disabled
Agreed on all statements in the last several posts. After what I learned in this thread to rephrase my original question: how do the maintainers "brand" their newest kernel version, i.e. in what (config)-file is the newest name actually written down? As I understand it, "uname -a" must read it from the running kernel (probably using a know offset from the beginning or some such).
 
Old 03-25-2013, 08:22 AM   #23
oldscratch
LQ Newbie
 
Registered: Apr 2008
Location: South Carolina
Distribution: Red Hat, Scientific Linux, CentOS, and Ubuntu
Posts: 27

Rep: Reputation: 13
Quote:
how do the maintainers "brand" their newest kernel version, i.e. in what (config)-file is the newest name actually written down?
I believe it is picked up from include/config/kernel.release in the kernel source, which is created from variables set right at the top of the kernel Makefile:

Code:
VERSION = 2
PATCHLEVEL = 6
SUBLEVEL = 32
EXTRAVERSION = -358.2.1.el6.x86_64
NAME = Man-Eating Seals of Antiquity
RHEL_MAJOR = 6
RHEL_MINOR = 4
RHEL_RELEASE = 357

Last edited by oldscratch; 03-25-2013 at 09:05 AM. Reason: to clarify how kernel.release is created
 
Old 03-25-2013, 09:45 AM   #24
JZL240I-U
Senior Member
 
Registered: Apr 2003
Location: Germany
Distribution: openSuSE 13.1 / 12.3_64-KDE, Ubuntu 14.04, Fedora 20, Mint 17, Chakra
Posts: 3,642

Original Poster
Rep: Reputation: Disabled
Yippheee. Confirmed:

http://crashcourse.ca/introduction-l...-configuration

Thanks, oldscratch, solved .
 
  


Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
square brackets in output of "ps aux" not matching output of "ps -ejH" alirezan1 Linux - Newbie 14 07-14-2010 04:17 AM
printing hh in hh:mm using "awk '{FS=":";print $1}'" misses first line of output!! mayankmehta83 Linux - Newbie 2 12-03-2009 02:55 AM
output of dmesg is "kernel: hda:" rajeev_ku Linux - Server 1 05-04-2009 12:46 PM
"failed to execute child process" "Input/output error" fl.bratu Fedora 4 12-15-2008 04:03 AM
Feeding the output of "diff" or "cat" command to dpkg --purge kushalkoolwal Debian 9 06-19-2008 07:27 AM


All times are GMT -5. The time now is 01:23 AM.

Main Menu
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
identi.ca: @linuxquestions
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration