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

Re: Bits from the CD team: plans for debian-cd v3.0

On Thu, 14 Jul 2005, Steve McIntyre wrote:

> On Wed, Jul 13, 2005 at 09:31:26AM +0200, Raphael Hertzog wrote:
> >Le mardi 12 juillet 2005 ? 19:08 +0200, Robert Lemmen a ?crit :
> >> >     [...] once the tree gets to within a small
> >> >     margin of the target, we can start running mkisofs -print-size to
> >> >     check exactly how large the resulting image would be. It will even
> >>
> >> is this really necessary? can't we somehow determine how much will fit
> >> on the cd without doing this?
> >
> >To calculate the exact size of the image, you must have knowledge of
> >ISO-9660 and mkisofs has this knowledge. So it looks logical to rely on
> >it rather than reinvent the wheel.
> >
> >The image is by definition larger than the sum of the file size. You
> >have space lost for the filesystem meta-data and also because of the way
> >how data is stored (fixed-size blocks, ...).
> Yes, exactly. We can do quick-and-dirty size estimation as we copy
> files in, but the only way to know _exactly_ how big the image will be
> is to use mkisofs. Hence the "within a small margin" above. I'm hoping
> we can guesstimate sizes reasonably well up to ~95% of the target
> size, and go for the slower option from there:
>   * Dump stanzas into the Packages/Source file and compress them
>   * Update Release file
>   * Fill in any last files
>   * Run mkisofs --print-size
> The plan will then be to fill the discs as much as possible. In fact,
> the best way might even be to go 1 package/source file too far, then
> roll back.

...and if that package happens to be big, like game data or somesuch, skip
that package and try adding the next one (incl. deps). Iterate until you are
within, say, 100kB of the disc size. Requires a "staging area" that includes
all a package's deps, which is either committed or dropped as a whole.

By the way, "guesstimating sizes" is quite doable in three steps:
1. Begin with all non-package content like installer, docs
2. Take mkisofs --print-size and add "something" for Packages/md5sums
3. For each package to add, round size up to 2048-multiple

  Anne Bezemer

Reply to: