[Fedora-livecd-list] [PATCH 7/7] livecd: improve livecd install speed by about 20%: turboLiveInst/genMinInstDelta

Jeremy Katz katzj at redhat.com
Mon Sep 17 21:40:09 UTC 2007


On Mon, 2007-09-17 at 12:37 -0500, Douglas McClendon wrote:
> diff -Naur livecd.3.resize2fsToMinimal_implicitsize/creator/livecd-creator livecd.turboliveinst/creator/livecd-creator
> --- livecd.3.resize2fsToMinimal_implicitsize/creator/livecd-creator     2007-09-17 17:09:57.000000000 +0000
> +++ livecd.turboliveinst/creator/livecd-creator 2007-09-14 17:40:21.000000000 +0000 
> +    def genMinInstDelta(self):'
[snip]
> +        # associate os image with loop device
> +        osloop = LoopbackMount("%s/data/os.img" %(self.build_dir,),
> +                               "not_going_to_actually_get_mounted")

Maybe just use None here instead of that.  But nitpicky and not a big
deal

> +        # calculate how much delta data to keep
[snip]
> +        try:
> +            minInstDeltaDataLength = int((dmsetupOutput.split()[3]).split('/')[0])

Ugh, depending on dmsetup's output to not change scares me.  But I don't
see any alternative.  Probably worth giving an example output of what's
being split apart just so that when it _does_ change, it's easier to
figure out what we were using.

> diff -Naur livecd.3.resize2fsToMinimal_implicitsize/creator/mayflower livecd.turboliveinst/creator/mayflower
> --- livecd.3.resize2fsToMinimal_implicitsize/creator/mayflower  2007-09-14 05:49:42.000000000 +0000
> +++ livecd.turboliveinst/creator/mayflower      2007-09-14 18:28:20.000000000 +0000
> @@ -625,6 +625,24 @@
>      mount -n -o ro,remount /sysroot
>  }
>  
> +modprobe loop max_loop=128
> +
> +# we might have a genMinInstDelta delta file for anaconda to take advantage of
> +if [ -e /sysroot/LiveOS/osmin.gz ]; then
> +  mknod /dev/loop118 b 7 118
> +  # note: osmin.gz should typically only be about 7kb. 
> +  dd if=/sysroot/LiveOS/osmin.gz of=/osmin.gz bs=512 2> /dev/null
> +  # pad to at least next sector boundry
> +  dd if=/dev/zero of=/osmin.gz bs=512 count=1 oflag=append conv=notrunc 2> /dev/null
> +  losetup /dev/loop118 /osmin.gz
> +elif [ -e /sysroot/osmin.gz ] ; then
> +  mknod /dev/loop118 b 7 118
> +  dd if=/sysroot/osmin.gz of=/osmin.gz bs=512 2> /dev/null
> +  # pad to at least next sector boundry
> +  dd if=/dev/zero of=/osmin.gz bs=512 count=1 oflag=append conv=notrunc 2> /dev/null
> +  losetup /dev/loop118 /osmin.gz
> +fi

Better to check for the existence of the files and then set $MINIMG or
similar.  That way, the rest of the check can avoid suffering cut and
paste problems

Jeremy




More information about the Fedora-livecd-list mailing list