LinuxQuestions.org
Download your favorite Linux distribution at LQ ISO.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Software > Linux - Kernel
User Name
Password
Linux - Kernel This forum is for all discussion relating to the Linux kernel.

Notices


Reply
  Search this Thread
Old 04-01-2012, 09:45 AM   #1
anup.estuff
LQ Newbie
 
Registered: Jan 2012
Posts: 15

Rep: Reputation: Disabled
Kernel Compilation Error


Hi all,

I am a new to linux....I am trying to compile linux kernel 3.2.9....But I am not able to get through...

operating system : 2.6.32-24-generic (ubuntu)

I am done with the following steps.


1) untarring 'linux-3.2.9.tar.bz2' file to folder 'linux-3.2.9'
2) Change makefile : EXTRAVERSION =anup
3) copying the existing 'config-2.6.32-24-generic' to the folder 'linux-3.2.9' as .config
3) installing ncurses
4) make menuconfig ( no changes..just save and exit)
5) make bzImage
6) make modules
7) make modules_install
8) sudo depmod -a
8) cp arch/i386/boot/bzImage /boot/vmlinuz-3.2.9anup
9) cp System.map /boot/System.map-3.2.9anup
10) mkinitramfs -k -o initrd.img-3.2.9anup-generic
11) update-grub2
12) update-grub2 didnt take right initrd..hence updated manually

Facts:
Df command shows the following output
Filesystem 1K-blocks Used Available Use% Mounted on
/dev/sda6 19223252 10952212 7294556 61% /

My Grub Entry:
menuentry 'Ubuntu, with Linux 3.2.9anup' --class ubuntu --class gnu-linux --class gnu --class os {
recordfail
insmod ext2
set root='(hd0,6)'
search --no-floppy --fs-uuid --set 8d80b4a9-da76-41bf-85ea-d49fdc98e7dc
linux /boot/vmlinuz-3.2.9anup root=/dev/sda6 ro quiet splash
initrd /boot/initrd.img-3.2.9anup-generic
}
menuentry 'Ubuntu, with Linux 3.2.9anup (recovery mode)' --class ubuntu --class gnu-linux --class gnu --class os {
recordfail
insmod ext2
set root='(hd0,6)'
search --no-floppy --fs-uuid --set 8d80b4a9-da76-41bf-85ea-d49fdc98e7dc
echo 'Loading Linux 3.2.9anup ...'
linux /boot/vmlinuz-3.2.9anup root=/dev/sda6 ro single
echo 'Loading initial ramdisk ...'
}

/lib/modules/3.2.9anup/modules.dep..........this file is also present at the given location.


I am getting the following error after reboot...

Check your root = boot argument.
Check for missing modules or device files
- Missing modules (cat /proc/modules; ls /dev)
FATAL: could not load /lib/modules/3.2.9anup/modules.dep : No such file or directory
FATAL: could not load /lib/modules/3.2.9anup/modules.dep : No such file or directory
ALERT! /dev/sd6 does not exist. Dropping to a shell!
(initramfs)




Please help!!!!.....I am in deep need to learn kernel compilation. I am not getting complete information from internet articles.

Please let me know where I am going wrong...
 
Old 04-01-2012, 10:53 AM   #2
Ser Olmy
Senior Member
 
Registered: Jan 2012
Distribution: Slackware
Posts: 3,339

Rep: Reputation: Disabled
This error:
FATAL: could not load /lib/modules/3.2.9anup/modules.dep : No such file or directory
...does not refer to a missing file on the root file system, but in the initrd ramdisk image. Mount the ramdisk (with mount -o loop) and make sure the directory exists.

Also, you don't have to (and probably shouldn't) edit the Makefile in order to add a custom kernel suffix. CONFIG_LOCALVERSION ("General setup" > "Local version" in menuconfig) will do that for you.
 
Old 04-01-2012, 11:00 AM   #3
theNbomr
LQ 5k Club
 
Registered: Aug 2005
Distribution: OpenSuse, Fedora, Redhat, Debian
Posts: 5,399
Blog Entries: 2

Rep: Reputation: 908Reputation: 908Reputation: 908Reputation: 908Reputation: 908Reputation: 908Reputation: 908Reputation: 908
Your problem really appears to have nothing to do with kernel compilation, assuming that the first 8 steps that you listed completed without errors. Your real problem is about setting up a grub-2 bootloader. Are you sure you've accurately transcribed error messages to your posting? I am puzzled by the message that reads 'ALERT! /dev/sd6 does not exist'. I don't see anywhere that a '/dev/sd6' (whatever that might mean) gets referenced in your grub config, so I am suspicious that your transcription is inaccurate. It is also possible to install a kernel commandline that is built into the kernel. Have you possibly done so incorrectly there?

---- rod.
 
Old 04-02-2012, 04:37 AM   #4
anup.estuff
LQ Newbie
 
Registered: Jan 2012
Posts: 15

Original Poster
Rep: Reputation: Disabled
Quote:
Originally Posted by Ser Olmy View Post
This error:
FATAL: could not load /lib/modules/3.2.9anup/modules.dep : No such file or directory
...does not refer to a missing file on the root file system, but in the initrd ramdisk image. Mount the ramdisk (with mount -o loop) and make sure the directory exists.

Also, you don't have to (and probably shouldn't) edit the Makefile in order to add a custom kernel suffix. CONFIG_LOCALVERSION ("General setup" > "Local version" in menuconfig) will do that for you.
Hi Ser Olmy,
Thanks for your quick response.
I tried the following commands:
mkdir ramdisk
mount -t sysfs /boot/initrd.img-3.2.9anup /ramdisk -o loop
I tried this command from the folder prompt were linux 3.2.9 is untarred.

After reboot I am getting the following error..
Kernel panic - not syncing: VFS: Unable to mount root fs on unknown-block(0,0)".

Can you please guide me how to proceed with mounting ramdisk or is there any other issue
 
Old 04-02-2012, 09:29 AM   #5
anup.estuff
LQ Newbie
 
Registered: Jan 2012
Posts: 15

Original Poster
Rep: Reputation: Disabled
Quote:
Originally Posted by theNbomr View Post
Your problem really appears to have nothing to do with kernel compilation, assuming that the first 8 steps that you listed completed without errors. Your real problem is about setting up a grub-2 bootloader. Are you sure you've accurately transcribed error messages to your posting? I am puzzled by the message that reads 'ALERT! /dev/sd6 does not exist'. I don't see anywhere that a '/dev/sd6' (whatever that might mean) gets referenced in your grub config, so I am suspicious that your transcription is inaccurate. It is also possible to install a kernel commandline that is built into the kernel. Have you possibly done so incorrectly there?

---- rod.
Hi theNbomr,

Sry for wrong post. Its actually ALERT! /dev/sda6 does not exist' . It was a typo
 
Old 04-02-2012, 10:56 AM   #6
Ser Olmy
Senior Member
 
Registered: Jan 2012
Distribution: Slackware
Posts: 3,339

Rep: Reputation: Disabled
Quote:
Originally Posted by anup.estuff View Post
[SIZE="3"]Hi Ser Olmy,
mkdir ramdisk
mount -t sysfs /boot/initrd.img-3.2.9anup /ramdisk -o loop
Sorry, my mistake. According to the Ubuntu documentation, mkinitramfs creates a gzipped cpio archive, not a file system. Thus, in order to edit an existing initrd, you need to:

- Create an empty folder
- Unzip and unpack the initrd (with cpio)
- Make the required modifications
- Create a new, zipped cpio image from the modified files

It's probably a lot easier to simply create a new initrd. I'm fairly certain your problems are related to this step:
10) mkinitramfs -k -o initrd.img-3.2.9anup-generic
You didn't specify a kernel version when you created the initrd image. According to the mkinitramfs man pages, it will default to the current kernel, which in your case is an older version. As a result, the initrd will not contain a /lib/modules/<your_kernel_version> directory.

Try creating a new initrd with mkinitramfs -o initrd.img-3.2.9anup-generic 3.2.9anup.
 
Old 04-02-2012, 12:47 PM   #7
anup.estuff
LQ Newbie
 
Registered: Jan 2012
Posts: 15

Original Poster
Rep: Reputation: Disabled
Quote:
Originally Posted by Ser Olmy View Post
Sorry, my mistake. According to the Ubuntu documentation, mkinitramfs creates a gzipped cpio archive, not a file system. Thus, in order to edit an existing initrd, you need to:

- Create an empty folder
- Unzip and unpack the initrd (with cpio)
- Make the required modifications
- Create a new, zipped cpio image from the modified files

It's probably a lot easier to simply create a new initrd. I'm fairly certain your problems are related to this step:
10) mkinitramfs -k -o initrd.img-3.2.9anup-generic
You didn't specify a kernel version when you created the initrd image. According to the mkinitramfs man pages, it will default to the current kernel, which in your case is an older version. As a result, the initrd will not contain a /lib/modules/<your_kernel_version> directory.

Try creating a new initrd with mkinitramfs -o initrd.img-3.2.9anup-generic 3.2.9anup.
Hi Ser Olmy,
Your Analysis was Perfect!!! It worked....
Thanks man...seriously thanks!
There are soooo many little things which kernel compilation articles on wide internet miss to explain.
I would like to learn all the aspects of linux kernel compilation..( like significance of initial ramdisk..how it works..why it is needed..importance of mkinitramfs,mkinitrd...grub configuration...and all the other imp steps...)
It would be great if you could guide me through these topics by providing internet links/documents.
Thanks Again!
 
  


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 compilation error: Error 15: File not found Niceman2005 Linux - General 9 10-04-2007 03:45 AM
Kernel compilation error windycity_linux Red Hat 1 12-17-2006 07:41 AM
kernel compilation error!! vishamr2000 Linux - General 2 05-12-2006 02:20 PM
Kernel compilation error!! vishamr2000 Linux - General 8 02-27-2006 10:48 AM
kernel compilation error in 2.4.20-8 cranium2004 Linux - Software 1 11-24-2004 06:04 AM

LinuxQuestions.org > Forums > Linux Forums > Linux - Software > Linux - Kernel

All times are GMT -5. The time now is 08:01 PM.

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