LinuxQuestions.org
Welcome to the most active Linux Forum on the web.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Software
User Name
Password
Linux - Software This forum is for Software issues.
Having a problem installing a new program? Want to know which application is best for the job? Post your question in this forum.

Notices


Reply
  Search this Thread
Old 09-29-2008, 06:27 AM   #1
hoshangi
Member
 
Registered: Nov 2007
Posts: 88

Rep: Reputation: 15
Create an initrd


hi


i want to create a initial Ramdisk i dont know how but i think i must create an initrd to load my kernel on my board flash when i create the initrd the dd command it's my problem when i use it as following :

dd if=/dev/zero of=initrd bs=4096

then no thing apeare.it stops here and no thing to be done,

if you have an experience about the kernel Ramdisk and how to load it on at91rm9200dk board please help me
 
Old 09-29-2008, 06:40 AM   #2
keefaz
LQ Guru
 
Registered: Mar 2004
Distribution: Slackware
Posts: 6,552

Rep: Reputation: 872Reputation: 872Reputation: 872Reputation: 872Reputation: 872Reputation: 872Reputation: 872
You need to tell to dd how much blocks you want to copy with count= option

Now usually the initrd are not image file made with dd, but rather an image made with cpio program
Are you sure you don't have a script that makes all the initrd procedure for you ?
like mkinitrd or mkramfs or a command with similar name

Which Linux distribution are you using ?
 
Old 09-29-2008, 07:02 AM   #3
pinniped
Senior Member
 
Registered: May 2008
Location: planet earth
Distribution: Debian
Posts: 1,732

Rep: Reputation: 50
An initramfs image will take up less space than initrd; create the directory structure, let's say it's in a directory called '/stuff'. According to the documentation in the Linux source directory you'd do something like:

cd /stuff
find . | cpio -o -H newc | gzip > ../myinitrd.img

Note: the documentation states that the 'cpio' documentation gives bad advice on how to generate the image, so don't follow any cpio docs on how to create the initramfs image.

The trick now is in the booting; for a genuine initrd, you need to pass the kernel "init=blah" to tell the kernel what to use for init (for example: init=/bin/sh), but for an initramfs you need "rdinit=blah".

But - if you really want an initrd:
dd if=/dev/zero of=myinitrd bs=512 count=40000
mke2fs myinitrd
mount myinitrd /mnt -o loop

and so on ... and after copying files into the image:
gzip myinitrd
 
  


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
How to create new initrd.gz (or initrd.img) file? kkpal Programming 2 12-10-2007 08:38 AM
to create initrd on CD on fedora what is used tkmsr Linux - Software 11 10-31-2007 03:42 AM
Create initrd namit Linux - Software 8 08-12-2007 05:50 PM
failed to create initrd gunnix Debian 1 01-05-2007 07:01 PM
create initrd alaios Debian 5 01-19-2005 09:54 AM

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

All times are GMT -5. The time now is 04:36 AM.

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