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 Sun 20 Apr 2014, 09:57
All times are UTC - 4
 Forum index » House Training » Users ( For the regulars )
How to make Image.gz with usr_cram.fs inside for LAN Boot?
Moderators: Flash, Ian, JohnMurga
Post new topic   Reply to topic View previous topic :: View next topic
Page 2 of 3 [44 Posts]   Goto page: Previous 1, 2, 3 Next
Author Message
sunburnt


Joined: 08 Jun 2005
Posts: 4982
Location: Arizona, U.S.A.

PostPosted: Sat 19 Nov 2005, 02:14    Post subject:  

Fantastic, everything you guys just said makes sense, I'm in the home stretch here folks.
I want to add a line right after the cram file copy to calculate the ramdiskfssize value.
But for the moment to make it work I'll add $2 to manually in put the value.
Is the end of this line: "resize2fs -f /tmp/image $2M" going to work?

Does the kernel arg.: ramdisk_size=50603 override the file: /etc/ramdiskfssize?
If so, as long as it's a kernel arg., the ramdiskfssize file needn't be changed.

I assume this is the same value to put in the line: resize2fs -f /tmp/image $rdfss.

Also there's the files: /etc/ramdisksize & /etc/sizeusecram, do they need to be set also?
ramdisksize has: 12288, & sizeusrcram has: 48078848

Last edited by sunburnt on Sat 19 Nov 2005, 02:38; edited 1 time in total
Back to top
View user's profile Send private message 
Ted guest Dog
Guest


PostPosted: Sat 19 Nov 2005, 02:37    Post subject: that is where I need help also.  

I have got it, to this stage, and I'm stuck. There are multiple files which must change in image.gz (thats why my version shows files to edit with ROX) but after a few hours of hacking I couldn't get past the impasses. I need it for grub-er puppy version two. So multiple custom puppies could exist on one CD or DVD. If you do figure it out reply please, thanks -TD
Back to top
sunburnt


Joined: 08 Jun 2005
Posts: 4982
Location: Arizona, U.S.A.

PostPosted: Sat 19 Nov 2005, 02:58    Post subject:  

I can only think of 2 was to have multi Puppies on a CD.
1) The same way I got it working on the HD, copy usr_cram.fs to hda1 or C:\.
2) The way I'm working on now, mount the versions iso file or dir. on the CD where the kernel, Image.gz, & usr_cram.fs files are at as a drive, so Puppy is fooled into thinking the usr_cram.fs file is in the root of a drive with the rest of the files.
The multi iso files on the CD & mounting one at a time might work the best & be the easist to do.

That's the way Puppy works, it looks in the ramdisk root, then the pup001 file root, then /hda1 root, then /CDROM root.
I don't know if this helps, but it's the only way I can see to do it until I can figure out the changes for the rc.sysinit file & probably some other files too.

Barry had no way of knowing Puppy would go this far, but as I see it, Puppy needs to be able to specify the path & the name for the cram file so problems like yours & mine would just go away!
This would save alot of headaches that folks are having trying to extend Puppy beyond Barry's original vision.
Back to top
View user's profile Send private message 
Pizzasgood


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

PostPosted: Sat 19 Nov 2005, 03:29    Post subject:  

Quote:
Also there's the files: /etc/ramdisksize & /etc/sizeusecram, do they need to be set also?
ramdisksize has: 12288, & sizeusrcram has: 48078848


/etc/sizeusrcram only needs to be changed if you change the size of usr_cram.fs. I don't know what /etc/ramdisksize does.

Quote:
Does the kernel arg.: ramdisk_size=50603 override the file: /etc/ramdiskfssize?
If so, as long as it's a kernel arg., the ramdiskfssize file needn't be changed.

I don't know. /etc/ramdiskfssize might just be used to store the size so you don't have to write it down. I did find this in Barry's old remaster script:
Quote:
#...note, /sbin/init will change this at bootup.

Better safe than sorry, though.

This will get the size of image. This is more or less copied and pasted from my HackyRemaster script:
Code:

IMAGEUSED=`du -ks /mnt/image | cut -f 1`
IMAGEFREE=5120  #Buffer space
IMAGESIZE=`expr $IMAGEUSED + $IMAGEFREE`
USRCRAMSIZE="`cat /mnt/image/etc/sizeusrcram`"
TOTALSIZE=`expr $IMAGESIZE + $USRCRAMSIZE`

$TOTALSIZE will be the size with 5120 of buffer space.

If you get problems, try bumping up the buffer. More can't hurt, but less can. I don't know exactly what it needs, but the script I based mine on said this
Quote:

#448K free space. we rely on /root0 getting deleted.
#...also, squashfs f.s. management uses most of that 448K.



If you haven't figured it out by tomorrow afternoon, I'll try it too with Personal-Pan Puppy. I'll be needing to test it by then anyways to make sure I haven't broken anything yet Rolling Eyes

_________________
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 poster's website 
Ted guest Dog
Guest


PostPosted: Sat 19 Nov 2005, 04:55    Post subject: new improved script  

Code:
#!/bin/bash
ISO=$1
IMAGESIZE=$2
WRKDIR=$3
#====== testing ===
ISO="/mnt/home/pizzapup105.iso"
IMAGESIZE="96000"
WRKDIR="/mnt/home"
#=================
rm -f $WRKDIR/new.iso
mkdir $WRKDIR/livecd
mount -o loop -t iso9660 $ISO $WRKDIR/livecd
gunzip -c $WRKDIR/livecd/image.gz | dd of=/tmp/image
rm -rf /mnt/image
mkdir /mnt/image
resize2fs -f /tmp/image $IMAGESIZE
e2fsck /tmp/image
losetup-FULL /dev/loop4 /tmp/image
mount -t ext2 /dev/loop4 /mnt/image
sync
rox "/mnt/image"
echo -n -e "Press Enter to reconstruct image.gz"
read nn4
rox -D "/mnt/image"
 echo -n "$IMAGESIZE" > /mnt/image/root0/.etc/ramdiskfssize
  echo -n "$IMAGESIZE" > /mnt/image/root0/.etc/ramdisksize
  echo "There is no need for special /mnt/image/sbin/init script..."
  rm -f /mnt/image/sbin/init
  ln -s /bin/busybox /mnt/image/sbin/init
  echo "Editing /mnt/image/sbin/check_space script to monitor /dev/ram0..."
  cat /mnt/image/sbin/check_space | sed -e 's/#DEVICES="\/dev\/ram0"/DEVICES="\/dev\/ram0"/g' > /tmp/checkspacetmp
  sync
  cat /tmp/checkspacetmp | sed -e 's/DEVICES="tmpfs"/#DEVICES="tmpfs"/g' > /mnt/image/sbin/check_space
  sync
mkdir $WRKDIR/tmp
mkdir $WRKDIR/tmp/livecd
cp -a $WRKDIR/livecd/ $WRKDIR/tmp/
rm $WRKDIR/tmp/livecd/usr_cram.fs
dd if=/tmp/image | gzip -9 > $WRKDIR/tmp/livecd/image.gz
umount /mnt/image
rm -f /tmp/image

umount $WRKDIR/livecd

mkisofs -J -R -pad -b isolinux.bin -c boot.cat -no-emul-boot -boot-load-size 4 -boot-info-table -o $WRKDIR/new.iso $WRKDIR/tmp/livecd/

qemu -m 120 -cdrom $WRKDIR/new.iso -boot d -user-net


found out what was causing the stopage.
Back to top
sunburnt


Joined: 08 Jun 2005
Posts: 4982
Location: Arizona, U.S.A.

PostPosted: Sat 19 Nov 2005, 05:52    Post subject:  

Looks great Ted Dog, I'll try it tomorrow... getting sleepy now.

Pizzasgood; I'll see about inserting your code into Ted Dog's tomorrow.
Back to top
View user's profile Send private message 
sunburnt


Joined: 08 Jun 2005
Posts: 4982
Location: Arizona, U.S.A.

PostPosted: Sat 19 Nov 2005, 18:10    Post subject:  

I got the Puppy 128 Special to LAN boot, answers my Q about usr_cram.fs being in Image.gz or image... image.
I beleave kernel arg. ramdisk_size= does override the RAMDISKFSSIZE file, usually what args. are for.
I can't fathom what's going on in Teb Dog's script, but some Qs & thoughts.
1) I assume that if I comment out the last line it won't burn a CD.
2) The best setup is to have an existing dir. "/image", that you would put any files you want added to the new image into.
The script extracts the iso to "/iso", then extracts Image.gz in "/iso", mounts it & copies it to "/image",& makes a new image.
To make a new iso file, more files would need to be added, so a different script to do it.
A gui can then be made that uses these utility scripts.

I'm making a short script just to modify the iso file.
Deletes from the iso: Boot.cat, Boot.msg, Goofy.16, Isolinux.bin, Isolinux.cfg
Adds to it: LinLd.com, it's kernel arg. file args.lin, & a batch file to run Puppy.
... So a multi. Puppy versions can be put on CD, HD, or USB & selected from a boot menu.
Back to top
View user's profile Send private message 
Ted sleepy Dog
Guest


PostPosted: Sat 19 Nov 2005, 18:47    Post subject: iso to iso  

You got the jist of it QEMU just runs a machine emulator with puppy. I find it useful to test if an ISO can boot prior to burning to CD.
I was able to get both Pizzasgoods (with a added bug- had to type XWIN) and grafpup running side by side in the same install.
The newer code was directly pulled from remaster-script. I'm glad he put in the comment on init since that is where my earlier attempts failed.

Had to add the WRKDIR since Pizzasgoods extra folder caused a bump in memory useage. It could be blank for tmp use.

iso2iso NameOfISO.iso [size in bytes] [working directory]
Back to top
sunburnt


Joined: 08 Jun 2005
Posts: 4982
Location: Arizona, U.S.A.

PostPosted: Sat 19 Nov 2005, 20:36    Post subject:  

Ted; so putting the cram file in image.gz allows you to run 2 Puppies in Win?
You said the RAMDISKFSSIZE is being auto. set now, so no command line arg. is needed?
So, iso2iso will extract: iso > Image.gz > image > files, wait for you to alter it, press [Enter] & it makes a new iso, right?

It looks like the Boot.*, Isolinux.*, & Goofy.16 files are needed to make the new iso file, right?
I looked up the mkisofs command & some of the args. you have aren't listed.
If the CDs not to boot, would the mkisofs line be "mkisofs -J -R -pad -o new.iso (files dir.)"?
What if you wanted to boot to DOS, what needs to be changed (briefly)?
Back to top
View user's profile Send private message 
Ted Dog


Joined: 13 Sep 2005
Posts: 2052
Location: Heart of Texas

PostPosted: Sat 19 Nov 2005, 21:16    Post subject: mkiso extra commands make CD bootable  

These commands are under advanced commands. I personally leave off the -pad but that is the standard method of making CD/DVD bootable with ISOLINUX, The muliboot GRUB cd/DVD has like setting, and that is what works best for multiple linux on one CD/DVD my record is six, knoppix,katoix, Beatrix, Puppy, TCCBOOT, and GeeXBox on a single DVD.
I'm working on collection edition of best of bred (puppies) from the website www.puptrix.org where I am the webmaster.
Back to top
View user's profile Send private message 
sunburnt_
Guest


PostPosted: Sun 20 Nov 2005, 18:12    Post subject:  

I made a simple script to just make an image & mounts it & exits.
Checked properties to make sure it's executable.
Opened a console & typed the file name & it says: command not found.
ROX says /mnt/cdrive no such dir. or file.
I type ls & I can see the script & the mount dir., what's up?
The files name is mk-img.sh, here's it's code:

#!/bin/sh
######### create new image file & make ext2 file sys. on it.
dd if=/dev/zero of=image_new bs=1k count=100352
mke2fs -F -m 0 -b 1024 image_new
sync
mount -o loop image_new /image_tmp

P.S. when umounted, will the new image file be called image_new?
Thanks, sunburnt... struggling with the simple stuff

Pizzasgood;
PC = 2.4 Sempron, 1/4GB DDR333, 160GB + 120GB, DVD-R, ATI 7500, 4Mb cable, 100Mb LAN
Back to top
Pizzasgood


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

PostPosted: Sun 20 Nov 2005, 20:19    Post subject:  

Say the script is /wherever/myscript. You have to either type
Code:
/wherever/myscript
or be in the actual directory and type
Code:
./myscript

Just typing
Code:
myscript
will only work if it is in the path (like at /usr/bin or /usr/local/bin)

EDIT: Yeah, in that case it would be image_new. Whatever you call it when you make it is what it's called unless you rename it. Mounting doesn't change anything.

_________________
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


Last edited by Pizzasgood on Sun 20 Nov 2005, 20:55; edited 1 time in total
Back to top
View user's profile Send private message Visit poster's website 
sunburnt_
Guest


PostPosted: Sun 20 Nov 2005, 20:31    Post subject:  

Thanks Pizzasgood; still won't work;

# ./mk-img.sh
: bad interpreter: No such file or directory
#

The drive shows mounted, I'm in the dir., I see the mount point /image/tmp & the file mk=img.sh.... ARRRGHH!!!!!
I have the worst luck with all Linux distros, can't make this, no lib for that, no permission, etc., etc.

I'm running Pizza105, that's why I'm using the alias, usually in Win98.
Hey... how are you doing with empty crust Puppy?
Back to top
Pizzasgood


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

PostPosted: Sun 20 Nov 2005, 21:10    Post subject:  

Just a thought, last post you said image/tmp, and the post before it was imag_tmp/
Probably just typing one here while it's the other there, but I've actually done that before, so it's worth checking Wink

Okay, first thing to do is find out which step is giving the error. Try doing it step by step in a console instead to pinpoint it.

The only other things I can say without being able to see the actual filetree is that you should check the locations in the script. Remember that /image_tmp is at the root, image_tmp is in the current directory. And make sure it's unmounted before you mount it (I don't think that's the problem though).

Maybe get rid of the .sh extension. Actually, I think that's probably it. That extention changes the working directory if I remember correctly.


As for empty crust, it's on hold 'till 1.0.7 comes out. Meanwile I'm working on PupBeGone (PupGet for removing standard built-in packages like Mozilla).

_________________
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 poster's website 
sunburnt


Joined: 08 Jun 2005
Posts: 4982
Location: Arizona, U.S.A.

PostPosted: Sun 20 Nov 2005, 22:30    Post subject:  

Same report, damn it! hdd1 is mounted by the wiz as /mnt/cdrive
I cd to /mnt/cdrive, do ls to check, & dir. tree is:

/mnt_old
/mnt_new
/image_tmp/usr_cram.fs
image
mk-img

I rewrote the script to extract the image file to /image_tmp, where usr_cram.fs is already.
I removed the .sh & the ROX icon changed, & now properties say it's an executable script.
=========
#!/bin/sh
######### Put the extra files you want in the new image in /image_tmp
######### Image = /mnt_old > image_tmp > /mnt_new = image_new

# mount Image file on /mnt_old, copy its insides to /image_tmp, umount /image_old
mount -o loop Image /mnt_old
cp -a /mnt_old/* image_tmp
umount /mnt_old
sync
# create image_new file & make ext2 file sys. on it
dd if=/dev/zero of=image_new bs=1k count=100352
mke2fs -F -m 0 -b 1024 image_new
sync
# mount image_new on /mnt_new & copy the contense of the /image_tmp to /mnt_new
mount -o loop image_new /mnt_new
cp -a /image_tmp/* /mnt_new
umount /mnt_new
sync
=====
Also, will the new image file be named: image_new?
Again... thanks, if there's something I can do, say so, sunburnt

Last edited by sunburnt on Sun 20 Nov 2005, 23:30; edited 1 time in total
Back to top
View user's profile Send private message 
Display posts from previous:   Sort by:   
Page 2 of 3 [44 Posts]   Goto page: Previous 1, 2, 3 Next
Post new topic   Reply to topic View previous topic :: View next topic
 Forum index » House Training » Users ( For the regulars )
Jump to:  

You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum
You cannot attach files in this forum
You can download files in this forum


Powered by phpBB © 2001, 2005 phpBB Group
[ Time: 0.0814s ][ Queries: 11 (0.0040s) ][ GZIP on ]