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

Mattia Dongili malattia at linux.it
Fri Dec 8 19:30:18 CET 2006


On Fri, Dec 08, 2006 at 04:09:44PM +0100, Mattia Dongili wrote:
> On Mon, Oct 09, 2006 at 02:31:34PM +0200, Marcus Better wrote:
[...]
> > 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