简体   繁体   中英

Booting a newly compiled linux kernel

I have started reading the book Essential Linux Device Drivers. I am following the process for compiling and booting into a new kernel. However I am unable to boot into the newly compiled kernel - I select the new kernel in grub and then ..nothing...the screen just stays the same.

Here are the steps I am taking, as described in the book (I am using kernel 2.6.24 as that is what the book is based on) -

  • cd /usr/src/linux-2.6.24 (the base dir of the kernel I downloaded)
  • make clean
  • cp arch/x86/configs/i386_defconfig .config
  • make bzImage cp arch/x86/boot/bzImage /boot/vmlinuz

The book says that 'you might need to alert your bootloader about the arrival of the new boot image. If you are using the GRUB bootloader, it figures this out automatically'.

Well it didn't figure it out automatically in my case as there was no option to select this kernel in GRUB. So I did it manually by typing update-grub in the terminal. And this didn't work either. However once I changed the filename from vmlinuz to vmlinuz-2.6.24 and type update-grub it picked it up. So on page 11 of the book there seems to already be multiple things left out...

The book says to then reboot the machine.

Anyway, I am now able to select this kernel in GRUB but as I said above it doeesn't boot properly, the screen just goes blank and never changes. So am I missing something? I have followed the instructions in the book exactly.

Most automatic grub setups include kernel options to hide the messages generated as the kernel attempts to boot. For example:

/boot/vmlinuz-x.x.x.x-generic root=UUID=something ro quiet splash

While on the grub menu line of the kernel you wish to boot, press 'e' to temporarily edit it, and delete options such as quiet and splash (but leave the ro).

Then boot the temporarily modified line, and see the progress messages in order to get an idea where the boot is failing.

The default configuration probably requires an initrd (eg because the file system and root device needs their driver, from modules, which is what initrd provides).

You could either configure your kernel appropriately (carefully enabling as in-kernel, not in-modules, the essential drivers) for your particular hardware, or use a procedure to build a kernel package with its initrd.

You should find a procedure appropriate for your linux distribution and habits, eg something like this or that . I am using on Debian:

time fakeroot make-kpkg -j2 --initrd --revision=3.4.2 --append-to-version=-amd64 binary

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM