LinuxQuestions.org
Download your favorite Linux distribution at LQ ISO.
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Newbie
User Name
Password
Linux - Newbie This Linux forum is for members that are new to Linux.
Just starting out and have a question? If it is not in the man pages or the how-to's this is the place!

Notices


Reply
  Search this Thread
Old 07-29-2008, 09:26 AM   #1
PlatinumX
Member
 
Registered: May 2008
Location: France
Distribution: Debian / Fedora / Gentoo
Posts: 178

Rep: Reputation: 15
Exclamation Good usage of mkinitrd


HI all,

I am running a Debian and I just compiled a vanillia kernel to make some change.
So i launched
make && make modules_install

Now i need to build the initrd.

I found the command mkinitrd -o <path/to/output/file>

However, how do I inform mkinitrd to take into account my new compiled kernel and not the actual running kernel ?

Thanks
 
Old 07-29-2008, 09:40 AM   #2
Guttorm
Senior Member
 
Registered: Dec 2003
Location: Trondheim, Norway
Distribution: Debian and Ubuntu
Posts: 1,263

Rep: Reputation: 297Reputation: 297Reputation: 297
Hi

Using Debian, I think it's better to do it the Debian way. It has tools that will do stuff like mkinitrd and grub/lilo for you. You also get a .deb file for your kernel so it's easier to uninstall it later if something goes wrong.

http://www.howtoforge.com/kernel_com...on_debian_etch
 
Old 07-29-2008, 10:16 AM   #3
PlatinumX
Member
 
Registered: May 2008
Location: France
Distribution: Debian / Fedora / Gentoo
Posts: 178

Original Poster
Rep: Reputation: 15
Right, there are some Debian tools (make-kpkg,...) to ease a kernel change on your system.

However, making it easy, makes it also obscur.

This is why I am doing it the "raw" way to understand it clealry.

And this is how I am wondering about mkinitrd
 
Old 07-29-2008, 10:52 AM   #4
checkmate3001
Member
 
Registered: Sep 2007
Location: Folsom, California
Distribution: Debian 4.0 (Etch), Debian 5.0 (Lenny), Ubuntu 8.04
Posts: 302

Rep: Reputation: 32
I only know that when I compiled (the debian way) kernel 2.6.26 (previous was 2.6.18) I had to do:
[code]
mkinitrd -o /boot/initrd.img-2.6.26 2.6.26

That last "2.6.26" (I'm totally guessing) tells it to make the initrd from the 2.6.26 kernel... I think it looks for the directory in /lib/modules?

My /lib/modules directory:
Code:
drwxr-xr-x 3 root root 4096 2008-07-27 14:55 2.6.18-6-amd64
drwxr-xr-x 3 root root 4096 2008-07-27 20:02 2.6.26

Someone that knows more would prolly be more helpful.
 
Old 07-29-2008, 11:10 AM   #5
PlatinumX
Member
 
Registered: May 2008
Location: France
Distribution: Debian / Fedora / Gentoo
Posts: 178

Original Poster
Rep: Reputation: 15
Yea !

I made a test with
Code:
mkinitrd -o /tmp/output 2.4.12
and I got the message:
Code:
/lib/modules/2.4.12 not a directory.
So it refers to /lib/modules folder. Good point

I also experienced something strange after compiling.
Instead of getting a vmlinuz file, i got :
- a vmlinux file
- a vmlinux.o file

I am searching for the good way to use it.
When I copy vmlinux file in /boot, grub refuse to boot.
Quote:
Error 13: Invalid or unsupported executable format

Last edited by PlatinumX; 07-29-2008 at 11:13 AM.
 
Old 07-29-2008, 11:11 AM   #6
brianL
LQ 5k Club
 
Registered: Jan 2006
Location: Oldham, Lancs, England
Distribution: Slackware & Slackware64 14.1
Posts: 7,453
Blog Entries: 55

Rep: Reputation: Disabled
This is a document detailing how to make an initrd on Slackware, don't know if it will be any use for Debian:

http://www.mirrorservice.org/sites/f.../README.initrd
 
  


Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search

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
LXer: Learn 10 more good UNIX usage habits LXer Syndicated Linux News 0 05-30-2008 09:50 PM
LXer: Learn 10 good UNIX usage habits LXer Syndicated Linux News 0 02-26-2008 04:41 AM
A good memory usage monitor? ginda Linux - Enterprise 3 08-14-2007 11:14 AM
LXer: Learn 10 good UNIX usage habits LXer Syndicated Linux News 0 12-18-2006 04:54 PM
good lightweight mail server for specific usage naijaguy Linux - Software 1 02-24-2005 06:15 PM


All times are GMT -5. The time now is 12:14 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
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration