SlackwareThis Forum is for the discussion of Slackware Linux.
Notices
Welcome to LinuxQuestions.org, a friendly and active Linux Community.
You are currently viewing LQ as a guest. By joining our community you will have the ability to post topics, receive our newsletter, use the advanced search, subscribe to threads and access many other special features. Registration is quick, simple and absolutely free. Join our community today!
Note that registered members see fewer ads, and ContentLink is completely disabled once you log in.
If you have any problems with the registration process or your account login, please contact us. If you need to reset your password, click here.
Having a problem logging in? Please visit this page to clear all LQ-related cookies.
Get a virtual cloud desktop with the Linux distro that you want in less than five minutes with Shells! With over 10 pre-installed distros to choose from, the worry-free installation life is here! Whether you are a digital nomad or just looking for flexibility, Shells can put your Linux machine on the device that you want to use.
Exclusive for LQ members, get up to 45% off per month. Click here for more info.
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"
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.
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?
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).
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.
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.
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).
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?
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.
(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.
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.
LinuxQuestions.org is looking for people interested in writing
Editorials, Articles, Reviews, and more. If you'd like to contribute
content, let us know.