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

Re: preconfiguring with multistrap



On Fri, 25 Sep 2009 15:18:57 +0100
Wookey <wookey@wookware.org> wrote:

> I have a rootfs made with multistrap - it is all very lovely except
> for one little wrinkle.

native or cross?

> When it is loaded onto the target device and configured I get a
> debconf question from tzdata about timezones.

In the environment that runs the dpkg --configure -a, you need to tell
debconf to not be so dumb:

	DEBIAN_FRONTEND=noninteractive
	DEBCONF_NONINTERACTIVE_SEEN=true
	export DEBIAN_FRONTEND DEBCONF_NONINTERACTIVE_SEEN

See ./emsecondstage for the original of this snippet.

Without these, it won't just be tzdata that halts the install,
depending on what other packages you install and how they are updated
from here on.

> Putting random pre-generated files into the rootfs is easy with the
> multistrap rootfs-config script, and we do quite a lot of that.

This needs to be in the "first-boot" type config really.
 
> preseeding seemed like a good idea but appears to only be a feature of
> debian-installer, not a normal rootfs. So I'm not sure if there is a
> way to use that?

Only once debconf has been told that there is no point asking anything.

> One way to deal with it is simply set the debconf frontend to
> 'noninteractive' as we don't actually care what timezone gets set.
> However this does not seem to be be a setting in /etc/debconf.conf -
> it is a debconf qeustion itself which leads back to the 'how to
> pre-set a debconf question' problem.

That depends on what environment is available when you start the
configure.

For native, multistrap should be doing this for you:

	my $env = "DEBIAN_FRONTEND=noninteractive ".
	"DEBCONF_NONINTERACTIVE_SEEN=true ".
	"LC_ALL=C LANGUAGE=C LANG=C";
	print "I: dpkg configuration settings:\n\t$env\n";
	system ("$str $env chroot $dir dpkg --configure -a");

That's from multistrap package version 2.0.3.
(em_multistrap script version 0.0.7)

(Yes, I know, haven't got a good way of harmonising those.)

> This is likely to be a fairly general problem so I thought it worthy
> of discussion.

It is, it's affected emsandbox and debootstrap before it. It's common
in pbuilder and chroot tools too - something, doesn't matter what -
needs to create a shell environment and within that environment, tell
debconf to do the right thing before then calling dpkg --configure -a.

The other thing to do is tell perl to be nice too, that's the LC_ALL
LANGUAGE and LANG settings in the above snippet.

The issue is that these must only be run when you need automation,
leaving these enabled (by putting them into /etc/profile) is not a
GoodIdea.

-- 


Neil Williams
=============
http://www.data-freedom.org/
http://www.nosoftwarepatents.com/
http://www.linux.codehelp.co.uk/

Attachment: pgpprtGDjR0es.pgp
Description: PGP signature


Reply to: