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

Bug#695261: choose-mirror: fails with with a preseeded mirror and a non-debianish codename



Package: choose-mirror
Version: 2.44
Severity: normal
Tags: patch

I have a derivative distribution which has its own codename. So I have
preseeded the installer like this:

d-i mirror/country string enter information manually
d-i mirror/suite string foobar
d-i mirror/codename string foobar
d-i mirror/http/hostname string ftp.foobar.com
d-i mirror/http/directory string /foobar

And this points to a perfectly fine APT repository. However while testing
choose-mirror always ends up complaining that the mirror is broken
after having tried to download
http://ftp.foobar.com/foobar/dists/wheezy/Release and having noted that
this file in fact contains another codename. This is precisely because
"wheezy" is a symlink to "foobar" (because unfortunately too many Debian
tools hardcode the codename in some ways).

My CD contains a base system so many checks are skipped and in particular
in get_default_suite() the preseeding of mirror/suite is ignored so that
/etc/default-release is always the source of information.

This comes back to this commit:

commit 80b173602201a274681dbb9dffc0c43b39157bce
Author: Frans Pop <fjp@debian.org>
Date:   Thu Nov 19 21:46:28 2009 +0000

    Ignore preseeded suite when installing from CD with base system
    
    If we're installing from a CD that contains base system packages we
    want to always use the release corresponding to that.
    
    r61380

But I don't really buy this argument. If I preseed something, it's because
I want this value to be used! Furthermore /etc/default-release is hardcoded
in the initrd and it's much less convenient to update.

Suggested patch is attached.

-- System Information:
Debian Release: wheezy/sid
  APT prefers unstable
  APT policy: (500, 'unstable'), (500, 'testing'), (1, 'experimental')
Architecture: amd64 (x86_64)
Foreign Architectures: i386

Kernel: Linux 3.6-trunk-amd64 (SMP w/4 CPU cores)
Locale: LANG=fr_FR.UTF-8, LC_CTYPE=fr_FR.UTF-8 (charmap=UTF-8)
Shell: /bin/sh linked to /bin/dash
>From eb395dca02be0066b5a3d33c6af976e8d4279069 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Rapha=C3=ABl=20Hertzog?= <hertzog@debian.org>
Date: Thu, 6 Dec 2012 10:57:30 +0100
Subject: [PATCH] Respect mirror/suite even if the installation media contains
 an installable base system.

This partly reverts 80b173602201a274681dbb9dffc0c43b39157bce. The
reasoning of that commit does not make much sense if you want
official debian installer images to be usable for derivatives as
well. Furthermore mirror/suite has no default value and if it's set,
it means that the user wants to override the default hardcoded
value in /etc/default-release.
---
 choose-mirror.c  |    2 +-
 debian/changelog |    7 +++++++
 2 files changed, 8 insertions(+), 1 deletion(-)

diff --git a/choose-mirror.c b/choose-mirror.c
index fa782e7..93cc7a2 100644
--- a/choose-mirror.c
+++ b/choose-mirror.c
@@ -135,7 +135,7 @@ static char *get_default_suite(void) {
 	char buf[SUITE_LENGTH];
 
 	debconf_get(debconf, DEBCONF_BASE "suite");
-	if (! base_on_cd && strlen(debconf->value) > 0) {
+	if (strlen(debconf->value) > 0) {
 		/* Use preseeded or previously selected value. */
 		suite = strdup(debconf->value);
 	} else {
diff --git a/debian/changelog b/debian/changelog
index ad2903c..7252559 100644
--- a/debian/changelog
+++ b/debian/changelog
@@ -1,3 +1,10 @@
+choose-mirror (2.45) UNRELEASED; urgency=low
+
+  * Respect mirror/suite even if the installation media contains an
+    installable base system.
+
+ -- Raphaël Hertzog <hertzog@debian.org>  Thu, 06 Dec 2012 10:56:22 +0100
+
 choose-mirror (2.44) unstable; urgency=low
 
   [ Updated translations ]
-- 
1.7.10.4


Reply to: