Merge lp:~timrchavez/live-build/lb-sg-2.x-resolvconf-cleanup into lp:~ce-infrastructure/live-build/lb-sg-2.x

Proposed by Timothy R. Chavez
Status: Merged
Approved by: Timothy R. Chavez
Approved revision: 1600
Merged at revision: 1600
Proposed branch: lp:~timrchavez/live-build/lb-sg-2.x-resolvconf-cleanup
Merge into: lp:~ce-infrastructure/live-build/lb-sg-2.x
Diff against target: 52 lines (+19/-1)
2 files modified
debian/changelog (+8/-0)
scripts/build/lb_chroot_resolv (+11/-1)
To merge this branch: bzr merge lp:~timrchavez/live-build/lb-sg-2.x-resolvconf-cleanup
Reviewer Review Type Date Requested Status
OEM Solutions Release Engineers Pending
Review via email: mp+134365@code.launchpad.net

Description of the change

  * scripts/build/lb_chroot_resolv
    - Add checks for the case where resolv.conf is a symlink and clean-up
      any resolvconf pollution (backported from 3.0~a24-1ubuntu23)

To post a comment you must log in.

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1=== modified file 'debian/changelog'
2--- debian/changelog 2012-06-18 23:11:05 +0000
3+++ debian/changelog 2012-11-14 20:14:21 +0000
4@@ -1,3 +1,11 @@
5+live-build (2.0.12-2cesg8) lucid; urgency=low
6+
7+ * scripts/build/lb_chroot_resolv
8+ - Add checks for the case where resolv.conf is a symlink and clean-up
9+ any resolvconf pollution (backported from 3.0~a24-1ubuntu23)
10+
11+ -- Timothy Chavez <timothy.chavez@canonical.com> Tue, 13 Nov 2012 14:15:13 -0600
12+
13 live-build (2.0.12-2cesg7) lucid; urgency=low
14
15 * data/debian-cd/quantal:
16
17=== modified file 'scripts/build/lb_chroot_resolv'
18--- scripts/build/lb_chroot_resolv 2011-03-09 18:17:33 +0000
19+++ scripts/build/lb_chroot_resolv 2012-11-14 20:14:21 +0000
20@@ -51,6 +51,10 @@
21 # If you want to have a custom resolv.conf, please
22 # overwrite it with normal local_includes mechanism.
23 Truncate chroot/etc/resolv.conf.orig
24+ elif [ -L chroot/etc/resolv.conf ]
25+ then
26+ # Move resolv.conf aside if it's a symlink (likely resolvconf)
27+ mv chroot/etc/resolv.conf chroot/etc/resolv.conf.orig
28 fi
29
30 if [ -f /etc/resolv.conf ]
31@@ -77,7 +81,7 @@
32 # Copying local resolv.conf
33 cp -a config/chroot_local-includes/etc/resolv.conf chroot/etc/resolv.conf
34 rm -f chroot/etc/resolv.conf.orig
35- elif [ -e chroot/etc/resolv.conf.orig ]
36+ elif [ -e chroot/etc/resolv.conf.orig ] || [ -L chroot/etc/resolv.conf.orig ]
37 then
38 # Restoring resolv file or symlink
39 mv chroot/etc/resolv.conf.orig chroot/etc/resolv.conf
40@@ -86,6 +90,12 @@
41 Truncate chroot/etc/resolv.conf
42 fi
43
44+ # Clean up resolvconf's pollution
45+ if [ -d chroot/etc/resolvconf/resolv.conf.d ]; then
46+ rm -f chroot/etc/resolvconf/resolv.conf.d/original
47+ rm -f chroot/etc/resolvconf/resolv.conf.d/tail
48+ fi
49+
50 # Removing stage file
51 rm -f .stage/chroot_resolv
52 ;;

Subscribers

People subscribed via source and target branches