[Pbuilder-maint] Bug#391915: pbuilder-uml network config files

Paul TBBle Hampson Paul.Hampson at Pobox.com
Tue Mar 20 06:03:36 UTC 2007


I hit a similar problem to this, except in my case it
was complaining because the uml image didn't have a sensible
resolv.conf, but the chroot did, as it was DHCPing its
IP address and presumably dhclient was creating /etc/resolv.conf.

I applied the following patch, to not whack the /etc/resolv.conf
in the chroot if it already exists. I assume if the resolv.conf
exists, it is correct. Given that the uml image doesn't actually
need network support (that I can see) this seems to be a safer
assumption than the current one, in the pbuilder-uml context.

I haven't tried this outside the pbuilder-uml context, but I think
it's fairly correct. The semantics only change when the host is
missing one of these files, which is currently a Error anyway.

This does what the first patch did, except that if the chroot
doesn't have the relevant files, they still get copied in from
the UML.

If both UML and chroot have bad files, then you're still stuck.

--- pbuilder-modules	2007-02-27 10:07:04.000000000 +1100
+++ pbuilder-modules	2007-03-20 12:15:24.000000000 +1100
@@ -328,11 +328,12 @@
 function copy_local_configuration () {
     echo " -> copying local configuration"
     for a in hosts hostname resolv.conf; 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
+	if [ -f "/etc/$a" ]; then
+		rm -f "$BUILDPLACE/etc/$a"
+		cp $( readlink -f "/etc/$a" ) "$BUILDPLACE/etc/$a";
+	else
+		echo "W: No local /etc/$a to copy, relying on $BUILDPLACE/etc/$a to be correct"
 	fi
-	cp $( readlink -f "/etc/$a" ) "$BUILDPLACE/etc/$a";
     done
 }

-- 
Paul "TBBle" Hampson, Paul.Hampson at Pobox.com

Shorter .sig for a more eco-friendly paperless office.
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 189 bytes
Desc: not available
Url : http://lists.alioth.debian.org/pipermail/pbuilder-maint/attachments/20070320/71d8b024/attachment.pgp


More information about the Pbuilder-maint mailing list