LinuxQuestions.org
Share your knowledge at the LQ Wiki.
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 05-13-2009, 06:47 PM   #1
jemate18
LQ Newbie
 
Registered: May 2009
Distribution: Ubuntu 11.04
Posts: 10

Rep: Reputation: 0
Messed Slackware after attempt to compile new kernel


So I was into experimenting on how to compile a kernel.

1. downloaded linux-2.6.29.3.tar.bz2 from kernel.org
2. cp ./linux-2.6.29.3.tar.bz2 /usr/src
3. tar -xvjf linux-2.6.29.3.tar.bz2
4. cd /linux-2.6.29.3
5. make clean
6. cp ../linux-2.6.27.7/.config ./
7. make menuconfig (loaded the .config which was copied)
8. make && make install
9. make bzImage
10. cp arch/i386/boot/bzImage /boot/vmlinuz-2.6.29.3-CUSTOM
11. edited /etc/.conf
12. restarted

Then I got a tazmanian devil instead of tux in the bootloading.
Then booting stopped, with my keyboard caps lock and other lights blinking.

Next,
Booted the DVD installer, deleted, /boot/vmlinuz-2.6.29.3-CUSTOM /usr/src/linux-2.6.29.4 and /lib/modules/2.6.29.3 in an attempt to go back to my working kernel.

mounted /dev/sda5 (my /) to /mnt/
mounted /dev/sda1 (my /boot) to /mnt/boot
chroot /mnt
/sbin/lilo -b /dev/sda1
got 5 warnings, then restarted my PC.
I still got the tazmaninan devil instead of Tux, them here is the error
List of all partitions:
No filesystem could mount root, tried: romfs
Kernel panic - not syncing: VFS: Unable to mount root fs on unknown-block(8,5)

Keyboard lights blinking and computer freeze


Please help, regards,
 
Old 05-13-2009, 07:54 PM   #2
niels.horn
Senior Member
 
Registered: Mar 2007
Location: Rio de Janeiro - Brazil
Distribution: Slackware64-current
Posts: 1,004

Rep: Reputation: 91
Is your /etc/lilo.conf pointing to the right (original) kernel?

Try configuring it to use the 'huge' kernel, normally called /boot/vmlinuz (actually a soft link).
With the huge kernel it should boot fine, then you can start playing around again
 
Old 05-13-2009, 08:10 PM   #3
jemate18
LQ Newbie
 
Registered: May 2009
Distribution: Ubuntu 11.04
Posts: 10

Original Poster
Rep: Reputation: 0
Quote:
Originally Posted by niels.horn View Post
Is your /etc/lilo.conf pointing to the right (original) kernel?

Try configuring it to use the 'huge' kernel, normally called /boot/vmlinuz (actually a soft link).
With the huge kernel it should boot fine, then you can start playing around again
Ok, I will boot from the DVD installer,
mount my drives in /mnt/ and chroot to /mnt,

Then edit /etc/lilo.conf.

How do I install lilo?

Is this right? /sbin/lilo -b /dev/sda ?

Thanks again
 
Old 05-13-2009, 08:13 PM   #4
niels.horn
Senior Member
 
Registered: Mar 2007
Location: Rio de Janeiro - Brazil
Distribution: Slackware64-current
Posts: 1,004

Rep: Reputation: 91
Just check the /etc/lilo.conf
It should have these lines to point to the huge kernel:
Code:
# Slackware - Huge kernel
image = /boot/vmlinuz
  root = /dev/sda2          <-- ***change this for your hard drive***
  label = Linux
  read-only
Then afterwards just run:
Code:
lilo
 
Old 05-13-2009, 08:18 PM   #5
jemate18
LQ Newbie
 
Registered: May 2009
Distribution: Ubuntu 11.04
Posts: 10

Original Poster
Rep: Reputation: 0
This is my lilo.conf

image = /boot/vmlinuz
root=/dev/sda5
label =Linux
read-only

ls -l /boot
vmlinuz
vmlinuz-generic-2.6.27.7
vmlinuz-generic-smp-2.6.27.7-smp
vmlinuz-huge-2.6.27.7
vmlinuz-huge-smp-2.6.27.7-smp
vmlinuz.old


Should I point out image to /boot/vmlinuz.old instead?

Thanks
 
Old 05-13-2009, 08:20 PM   #6
niels.horn
Senior Member
 
Registered: Mar 2007
Location: Rio de Janeiro - Brazil
Distribution: Slackware64-current
Posts: 1,004

Rep: Reputation: 91
Better point it to vmlinuz-huge-smp-2.6.27.7-smp
That should work!
 
Old 05-13-2009, 08:25 PM   #7
jemate18
LQ Newbie
 
Registered: May 2009
Distribution: Ubuntu 11.04
Posts: 10

Original Poster
Rep: Reputation: 0
One more thing. What could have happened or was there something i did that make the new compilation not work?

Well this were the steps I made
1 downloaded linux-2.6.29.3 to /usr/src
2. copied a working .config from the default 2.6.27 kernel to /usr/src/linux-2.6.29.3
3. make clean
3. make menuconfig (and loaded the .config which was copied)
4. make && make install
5. make bzImage
6. copied the bzImage to /boot/vmlinuz-2.6.29.3
7. Edited lilo and entered an entry for the new kernel.
8. Restarted, then freeze

Are there any steps which I didnt make? what other steps for me to take or commands to execute to have a new kernel. Is the making of initram the next step? How?


Regards
 
Old 05-13-2009, 08:34 PM   #8
niels.horn
Senior Member
 
Registered: Mar 2007
Location: Rio de Janeiro - Brazil
Distribution: Slackware64-current
Posts: 1,004

Rep: Reputation: 91
I *think* the problem lies in the config file you picked.
It was probably from the "generic" kernel, not the "huge" kernel.

The generic kernel is lighter and better for day-to-day use, but does not include all the modules (especially the file-system modules needed to mount ext3 / ext4 / reiser partitions etc.).

So you can go two ways:
1) use the config file from the huge kernel as a basis to configure your own kernel (copy from /boot/config-huge-smp-2.6.27.7-smp)
2) build as you did before, but you will need to create an initial ram disk (initrd). Use these steps before rebooting:
Code:
cd /boot
mkinitrd -c -k 2.6.29.3-CUSTOM -m jbd:ext3 -f ext3 -r /dev/sda5    # change ext3 if you use another file system, like ext4, reiserfs etc.
and include in your lilo.conf the line:
Code:
initrd = /boot/initrd.gz
This is how my lilo.conf looks:
Code:
# Slackware - Generic kernel
image = /boot/vmlinuz-generic-smp-2.6.29.2-smp
  initrd = /boot/initrd.gz
  root = /dev/sda2
  label = Slackware
  read-only
Hint: do not erase the configuration in lilo that points to the huge kernel. If anything goes wrong, you can use it to boot.

Then run lilo & reboot

Last edited by niels.horn; 05-13-2009 at 08:38 PM.
 
Old 05-13-2009, 08:56 PM   #9
jemate18
LQ Newbie
 
Registered: May 2009
Distribution: Ubuntu 11.04
Posts: 10

Original Poster
Rep: Reputation: 0
Thank you so much for a very detailed response.

I'll try it later and notify/post here the results (and problems if any)

Regards,
 
Old 05-13-2009, 11:33 PM   #10
jemate18
LQ Newbie
 
Registered: May 2009
Distribution: Ubuntu 11.04
Posts: 10

Original Poster
Rep: Reputation: 0
Thanks niels.horn

I followed your instruction and my new kernel was booting successfully now! I have one more question though,

for the command
mkinitrd -c -k 2.6.29.3-CUSTOM -m jbd:ext3 -f ext3 -r /dev/sda5
# change ext3 if you use another file system, like ext4, reiserfs etc.

the output is initrd.gz

However, if I would compile another version of a kernel, would i create another initrd.gz? or do i just have to rename initrd.gz
 
Old 05-14-2009, 04:40 AM   #11
niels.horn
Senior Member
 
Registered: Mar 2007
Location: Rio de Janeiro - Brazil
Distribution: Slackware64-current
Posts: 1,004

Rep: Reputation: 91
You can just rename the initrd.gz, or better, use this command:
Code:
mkinitrd -c -k 2.6.29.3-CUSTOM -m jbd:ext3 -f ext3 -r /dev/sda5 -o /boot/initrd-<yourversion>.gz
The -o option defines the output file, where you replace <yourversion> with whatever you want, like the -CUSTOM tag.
Don't forget to change the 'initrd = /boot/initrd.gz' likewise in your lilo.conf
 
Old 05-14-2009, 04:47 AM   #12
H_TeXMeX_H
LQ Guru
 
Registered: Oct 2005
Location: $RANDOM
Distribution: slackware64
Posts: 12,928
Blog Entries: 2

Rep: Reputation: 1301Reputation: 1301Reputation: 1301Reputation: 1301Reputation: 1301Reputation: 1301Reputation: 1301Reputation: 1301Reputation: 1301Reputation: 1301
Quote:
Originally Posted by jemate18 View Post
Thanks niels.horn

I followed your instruction and my new kernel was booting successfully now! I have one more question though,

for the command
mkinitrd -c -k 2.6.29.3-CUSTOM -m jbd:ext3 -f ext3 -r /dev/sda5
# change ext3 if you use another file system, like ext4, reiserfs etc.

the output is initrd.gz

However, if I would compile another version of a kernel, would i create another initrd.gz? or do i just have to rename initrd.gz
You don't need an initrd if you built-in the filesystem modules.
 
Old 05-14-2009, 04:59 AM   #13
niels.horn
Senior Member
 
Registered: Mar 2007
Location: Rio de Janeiro - Brazil
Distribution: Slackware64-current
Posts: 1,004

Rep: Reputation: 91
Quote:
Originally Posted by H_TeXMeX_H View Post
You don't need an initrd if you built-in the filesystem modules.
ok, if jemate18 accepts an extra exercise...

This would be done as follows:
- when in make menuconfig, go to the file systems sub-menu and change "ext3" from "M" (built as Module) to "*" (Built in).

Then compile normally and you won't need to make an initrd.
The 'jbd' module is automagically selected by the menuconfig script to be built in as well.

@H_TeXMeX_H: I didn't mention the option to build in the modules, as jemate18 is a new user and I think it is good to understand the basic process of making an initrd, changing lilo.conf, etc.

But, we're talking Slackware here - it is even better to always take it up to the next level
 
Old 05-14-2009, 05:15 AM   #14
H_TeXMeX_H
LQ Guru
 
Registered: Oct 2005
Location: $RANDOM
Distribution: slackware64
Posts: 12,928
Blog Entries: 2

Rep: Reputation: 1301Reputation: 1301Reputation: 1301Reputation: 1301Reputation: 1301Reputation: 1301Reputation: 1301Reputation: 1301Reputation: 1301Reputation: 1301
Sure whatever way you want to do it. I just prefer not having to worry about initrd. Just another potential complication.
 
Old 05-14-2009, 05:24 AM   #15
niels.horn
Senior Member
 
Registered: Mar 2007
Location: Rio de Janeiro - Brazil
Distribution: Slackware64-current
Posts: 1,004

Rep: Reputation: 91
That's the Slackware philosophy: the user is in control.
It's up to each individual user to decide how to do things & Slackware gives several options
 
  


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
kernel compile for slackware 11 Dalip Sharma Linux - General 1 02-06-2008 05:19 AM
Messed up an attempt at dual boot install- GRUB on one, LILO on the other 0mn1z10n Linux - General 4 12-04-2005 11:57 AM
Failed Attempt to Compile 2.6.5 as Non-root User farmerdan Linux - General 3 04-06-2004 06:49 PM
Help! I messed up my system with a kernel compile chris26 Slackware 6 11-28-2003 04:47 PM

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

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

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