LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Slackware (https://www.linuxquestions.org/questions/slackware-14/)
-   -   trouble switching to generic kernel (https://www.linuxquestions.org/questions/slackware-14/trouble-switching-to-generic-kernel-4175448611/)

club slacker 02-04-2013 06:24 PM

trouble switching to generic kernel
 
i am following the guide on this page: http://docs.slackware.com/slackware:beginners_guide

first i ran this:
Code:

/usr/share/mkinitrd/mkinitrd_command_generator.sh
then i ran this:
Code:

bash-4.2# /usr/share/mkinitrd/mkinitrd_command_generator.sh
#
# mkinitrd_command_generator.sh revision 1.45
#
# This script will now make a recommendation about the command to use
# in case you require an initrd image to boot a kernel that does not
# have support for your storage or root filesystem built in
# (such as the Slackware 'generic' kernels').
# A suitable 'mkinitrd' command will be:

mkinitrd -c -k 3.2.29-smp -f ext2 -r /dev/sda1 -m mbcache:ext2 -u -o /boot/initrd.gz

then i did the this from the recommended above:
Quote:

mkinitrd -c -k 3.2.29-smp -f ext2 -r /dev/sda1 -m mbcache:ext2 -u -o /boot/initrd.gz
bash-4.2# mkinitrd -c -k 3.2.29-smp -f ext2 -r /dev/sda1 -m mbcache:ext2 -u -o /boot/initrd.gz
OK: /lib/modules/3.2.29-smp/kernel/fs/mbcache.ko added.
OK: /lib/modules/3.2.29-smp/kernel/fs/mbcache.ko added.
OK: /lib/modules/3.2.29-smp/kernel/fs/ext2/ext2.ko added.
16523 blocks
/boot/initrd.gz created.
Be sure to run lilo again if you use it.
bash-4.2#
then i run this:
Quote:

bash-4.2# /usr/share/mkinitrd/mkinitrd_command_generator.sh -l /boot/vmlinuz-generic-3.2.29
# Linux bootable partition config begins
# initrd created with 'mkinitrd -c -k 3.2.29 -f ext2 -r /dev/sda1 -m mbcache:ext2 -u -o /boot/initrd.gz'
image = /boot/vmlinuz-generic-3.2.29
initrd = /boot/initrd.gz
root = /dev/sda1
label = 3.2.29
read-only
# Linux bootable partition config ends
bash-4.2#
then i edited /etc/lilo.conf to look like this:
Code:

# LILO configuration file
# generated by 'liloconfig'
#
# Start LILO global section
boot = /dev/sda
#compact        # faster, but won't work on all systems.
# Standard menu.
message = /boot/boot_message.txt

# Append any additional kernel parameters:
append=" vt.default_utf8=0"
#prompt
#timeout = 5
# Normal VGA console
vga = normal
# Ask for video mode at boot (time out to normal in 30s)
#vga = ask
# VESA framebuffer console @ 1024x768x64k
# vga=791
# VESA framebuffer console @ 1024x768x32k
# vga=790
# VESA framebuffer console @ 1024x768x256
# vga=773
# VESA framebuffer console @ 800x600x64k
# vga=788
# VESA framebuffer console @ 800x600x32k
# vga=787
# VESA framebuffer console @ 800x600x256
# vga=771
# VESA framebuffer console @ 640x480x64k
# vga=785
# VESA framebuffer console @ 640x480x32k
# vga=784
# VESA framebuffer console @ 640x480x256
# vga=769
# ramdisk = 0    # paranoia setting
# End LILO global section
# Linux bootable partition config begins
####image = /boot/vmlinuz
####  root = /dev/sda1
####  label =
####  read-only  # Partitions should be mounted read-only for checking
# Linux bootable partition config ends

image = /boot/vmlinuz-generic-3.2.29
        initrd = /boot/initrd.gz
        root = /dev/sda1
        label = 3.2.29
        read-only

lastly, i ran lilo -v:
Code:

Warning: LBA32 addressing assumed
Reading boot sector from /dev/sda
Using MENU secondary loader
Calling map_insert_data
Mapping message file /boot/boot_message.txt
Calling map_insert_file

Boot image: /boot/vmlinuz-generic-3.2.29
Mapping RAM disk /boot/initrd.gz
The initial RAM disk will be loaded in the high memory above 16M.
Added 3.2.29  +  *

Writing boot sector.
/boot/boot.0800 exists - no boot sector backup copy made.
One warning was issued.

i restart computer and get kernel panic. right now i am booted off the CD.:(

club slacker 02-04-2013 07:12 PM

edit: updated OP with exact details of all the changes i did

clubslacker 02-04-2013 07:20 PM

this is the error that i get on startup:
Quote:

no kernel modules found for linux 3.2.29
mount: mounting /dev/sda1 on /mnt failed: no such device
error: no /sbin/init found on rootdev (or not mounted). trouble ahead. you can try to fix it. type 'exit' when things are done.
and so i type 'exit' and then see a bunch of other stuff, looks like modules or stuff, is missing... then it continues to say it is "closing initrd.gz"

a bunch of other stuff happens

then keyboard starts blinking, cannot do anything... :D

jamesf 02-04-2013 07:31 PM

Note: I answered the wrong question, sorry.

jamesf 02-04-2013 07:40 PM

Before you exit you should try to edit /etc/lilo.conf and remove the comments you put in front of the huge kernel, the ####'s. You can have more than one kernel to choose from at the lilo prompt and this will allow you to experiment and recover easily.

If you can get the file edited then run lilo, type exit, (maybe reboot) and you ought to be back up. Be sure to pick the huge kernel to boot from instead of the broken configuration.

It also appears that you tried to set up the initrd.gz for a non-smp kernel. Unless you really, really want that and can modify the kernel sources to support it (in some cases), then you should really be using the smp kernel.

Code:

/usr/share/mkinitrd/mkinitrd_command_generator.sh --longhelp | more
has a lot of good information.

basically, you should:
Code:

root@tardis:~# /usr/share/mkinitrd/mkinitrd_command_generator.sh --lilo /boot/vmlinuz-generic-smp-3.2.29-smp >>/etc/lilo.conf

root@tardis:~# $( /usr/share/mkinitrd/mkinitrd_command_generator.sh --run /boot/vmlinuz-generic-smp-3.2.29-smp )

root@tardis:~# lilo


clubslacker 02-04-2013 07:57 PM

Quote:

Originally Posted by jamesf (Post 4884493)

basically, you should:
Code:

root@tardis:~# /usr/share/mkinitrd/mkinitrd_command_generator.sh --lilo /boot/vmlinuz-generic-smp-3.2.29-smp >>/etc/lilo.conf

root@tardis:~# $( /usr/share/mkinitrd/mkinitrd_command_generator.sh --run /boot/vmlinuz-generic-smp-3.2.29-smp )

root@tardis:~# lilo


ok, i am going to do this after dinner... As far as SMP i was unaware of any of this, as i was simply following the "beginners guide" to.the.letter.

i do not understand why following the beginners guide, as perfectly as i have done, has resulted in a broken mess. don't get me wrong, i'm not mad I am learning and trying to have fun, but... ::violin

darkstar61 02-04-2013 08:04 PM

Quote:

Originally Posted by clubslacker (Post 4884497)
i do not understand why following the beginners guide, as perfectly as i have done, has resulted in a broken mess. don't get me wrong, i'm not mad I am learning and trying to have fun, but... ::violin

from the beginners guide:

Code:

Note that it is recommended to add a new section instead of editing the existing kernel image section. Assign a unique label to your new section. After reboot, LILO will give you two options: to boot into your freshly added generic kernel, or to boot into the failsafe huge kernel (of which you are certain that it will work).
:)

clubslacker 02-04-2013 08:17 PM

Quote:

Originally Posted by darkstar61 (Post 4884502)
from the beginners guide:

Code:

Note that it is recommended to add a new section instead of editing the existing kernel image section. Assign a unique label to your new section. After reboot, LILO will give you two options: to boot into your freshly added generic kernel, or to boot into the failsafe huge kernel (of which you are certain that it will work).
:)

ok ya i get that but its no big deal i can just edit quickly a new section in lilo.conf when booted from my cd. then i can reboot and choose the huge kernel. but still, i followed beginners guide and it no worky

club slacker 02-04-2013 08:49 PM

Quote:

Originally Posted by jamesf (Post 4884493)
Before you exit you should try to edit /etc/lilo.conf and remove the comments you put in front of the huge kernel, the ####'s. You can have more than one kernel to choose from at the lilo prompt and this will allow you to experiment and recover easily.

If you can get the file edited then run lilo, type exit, (maybe reboot) and you ought to be back up. Be sure to pick the huge kernel to boot from instead of the broken configuration.

It also appears that you tried to set up the initrd.gz for a non-smp kernel. Unless you really, really want that and can modify the kernel sources to support it (in some cases), then you should really be using the smp kernel.

Code:

/usr/share/mkinitrd/mkinitrd_command_generator.sh --longhelp | more
has a lot of good information.

basically, you should:
Code:

root@tardis:~# /usr/share/mkinitrd/mkinitrd_command_generator.sh --lilo /boot/vmlinuz-generic-smp-3.2.29-smp >>/etc/lilo.conf

root@tardis:~# $( /usr/share/mkinitrd/mkinitrd_command_generator.sh --run /boot/vmlinuz-generic-smp-3.2.29-smp )

root@tardis:~# lilo


ok. first i restored to my original lilo.conf and loaded into the huge kernel. then i followed your 3 steps:
Code:

bash-4.2# /usr/share/mkinitrd/mkinitrd_command_generator.sh --lilo /boot/vmlinuz-generic-smp-3.2.29-smp >>/etc/lilo.conf
bash-4.2# $( /usr/share/mkinitrd/mkinitrd_command_generator.sh --run /boot/vmlinuz-generic-smp-3.2.29-smp )
OK: /lib/modules/3.2.29-smp/kernel/fs/mbcache.ko added.
OK: /lib/modules/3.2.29-smp/kernel/fs/mbcache.ko added.
OK: /lib/modules/3.2.29-smp/kernel/fs/ext2/ext2.ko added.
16523 blocks
/boot/initrd.gz created.
Be sure to run lilo again if you use it.
bash-4.2# lilo
Warning: LBA32 addressing assumed
Added read-only  *
Added 3.2.29-smp  +
One warning was issued.

now rebooting computer. will let u know how it goes.

darkstar61 02-04-2013 08:50 PM

Quote:

Originally Posted by clubslacker (Post 4884506)
ok ya i get that but its no big deal i can just edit quickly a new section in lilo.conf when booted from my cd. then i can reboot and choose the huge kernel. but still, i followed beginners guide and it no worky

did you do a full install?

can you post the results of ls -hal /boot

here 's mine

Code:

le@darkstar:~$ ls -hal /boot
total 19M
drwxr-xr-x  3 root root 4.0K Feb  5 03:30 ./
drwxr-xr-x 23 root root 4.0K Feb  4 18:01 ../
lrwxrwxrwx  1 root root  37 Jan 31 18:43 README.initrd -> /usr/doc/mkinitrd-1.4.7/README.initrd
lrwxrwxrwx  1 root root  22 Jan 31 18:56 System.map -> System.map-huge-3.2.29
-rw-r--r--  1 root root 1.9M Sep 17 20:38 System.map-generic-3.2.29
-rw-r--r--  1 root root 3.1M Sep 17 21:19 System.map-huge-3.2.29
-rw-r--r--  1 root root  512 Jan 31 18:58 boot.0800
-rw-r--r--  1 root root  209 Jan 31 18:58 boot_message.txt
lrwxrwxrwx  1 root root  18 Jan 31 18:56 config -> config-huge-3.2.29
-rw-r--r--  1 root root 119K Sep 17 20:38 config-generic-3.2.29
-rw-r--r--  1 root root 119K Sep 17 21:19 config-huge-3.2.29
drwxr-xr-x 14 root root 4.0K Feb  2 13:16 initrd-tree/
-rw-r--r--  1 root root 4.4M Feb  2 13:16 initrd.gz
-rw-r--r--  1 root root  23K Aug 18 01:37 inside.bmp
-rw-------  1 root root 170K Feb  5 03:30 map
-rw-r--r--  1 root root 6.8K Aug 18 01:37 onlyblue.bmp
-rw-r--r--  1 root root  16K Mar 27  2011 slack.bmp
-rw-r--r--  1 root root  33K Aug 18 01:37 tuxlogo.bmp
lrwxrwxrwx  1 root root  19 Jan 31 18:56 vmlinuz -> vmlinuz-huge-3.2.29
-rw-r--r--  1 root root 3.1M Sep 17 20:38 vmlinuz-generic-3.2.29
-rw-r--r--  1 root root 6.0M Sep 17 21:19 vmlinuz-huge-3.2.29

and of the linux part of your lilo.conf

here's mine

Code:

le@darkstar:~$ less /etc/lilo.conf

# Linux bootable partition config begins
image = /boot/vmlinuz-generic-3.2.29
  initrd = /boot/initrd.gz # add this line so that lilo sees initrd.gz
  root = /dev/sda3
  label = Slackware
  read-only

image = /boot/vmlinuz
  root = /dev/sda3
  label = Linux
  read-only
# Linux bootable partition config ends


club slacker 02-04-2013 09:24 PM

here you go dude, am i all set to go now? :D
Quote:

bash-4.2# ls -hal /boot
total 29M
drwxr-xr-x 3 root root 4.0K Feb 4 19:07 .
drwxr-xr-x 21 root root 4.0K Jan 31 15:45 ..
lrwxrwxrwx 1 root root 37 Jan 31 14:45 README.initrd -> /usr/doc/mkinitrd-1.4.7/README.initrd
lrwxrwxrwx 1 root root 30 Jan 31 14:43 System.map -> System.map-huge-smp-3.2.29-smp
-rw-r--r-- 1 root root 1.5M Sep 17 11:27 System.map-generic-3.2.29
-rw-r--r-- 1 root root 1.5M Sep 17 11:03 System.map-generic-smp-3.2.29-smp
-rw-r--r-- 1 root root 2.4M Sep 17 12:11 System.map-huge-3.2.29
-rw-r--r-- 1 root root 2.5M Sep 17 11:17 System.map-huge-smp-3.2.29-smp
-rw-r--r-- 1 root root 512 Jan 31 16:47 boot.0800
-rw-r--r-- 1 root root 512 Jan 31 16:04 boot.0801
-rw-r--r-- 1 root root 168 Jan 31 16:04 boot_message.txt
lrwxrwxrwx 1 root root 26 Jan 31 14:43 config -> config-huge-smp-3.2.29-smp
-rw-r--r-- 1 root root 123K Sep 17 11:27 config-generic-3.2.29
-rw-r--r-- 1 root root 124K Sep 17 11:03 config-generic-smp-3.2.29-smp
-rw-r--r-- 1 root root 123K Sep 17 12:11 config-huge-3.2.29
-rw-r--r-- 1 root root 124K Sep 17 11:17 config-huge-smp-3.2.29-smp
drwxr-xr-x 13 root root 4.0K Feb 4 18:47 initrd-tree
-rw-r--r-- 1 root root 3.4M Feb 4 18:47 initrd.gz
-rw-r--r-- 1 root root 23K Aug 20 12:13 inside.bmp
-rw------- 1 root root 78K Feb 4 19:07 map
-rw-r--r-- 1 root root 6.8K Aug 20 12:13 onlyblue.bmp
-rw-r--r-- 1 root root 14K Feb 14 2010 slack.bmp
-rw-r--r-- 1 root root 33K Aug 20 12:13 tuxlogo.bmp
lrwxrwxrwx 1 root root 27 Jan 31 14:43 vmlinuz -> vmlinuz-huge-smp-3.2.29-smp
-rw-r--r-- 1 root root 2.8M Sep 17 11:27 vmlinuz-generic-3.2.29
-rw-r--r-- 1 root root 2.9M Sep 17 11:03 vmlinuz-generic-smp-3.2.29-smp
-rw-r--r-- 1 root root 5.6M Sep 17 12:11 vmlinuz-huge-3.2.29
-rw-r--r-- 1 root root 5.8M Sep 17 11:17 vmlinuz-huge-smp-3.2.29-smp
bash-4.2#


here is how i have my lilo.conf set now:
Quote:

# Linux bootable partition config begins
#image = /boot/vmlinuz
# root = /dev/sda1
# label =
# read-only # Partitions should be mounted read-only for checking
# Linux bootable partition config ends
# Linux bootable partition config begins
# initrd created with 'mkinitrd -c -k 3.2.29-smp -f ext2 -r /dev/sda1 -m mbcache:ext2 -u -o /boot/initrd.gz'
image = /boot/vmlinuz-generic-smp-3.2.29-smp
initrd = /boot/initrd.gz
root = /dev/sda1
label = 3.2.29-smp
read-only
# Linux bootable partition config ends

darkstar61 02-04-2013 10:20 PM

Quote:

Originally Posted by club slacker (Post 4884528)
here you go dude, am i all set to go now? :D

if you want the huge too you have to uncomment

Code:

#image = /boot/vmlinuz
# root = /dev/sda1
# label =
# read-only

and add a label, i guess, then run lilo that should add it

btw, can you now boot with the generic or you still have trouble?

clubslacker 02-04-2013 10:26 PM

Quote:

Originally Posted by darkstar61 (Post 4884542)
if you want the huge too you have to uncomment

Code:

#image = /boot/vmlinuz
# root = /dev/sda1
# label =
# read-only

and add a label, i guess, then run lilo that should add it

Ok, thanks man. Excuse my ignorance, but a couple more quick questions...

The point of using a generic kernel is to optimize the pc, right? Is there another use to why I would want to use the huge kernel in the future?

I originally had both the kernels listed in my lilo.conf file, but i couldn't figure out which one was being run by computer at bootup so thats why i commented it out.

darkstar61 02-04-2013 10:35 PM

Quote:

Originally Posted by clubslacker (Post 4884545)
Ok, thanks man. Excuse my ignorance, but a couple more quick questions...

The point of using a generic kernel is to optimize the pc, right? Is there another use to why I would want to use the huge kernel in the future?

I originally had both the kernels listed in my lilo.conf file, but i couldn't figure out which one was being run by computer at bootup so thats why i commented it out.

the reason to keep the huge as an option is that if something goes wrong with the generic (eg. i had trouble after installing amd proprietary drivers) you can still boot into your box

i guess you have to label the huge to see it at boot time > eg. label = huge

cynwulf 02-05-2013 03:32 AM

As others have said, if you instantly disable the huge kernel, you're just assuming the generic one will work. It's best to keep the huge kernel as a backup at least until you're sure the generic one boots.
Quote:

Originally Posted by clubslacker (Post 4884484)
this is the error that i get on startup:
Code:

no kernel modules found for linux 3.2.29
 mount: mounting /dev/sda1 on /mnt failed: no such device
 error: no /sbin/init found on rootdev (or not mounted). trouble ahead. you can try to fix it. type 'exit' when things are done.


It looks to me like you did not build in your file system to the initrd...? From your OP:
Quote:

Originally Posted by club slacker (Post 4884458)
Code:

mkinitrd -c -k 3.2.29-smp -f ext2 -r /dev/sda1 -m mbcache:ext2 -u -o /boot/initrd.gz

You built in support for ext2? Are you using ext2? I ask this because clearly you are not using it for / and because most are using at least ext3 or more commonly ext4 nowadays.

This is how I build an initrd for the 3.2.29 generic kernel
Code:

# mkinitrd -c -k 3.2.29-smp -m ext4
Or you can grab the source for e.g. 3.2.37 and compile against the 3.2.29 generic config and build ext3/ext4/whatever fs into the kernel and avoid needing an initrd.


All times are GMT -5. The time now is 09:51 AM.