LinuxQuestions.org
Latest LQ Deal: Latest LQ Deals
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Distributions
User Name
Password
Linux - Distributions This forum is for Distribution specific questions.
Red Hat, Slackware, Debian, Novell, LFS, Mandriva, Ubuntu, Fedora - the list goes on and on... Note: An (*) indicates there is no official participation from that distribution here at LQ.

Notices


Reply
  Search this Thread
Old 05-07-2008, 10:01 AM   #1
luispt
LQ Newbie
 
Registered: Apr 2008
Posts: 10

Rep: Reputation: 0
Unhappy MKINITRAMFS and Minimal Linux OS Scratch


Hello guys,

I didn't know where to put this, so I've created this topic under this subforum.

I'm using Ubuntu Gutsy in my laptop as host system to develop a kind of linux from scratch, or else, a minimum linux OS: just the kernel and busybox (maybe one day I will compile and install grub, xorg, xfce and firefox just for fun).

Anyway, Gutsy it's installed in /dev/sda7 and I'm building that minimal linux scratch OS in /dev/sda5 partition.

I've already created filesystem structure (the folders). the dev's with MAKEDEV, compiled and installed the latest (2.6.25.2) kernel & modules. I've already also compiled and installed busybox (last stable also).

But now I have a problem: I must create the initrd.img file so I can add it to grub for booting to /dev/sda5.

I've already know that the tool to use is MKINITRAMFS, with this command (more or less):
mkinitramfs -k -o /boot/initrd.img-$(uname -r)


My doubt is that when I use that initramfs command above, since I'm working in Gutsy enviroment, it will search /boot on sda7 (where is installed Gutsy) and will create the initrd image file of the kernel version and the filesystem that Gutsy is using, instead of the kernel and the filesystem on sda5 that is newer (2.6.25.2) than the Gutsy Kernel.

Does anybody know how to use mkinitramfs in a way that it will create the initrd.img of the 2.6.25.2 instaled on SDA5 instead of the kernel of Gutsy on SDA7 (please remember that on SDA7 it's installed GUtsy that's being used to deploy a linux OS on SDA5)?

I've already remember that maybe CHROOT would do the trick, but for that I would have to mount /proc and /sys on SDA5 but those two folders are totaly empty on SDA5. The mkinitramfs doesn's exist installed on SDA5 /sbin folder (remember just kernel and busybox), so I suspect that will not run on chroot enviroment (just a gess).

I would apreciate your help in this matter, because at the moment I'm stucked at this point.
 
Old 05-08-2008, 07:00 PM   #2
jailbait
LQ Guru
 
Registered: Feb 2003
Location: Virginia, USA
Distribution: Debian 12
Posts: 8,337

Rep: Reputation: 548Reputation: 548Reputation: 548Reputation: 548Reputation: 548Reputation: 548
Quote:
Originally Posted by luispt View Post


Does anybody know how to use mkinitramfs in a way that it will create the initrd.img of the 2.6.25.2 instaled on SDA5 instead of the kernel of Gutsy on SDA7 (please remember that on SDA7 it's installed GUtsy that's being used to deploy a linux OS on SDA5)?

Yes instead of using the uname command to create the initrd name use the literal name of the kernel you have on /dev/sda5. For example if the name of the kernel on /dev/sda5 is vmlinuz-2.6.25.2-luipt then use this mkinitramfs command:

mkinitramfs -k -o /boot/initrd.img-2.6.25.2-luipt

You have to chroot to /dev/sda5 so that the initrd will be built against the /dev/sda5 kernel rather than the /dev/sda7 kernel.

------------------
Steve Stites

Last edited by jailbait; 05-08-2008 at 07:02 PM.
 
  


Reply

Tags
busybox, initramfs



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
Compiling Linux kernel trouble at mkinitramfs dtmbmw325i Linux - Kernel 20 02-07-2008 07:23 AM
Differece: mkinitrd and mkinitramfs? kushalkoolwal Debian 2 05-14-2007 03:14 PM
ali aladdin v agp stinks :scratch: :scratch: :scratch: Mr Marmmalade Linux - Hardware 1 07-08-2003 05:11 AM
Installing Linux [Minimal] den_santiago Linux - Hardware 1 07-04-2003 11:44 PM
Linux minimal install NGraphiX Linux - General 10 08-08-2002 06:56 AM

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

All times are GMT -5. The time now is 06:17 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