[SOLVED] Kernel huge or generic, which is running?
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.
Is there a way to know which kernel is running without look at bootloader config files?
I am asking this just to confirm what grub2 does on the advanced options from the boot submenu.
cat /proc/cmdline
? EDIT: Answer: #10! Thanks! (I learned a bunch here!)
(Note to NoobSelf: Slack'=='Linux!=grubOS. poweroff that Mint [VBox that's eating halfXPnetbook] &Start some SlackS [which IantiGUI had already installed])
I'm an advocate of using the LOCALVERSION string when building a kernel to clearly differentiate them, but the stock slackware kernels aren't built that way, so you're basically left looking for clues such as whether ext4 support is built in or not.
zgrep -q 'CONFIG_EXT4_FS=y' /proc/config.gz is likely as good a way as any.
I've no idea what grub does. I consider it to be a monstrosity and avoid it like the plague.
All approaches depends on LOCALVERSION, except the GazL suggestion that searchs one feature built-in only in the generic kernel.
The command from GazL didn't work here but i got the idea.
cat /proc/cmdline seems to have the most potential to produce something meaningful. For each grub2 and lilo, the first part of /proc/cmdline's output depends on how grub2/lilo was configured. For grub2, it is whatever the value of the linux field was e.g.
Code:
linux /boot/vmlinuz-generic-4.4.38 root=/dev/sda7 rootfstype=ext4 raid=noautodetect intel_idle.max_cstate="1" nomodeset ro 4
Overall, the problem ends up being... the kernel doesn't have a "generic" or "huge" option. It doesn't understand what they are. Those are just two different configurations that Pat has provided for us. One has the majority of drivers compiled as modules (generic) and the other has the majority of modules compiled in the kernel (huge).
If you end up just using the symlink for your booting (by default, /boot/vmlinuz points to /boot/vmlinuz-huge-4.4.14 on a fresh 14.2 install, and /boot/vmlinuz is what is used in lilo.conf to call the kernel), your /proc/cmdline will provide no useful output since the entry is just called "Linux". The below is taken off a fresh install of 14.2 without modification to the boot system.
Code:
jbhansen@febtober:~$ cat /proc/cmdline
auto BOOT_IMAGE=Linux ro root=802 vt.default_utf8=1
That provides no useful information. However, when you check /etc/lilo.conf and /boot, you'd realize it points to the huge kernel.
Really, if you're using the stock kernels, the best check is GazL's quick check to see if ext4 is compiled into the kernel. If it is, you know you're running a huge kernel, and if it's compiled as a module, you're running a generic kernel. You can even simplify kjhambrick's little script to a one-liner.
However, that becomes more difficult to determine if you're running a self-compiled kernel. Many people will include the default filesystem (ext4 in most cases) into the kernel to prevent needing to load it in an initrd. At that point, your kernel is neither "Huge" nor "Generic" as those are only official terms applying to official Slackware kernels. I guess your big thing would be to see how much of the kernel is compiled as modules.
I just did a random check, and surprisingly, between the huge and generic kernels, there's only a difference of about 100 modules between the generic and huge kernels. Both kernels contain over 3000 items compiled in as modules. But I guess those 101 items equate to about 3.1MB within the kernel (4.2MB for the 4.4.14 generic and 7.3MB for the huge).
Add an entry for the md5sum of each kernel it is likely to encounter. Obviously this takes a little extra work as you'll need to collate and maintain the list of md5sums to start with, but it should be a reasonably reliable way of identifying them once that's done.
LinuxQuestions.org is looking for people interested in writing
Editorials, Articles, Reviews, and more. If you'd like to contribute
content, let us know.