IMage,gz

Booting, installing, newbie
Post Reply
Message
Author
folks
Posts: 24
Joined: Thu 13 Dec 2007, 07:18

IMage,gz

#1 Post by folks »



How do i make image .gz?
if so , how can i make it?

Early i mount image. .. and i copied into hda.. how to make image....gz

User avatar
Pizzasgood
Posts: 6183
Joined: Wed 04 May 2005, 20:28
Location: Knoxville, TN, USA

#2 Post by Pizzasgood »

Oh, image.gz. I didn't notice that in your last post. So you're using Puppy 1.x.x. I don't have any build trees from that on my drive to look it up the official way to do it. Here's a modified version of the code from my HackyRemaster script:

Code: Select all

#!/bin/sh

gunzip image.gz
mkdir tree1 tree2 new
mount image tree2 -t ext2 -o loop,rw
cp -a tree2/* tree1/
sync
umount tree2
echo ""
echo "You may now edit the contents of tree1/ to modify what will go into the new image.gz.  Press <enter> when finished."
read blah

IMAGEUSED=`du -ks tree2 | cut -f 1`
IMAGEFREE=448
IMAGEWANTSIZE=`expr $IMAGEUSED + $IMAGEFREE`
IMAGESIZE=`expr $IMAGEWANTSIZE \* 26 \/ 25 \+ 13`
if [ $IMAGESIZE -gt 12288 ];then
	echo ""
	echo "WARNING:  The kernel is compiled to use a ramdisk of 12288 Kbytes.  However, we need a ramdisk size of $IMAGESIZE Kbytes.  The isolinux.cfg file in the ISO needs to be modified to have ramdisk_size=$IMAGESIZE in the 'append' line."
	echo "press enter to continue"
	read blah
else
	IMAGESIZE=12288 #to match default ramdisk size of kernel.
fi
echo -n "$IMAGESIZE" > /tree1/root0/.etc/ramdiskfssize

dd if=/dev/zero of=new/image bs=1k count=$IMAGESIZE > /dev/null 2>&1
sync
mke2fs -m 0 -b 1024 -qF new/image
mount new/image tree2 -t ext2 -o loop,rw
cp tree1/* tree2 -a
sync
umount tree2
gzip -f9 new/image
sync
echo ""
echo "Finished.  The new image.gz is in new/"
To use that, first create a directory somewhere that is NOT inside the pup001 file. It needs to be on a normal area of the harddrive or the mounting won't work right. Then put a copy of the image.gz file you want to modify in it, along with a copy of this script (set it executable either with chmod 755 scriptname or by right-clicking and going to properties). Open a terminal in that directory and run the script like this:
./scriptname
When it pauses, you can go into the tree1/ directory it created to edit what will become the new image.gz file. When you finish editing pull up the terminal window and press <enter> to continue.

If it stops and tells you to add ramdisk_size=#### to the isolinux.cfg file, you should do that. Otherwise you probably won't be able to boot with that image.gz file (if using GRUB, add it to the kernel line in menu.lst instead).

When it finishes, there should be a new image.gz file in the new/ directory.


Keep in mind, I haven't actually tested this code, and it's 2AM and I should really be memorizing my Japanese homework instead of writing shell scripts. So I apologize in advance if it's broken. :wink:
[size=75]Between depriving a man of one hour from his life and depriving him of his life there exists only a difference of degree. --Muad'Dib[/size]
[img]http://www.browserloadofcoolness.com/sig.png[/img]

Post Reply