[Date Prev][Date Next] [Thread Prev][Thread Next] [Date Index] [Thread Index]

Re: [debian-knoppix] compressloop.c usage



On Fri, Jan 03, 2003 at 04:54:20PM +0100, Valentijn Sessink wrote:
> Hello all,
> 
> For those who use the create_compressed_fs utility with a file from stdin,
> maybe the following script is useful:
> 
> bailout() {
> echo "$*" >&2
> exit 1
> }
> 
> cloopblocks=`mkisofs -quiet -print-size -R cloop`
> cloopsize=$(( $cloopblocks * 2048 ))
> trap "rm cd/KNOPPIX/KNOPPIX; bailout aborted." INT
> mkisofs -quiet -R cloop | compressloop -i $cloopsize \
> 	 -c${compression} -v -b 65536 - cd/KNOPPIX/KNOPPIX ||
> 	{ rm cd/KNOPPIX/KNOPPIX; bailout "could not make compressed ISO-image."; }

that looks familiar... is compressloop the thing I wrote?

> This will test the size of the image first, then tells compressloop to use
> this as input image size with the -i option.
> 
> Without the -i option, compressloop fixes the image size at max 2G, but will
> waste some space if the input image size is less than 2Gb. When you use -i,
> there's no waste of index space and the input image can be larger than 2Gb.
> Thus, I would recommend using the commands above :)
> 
> As Klaus has pointed out, compressloop cannot (yet) output it's file to
> stdout. This is due to the seek() commands. I'm (slowly) working on a fixed
> version, but this may take some time.
> 
> V.
I know of one way to make to be able to output to stdout, without
using up all ram, but it involves using up a lot of cpu....
You simply run through the compress loop once, writing out the preable
and the block index(or whatever thats called), then go back and compress
everything again, this time writing out the actual compressed data.

what i mean is right now it does:

for every block
compress block
write size
seek
write data
go to the next block

doing it as:
for every block
compress block
write size
go to the next block

for every block
compress block
write data
go to the next block

would work, just take twice as much cpu, but require no temporary ram or
disk space.

-- 
-Justin
_______________________________________________
debian-knoppix mailing list
debian-knoppix@linuxtag.org
http://mailman.linuxtag.org/mailman/listinfo/debian-knoppix


Reply to: