Patch from Ian Campbell <ijc@hellion.org.uk>:

Detect duplicates in the extra images used for installation

Several files included under install.{386,amd} are actually identical to
others. Rather than duplicating them attempt to detect this and hardlink
them.

Since images can be downloaded from the web at build time it is not
always possible to detect identical files by looking for the symlinks
created by the debian-installer build. Instead we pass a list of
potential "doppelgangers" to extra_image each of which is checked for
similarity to the new image.

I added gtk/vmlinuz (which is always the same as plain vmlinuz) which
although not necessary makes it more explicit which kernel goes with the
initrd at very little cost.

Hardlinks are used in preference to symlinks since these are expected to
work better with isolinux and the Xen tools.
This commit is contained in:
Steve McIntyre 2010-07-07 23:49:46 +00:00
parent 35464f68a7
commit b5ec72640c
2 changed files with 17 additions and 3 deletions

4
debian/changelog vendored
View File

@ -30,6 +30,10 @@ debian-cd (3.1.4) UNRELEASED; urgency=low
are at least as new as the jigdo files, as this helps people mirroring.
Closes: #587774
[ Ian Campbell ]
* boot-x86: detect duplicates in the extra images used for installation
and replace with hard links.
-- Steve McIntyre <93sam@debian.org> Tue, 27 Feb 2010 12:24:29 +0100
debian-cd (3.1.3) unstable; urgency=low

View File

@ -133,6 +133,7 @@ fi
extra_image () {
image=$1
doppelgangers="$2"
dir=$(dirname "$image")
mkdir -p $CDDIR/$INSTALLDIR/$dir
@ -146,6 +147,14 @@ extra_image () {
wget "$DI_WWW_HOME/cdrom/$image" -O $CDDIR/$INSTALLDIR/"$image"
fi
fi
for doppelganger in $doppelgangers ; do
if [ -f "$CDDIR/$INSTALLDIR/$dir/$doppelganger" ] &&
cmp -s $CDDIR/$INSTALLDIR/"$image" $CDDIR/$INSTALLDIR/"$dir"/"$doppelganger" ; then
echo " $image identical to $doppelganger. Linking"
ln -nf "$doppelganger" $CDDIR/$INSTALLDIR/"$image"
break
fi
done
}
# If multiple desktops are to be supported, set the default one
@ -231,7 +240,8 @@ if [ "$THISTYPE" = "isolinux" ]; then
fi
if [ -e boot$N/isolinux/f3.txt.withgtk ]; then
extra_image gtk/initrd.gz
extra_image gtk/vmlinuz "../vmlinuz"
extra_image gtk/initrd.gz "../initrd.gz"
mv boot$N/isolinux/f3.txt.withgtk boot$N/isolinux/f3.txt
mv boot$N/isolinux/f4.txt.withgtk boot$N/isolinux/f4.txt
if [ -e boot$N/isolinux/isolinux.cfg.withgtk ]; then
@ -243,8 +253,8 @@ if [ "$THISTYPE" = "isolinux" ]; then
rm -f boot$N/isolinux/isolinux.cfg.with*
if variant_enabled "xen" ; then
extra_image xen/vmlinuz
extra_image xen/initrd.gz
extra_image xen/vmlinuz "../vmlinuz ../gtk/vmlinuz"
extra_image xen/initrd.gz "../initrd.gz ../gtk/initrd.gz"
extra_image xen/xm-debian.cfg
fi