Вы находитесь на странице: 1из 6

Welcome to the most active Linux Forum on the web.

Home Forums HCL Reviews Tutorials Articles Register Search LinuxQuestions.org > Forums > Linux Forums > Linux - Distributions > Red Hat How do I edit the initrd.img in the RHEL 5.1 boot disk? User Name Remember Me? Password Red Hat This forum is for the discussion of Red Hat Linux. 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. Are you new to LinuxQuestions.org? Visit the following links: Site Howto Site FAQ Sitemap Register Now 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. Introduction to Linux - A Hands on Guide This guide was created as an overview of the Linux Operating System, geared toward new users as an exploration tour and getting started guide, with exercises at the end of each chapter. For more advanced trainees it can be a desktop reference, and a collection of the base knowledge needed to proceed with system and network administration. This book contains many real life examples derived from the author's experience as a Linux system and network administrator, trainer and consultant. They hope these examples will help you to get a better understanding of the Linux system and that you feel encouraged to try out things on your own. Click Here to receive this Complete Guide absolutely free. LinkBack Search this Thread 06-09-2008, 09:00 PM #1 Ken B LQ Newbie Registered: Jun 2008 Posts: 3 Rep: How do I edit the initrd.img in the RHEL 5.1 boot disk?

[Log in to get rid of this advertisement] Hello, I am trying to make a RHEL 5.1 installer that runs from a USB flash drive. I would like to place a kickstart file in the install system's root directory, so that I may use it with ks=file:/ks.cfg. I understand that I must modify the contents of the initrd.img located in the <RHEL 5.1 CD>/images/diskboot.img. I found a few websites that say initrd.img is a gzipped ext2 filesystem. They give the following procedure for opening initrd.img: # gzip -dc /mnt/boot/initrd.img >/tmp/initrd.ext2 # mkdir /mnt/initrd # mount -o loop /tmp/initrd.ext2 /mnt/initrd (http://www.faqs.org/docs/Linux-HOWTO...WTO.html#ss6.2) However, I have had no success with this. gzip does successfully decompress the file, but when I attempt to mount it, mount does not recognize the filesystem type. When I specify the filesystem type as ext2 with # mount -t ext2 -o loop /tmp/initrd.ext2 /mnt/initrd the output suggests that I may have a bad superblock. (Sorry, but I'm not able to reproduce the exact output at the moment.) Can anyone please shed some light on my problem? Thank you very much. Last edited by Ken B; 06-09-2008 at 09:00 PM. Reason: Put the URL for my source in. 06-10-2008, 04:40 AM #2 blacky_5251 Member Registered: Oct 2004 Location: Adelaide Hills, South Australia Distribution: RHEL 4&5, Fedora 10, CentOS 5.4, IPCop Posts: 567 Rep: Hi, You're partly correct. The initial ram disk image is a compressed file, but it is a compressed cpio archive. Try this command to see what is inside your initrd file. Code: zcat /boot/initrd-$(uname -r).img cpio -itv You should now see the content of the file. less

06-10-2008, 07:34 AM #3 Ken B LQ Newbie Registered: Jun 2008 Posts: 3 Original Poster Rep: Thanks for the help! That works like a charm. 07-17-2008, 06:53 AM #4 trev_uk LQ Newbie Registered: Jul 2008 Posts: 2 Rep: Hi there, I am having the same problem. Could you advise which command will extract the kickstart initrd.img and then how we can mount it in rhel5. I can view the files with cpio but I want to extract them so I can add new net driver modules. 07-17-2008, 05:54 PM #5 blacky_5251 Member Registered: Oct 2004 Location: Adelaide Hills, South Australia Distribution: RHEL 4&5, Fedora 10, CentOS 5.4, IPCop Posts: 567 Rep: If you extract the files from the initial ram disk file, you just have a bunch of files - not a mountable file-system. If you want to modify your current initial ram disk file by adding modules, use the mkinitrd command to build a new initrdxxx.img file. Perhaps some more info about what you're doing might help us provide a better response for you Ian

07-18-2008, 04:59 AM #6 trev_uk LQ Newbie Registered: Jul 2008 Posts: 2 Rep: I was working on hacking rhel5 kickstart initrd to add new network drivers. I have completed this but for other users here's how: gzip ?dc initrd.img >initrd.x cpio ?id < initrd.x This will extract all folders. I extracted the modules.cgz & added new kernel module drivers. Repackage using cpio & gzip. Put it back into initrd/modules folder. Modify modules/pci.ids with details of your new modules. Then use mkisofs & create a kickstart CD 07-18-2008, 08:34 AM #7 Ken B LQ Newbie Registered: Jun 2008 Posts: 3 Original Poster Rep: Here's the process I used. The important trick is specifying the "newc" cpio format. 1 Decompress. gunzip < initrd.img > initrd.cpio 2. Append files. ls myfile cpio -oAO initrd.cpio -H newc 3. Recompress. gzip -cz initrd.cpio > initrd.img

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 Trackbacks are Off Pingbacks are On Refbacks are Off Forum Rules Similar Threads Thread Thread Starter Forum Replies Last Post Failed to symbolic-link boot/initrd.img-2.6.18-4-486 to initrd.img Scotteh Linu x - Software 8 06-01-2007 11:24 PM I want to edit initrd.img in my fedora 6 dvd-iso rishipandit007 Linux - General 7 01-19-2007 12:42 AM how to make initrd.img for your kernel without boot disk? donaldtalbert Linux Software 1 06-19-2005 10:30 PM Mounting boot/initrd.img Law1213 Linux - Software 10 01-25-2005 02:37 PM No /boot/initrd*.img in RH7? stoub Linux - Newbie 0 12-15-2002 10:59 PM All times are GMT -5. The time now is 04:06 AM. Contact Us - Advertising Info - Rules - LQ Merchandise - Donations Contributing Member - LQ Sitemap Main Menu Linux Forums Android Forum Search LQ Tags Linux HCL Linux Tutorials LQ Job Marketplace Linux Wiki Distro Reviews Book Reviews Download Linux

Social Groups LQ Blogs Home (Con't) My LQ Login Register 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 LQ Calendar LQ Rules LQ Sitemap Site FAQ View New Posts View Latest Posts Zero Reply Threads LQ Wiki Most Wanted Jeremy's Blog Report LQ Bug Syndicate Latest Threads LQ News Twitter: @linuxquestions identi.ca: @linuxquestions Facebook: @linuxquestions Open Source Consulting Domain Registration

Вам также может понравиться