How to make Image.gz with usr_cram.fs inside for LAN Boot?

Using applications, configuring, problems
Message
Author
User avatar
sunburnt
Posts: 5090
Joined: Wed 08 Jun 2005, 23:11
Location: Arizona, U.S.A.

#16 Post by sunburnt »

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, 06:38, edited 1 time in total.

Ted guest Dog

that is where I need help also.

#17 Post by Ted guest Dog »

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

User avatar
sunburnt
Posts: 5090
Joined: Wed 08 Jun 2005, 23:11
Location: Arizona, U.S.A.

#18 Post by sunburnt »

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.

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

#19 Post by Pizzasgood »

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.
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:
#...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: Select all

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
#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 :roll:
[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]

Ted guest Dog

new improved script

#20 Post by Ted guest Dog »

Code: Select all

#!/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.

User avatar
sunburnt
Posts: 5090
Joined: Wed 08 Jun 2005, 23:11
Location: Arizona, U.S.A.

#21 Post by sunburnt »

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.

User avatar
sunburnt
Posts: 5090
Joined: Wed 08 Jun 2005, 23:11
Location: Arizona, U.S.A.

#22 Post by sunburnt »

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.

Ted sleepy Dog

iso to iso

#23 Post by Ted sleepy Dog »

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]

User avatar
sunburnt
Posts: 5090
Joined: Wed 08 Jun 2005, 23:11
Location: Arizona, U.S.A.

#24 Post by sunburnt »

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)?

User avatar
Ted Dog
Posts: 3965
Joined: Wed 14 Sep 2005, 02:35
Location: Heart of Texas

mkiso extra commands make CD bootable

#25 Post by Ted Dog »

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 http://www.puptrix.org where I am the webmaster.

sunburnt_

#26 Post by sunburnt_ »

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

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

#27 Post by Pizzasgood »

Say the script is /wherever/myscript. You have to either type

Code: Select all

/wherever/myscript
or be in the actual directory and type

Code: Select all

./myscript
Just typing

Code: Select all

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.
Last edited by Pizzasgood on Mon 21 Nov 2005, 00:55, edited 1 time in total.
[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]

sunburnt_

#28 Post by sunburnt_ »

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?

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

#29 Post by Pizzasgood »

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).
[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]

User avatar
sunburnt
Posts: 5090
Joined: Wed 08 Jun 2005, 23:11
Location: Arizona, U.S.A.

#30 Post by sunburnt »

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 Mon 21 Nov 2005, 03:30, edited 1 time in total.

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

#31 Post by Pizzasgood »

If that's copied and pasted, the problem is that you have
A. a capital I in image, then lowercase i's.
B. You start things with /. That takes it all the way back to /. In other words, either use the name or use /mnt/cdrive/mnt_old. If you really want to have /s on directories, stick them on the back like mnt_new/.

Try this:

Code: Select all


#!/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 mnt_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. ~ 150MB (150*1024) = 153600
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 

That worked for me when run with ./mk-img
And it does make img_new as the new one.
[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]

User avatar
sunburnt
Posts: 5090
Joined: Wed 08 Jun 2005, 23:11
Location: Arizona, U.S.A.

#32 Post by sunburnt »

It's running now, but it has errors on all of the files; cannot create symbolic link & failed to preserve ownership.
I don't know what's wrong or if it's normal (doesn't seem so), but I'm going to try it anyway, & who knows?
Hope it works, I'll let you know, but either way you've made it possable.
If I get it running right it would make a great addition for ROX, if that can be done?
ROX opening, extracting, & compressing; iso, image, & gzip files. It'd make Puppy work easy.

User avatar
sunburnt
Posts: 5090
Joined: Wed 08 Jun 2005, 23:11
Location: Arizona, U.S.A.

#33 Post by sunburnt »

It's running, but with errors on all files; cannot create symbolic link & failed to preserve ownership.
Don't know what's wrong, I tried "cp -a -P " to preserve ownership, no change, I'll try it anyway.
Maybe an addon for ROX to work with iso, image, & gzip files, it'd make Puppy work easy.

User avatar
Ted Dog
Posts: 3965
Joined: Wed 14 Sep 2005, 02:35
Location: Heart of Texas

Windows files lack full linux atrribute flags

#34 Post by Ted Dog »

Many of the messages could be due to using FAT directly. RAM is safe and so is ext3 that I was using, sorry to not make that clear. This has tripped me up countless times. Try moving your working directories into /root/ (which is ext2 inside a file on FAT drive called pup015) or /tmp (which is in memory and linux full supported) to clear those errors. Permissions are important to preserve.

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

#35 Post by Pizzasgood »

That's why I use a big partition image in HackyRemaster. Then I know it will be within an ext2 filesystem, and it can be put anywhere Puppy can read and write to.

So solve this on the harddrive, do the same thing you do to make the image to make another image, and put those mountpoints within that. Then it would work correctly.
[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