Linux - KernelThis forum is for all discussion relating to the Linux kernel.
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.
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.
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.
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?
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
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
[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:
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.
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:
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!
LinuxQuestions.org is looking for people interested in writing
Editorials, Articles, Reviews, and more. If you'd like to contribute
content, let us know.