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

Re: preseeding and environment overrides



On Thu, Jun 09, 2005 at 07:37:44AM +0200, Christian Perrier wrote:
> Quoting Joey Hess (joeyh@debian.org):
> > I'd like to at least explore the idea. It may be that the
> > simplifications of removing a stage from the install process outweigh
> > those problems. We'd no longer need to worry about the booted system
> > missing a root password with daemons running, or about propigating
> > mirror/cd selection/debconf priority to base-config, or about setting up
> > a framebuffer console for base-config to run in. Also base-config would
> > become more obviously a part of d-i and somewhat easier to test and so
> > hopefully get more people working on it.
> 
> As shadow package maintainer, I'd be happy to contribute on that, of
> course. I know Colin did work on a udeb in Ubuntu for shadow with that
> idea in mind (do you actually use it, Colin?).

Yes. It's basically just the usual control/templates guff plus this
postinst:


#! /bin/sh -e

. /usr/share/debconf/confmodule

db_get debian-installer/locale
if [ "$RET" ]; then
        TARGETLANG="$RET"
else
        TARGETLANG=C
fi

db_get debconf/priority
TARGETPRIO="$RET"

target_debconf () {
        env -u DEBIAN_HAS_FRONTEND -u DEBIAN_FRONTEND \
                -u DEBCONF_REDIR -u DEBCONF_OLD_FD_BASE \
                DEBCONF_READFD=0 DEBCONF_WRITEFD=3 \
                DEBIAN_PRIORITY="$TARGETPRIO" \
                LANG="$TARGETLANG" DEBCONF_RECONFIGURE=1 \
                chroot /target debconf -o base-config "$@"
}

debconf-copydb -p ^passwd/ configdb target_configdb

# Ideally, dpkg-reconfigure wouldn't create a new frontend every time. In
# the meantime, we reimplement a couple of bits of it. Note that
# DEBCONF_RECONFIGURE=1 is set in target_debconf above.

version="$(LANG="$TARGETLANG" chroot /target dpkg --status passwd | \
           grep ^Version: | sed 's/^Version: //')"
CODE=0
target_debconf -f passthrough \
        /var/lib/dpkg/info/passwd.config reconfigure "$version" || CODE="$?"
if [ "$CODE" = 30 ]; then
        exit 10
else
        exit $CODE
fi


If base-config were being fully integrated into d-i, I imagine we
wouldn't use this kind of passthrough trick, although the idea is
interesting and we've had the opportunity to fix a number of passthrough
frontend bugs as a result. :-)

-- 
Colin Watson                                       [cjwatson@debian.org]



Reply to: