LinuxQuestions.org
Review your favorite Linux distribution.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Distributions > Slackware
User Name
Password
Slackware This Forum is for the discussion of Slackware Linux.

Notices


Reply
  Search this Thread
Old 03-02-2015, 08:02 AM   #16
Ne36u12Y
Member
 
Registered: Aug 2013
Distribution: slackware
Posts: 42

Rep: Reputation: Disabled

Quote:
Originally Posted by Alien Bob View Post
You can check some of the kernel modules to see if you are running the official generic kernel instead of the official huge kernel.

Huge kernel:
Code:
# zcat /proc/config.gz | grep CONFIG_I2O=
CONFIG_I2O=y
Generic kernel:
Code:
# zcat /proc/config.gz | grep CONFIG_I2O= 
CONFIG_I2O=m
Eric

Hey Alien BoB, I tried using these codes you've supplied here but I get nothing but a returning cursor "#"
Did I do something wrong? Using your codes like this: "# zcat /proc/config.gz | grep CONFIG_I2O=CONFIG_I2O=y" or using "# zcat /proc/config.gz | grep CONFIG_I2O=CONFIG_I2O=m"

Last edited by Ne36u12Y; 03-02-2015 at 07:01 PM.
 
Old 03-02-2015, 08:05 AM   #17
Ne36u12Y
Member
 
Registered: Aug 2013
Distribution: slackware
Posts: 42

Rep: Reputation: Disabled
Quote:
Originally Posted by JackHair View Post
Its dmesg instead of demesg.
Sorry people, typo (fixed) but great catch, thanks
 
Old 03-02-2015, 08:30 AM   #18
bassmadrigal
LQ Guru
 
Registered: Nov 2003
Location: West Jordan, UT, USA
Distribution: Slackware
Posts: 8,792

Rep: Reputation: 6656Reputation: 6656Reputation: 6656Reputation: 6656Reputation: 6656Reputation: 6656Reputation: 6656Reputation: 6656Reputation: 6656Reputation: 6656Reputation: 6656
Quote:
Originally Posted by Ne36u12Y View Post
Hey AlienBoB, I tried using these codes you've supplied here but I get nothing but a returning cursor "#"
Did I do something wrong? Using your codes like this: "# zcat /proc/config.gz | grep CONFIG_I2O=CONFIG_I2O=y" or using "# zcat /proc/config.gz | grep CONFIG_I2O=CONFIG_I2O=m"
You are including parts you aren't supposed to. The line breaks in Eric's "code" indicates the output from the command. So the command zcat /proc/config.gz | grep CONFIG_I2O= should output CONFIG_I2O=y if you're running the default huge kernel and if you're running a generic kernel zcat /proc/config.gz | grep CONFIG_I2O= should output CONFIG_I2O=m.
 
Old 03-02-2015, 04:34 PM   #19
Ne36u12Y
Member
 
Registered: Aug 2013
Distribution: slackware
Posts: 42

Rep: Reputation: Disabled
Quote:
Originally Posted by bassmadrigal View Post
You are including parts you aren't supposed to. The line breaks in Eric's "code" indicates the output from the command. So the command zcat /proc/config.gz | grep CONFIG_I2O= should output CONFIG_I2O=y if you're running the default huge kernel and if you're running a generic kernel zcat /proc/config.gz | grep CONFIG_I2O= should output CONFIG_I2O=m.


Thanks bassmadrigal ... very well explained. It's all learning.

Now re-running Eric's command codes properly, running:

"# zcat /proc/config.gz | grep CONFIG_I2O" returns: "CONFIG_I2O=y" and a bunch of other CONFIG_I2O lines, 10 in total.

So I am running the default huge-smp kernel. Figures, I did not change anything on the install.


However, essentially looking at what commands can output what specific kernel version I am using. That is to say, not just the release, but what version, whether I am running the default "huge" or "generic". I have tried:

Code:
# uname -a
which outputs that I am using Linux (not that I am using Slackware GNU/Linux), the kernel release of "3.10.17" and a bunch of other good information, but not whether I am using "huge" or the "generic".


Code:
# uname -o
outputs "Linux"


Code:
# uname -s
outputs "GNU/Linux"


Code:
# uname -r
outputs "3.10.17"


Code:
# uname -v
outputs "SMP" and the date ... So I guess that is helpful, as it is the version I am using. But why doesn't it say huge.smp? Is that just redundant? Although it is in big capital letters.


Code:
# ls -l /var/log/packages/kernel*
outputs the firmware, generic, headers, huge, modules, and source.


Code:
# cat /etc/*-release
or
Code:
# cat /etc/*release
seem to both give the same output, which is to say that I am running Slackware; giving also the VERSION, ID, PRETTY_NAME, ANSI_COLOR, CPE_NAME, HOME_URL, SUPPORT_URL, and BUG_REPORT_URL, which is nice. (Maybe there is a file I need to configure/edit/create so it does output that I am using Slackware, and related details?).


Code:
# ls -l /boot/vmlinuz
output seems to point directly to what version of the kernel I am running, its in cyan color, which is what I want to know: "/boot/vmlinuz -> vmlinuz-huge -3.10.17". So that seems good.


Code:
# ls -l /boot/vmlinuz*
output of this command is good too, it seems to show again what kernel version currently using again in cyan color "/boot/vmlinuz -> vmlinuz-huge -3.10.17" as well as the other kernel version available, "vmlinuz-generic-3.10.17".

Code:
# dmesg | grep vmlinuz
this code still gives me no output, just returns to the cursor "#". Anyone know why?

Last edited by Ne36u12Y; 03-02-2015 at 04:40 PM.
 
Old 03-02-2015, 05:28 PM   #20
bassmadrigal
LQ Guru
 
Registered: Nov 2003
Location: West Jordan, UT, USA
Distribution: Slackware
Posts: 8,792

Rep: Reputation: 6656Reputation: 6656Reputation: 6656Reputation: 6656Reputation: 6656Reputation: 6656Reputation: 6656Reputation: 6656Reputation: 6656Reputation: 6656Reputation: 6656
The reason why is because the kernel doesn't know whether it is "huge" or "generic" since these are Slackware terms. All the computer cares about is that you're running kernel version 3.xx.xx. It doesn't care whether the drivers are built into the kernel (huge) or if they are all separate modules (generic). Once you build your own kernel, it can be based on a huge or generic kernel, but it is now a custom kernel. If you do have most of your kernel modularized (generic-ish), if you don't have the filesystem and a few other basic drivers built into the kernel, you will need to use an initrd.

And it isn't the best plan to rely on the output of /boot, since you can run a new kernel without changing the symlink by editing /etc/lilo.conf. I'm not sure if there is a "best" way to figure out what kernel you're using, however, I would probably check by looking at your lilo.conf and then seeing what is set as default (or remembering which entry you selected if you didn't use the default option).
 
Old 03-02-2015, 06:30 PM   #21
Ne36u12Y
Member
 
Registered: Aug 2013
Distribution: slackware
Posts: 42

Rep: Reputation: Disabled
Quote:
Originally Posted by bassmadrigal View Post
The reason why is because the kernel doesn't know whether it is "huge" or "generic" since these are Slackware terms. All the computer cares about is that you're running kernel version 3.xx.xx. It doesn't care whether the drivers are built into the kernel (huge) or if they are all separate modules (generic). Once you build your own kernel, it can be based on a huge or generic kernel, but it is now a custom kernel. If you do have most of your kernel modularized (generic-ish), if you don't have the filesystem and a few other basic drivers built into the kernel, you will need to use an initrd.

And it isn't the best plan to rely on the output of /boot, since you can run a new kernel without changing the symlink by editing /etc/lilo.conf. I'm not sure if there is a "best" way to figure out what kernel you're using, however, I would probably check by looking at your lilo.conf and then seeing what is set as default (or remembering which entry you selected if you didn't use the default option).

Thanks for your input bassmadrigal. I have made so many changes from time to time its hard to keep up with what I have done ... I should be more diligent in my configuration habits.

Yeah I looked at my lilo.conf

Code:
# vim /etc/lilo.conf
But knowing at the end of the lilo.conf file is what is of interest, pertaining to what kernel version is running, for the default huge.smp, it only states that the "image = /boot/vmlinuz" it doesn't state which kernel version. Unless those who know, that means the default huge.smp kernel? However, if one makes changes to this file, in for example, compiling a custom kernel, or switching to the generic kernel, this will obviously change. I have used initrd on another computer, using Slackware of course changing to the generic kernel, and lilo.conf at the bottom reflects this kernel change, for example on my other pc, it reads "image = /boot/vmlinuz-generic-3.10.17". It was an enjoyable conquest

I really was just after a command for the terminal that could tell me the kernel version running, not just the release. The above commands plus the ones just gained through Eric (Alien Bob), EYo, and Richard Cranium on this thread, are all I have come across.

Last edited by Ne36u12Y; 03-02-2015 at 06:59 PM.
 
Old 03-02-2015, 07:30 PM   #22
bassmadrigal
LQ Guru
 
Registered: Nov 2003
Location: West Jordan, UT, USA
Distribution: Slackware
Posts: 8,792

Rep: Reputation: 6656Reputation: 6656Reputation: 6656Reputation: 6656Reputation: 6656Reputation: 6656Reputation: 6656Reputation: 6656Reputation: 6656Reputation: 6656Reputation: 6656
Quote:
Originally Posted by Ne36u12Y View Post
But knowing at the end of the lilo.conf file is what is of interest, pertaining to what kernel version is running, for the default huge.smp, it only states that the "image = /boot/vmlinuz" it doesn't state which kernel version. Unless those who know, that means the default huge.smp kernel? However, if one makes changes to this file, in for example, compiling a custom kernel, or switching to the generic kernel, this will obviously change. I have used initrd on another computer, using Slackware of course changing to the generic kernel, and lilo.conf at the bottom reflects this kernel change, for example on my other pc, it reads "image = /boot/vmlinuz-generic-3.10.17". It was an enjoyable conquest
I don't know if you'll ever find something that does that since they are Slackware only terms. The kernel itself doesn't care whether drivers are built in or modules. To it, a kernel is a kernel and the only things that matter are the version, SMP support, and architecture (32bit vs 64bit). As to lilo.conf, if it just states "image = /boot/vmlinuz", then that means you've left it untouched. At that point, it is just whatever kernel you have /boot/vmlinuz symlinked to. By default, this is the huge kernel, but you can change it to be any kernel you'd like, including custom ones you've built.

However, I tend to leave that alone on my system (as a failsafe) and then will add any additional kernels (or the generic kernel) as a separate entry.
 
Old 03-02-2015, 11:24 PM   #23
T3slider
Senior Member
 
Registered: Jul 2007
Distribution: Slackware64-14.1
Posts: 2,367

Rep: Reputation: 843Reputation: 843Reputation: 843Reputation: 843Reputation: 843Reputation: 843Reputation: 843
The easy way to do this, assuming you haven't done something weird like delete /boot/config-*, is to run the following command in a terminal:
Code:
for i in /boot/config-* ; do if zdiff /proc/config.gz $i >/dev/null 2>&1 ; then if [ -f $i ]; then echo $i ; fi ; fi ; done
This should print out, definitively and without ambiguity, the kernel that you are currently running, as long as it has an aptly-named config file in /boot (the Slackware-provided kernels do and I make sure any custom kernels I build do too).

Last edited by T3slider; 03-02-2015 at 11:25 PM.
 
2 members found this post helpful.
Old 03-06-2015, 04:54 AM   #24
Ne36u12Y
Member
 
Registered: Aug 2013
Distribution: slackware
Posts: 42

Rep: Reputation: Disabled
Quote:
Originally Posted by T3slider View Post
The easy way to do this, assuming you haven't done something weird like delete /boot/config-*, is to run the following command in a terminal:
Code:
for i in /boot/config-* ; do if zdiff /proc/config.gz $i >/dev/null 2>&1 ; then if [ -f $i ]; then echo $i ; fi ; fi ; done
This should print out, definitively and without ambiguity, the kernel that you are currently running, as long as it has an aptly-named config file in /boot (the Slackware-provided kernels do and I make sure any custom kernels I build do too).

Hey T3slider

That is really impressive, thanks for your time and efforts. How did you learn that?
 
Old 03-06-2015, 07:42 AM   #25
Alien Bob
Slackware Contributor
 
Registered: Sep 2005
Location: Eindhoven, The Netherlands
Distribution: Slackware
Posts: 8,559

Rep: Reputation: 8106Reputation: 8106Reputation: 8106Reputation: 8106Reputation: 8106Reputation: 8106Reputation: 8106Reputation: 8106Reputation: 8106Reputation: 8106Reputation: 8106
Quote:
Originally Posted by Ne36u12Y View Post
Hey T3slider

That is really impressive, thanks for your time and efforts. How did you learn that?
It is a combination of knowledge about shell scripting, familiarity with standard UNIX tools, knowing that in traditional UNIX, everything is a file, being aware that the kernel creates a virtual filesystem called /proc where a lot of information can be found on running processes; knowing that the running kernel's configuration can be queried through a /proc interface (specifically the /proc/config.gz file) and that Slackware keeps a copy of the configuration file that was used to compile the kernel in /boot .

I.e. several separate knowledge bits and bites. It takes time to master all that knowledge and integrate it so you can start building complex solutions of your own.

Reading the many Q&A threads on this forum will teach you a lot.
 
1 members found this post helpful.
Old 03-07-2015, 05:52 AM   #26
Ne36u12Y
Member
 
Registered: Aug 2013
Distribution: slackware
Posts: 42

Rep: Reputation: Disabled
Hello Alien Bob, Eric

Great post, thanks for taking the time and effort to post a response. Mentioning what you have, the way you have is very very helpful.
 
Old 03-07-2015, 07:23 AM   #27
lems
Member
 
Registered: May 2004
Distribution: BSD
Posts: 269

Rep: Reputation: 119Reputation: 119
Quote:
Originally Posted by Ne36u12Y View Post
"# zcat /proc/config.gz | grep CONFIG_I2O" returns: "CONFIG_I2O=y" and a bunch of other CONFIG_I2O lines, 10 in total.
(z)grep works on files as well, this is actually a useless use of cat.
</nitpick>

Code:
zgrep CONFIG_I2O /proc/config.gz
 
Old 03-07-2015, 11:18 AM   #28
Alien Bob
Slackware Contributor
 
Registered: Sep 2005
Location: Eindhoven, The Netherlands
Distribution: Slackware
Posts: 8,559

Rep: Reputation: 8106Reputation: 8106Reputation: 8106Reputation: 8106Reputation: 8106Reputation: 8106Reputation: 8106Reputation: 8106Reputation: 8106Reputation: 8106Reputation: 8106
Quote:
Originally Posted by lems View Post
(z)grep works on files as well, this is actually a useless use of cat.
</nitpick>

Code:
zgrep CONFIG_I2O /proc/config.gz
Actually there is no difference... both commands use gzip and grep, cat is not involved. The zcat script does nothing more than "gzip -cd" and the zgrep script is a convoluted way to pipe a gzip command's output into a grep command.
 
Old 03-07-2015, 11:31 AM   #29
lems
Member
 
Registered: May 2004
Distribution: BSD
Posts: 269

Rep: Reputation: 119Reputation: 119
Quote:
Originally Posted by Alien Bob View Post
Actually there is no difference... both commands use gzip and grep, cat is not involved. The zcat script does nothing more than "gzip -cd" and the zgrep script is a convoluted way to pipe a gzip command's output into a grep command.
I see. Still, my great teacher Aristotle Pagaltzis told me in my early unix days that cat FILE | grep foo is a useless use of cat. Though I see now that this is not applicable to the zgrep tool. Thank you for the explanation.
 
  


Reply



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
[SOLVED] setting up initrd / generic kernel in Grub2...can't load generic Ubunoob001 Slackware 12 03-20-2015 07:32 AM
[SOLVED] Kernel Panic with generic kernel on Dell poweredge 2850 Slackware 14.1 Dieselchair Slackware 44 08-22-2014 06:46 PM
kernel-generic and kernel-generic-smp ?? liuyug Slackware - Installation 5 06-01-2014 07:01 PM
KUbuntu 7.05 with 2.6.20-17-generic kernel on Thinkpad 600E running 4x faster AndrzejL Linux - Laptop and Netbook 4 10-14-2008 05:18 PM
slack 12, switch to generic kernel from huge kernel, using grub? jaguarrh Slackware 8 09-19-2007 06:29 AM

LinuxQuestions.org > Forums > Linux Forums > Linux - Distributions > Slackware

All times are GMT -5. The time now is 03:50 PM.

Main Menu
Advertisement
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
Open Source Consulting | Domain Registration