Bug#391915: [Pbuilder-maint] Bug#391915: pbuilder: pbuilder-uml should not overwrite network configuration

Mattia Dongili malattia at linux.it
Wed Mar 28 18:21:51 UTC 2007


On Tue, Mar 27, 2007 at 10:44:07PM +0900, Junichi Uekawa wrote:
> Hi,
> 
> the patch in the following message doesn't look correct.
> Would you care to re-send?

Humm, meaning that it doesn't apply anymore or the logic is bogus?
Anyway I'll need some days as I'm in the middle of change country
mess... ;)

> > [...]
> > > > pbuilder copies the system's /etc/{resolv.conf,hosts,hostname} to the
> > > > build chroot. This is wrong for pbuilder-user-mode-linux, since the
> > > > host information is not necessary correct for the guest.
> > > > 
> > > > For example if the host has "nameserver 0.0.0.0" in /etc/resolv.conf,
> > > > then the UML guest will have a broken network configuration.
> > > > 
> > > > The following patch appears to fix it.
> > > 
> > > It looks quite sane to me. The only problem being that this assumes
> > > you've correctly configured the domain and nameserver directives for
> > > the [network]'s rootstrap module.
> > > So one may want to copy resolv.conf if it doesn't exist (and only
> > > resolv.conf).
> > 
> > Maybe the following is safer?
> > 
> > Index: pbuilder-modules
> > ===================================================================
> > RCS file: /cvsroot/pbuilder/pbuilder/pbuilder-modules,v
> > retrieving revision 1.103
> > diff -u -r1.103 pbuilder-modules
> > --- pbuilder-modules	6 Nov 2006 20:06:25 -0000	1.103
> > +++ pbuilder-modules	8 Dec 2006 18:28:35 -0000
> > @@ -327,7 +327,18 @@
> >  
> >  function copy_local_configuration () {
> >      echo " -> copying local configuration"
> > -    for a in hosts hostname resolv.conf; do 
> > +    # if running into an UML instance don't touch networking
> > +    # configuration if already present, and eventually 
> > +    # only copy resolv.conf
> > +    if [ "${INTERNAL_BUILD_UML}" = "yes" ] ; then
> > +	    if ! [ -f "$BUILDPLACE/etc/resolv.conf" ] ; then
> > +		    echo "    -> UML copy only"
> > +		    BUILDPLACE_CONFFILES="resolv.conf"
> > +	    fi
> > +    else
> > +	    BUILDPLACE_CONFFILES="hosts hostname resolv.conf"
> > +    fi
> > +    for a in $BUILDPLACE_CONFFILES; do 
> >  	rm -f "$BUILDPLACE/etc/$a"
> >  	if [ ! -f "/etc/$a" ]; then
> >  	    echo "E: /etc/$a does not exist, your setup is insane. fix it" >&2

-- 
mattia
:wq!




More information about the Pbuilder-maint mailing list