Puppy Linux Discussion Forum Forum Index Puppy Linux Discussion Forum
Puppy HOME page : puppylinux.com
"THE" alternative forum : puppylinux.info
 
 FAQFAQ   SearchSearch   MemberlistMemberlist   UsergroupsUsergroups   RegisterRegister 
 ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 

The time now is Sat 25 Oct 2014, 00:36
All times are UTC - 4
 Forum index » House Training » Beginners Help ( Start Here)
How to compress and uncompress image.gz?
Moderators: Flash, Ian, JohnMurga
Post_new_topic   Reply_to_topic View_previous_topic :: View_next_topic
Page 1 of 1 Posts_count  
Author Message
folks

Joined: 13 Dec 2007
Posts: 24

PostPosted: Mon 21 Jan 2008, 03:24    Post_subject:  How to compress and uncompress image.gz?  

I am looking for remastering image.gz.. i have mounted image.gz.. and finally i do some changes after then i put a a.out file.. ..and i executed .. it show " segmentation error"... ..please help... me.. how to make image. gz...

my objective is can we compress and uncompress image.gz.. can we make a image.gz.. by our self.. but..how...


Thanks in advance
Back to top
View user's profile Send_private_message 
Pizzasgood


Joined: 04 May 2005
Posts: 6270
Location: Knoxville, TN, USA

PostPosted: Mon 21 Jan 2008, 19:38    Post_subject:  

The process is different for Puppy 3.xx and Puppies before 3.xx.

To edit initrd.gz from Puppy 3.xx, first copy initrd.gz to someplace on a linux filesystem where you can work on it (I like to use /tmp/NewDir). Then open a terminal there and run this:
Code:
mkdir initrd-tree
cd initrd-tree
zcat ../initrd.gz | cpio -i -d


That will make a directory initrd-tree that contains the contents of the initrd.gz file. Go inside and edit away. When you're finished, from inside the initrd-tree/ directory, run these commands:
Code:
find . | cpio -o -H newc | gzip -9 > ../initrd.gz


That will replace the old initrd.gz file with the new one. Now just copy that into the correct place, and you're good to go.


For 2.xx and earlier, Puppy used actual fileystem images. Those are more annoying to work with. If all you need to do is small edits, you can just decompress it, mount it, edit it, unmount it, recompress it, and replace it, like this:
Code:
gunzip initrd.gz
mount initrd /mnt/data -o loop
### Now go into /mnt/data and make any edits you need to make ###
umount /mnt/data
gzip initrd


If you need to make bigger changes, you need to create a new filesystem image. I made a script called Edit-Initrd that can help, but it sometimes has issues.
http://murga-linux.com/puppy/viewtopic.php?search_id=1157959291&t=12089
If you get a file that's much too small, chances are you need to modify the PAD variable in the script to use a bigger number.

_________________
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

Back to top
View user's profile Send_private_message Visit_website 
Colonel Panic


Joined: 16 Sep 2006
Posts: 1521

PostPosted: Sun 12 Apr 2009, 04:45    Post_subject:  

Don't know if I'm doing anything wrong here, but I'm not getting this to work. I'm using and trying to "edit" Puppy Community 2.15.

I ungzipped initrd.gz without difficulty, and then tried the command

mount initrd/mnt/data -o loop.

The first message I got was, "can't find initrd/mnt/data in /etc/fstab", so I changed it and inserted a space between "initrd" and "mnt/data" and got this instead;

mount: ioctl: LOOP_SET_FD: Invalid argument
mount: Could not setup loop device

It's not the end of the world if this doesn't work out, but it would be good to have the capability to load a pristine file each time.

Best (and happy Easter to all Puppians),

Colonel Panic .
Back to top
View user's profile Send_private_message 
Béèm


Joined: 21 Nov 2006
Posts: 11782
Location: Brussels IBM Thinkpad R40, 256MB, 20GB, WiFi ipw2100. Frugal Lin'N'Win

PostPosted: Sun 12 Apr 2009, 05:54    Post_subject:  

There should be no space.
But I think a -t xxx parm is to be used, xxx indicating the type of file system to be used, but I cant remember the correct syntax for xxx.
The man pages could help.

_________________
Time savers:
Find packages in a snap and install using Puppy Package Manager (Menu).
Consult Wikka
Use peppyy's puppysearch
Back to top
View user's profile Send_private_message 
MU


Joined: 24 Aug 2005
Posts: 13642
Location: Karlsruhe, Germany

PostPosted: Sun 12 Apr 2009, 06:05    Post_subject:  

you can use the attached script, based on Pizzasgoods instructions.
I use it to modify Muppy or NYP.

Extract it e.g. to /root/editinit

then copy initrd.gz there, too.
Then type in a console:

cd /root/editinit
./editinit


This gunzips initrd.gz, extracts initrd, and opens "init" in leafpad.
When you close leafpad, the extracted folder is zipped again as "initrd", and gzipped.

Mark
editinit.tar.gz
Description 
gz

 Download 
Filename  editinit.tar.gz 
Filesize  241 Bytes 
Downloaded  433 Time(s) 

_________________
my recommended links
Back to top
View user's profile Send_private_message Visit_website 
Colonel Panic


Joined: 16 Sep 2006
Posts: 1521

PostPosted: Sun 12 Apr 2009, 17:15    Post_subject:  

Thanks, I'll give it a go soon.
Back to top
View user's profile Send_private_message 
Pizzasgood


Joined: 04 May 2005
Posts: 6270
Location: Knoxville, TN, USA

PostPosted: Thu 16 Apr 2009, 23:18    Post_subject:  

Béèm wrote:
There should be no space.
No, in this case there should. He's trying to mount a file named initrd at the mountpoint /mnt/data.

I assume the confusion is that it looks like the path /initrd/mnt/data, which is a real path, but that is not the case.

It may be that you don't have a free loopback device, which can happen if you've mounted a number of .iso or .sfs files without unmounting them. Normally Puppy only has something like eight loopback devices, and a number will be in use to run Puppy (for example, the pup_xxx.sfs file uses one, and if you have devx_xxx.sfs, that will use another).

You can check if there are any free with this command:
losetup -f
If it returns something like /dev/loop2, then there is at least that one free, and the mount command is failing for another reason (perhaps a corrupt initrd file?).

_________________
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

Back to top
View user's profile Send_private_message Visit_website 
Béèm


Joined: 21 Nov 2006
Posts: 11782
Location: Brussels IBM Thinkpad R40, 256MB, 20GB, WiFi ipw2100. Frugal Lin'N'Win

PostPosted: Fri 17 Apr 2009, 04:13    Post_subject:  

Thank you for the clarification. I understand now.
_________________
Time savers:
Find packages in a snap and install using Puppy Package Manager (Menu).
Consult Wikka
Use peppyy's puppysearch
Back to top
View user's profile Send_private_message 
Display_posts:   Sort by:   
Page 1 of 1 Posts_count  
Post_new_topic   Reply_to_topic View_previous_topic :: View_next_topic
 Forum index » House Training » Beginners Help ( Start Here)
Jump to:  

Rules_post_cannot
Rules_reply_cannot
Rules_edit_cannot
Rules_delete_cannot
Rules_vote_cannot
You cannot attach files in this forum
You can download files in this forum


Powered by phpBB © 2001, 2005 phpBB Group
[ Time: 0.0633s ][ Queries: 12 (0.0047s) ][ GZIP on ]