Remote-exploit is down so in your infinite Linux wisdom help me with initrd

Remote-exploit is down so in your infinite Linux wisdom help me with initrd

Postby beakmyn » Sat May 13, 2006 11:57 am

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 :D

# 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:
[color="RoyalBlue"]repack the initrd mounted image[/color]
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?
beakmyn
 
Posts: 4858
Joined: Sun Aug 03, 2003 1:53 pm

Postby streaker69 » Sat May 13, 2006 11:59 am

Remote-exploit is werkin' fer me.
Treat your gun like your genitals, only whip it out when it's absolutely necessary.
User avatar
streaker69
 
Posts: 11867
Joined: Thu Jul 08, 2004 10:09 am
Location: Virginville, BlueBall, Bird In Hand, Intercourse, Paradise, PA

Postby beakmyn » Sat May 13, 2006 12:53 pm

streaker69 wrote: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.
beakmyn
 
Posts: 4858
Joined: Sun Aug 03, 2003 1:53 pm

Postby c0nv3r9 » Sat May 13, 2006 5:47 pm

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
 
Posts: 291
Joined: Wed Jun 26, 2002 7:44 am
Location: not behind you, or am I?

Postby beakmyn » Sun May 14, 2006 5:58 am

[quote="c0nv3r9"]I think you might be making it a little too difficult on yourself ]

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.
beakmyn
 
Posts: 4858
Joined: Sun Aug 03, 2003 1:53 pm

Postby beakmyn » Mon May 15, 2006 4:16 am

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.
beakmyn
 
Posts: 4858
Joined: Sun Aug 03, 2003 1:53 pm


Return to Unix/Linux

Who is online

Users browsing this forum: No registered users and 2 guests

cron