Bug#610614: please support injecting debconf files

2011-01-22 Thread Neil Williams
tag 610614 - patch
quit

On Thu, 20 Jan 2011 14:12:37 +0100
Daniel Baumann dan...@debian.org wrote:

 In order to make that possible, we do have a few feature requests for
 multistrap. The first is to have a possibility to inject debconf
 preseeding files.

I think support for this already exists in multistrap:

 setupscript=/path/to/setup.sh

setupscript is run after the packages have been unpacked but before any
configuration is done. It is passed the architecture being processed
and the directory where it is operating.

From the manpage/POD:

Once multistrap has unpacked the downloaded packages, the setup.sh can
be called, passing the location and architecture of the root
filesystem, so that other fine tuning can take place. At this stage,
any operations inside the rootfs must not try to execute any binaries
within the rootfs.

I'll update that section to make the warning conditional on the rootfs
not being a native one.

 Nik Lutz, a co-worker of mine, prepared a patch which i've
 successfully tested. I'll attach it to this bug as soon as i got the
 bug number for it. Please let me know what think of it.

I don't like the way the patch proposes to do this. Let me know if
there is a problem with the setupsh support but it would seem to
operate in the same manner. The patch method precludes / hides allowing
non-native to use the same support by handling the preseeding in the
configsh.

setupsh and configsh are hangovers from the previous emdebian-rootfs
package but can still be useful.

The patch also looks like it tries to assert that every multistrap
config file has to be modified to add a blank line. That's simply not
going to fly. All options like this have to be entirely optional -
including the line simply not existing. On a sidenote, system cp and
system cat look a lot like shell rather than perl. 

The bug should stay open even if setupsh works - that allows the
documentation to be updated.

-- 


Neil Williams
=
http://www.linux.codehelp.co.uk/



pgpt1cTUKlktu.pgp
Description: PGP signature


Bug#610614: please support injecting debconf files

2011-01-20 Thread Daniel Baumann
Package: multistrap
Severity: wishlist
X-Debbugs-CC: n...@netstyle.ch

Hi Neil,

as you proposed in NYC last year, I'm now working on getting rid of all
the custom magic arround debootstrap in live-build for Debian Live, so
that we can use multistrap and let it to all the heavy lifting.

In order to make that possible, we do have a few feature requests for
multistrap. The first is to have a possibility to inject debconf
preseeding files.

Nik Lutz, a co-worker of mine, prepared a patch which i've successfully
tested. I'll attach it to this bug as soon as i got the bug number for
it. Please let me know what think of it.

Regards,
Daniel

-- 
Address:Daniel Baumann, Burgunderstrasse 3, CH-4562 Biberist
Email:  daniel.baum...@progress-technologies.net
Internet:   http://people.progress-technologies.net/~daniel.baumann/



-- 
To UNSUBSCRIBE, email to debian-bugs-dist-requ...@lists.debian.org
with a subject of unsubscribe. Trouble? Contact listmas...@lists.debian.org



Bug#610614: please support injecting debconf files

2011-01-20 Thread Daniel Baumann
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=