NetStumbler.org Forums

Go Back   NetStumbler.org Forums > Software > Unix/Linux
Register Search Today's Posts Mark Forums Read

Reply
 
LinkBack Thread Tools Display Modes
Old 05-13-2006   #1 (permalink)
beakmyn
root\.workspace\.garbage.
 
Join Date: Aug 2003
Posts: 4,767
Remote-exploit is down so in your infinite Linux wisdom help me with initrd

I know some of you use Slackware so maybe you get elighten me. I'm trying to install Backtrack onto an external USB Hard drive as a full operating system so I can just plug it into my work laptop and boot (and have plenty of space to save files). So, I run the install and everything seems to go well until I try to boot.

It starts to boot but I get a kernel panic, I do a few hours of Google searching and find out that the USB modules are not being loaded at boot so Slax can't properly mount my root. Ok, seems to make sense.

Now, I do some more googling and and find that I have hack a copy of the initrd.gz on the CD, mount it as a loopback file system and modify the linuxrc.

For the unintiated or those not paying close enough attention here is what I did, don't worry we're getting to my question..

Boot into my Damn Small Linux /dev/hda2 For some reason if you try to mount the loop filesystem from a Backtrack LiveCD it locks up the system completely!
Insert the Backtrack CD

# cd /mnt
# gunzip -c /mnt/CDROM/boot/boot/initrd.gz !yes there's two /boots you got two feet don't you?
That's a little Linux humor there, stay on task and maybe we'll go out for Ice cream

# mkdir initrdmnt
# mount -o loop initrd initmnt
# cp -a initmnt initimage
# umount initrd

So at this point I have a copy of all the files that were in the the initrd.gz file now located at /mnt/initimage
So I go and change the linuxrc and from a post on the Backtrack forum and I get to this step:
repack the initrd mounted image
As simple as that sounds, what is the correct way to do this? I thougt .gz could only contain one file? All the googling I do points to using scripts to do this but I can't locate this scripts and will they work in a debian environment on a Slax initrd, Hell if I really fuxor it up I should use XP in a VMware Linux install that's sure to piss of a few folks. Anyway. what's the easiest way to get initimage back to initrd.gz so I can then:

# cp initrd.gz /mnt/sda1/boot/
# cd /mnt/sda1
# chroot .
# nano lilo.conf add initrd=/boot/initrd.gz ! I've also seen initrd=/boot/initrd.img ??
# lilo !no that's not the guy who lived in Wyatt's closet


Anybody?
__________________
It's not Intelligent Design, it's peer pressure.

┌──────────────────────────────┐
NS Icons Explained|et hoc genus omne
└──────────────────────────────┘

Last edited by beakmyn : 06-08-2006 at 05:28 PM.
beakmyn is offline   Reply With Quote
Old 05-13-2006   #2 (permalink)
streaker69
Psychic Amish Stumbler
 
streaker69's Avatar
 
Join Date: Jul 2004
Location: Virginville, BlueBall, Bird In Hand, Intercourse, Paradise, PA
Posts: 11,708
Remote-exploit is werkin' fer me.
__________________
"One of these days, I'm going to cut you to pieces."

If you're offended by this post, please feel free to report it to one of the many helpful moderators of this forum.

Thank you.
streaker69 is offline   Reply With Quote
Old 05-13-2006   #3 (permalink)
beakmyn
root\.workspace\.garbage.
 
Join Date: Aug 2003
Posts: 4,767
Quote:
Originally Posted by streaker69
Remote-exploit is werkin' fer me.
The forums were down, earlier but it's really a Linux question rather then a Backtrack specific question. I suppose I could sign up for an account there and post the question but I don't think they would understand my humor, hell I don't even understand my humor, I guess that's a problem with geniuses like us.
__________________
It's not Intelligent Design, it's peer pressure.

┌──────────────────────────────┐
NS Icons Explained|et hoc genus omne
└──────────────────────────────┘
beakmyn is offline   Reply With Quote
Old 05-13-2006   #4 (permalink)
c0nv3r9
Church of WiFi
 
c0nv3r9's Avatar
 
Join Date: Jun 2002
Location: not behind you, or am I?
Posts: 290
I think you might be making it a little too difficult on yourself

* make backup copy if desired
* gunzip it
* mount it
* modify files in the mounted loop
* unmount
* gzip -9 < initrd > newinitrd

... that way you gzip the actual unmounted image and not a copied directory structure from the image. Something else that may be helpful depending on how you want to approach things, man mkinitrd... I think that's probably the script folks are referring to for rebuilding the image from your copied directory structure.
__________________
He shall recount his worthies: they shall stumble in their walk; they shall make haste to the wall thereof, and the defence shall be prepared.
-- Nahum 2:5, The Holy Bible, KJV
c0nv3r9 is offline   Reply With Quote
Old 05-14-2006   #5 (permalink)
beakmyn
root\.workspace\.garbage.
 
Join Date: Aug 2003
Posts: 4,767
Quote:
Originally Posted by c0nv3r9
I think you might be making it a little too difficult on yourself

* make backup copy if desired
* gunzip it
* mount it
* modify files in the mounted loop
* unmount
* gzip -9 < initrd > newinitrd

... that way you gzip the actual unmounted image and not a copied directory structure from the image. Something else that may be helpful depending on how you want to approach things, man mkinitrd... I think that's probably the script folks are referring to for rebuilding the image from your copied directory structure.
Yes, mkinitrd was one script but I wasn't sure it if would work on the looped filesystem or if it was intended to to work on the current kernel source. There was another script I found that would pack it similiar to mkinitrd but I was missing some dependencies. I'll try the easy method first.
__________________
It's not Intelligent Design, it's peer pressure.

┌──────────────────────────────┐
NS Icons Explained|et hoc genus omne
└──────────────────────────────┘
beakmyn is offline   Reply With Quote
Old 05-15-2006   #6 (permalink)
beakmyn
root\.workspace\.garbage.
 
Join Date: Aug 2003
Posts: 4,767
So close yet so far. I've got a new initrd.gz file ready to go, however now I've got to figure out why my chroot system thinks /dev/sda is a raid_setup which it isn't I'm gonna try a few other things first.
__________________
It's not Intelligent Design, it's peer pressure.

┌──────────────────────────────┐
NS Icons Explained|et hoc genus omne
└──────────────────────────────┘
beakmyn is offline   Reply With Quote
Reply


Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is Off
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On



Google
 
Web NetStumbler.org

All times are GMT -7. The time now is 11:46 PM.


Powered by vBulletin® Version 3.6.8
Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.
Content Relevant URLs by vBSEO 3.0.0 ©2007, Crawlability, Inc.


All messages express the views of the author and are for entertainment purposes only. Netstumbler.org cannot be held responsible for the authenticity of the content or the actions of its members. By using this site and its services, you warrant that you will not post any messages that are discriminating, obscene, hateful, threatening, or otherwise violates any laws and you release Netstumbler.org from any future claims of any kind whatsoever including, but not limited to, addiction and loss of productivity. All forum messages, private messages and any other content are properties of Netstumbler.org. Even if publicly available, personal or copyrighted information are not to be posted without the consent of the owner. Distribution of licensed and copyrighted materials in any way not endorsed by the copyright owner is strictly prohibited. You may not use this site and its resources to spam other sites or individuals or perform any action that violates any law. Items sold or bought in the For Sale forum are sold as is and no warranty or insurance of any kind is provided. Netstumbler.org cannot be held responsible for the outcome of any transactions and no warranty of any kind is provided, either express or implied. Vulgar words are not allowed in the subject lines ; they may be used in the message body in any forum. The Administrator, Super Moderators and Moderators of Netstumbler.org have the right to remove, edit, move or close any thread for any reason and to reveal your identity and other known information in the event of a complaint or legal action arising from any message posted by you.