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, [EMAIL PROTECTED]

Shorter .sig for a more eco-friendly paperless office.

Attachment: pgpm6OwlCB3aa.pgp
Description: PGP signature

Reply via email to