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

Re: Multi-arch netinst getting too big

On Tue, 2010-06-15 at 14:30 +0100, Steve McIntyre wrote:	
> The following packages are falling off onto a second disk now:
> i386:main:linux-image-2.6.32-5-686-bigmem:27213342
> i386:main:linux-image-2.6-686-bigmem:3036
> i386:main:linux-headers-2.6.32-5-686-bigmem:516338
> i386:main:linux-headers-2.6-686-bigmem:2930

Is this list part of the output somewhere when I do a local build either
with easy-build.sh or by replicating the invocation from debian-cd-setup

On Fri, 2010-06-25 at 21:51 +0100, Ian Campbell wrote:
> One thing to note is that the amd64 xen images should by symlinks to
> the regular vmlinuz+gtk/initrd.gz images (since no special kernel is
> needed on 64 bit, the intention was to symlink just for consistency in
> the path to the kernel for convenience) so there is an immediate 18.3M
> saving to be made which I will look into. 

This was inconvenienced a little because the images can be fetched from
the web and hence the symlinks aren't directly detectable, but here is
what I arrived at. However even with this a bunch of stuff gets punted
to CD2, in my case it is:
which is less than ideal.

This is with the Xen initrd pared down to the non-GTK version too -- I'm
not sure what else can be done to fit stuff on CD1 now...


Subject: boot-x86: 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 symlink

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.

(it's not clear if hardlinks or symlinks should be preferred. I chose
symlinks largely arbitrarily but I don't know if this has implications
for compatibility with other, non-symlink supporting, OSes which may
wish to read the CD)

Signed-off-by: Ian Campbell <ijc@hellion.org.uk>

diff --git a/tools/boot/squeeze/boot-x86 b/tools/boot/squeeze/boot-x86
index c0a5bdc..ef8aa5e 100644
--- a/tools/boot/squeeze/boot-x86
+++ b/tools/boot/squeeze/boot-x86
@@ -133,6 +133,8 @@ fi
 extra_image () {
+	doppelgangers="$2"
 	dir=$(dirname "$image")
 	mkdir -p $CDDIR/$INSTALLDIR/$dir
@@ -146,6 +148,15 @@ extra_image () {
 			wget "$DI_WWW_HOME/cdrom/$image" -O $CDDIR/$INSTALLDIR/"$image"
+	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 -nsf "$doppelganger" $CDDIR/$INSTALLDIR/"$image"
+			break
+		fi
+	done
 # If multiple desktops are to be supported, set the default one
@@ -231,7 +242,8 @@ if [ "$THISTYPE" = "isolinux" ]; then
 	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 +255,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

Ian Campbell

A mushroom cloud has no silver lining.

Attachment: signature.asc
Description: This is a digitally signed message part

Reply to: