LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Slackware (https://www.linuxquestions.org/questions/slackware-14/)
-   -   Kernel panic... (https://www.linuxquestions.org/questions/slackware-14/kernel-panic-4175585467/)

vito_spatafore 07-25-2016 07:57 AM

Kernel panic...
 
1 Attachment(s)
howdy folks ... as title says ... nice kernel panic trying to use generic, btw I have like 10 entries on grub(managed by my first distro) how to deal it ?

slacker1337 07-25-2016 08:20 AM

Are you using lvm? Did you create an initramfs? Some more information about your system setup would be helpful.

onebuck 07-25-2016 08:27 AM

Member response
 
Hi,

Welcome to LQ & Slackware!

When you are going to use the generic kernel a initrd must be used;
Quote:

From http://docs.slackware.com/slackware:beginners_guide?s

It's recommended that you switch to Slackware's generic kernel. This is easy to do but there are a few steps to follow.

What is the difference between a “generic” kernel and the “huge” kernel which has been installed as the default kernel?
The “huge” kernel is essentially a kernel which has every hardware driver built in which you might need for a successful installation of your computer. Think of storage and (wired) network drivers, filesystem and encryption drivers and a lot more. All these built-in drivers result in a big kernel image (hence the name “huge”). When this kernel boots it will use up a lot your RAM (relatively speaking… with 1 GB of RAM you will not really be troubled by a few MB less RAM).
The “generic” kernel on the other hand, is a kernel which has virtually no drivers built in. All drivers will be loaded into RAM on demand. This will make your kernel's memory consumption lower and the boot process a bit faster. The smaller size allows for the use of an initial RAM disk or “initrd”. An initial RAMdisk is required in certain configurations, like software RAID, or a fully encrypted hard drive.
For now, you need to remember that a “huge” kernel will not support an intial RAM disk, but the “generic” kernel will. We go for maximum flexibility and use a “generic” kernel.
You will need to create an initial RAM disk (“initrd” for short). The initrd functions as a temporary root file system during the intial stage of the kernel booting, and it helps get the actual root system mounted when your system boots. Run this, as root: # /usr/share/mkinitrd/mkinitrd_command_generator.sh
Be sure to continue reading the rest of the document.

The Slackware Doc Project is a very good resource for Slackware users, both new & old.

Hope this helps.
Have fun & enjoy!
:hattip:

vito_spatafore 07-25-2016 09:57 AM

Quote:

Originally Posted by slacker1337 (Post 5580981)
Are you using lvm?

Did you create an initramfs?

Some more information about your system setup would be helpful

I use ext4 [sda3],

yep, already did,

what info do you need ?

on installation skip LiLo, I have grub installed on sda in antiX partition, as said before I got like 10 Slackware entries

vito_spatafore 07-25-2016 11:20 AM

Quote:

If you use grub or another bootloader, then make changes which are applicable to the program you use.

that's it!

Ragnathok 07-25-2016 04:40 PM

Hi!

Last time I had this kind of problem, my GRUB configuration file was missing the name of one of the initrd files. The purpose of all I am going to ask is to verify if for the failing distribution, the "initrd" line in your GRUB configuration file for this distribution contains all of the necessary initrd required for booting.

I would like to take a look at the configuration file

Code:

/boot/grub/grub.cfg
of the distribution on which GRUB is installed. It is pretty huge. The part we are interested in is located near the bottom. There will be blocks that begin with a line starting with

Code:

menuentry
followed by the label used in the GRUB menu for one of your distributions. If would like to see the blocks about Slackware.

Moreover, I will need to see the contents of the /boot directory on your Slackware partition to see the names of the initrd files located in it.

Finally, are you using an Intel CPU? If so, you may also need an extra file, named "intel-ucode.img", located in the /boot directory of your Slackware partition. I say "may" because I do not require it on Ubuntu, but I do on Manjaro and Arch. It should be available in your distribution's repositories if you require it.

onebuck 07-25-2016 05:10 PM

Member response
 
Hi,

Even if the OP is using GRUB2 a initrd must be created for the Slackware generic kernel because necessary drivers are not included.. You would have a initrd entry line in the grub.cfg such as;
Code:

initrd    /boot/initrd.img-generic
That must be created by the use of the script '/usr/share/mkinitrd/mkinitrd_command_generator.sh' naming the initrd image file unique to the '/boot' directory
Quote:

From http://docs.slackware.com/slackware:beginners_guide?s[]=generic

You will need to create an initial RAM disk (“initrd” for short). The initrd functions as a temporary root file system during the intial stage of the kernel booting, and it helps get the actual root system mounted when your system boots. Run this, as root: # /usr/share/mkinitrd/mkinitrd_command_generator.sh
Hope this helps.
Have fun & enjoy!
:hattip:

vito_spatafore 07-25-2016 07:14 PM

Quote:

Originally Posted by Ragnathok (Post 5581197)
Hi!

Last time I had this kind of problem, my GRUB configuration file was missing the name of one of the initrd files. The purpose of all I am going to ask is to verify if for the failing distribution, the "initrd" line in your GRUB configuration file for this distribution contains all of the necessary initrd required for booting.

I would like to take a look at the configuration file

Code:

/boot/grub/grub.cfg
of the distribution on which GRUB is installed. It is pretty huge. The part we are interested in is located near the bottom. There will be blocks that begin with a line starting with

Code:

menuentry
followed by the label used in the GRUB menu for one of your distributions. If would like to see the blocks about Slackware.

Moreover, I will need to see the contents of the /boot directory on your Slackware partition to see the names of the initrd files located in it.

Finally, are you using an Intel CPU? If so, you may also need an extra file, named "intel-ucode.img", located in the /boot directory of your Slackware partition. I say "may" because I do not require it on Ubuntu, but I do on Manjaro and Arch. It should be available in your distribution's repositories if you require it.

I'm pretty sure with you help I'm going to get ahead with this ...

Richard Cranium 07-25-2016 07:37 PM

See https://www.linuxquestions.org/quest...ml#post5078462 for some information.

vito_spatafore 07-25-2016 08:45 PM

Quote:

Originally Posted by Ragnathok (Post 5581197)

Code:

/boot/grub/grub.cfg
of the distribution on which GRUB is installed. It is pretty huge. The part we are interested in is located near the bottom. There will be blocks that begin with a line starting with

Code:

menuentry
followed by the label used in the GRUB menu for one of your distributions. If would like to see the blocks about Slackware.

Moreover, I will need to see the contents of the /boot directory on your Slackware partition to see the names of the initrd files located in it.

Finally, are you using an Intel CPU? If so, you may also need an extra file, named "intel-ucode.img", located in the /boot directory of your Slackware partition. I say "may" because I do not require it on Ubuntu, but I do on Manjaro and Arch. It should be available in your distribution's repositories if you require it.

Code:

}

menuentry 'Slackware Linux (Slackware 14.2) (on /dev/sda3)' --class gnu-linux --class gnu --class os $menuentry_id_option 'osprober-gnulinux-simple-kkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkk' {
        insmod part_msdos
        insmod ext2
        set root='hd0,msdos3'
        if [ x$feature_platform_search_hint = xy ]; then
          search --no-floppy --fs-uuid --set=root --hint-bios=hd0,msdos3 --hint-efi=hd0,msdos3 --hint-baremetal=ahci0,msdos3  kkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkk
        else
          search --no-floppy --fs-uuid --set=root hhhhhhhhhhhhhhhhhhhhhhhhh
        fi
        linux /boot/vmlinuz root=/dev/sda3
        initrd /boot/initrd.gz
}
submenu 'Advanced options for Slackware Linux (Slackware 14.2) (on /dev/sda3)' $menuentry_id_option 'osprober-gnulinux-advanced-ρρρρρρρρρρρρρρρρρρρρρρρρ' {
        menuentry 'Slackware Linux (Slackware 14.2) (on /dev/sda3)' --class gnu-linux --class gnu --class os $menuentry_id_option 'osprober-gnulinux-/boot/vmlinuz--yyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyy' {
                insmod part_msdos
                insmod ext2
                set root='hd0,msdos3'
                if [ x$feature_platform_search_hint = xy ]; then
                  search --no-floppy --fs-uuid --set=root --hint-bios=hd0,msdos3 --hint-efi=hd0,msdos3 --hint-baremetal=ahci0,msdos3  kkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkk
                else
                  search --no-floppy --fs-uuid --set=root rrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrr
                fi
                linux /boot/vmlinuz root=/dev/sda3
                initrd /boot/initrd.gz
        }
        menuentry 'Slackware Linux (Slackware 14.2) (on /dev/sda3)' --class gnu-linux --class gnu --class os $menuentry_id_option 'osprober-gnulinux-/boot/vmlinuz--wwwwwwwwwwwwwwwwwwwwwwwwwwwwwww' {
                insmod part_msdos
                insmod ext2
                set root='hd0,msdos3'
                if [ x$feature_platform_search_hint = xy ]; then
                  search --no-floppy --fs-uuid --set=root --hint-bios=hd0,msdos3 --hint-efi=hd0,msdos3 --hint-baremetal=ahci0,msdos3  wwwwwwwwwwwwwwwwwwwwwwwwwwwwwwww
                else
                  search --no-floppy --fs-uuid --set=root zzzzzzzzzzzzzzzzzzzzzzzzzz
                fi
                linux /boot/vmlinuz root=/dev/sda3
                initrd /boot/initrd.gz
        }
        menuentry 'Slackware Linux (Slackware 14.2) (on /dev/sda3)' --class gnu-linux --class gnu --class os $menuentry_id_option 'osprober-gnulinux-/boot/vmlinuz-generic--zzzzzzzzzzzzzzzzzzzzzzzzzz' {
                insmod part_msdos
                insmod ext2
                set root='hd0,msdos3'
                if [ x$feature_platform_search_hint = xy ]; then
                  search --no-floppy --fs-uuid --set=root --hint-bios=hd0,msdos3 --hint-efi=hd0,msdos3 --hint-baremetal=ahci0,msdos3  xxxxxxxxxxxxxxxxxxxxxxxxxx
                else
                  search --no-floppy --fs-uuid --set=root xxxxxxxxxxxxxxxxxxxxxxxx
                fi
                linux /boot/vmlinuz-generic root=/dev/sda3
        }
        menuentry 'Slackware Linux (Slackware 14.2) (on /dev/sda3)' --class gnu-linux --class gnu --class os $menuentry_id_option 'osprober-gnulinux-/boot/vmlinuz-generic-4.4.14--==========================' {
                insmod part_msdos
                insmod ext2
                set root='hd0,msdos3'
                if [ x$feature_platform_search_hint = xy ]; then
                  search --no-floppy --fs-uuid --set=root --hint-bios=hd0,msdos3 --hint-efi=hd0,msdos3 --hint-baremetal=ahci0,msdos3  ddddddddddddddddddddddddddddddddddddd
                else
                  search --no-floppy --fs-uuid --set=root 41509d49-9b27-43b0-8a66-b9b1460424d0
                fi
                linux /boot/vmlinuz-generic-4.4.14 root=/dev/sda3
        }
        menuentry 'Slackware Linux (Slackware 14.2) (on /dev/sda3)' --class gnu-linux --class gnu --class os $menuentry_id_option 'osprober-gnulinux-/boot/vmlinuz-generic-smp--===============================' {
                insmod part_msdos
                insmod ext2
                set root='hd0,msdos3'
                if [ x$feature_platform_search_hint = xy ]; then
                  search --no-floppy --fs-uuid --set=root --hint-bios=hd0,msdos3 --hint-efi=hd0,msdos3 --hint-baremetal=ahci0,msdos3  //////////////////////////////
                else
                  search --no-floppy --fs-uuid --set=root/////////////////////////7
                fi
                linux /boot/vmlinuz-generic-smp root=/dev/sda3
        }
        menuentry 'Slackware Linux (Slackware 14.2) (on /dev/sda3)' --class gnu-linux --class gnu --class os $menuentry_id_option 'osprober-gnulinux-/boot/vmlinuz-generic-smp-4.4.14-smp--&&&&&&&&&&&&&&&&&&&&&&&&&' {
                insmod part_msdos
                insmod ext2
                set root='hd0,msdos3'
                if [ x$feature_platform_search_hint = xy ]; then
                  search --no-floppy --fs-uuid --set=root --hint-bios=hd0,msdos3 --hint-efi=hd0,msdos3 --hint-baremetal=ahci0,msdos3  %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
                else
                  search --no-floppy --fs-uuid --set=root $$$$$$$$$$$$$$$$$$$$$$$$$$$$
                fi
                linux /boot/vmlinuz-generic-smp-4.4.14-smp root=/dev/sda3
        }
        menuentry 'Slackware Linux (Slackware 14.2) (on /dev/sda3)' --class gnu-linux --class gnu --class os $menuentry_id_option 'osprober-gnulinux-/boot/vmlinuz-huge--###################################3' {
                insmod part_msdos
                insmod ext2
                set root='hd0,msdos3'
                if [ x$feature_platform_search_hint = xy ]; then
                  search --no-floppy --fs-uuid --set=root --hint-bios=hd0,msdos3 --hint-efi=hd0,msdos3 --hint-baremetal=ahci0,msdos3  ################################
                else
                  search --no-floppy --fs-uuid --set=root xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx
                fi
                linux /boot/vmlinuz-huge root=/dev/sda3
        }
        menuentry 'Slackware Linux (Slackware 14.2) (on /dev/sda3)' --class gnu-linux --class gnu --class os $menuentry_id_option 'osprober-gnulinux-/boot/vmlinuz-huge-4.4.14--xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx' {
                insmod part_msdos
                insmod ext2
                set root='hd0,msdos3'
                if [ x$feature_platform_search_hint = xy ]; then
                  search --no-floppy --fs-uuid --set=root --hint-bios=hd0,msdos3 --hint-efi=hd0,msdos3 --hint-baremetal=ahci0,msdos3  xxxxxxxxxxxxxxxxxxxxxxxxxx
                else
                  search --no-floppy --fs-uuid --set=root xxxxxxxxxxxxxxxxxxxxxxxxxxxxx
                fi
                linux /boot/vmlinuz-huge-4.4.14 root=/dev/sda3
        }
        menuentry 'Slackware Linux (Slackware 14.2) (on /dev/sda3)' --class gnu-linux --class gnu --class os $menuentry_id_option 'osprober-gnulinux-/boot/vmlinuz-huge-smp--5555555555555555555555555' {
                insmod part_msdos
                insmod ext2
                set root='hd0,msdos3'
                if [ x$feature_platform_search_hint = xy ]; then
                  search --no-floppy --fs-uuid --set=root --hint-bios=hd0,msdos3 --hint-efi=hd0,msdos3 --hint-baremetal=ahci0,msdos3  4444444444444444444444444444444
                else
                  search --no-floppy --fs-uuid --set=root 333333333333333333333333333333
                fi
                linux /boot/vmlinuz-huge-smp root=/dev/sda3
        }
        menuentry 'Slackware Linux (Slackware 14.2) (on /dev/sda3)' --class gnu-linux --class gnu --class os $menuentry_id_option 'osprober-gnulinux-/boot/vmlinuz-huge-smp-4.4.14-smp--11111111111111111111111' {
                insmod part_msdos
                insmod ext2
                set root='hd0,msdos3'
                if [ x$feature_platform_search_hint = xy ]; then
                  search --no-floppy --fs-uuid --set=root --hint-bios=hd0,msdos3 --hint-efi=hd0,msdos3 --hint-baremetal=ahci0,msdos3  22222222222222222222222222222222
                else
                  search --no-floppy --fs-uuid --set=root 1111111111111111111111
                fi
                linux /boot/vmlinuz-huge-smp-4.4.14-smp root=/dev/sda3
        }
}



**************************************************************************************************** **************


Code:

### BEGIN /etc/grub.d/10_linux ###
function gfxmode {
        set gfxpayload="${1}"
}
set linux_gfx_mode=
export linux_gfx_mode
menuentry 'antiX GNU/Linux' --class antix --class gnu-linux --class gnu --class os $menuentry_id_option 'gnulinux-simple-xxxxxxxxxxxxxxxxxxxxxxxxxxx' {
        load_video
        insmod gzio
        if [ x$grub_platform = xxen ]; then insmod xzio; insmod lzopio; fi
        insmod part_msdos
        insmod ext2
        set root='hd0,msdos1'
        if [ x$feature_platform_search_hint = xy ]; then
          search --no-floppy --fs-uuid --set=root --hint-bios=hd0,msdos1 --hint-efi=hd0,msdos1 --hint-baremetal=ahci0,msdos1  acxxxxxxxxxxxxxxxxxxxxxxxxxxx
        else
          search --no-floppy --fs-uuid --set=root ################################
        fi
        echo        'Loading Linux 4.4.10-antix.1-amd64-smp ...'
        linux        /boot/vmlinuz-4.4.10-antix.1-amd64-smp root=UUID=############################# ro  zswap.zpool=zsmalloc vga=788 quiet
        echo        'Loading initial ramdisk ...'
        initrd        /boot/initrd.img-4.4.10-antix.1-amd64-smp


vito_spatafore 07-25-2016 09:51 PM

Grub has become ridiculously complex, at least three places from where you can edit it's config... ?!?

The best thing you can do is ditch it.

Edit:
1) A config file for the program that generates the real config.
2) n-x scripts that generate the config.
3) The config file itself.

Richard Cranium 07-25-2016 10:10 PM

:rolleyes: It wasn't that difficult to modify someone else's script (that's all that I did) to create something that would generate grub entries that more-or-less worked with Slackware.

At least it's worked for all of my grub-booted machines.

Hangaber 07-25-2016 11:09 PM

The more vmlinuz files/symlinks you have in /boot/, the more entries grub will generate.
The grub scripts you're using also have to figure out if there's a matching initrd for each vmlinuz.

From the output you posted above, there are 9 vmlinuz files or symlinks in /boot/ and it looks like all the generic kernels are missing a line for the initrd.
(Or, the initrd's exist, but the grub script is looking for filename patterns that don't quite match them.)
Code:

vmlinuz
vmlinuz-generic        (no initrd?)
vmlinuz-generic-4.4.14        (no initrd?)
vmlinuz-generic-smp        (no initrd?)
vmlinuz-generic-smp-4.4.14-smp        (no initrd?)
vmlinuz-huge
vmlinuz-huge-4.4.14
vmlinuz-huge-smp
vmlinuz-huge-smp-4.4.14-smp

On my system, I go with the naming convention of "vmlinuz-<huge|generic>-<version>" and likewise, "initrd-generic-<version>.gz".
As an example, under /boot/ I currently have;
Code:

vmlinuz-generic-3.18.37
initrd-generic-3.18.37.gz
vmlinuz-generic-4.4.15
initrd-generic-4.4.15.gz

I slightly modified my "/etc/grub.d/10_linux" to look for "initrd-generic-${version}.gz".
Adding a line at line 202, my lines 201-203 now look like this;
Code:

          "initramfs-genkernel-${GENKERNEL_ARCH}-${alt_version}" \
          "initrd-generic-${version}.gz" \
          "initrd.gz"; do

Of course, I wouldn't have to do that if I kept to a naming convention that grub is looking for, such as "initramfs-genkernel-${version}".
You may have to check the grub scripts in a similar way on the system you are generating the grub.conf with to see exactly what filenames they're looking for.

In Slackware, I used the mkinitrd_command_generator.sh script to generate a suitable mkinitrd line and plopped that into a simple script such as;
Code:

#!/bin/bash
VER=4.4.15
TYPE=generic
echo "Making initrd for ${TYPE} kernel v${VER}"
mkinitrd -c -k ${VER} -f ext4 -r /dev/sda2 -m mbcache:jbd2:ext4 -u -o /boot/initrd-${TYPE}-${VER}.gz

So if needed, I can;
Code:

VER=4.4.16 ./myscriptname.sh
Then I have Slackware update my grub config;
Code:

grub-mkconfig -o /boot/grub/grub.cfg
Hope that helps!

vito_spatafore 07-26-2016 09:55 AM

1 Attachment(s)
/boot directory :

Ragnathok 07-26-2016 10:37 AM

Looking at your /boot directory, the only existing initrd file is "initrd.gz" for the "vmlinuz" kernel. The "vmlinuz" file seems to be a link. Which kernel does it point to? You can use "ls -l" to see.

As explained by Hangaber above (great answer by the way!), you will need to produce an initrd for the generic kernel, as there is none. Then, if it matches the pattern GRUB is looking for, it will be added automatically to your grub.cfg file once you update it using

Code:

grub-mkconfig -o /boot/grub/grub.cfg
For testing, you can also manually add it to the "initrd" line so it looks like

Code:

initrd /boot/NameOfTheInitrdFile
I recommend not touching the blocks about your antiX partition, as messing something up there would prevent you from being able to boot into it.

Also, from what I see the Slackware entry on the main GRUB menu, which corresponds to the very first block you posted, does not use the generic kernel (unless the link points to it). Only the third, fourth, fifth and sixth entries of the "Advanced options" menu use it. It is in those blocks that an "initrd" line needs to be added once the file has been generated, just under the "linux" line. If I use the fourth entry in the "Advanced options" as an example, using the GRUB standard convention explained by Hangaber, this would give

Code:

menuentry 'Slackware Linux (Slackware 14.2) (on /dev/sda3)' --class gnu-linux --class gnu --class os $menuentry_id_option 'osprober-gnulinux-/boot/vmlinuz-generic-4.4.14--==========================' {
                insmod part_msdos
                insmod ext2
                set root='hd0,msdos3'
                if [ x$feature_platform_search_hint = xy ]; then
                  search --no-floppy --fs-uuid --set=root --hint-bios=hd0,msdos3 --hint-efi=hd0,msdos3 --hint-baremetal=ahci0,msdos3  ddddddddddddddddddddddddddddddddddddd
                else
                  search --no-floppy --fs-uuid --set=root 41509d49-9b27-43b0-8a66-b9b1460424d0
                fi
                linux /boot/vmlinuz-generic-4.4.14 root=/dev/sda3
                initrd /boot/initramfs-genkernel-4.4.14
        }

If your initrd file is named otherwise, the name on the "initrd" line will be different.

Also, is the main GRUB menu entry also spitting out a kernel panic even though it is using the "initrd.gz" file? If so, there may be something else going on. It depends on which kernel the "vmlinuz" link points to.


All times are GMT -5. The time now is 08:31 AM.