UCK shouldn't fail building when resolv.conf is missing

Bug #1011191 reported by Pascal de Bruijn
38
This bug affects 10 people
Affects Status Importance Assigned to Milestone
Ubuntu Customization Kit
Fix Released
Undecided
Unassigned

Bug Description

On my Ubuntu Precise system there is no /etc/resolv.conf anymore, so UCK shouldn't fail if it's missing:

--- a/remaster-live-cd.sh 2012-06-10 17:15:24.772932646 +0200
+++ b/remaster-live-cd.sh 2012-06-10 17:15:53.741076297 +0200
@@ -357,7 +357,7 @@ function prepare_rootfs_for_chroot()
  if [ ! -e "$REMASTER_DIR/etc/resolv.conf" ] ; then
   echo "Copying resolv.conf..."
   cp -f /etc/resolv.conf "$REMASTER_DIR/etc/resolv.conf" ||
- failure "Failed to copy resolv.conf, error=$?"
+ echo "Failed to copy resolv.conf, error=$?"
  fi

  echo "Copying fstab/mtab..."

Changed in uck:
status: New → Fix Committed
Revision history for this message
Carlos Eduardo Alves (kmiksi) wrote :

This happend because of a broken symlink.
To really test if resolv.conf exist, use:
 if [ ! -e "$REMASTER_DIR/etc/resolv.conf" -a ! -h "$REMASTER_DIR/etc/resolv.conf" ] ; then

So, you can retain the failure message if resolv.conf really not exist.

Revision history for this message
Fabrizio Balliano (fabrizio-balliano) wrote :

if 2.4.7svn is working for you i'd not change that again cause we had 1thousand duplicate bugs on this and i'm quite stuck about

Revision history for this message
Pascal de Bruijn (pmjdebruijn) wrote :

I think it's fine now.

Changed in uck:
status: Fix Committed → Fix Released
Revision history for this message
அருண் குமார் - Arun Kumar (thangamani-arun) wrote :

I tried uck 2.4.7 on 11.10
I got the below error.

cp: not writing through dangling symlink `/media/docs/dev/tmp/remaster-root/etc/resolv.conf'

It got solved after below modification
cp -f --remove-destination /etc/resolv.conf "$REMASTER_DIR/etc/resolv.conf"

Request you to fix the same for version 2.4.7.

Thanks
Arun

Revision history for this message
salemboot (salemboot) wrote :

Check to see if /etc/resolv.conf actually exists.
If it doesn't, just "sudo touch /etc/resolv.conf"

Respectfully,

Revision history for this message
Pascal de Bruijn (pmjdebruijn) wrote :

That's not a good idea perse, as on modern system the whole resolv system is managed by the resolvconf package, and it should not be blindly interfered with.

These issues should already be fixed in uck-svn.

To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Duplicates of this bug

Other bug subscribers

Related questions

Remote bug watches

Bug watches keep track of this bug in other bug trackers.