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

Bug#424640: net-retriever: Should always use udebs from release corresponding to build



On Thursday 17 May 2007 21:17, Frans Pop wrote:
> This may break installations for several reasons:
> - library incompatibilities (as I suspect is the case here)

This turned out not to be the cause for the issue affecting the weekly 
built images. However, it will be an issue as soon as new library udebs 
migrate to testing and someone using the Etch netboot installer chooses 
to install testing.

> - missing kernel udebs (soon there will no longer be 2.6.18-4 kernel
>   udebs available in unstable)
>
> The solution seems simple: ensure in the build system that udebs will
> always be downloaded using the same _codename_ (not suite) as was used
> to build the initrd. Using the codename ensures there will be no
> problems at the time of a stable release.

Attached are two patches that implement this.
One patch is for the build system and will include two files in most D-I 
initrds in a directory /.installer/:
- default_release: contains the default release to use for the _target_
  system; currently unused, but intended to replace the hardcoded
  PREFERRED_DISTRIBUTION in choose-mirror which will mean one less thing
  needed to update after a stable release
- udebs_source: normally contains the codename of the release from which
  udebs were taken when images were built; for daily built images this
  will be set to "unstable"

The patch makes the inclusion of a preseed file in daily images to set 
mirror/udeb/suite unnecessary, but that parameter can still be used to 
overrule the suite from where udebs are to be retrieved.

Note that udebs_source file will not actually be used for CD based 
installs and default_release only for businesscard images, but it seems 
to me that including the files anyway is relatively harmless and avoids 
additional complexity in the build system.

The second patch makes net-retriever use the udebs_source file if 
available and thus ensures a clean transition; after the transition a 
further change is needed to make it stop using mirror/suite as a default 
and generate an error if the udebs_source file is missing.
The only open issue is that a check is probably needed that the release in 
udebs_source should be available on the selected mirror (although the 
risk that it is not is in practice fairly low).

It would be nice if someone else would write the patch for choose-mirror 
as my C is a bit too marginal for that task.

Comments welcome.

Cheers,
FJP

Index: build/config/common
===================================================================
--- build/config/common	(revision 46995)
+++ build/config/common	(working copy)
@@ -22,10 +22,6 @@
 # It will be loaded by the initrd-preseed udeb.
 PRESEED = 
 
-# Right now we want all d-i development and daily builds to use udebs from
-# unstable, so load the unstable.cfg. This is disabled for official builds.
-PRESEED_SUITE ?= unstable.cfg
-
 # The library reducer to use. Can be mklibs.sh or mklibs.py.
 MKLIBS = mklibs 
 
@@ -34,22 +30,26 @@
 # this. You can use copy:/ to use a local mirror
 #MIRROR = http://www.us.debian.org/debian
 
-# Define here if debian-installer should be built with modules from
-# stable, testing or unstable.
-SUITE ?= unstable
-
-# Archive components from which to fetch debian-installer modules.
-UDEB_COMPONENTS ?= main/debian-installer
-
 # Options to pass to dpkg when it is unpacking the udebs to create the
 # image. None should be needed, but --force-overwrite might need to be
 # enabled from time to time if udebs have conflicting files.
 DPKG_UNPACK_OPTIONS = --force-overwrite
 
+# The codename for the version of Debian that should be installed by default.
+DEBIAN_RELEASE = lenny
+
 # The version of Debian targeted by the installation images.
 #DEBIAN_VERSION = 4.0
 DEBIAN_VERSION = lenny
 
+# Define here from what release (codename!) components (udebs) should be taken
+# to build debian-installer. By default this is set to 'unstable' for building
+# daily images. For official builds this is overruled in debian/rules.
+USE_UDEBS_FROM ?= unstable
+
+# Archive components from which to fetch debian-installer modules.
+UDEB_COMPONENTS ?= main/debian-installer
+
 # The date the installer is built.
 BUILD_DATE ?= $(shell date -u '+%Y%m%d-%H:%M')
 
Index: build/config/i386/floppy/boot.cfg
===================================================================
--- build/config/i386/floppy/boot.cfg	(revision 46995)
+++ build/config/i386/floppy/boot.cfg	(working copy)
@@ -9,11 +9,12 @@
 # Use type -ng to not interfere with sparc and powerpc floppies
 TYPE=bootfloppy-ng
 
+# Release info not needed on boot floppy
+OMIT_RELEASE_INFO=1
 # No gpg fits on a boot floppy.
 KEYRING=
 # No debconf either, so no preseeding.
 PRESEED=
-PRESEED_SUITE=
 EXTRAUDEBS=
 
 # Save some much needed space by compressing busybox. This is kind of a
Index: build/unstable.cfg
===================================================================
--- build/unstable.cfg	(revision 46995)
+++ build/unstable.cfg	(working copy)
@@ -1,4 +0,0 @@
-# Preseed file to make d-i download udebs from unstable, useful for daily
-# builds and development builds.
-d-i mirror/udeb/suite string unstable
-d-i mirror/udeb/suite seen false
Index: build/Makefile
===================================================================
--- build/Makefile	(revision 46995)
+++ build/Makefile	(working copy)
@@ -383,14 +383,6 @@
 	# Copy in preseed file.
 	cp -a $(PRESEED) $(TREE)/preseed.cfg
 endif
-ifdef PRESEED_SUITE
-	# Add suite preseed file.
-	if [ -e "$(TREE)/preseed.cfg" ]; then \
-		cat $(PRESEED_SUITE) >> $(TREE)/preseed.cfg; \
-	else \
-		cp -a $(PRESEED_SUITE) $(TREE)/preseed.cfg; \
-	fi
-endif
 
 ifneq (,$(wildcard $(KEYRING)))
 	mkdir -p $(TREE)/usr/share/keyrings
@@ -411,6 +403,13 @@
 
 
 $(STAMPS)tree-$(targetstring)-stamp: $(STAMPS)tree-unpack-$(targetstring)-stamp
+ifndef OMIT_RELEASE_INFO
+	# Add release info
+	mkdir -p $(TREE)/.installer
+	echo $(DEBIAN_RELEASE) >$(TREE)/.installer/default_release
+	echo $(USE_UDEBS_FROM) >$(TREE)/.installer/udebs_source
+endif
+
 	# Create a dev tree.
 	mkdir -p $(TREE)/dev
 	# Always needed, in case devfs is not mounted on boot.
@@ -420,6 +419,7 @@
 	mkdir -p $(EXTRAUDEBSDIR)
 	mkdir -p $(EXTRAUDEBSDPKGDIR)/info $(EXTRAUDEBSDPKGDIR)/updates
 	touch $(EXTRAUDEBSDPKGDIR)/status $(EXTRAUDEBSDPKGDIR)/available
+
 ifdef EXTRADRIVERS
 	# Unpack the udebs of additional driver disks, so mklibs runs on them too.
 	dpkg $(DPKG_UNPACK_OPTIONS) --log=/dev/null --root=$(EXTRAUDEBSDIR) --unpack \
@@ -531,14 +531,14 @@
 	echo "# This file is automatically generated, edit $@.local instead."; \
 	echo "deb copy:$(shell pwd)/ $(LOCALUDEBDIR)/"; \
 	if [ "$(MIRROR)x" != "x" ]; then \
-		echo "deb $(MIRROR) $(SUITE) $(UDEB_COMPONENTS)"; \
+		echo "deb $(MIRROR) $(USE_UDEBS_FROM) $(UDEB_COMPONENTS)"; \
 	else \
 		grep '^deb[ \t]' $(SYSTEM_SOURCES_LIST) \
 		|grep -v '^deb[ \t]cdrom:' \
 		|grep -v '\(security.debian.org\|volatile.debian.\(net\|org\)\)' \
 		|grep '[ \t]main' \
 		|awk '{print $$1 " " $$2}' \
-		|sed "s,/* *$$, $(SUITE) $(UDEB_COMPONENTS)," \
+		|sed "s,/* *$$, $(USE_UDEBS_FROM) $(UDEB_COMPONENTS)," \
 		|sed "s,^deb file,deb copy," \
 		|perl -ne 'print unless $$seen{$$_}; $$seen{$$_}=1' ; \
 	fi) > $@
Index: build/README
===================================================================
--- build/README	(revision 46995)
+++ build/README	(working copy)
@@ -326,9 +326,22 @@
   The type of media produced, currently used to make qemu boot the image
   properly. Suggested values: "CD-ROM", "netboot image", "floppy", etc.
 
+DEBIAN_RELEASE
+  The codename of the debian release to be installed by default.
+  Included in .installer/default_release in most initrds.
+
 DEBIAN_VERSION
-  The debian version descriptive name.
+  The version number of the Debian release.
 
+USE_UDEBS_FROM
+  Normally the codename of the release to use for the build. Defaults to
+  unstable for daily builds.
+  Included in .installer/udebs_source in most initrds.
+
+OMIT_RELEASE_INFO
+  Can be used to suppress the inclusion of the .installer directory in some
+  targets.
+
 DOS_VOLUME_ID
 DOS_VOLUME_LABEL
   Volume ID and label for DOS filesystems.
@@ -383,7 +396,6 @@
   Mostly useful for floppies.
 
 UDEB_LISTS
-
   List of files listing udebs that were used to build the image.
 
 
@@ -405,9 +417,6 @@
   The mirror to get .deb and .udeb packages from. Defaults to the same
   as the host machine uses.
 
-SUITE
-  The suite to use for the build. Defaults to unstable.
-
 UDEB_COMPONENTS
   Archive components from which to fetch .udeb packages. Defaults to
   main/debian-installer.
@@ -415,10 +424,6 @@
 PRESEED
   An initrd preseed file to put in the initrd.
 
-PRESEED_SUITE
-  An initrd preseed file to append to any other preseed file put in the
-  initrd by PRESEED; used to preseed the suite for daily builds.
-
 Rules invoked from the various targets:
 
 arch_boot:
Index: debian/changelog
===================================================================
--- debian/changelog	(revision 46995)
+++ debian/changelog	(working copy)
@@ -43,8 +43,15 @@
   [ Martin Michlmayr ]
   * Switch arm, mips and mipsel to 2.6.21-1.
 
- -- dann frazier <dannf@debian.org>  Thu, 03 May 2007 15:49:39 -0600
+  [ Frans Pop ]
+  * Include the default release for the target system and the release from
+    which to retrieve udebs in images. The first makes it unnecessary to
+    hardcode the default release in choose-mirror and the last ensures
+    consistency between udebs included in the initrd and udebs retrieved
+    during the installation.
 
+ -- Frans Pop <fjp@debian.org>  Sat, 26 May 2007 17:22:14 +0200
+
 debian-installer (20070308) unstable; urgency=low
 
   [ Thiemo Seufer ]
Index: debian/rules
===================================================================
--- debian/rules	(revision 46995)
+++ debian/rules	(working copy)
@@ -4,11 +4,10 @@
 VERSION=$(shell LC_ALL=C dpkg-parsechangelog | grep ^Version: | cut -d ' ' -f 2)
 DATE=$(shell echo $(VERSION) | cut -d '.' -f 1)
 SUITE=$(shell LC_ALL=C dpkg-parsechangelog | grep ^Distribution: | cut -d ' ' -f 2)
-ifeq (${SUITE},unstable)
-SUITE=lenny
-endif
 ifeq (${SUITE},UNRELEASED)
-SUITE=unstable
+USE_UDEBS_FROM=unstable
+else
+USE_UDEBS_FROM=lenny
 endif
 
 ARCHIVEDIR=debian/tmp/installer-$(ARCH)
@@ -26,7 +25,7 @@
 # Must run as root, so is not run as part of regular build.
 build-images:
 	$(MAKE) -C build all_build stats release \
-		SUITE=$(SUITE) BUILD_DATE=$(DATE) PRESEED_SUITE=
+		USE_UDEBS_FROM=$(USE_UDEBS_FROM) BUILD_DATE=$(DATE)
 	
 build: build-stamp
 build-stamp:
Index: debian/changelog
===================================================================
--- debian/changelog	(revision 46993)
+++ debian/changelog	(working copy)
@@ -1,3 +1,12 @@
+net-retriever (1.18) UNRELEASED; urgency=low
+
+  * Use /.installer/udebs_source as the default release to fetch udebs from.
+    This is the same release (codename) as was used to build the images and
+    thus ensures consistency. It is independent of the release selected for
+    the target system. For daily builds the source will default to 'unstable'.
+
+ -- Frans Pop <fjp@debian.org>  Sat, 26 May 2007 16:42:28 +0200
+
 net-retriever (1.17) unstable; urgency=low
 
   [ Joey Hess ]
Index: net-retriever
===================================================================
--- net-retriever	(revision 46993)
+++ net-retriever	(working copy)
@@ -98,7 +98,11 @@
 
 		# Setting codename to a suite is not very nice, but can do no harm
 		if ! db_get mirror/udeb/suite || [ -z "$RET" ]; then
-			db_get mirror/codename
+			if [ -f /.installer/udebs_source ]; then
+				RET=$(cat /.installer/udebs_source)
+			else
+				db_get mirror/codename
+			fi
 		fi
 		codename="$RET"
 

Attachment: pgpnCajkhjnp8.pgp
Description: PGP signature


Reply to: