tag 610614 patch
thanks
attached is the patch.
--
Address:Daniel Baumann, Burgunderstrasse 3, CH-4562 Biberist
Email: daniel.baum...@progress-technologies.net
Internet: http://people.progress-technologies.net/~daniel.baumann/
From e18469559f5441a3d40c965abd915fbd63665954 Mon Sep 17 00:00:00 2001
From: Nik Lutz n...@netstyle.ch
Date: Thu, 20 Jan 2011 13:58:23 +0100
Subject: [PATCH] Adding new preseed file to support injecting preseeding files (Closes: #610614).
---
examples/lenny.conf |1 +
examples/multistrap-example.conf |1 +
examples/sid.conf|1 +
examples/squeeze.conf|1 +
multistrap | 13 -
pod/multistrap |8
6 files changed, 24 insertions(+), 1 deletions(-)
diff --git a/examples/lenny.conf b/examples/lenny.conf
index 11b4744..445a6b1 100644
--- a/examples/lenny.conf
+++ b/examples/lenny.conf
@@ -22,6 +22,7 @@ aptsources=Debian
[Debian]
packages=
+preseed=
source=http://ftp.uk.debian.org/debian
keyring=debian-archive-keyring
suite=stable
diff --git a/examples/multistrap-example.conf b/examples/multistrap-example.conf
index b99e771..8a4ac2d 100644
--- a/examples/multistrap-example.conf
+++ b/examples/multistrap-example.conf
@@ -23,6 +23,7 @@ aptsources=Debian
[Debian]
packages=
+preseed=
source=http://ftp.uk.debian.org/debian
keyring=debian-archive-keyring
suite=stable
diff --git a/examples/sid.conf b/examples/sid.conf
index 23e93f4..6c0e1fa 100644
--- a/examples/sid.conf
+++ b/examples/sid.conf
@@ -22,6 +22,7 @@ aptsources=Debian
[Debian]
packages=
+preseed=
source=http://ftp.uk.debian.org/debian
keyring=debian-archive-keyring
suite=unstable
diff --git a/examples/squeeze.conf b/examples/squeeze.conf
index 3bc60e4..8c334f8 100644
--- a/examples/squeeze.conf
+++ b/examples/squeeze.conf
@@ -22,6 +22,7 @@ aptsources=Debian
[Debian]
packages=
+preseed=
source=http://ftp.uk.debian.org/debian
keyring=debian-archive-keyring
suite=testing
diff --git a/multistrap b/multistrap
index 45e932e..5759351 100755
--- a/multistrap
+++ b/multistrap
@@ -25,7 +25,7 @@ use POSIX qw(locale_h);
use Locale::gettext;
use vars qw/ $progname $ourversion $dstrap $extra @aptsources $mirror
- @archives $deb $cachedir $config_str %packages $retval $str $retries
+ @archives $deb $cachedir $config_str %packages %preseeds $retval $str $retries
$dir $include $arch $foreign $suite $url $unpack $sourcedir $msg $etcdir
@e $sourcesname $libdir $dpkgdir @debootstrap %suites %components $chk
$component $repo @dirs @touch %sources $section %keys $host $key $value
@@ -670,6 +670,16 @@ sub native {
if ($e =~ /\nUSER=root\n/) {
$str = sudo if (-f /usr/bin/sudo);
}
+ foreach my $section (sort keys %preseeds) {
+ my $preseed = $preseeds{$section};
+ if ( $preseed ) {
+ system (cat $preseed $dir/tmp/multistrap.preseed);
+ }
+ }
+ if (-f $dir/tmp/multistrap.preseed ) {
+ system ($str $env chroot $dir debconf-set-selections /tmp/multistrap.preseed);
+ system (rm -f $dir/tmp/multistrap.preseed);
+ }
# check that we have a workable shell inside the chroot
check_bin_sh($dir);
system ($str $env chroot $dir dpkg --configure -a);
@@ -888,6 +898,7 @@ sub cascade {
# regexp is: optional string in '[]', string without '[' or ']', string ending in '/'
$flatfile{$section}++ if (($sources{$section} =~ /^(\[.*\] )*[^\[\]]+ .+\/$/));
$packages{$section}=$keys{$section}{'packages'} if (not exists $packages{$section});
+ $preseeds{$section}=$keys{$section}{'preseed'} if (not exists $preseeds{$section});
$suites{$section}=$keys{$section}{'suite'}
if (not exists $suites{$section} and not exists $flatfile{$section});
$components{$section}=$keys{$section}{'components'}
diff --git a/pod/multistrap b/pod/multistrap
index 995f7ab..582231e 100644
--- a/pod/multistrap
+++ b/pod/multistrap
@@ -79,6 +79,7 @@ Example configuration:
[Debian]
packages=
+ preseed=
source=http://ftp.uk.debian.org/debian
keyring=debian-archive-keyring
suite=lenny
@@ -172,6 +173,7 @@ configuration settings.
[Debian]
packages=
+ preseed=
source=http://ftp.uk.debian.org/debian
keyring=debian-archive-keyring
suite=lenny
@@ -184,6 +186,11 @@ after conversion to lower case).
'packages' is the list of packages to be added when this Section
is listed in Cbootstrap.
+'preseed' is the list of files that contain the information to preseed
+answers to questions in packages. This can be used to automate your
+installation. See the Debian Installer manual for more information
+about preseeding.
+
'source' is the apt source to use for this Section. (To use a local
source on the same machine, ensure you use Ccopy:// not Cfile://,
so that apt is told to copy the packages into the rootfs instead of
@@ -457,6 +464,7 @@ apt-cache size), use the omitdebsrc field in each Section.
[Baked]
packages=
+ preseed=