Merge lp:~codyshepherd/livecd-rootfs/xenial-proposed-resolvconf into lp:~ubuntu-core-dev/livecd-rootfs/xenial-proposed

Proposed by Cody Shepherd on 2018-10-31
Status: Merged
Merged at revision: 1470
Proposed branch: lp:~codyshepherd/livecd-rootfs/xenial-proposed-resolvconf
Merge into: lp:~ubuntu-core-dev/livecd-rootfs/xenial-proposed
Diff against target: 40 lines (+13/-3)
1 file modified
live-build/functions (+13/-3)
To merge this branch: bzr merge lp:~codyshepherd/livecd-rootfs/xenial-proposed-resolvconf
Reviewer Review Type Date Requested Status
Dimitri John Ledkov core-dev 2018-10-31 Approve on 2018-11-01
Robert C Jennings (community) 2018-10-31 Approve on 2018-11-01
Review via email: mp+358120@code.launchpad.net

Commit message

Increasing modularity in relocation of /etc/resolv.conf to enable users of live-build/functions to manipulate /etc/resolv.conf in a more granular and future-proof way.

Description of the change

Increasing modularity in relocation of /etc/resolv.conf

To post a comment you must log in.
Robert C Jennings (rcj) wrote :

+1

review: Approve
Dimitri John Ledkov (xnox) wrote :

+1

review: Approve (core-dev)

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1=== modified file 'live-build/functions'
2--- live-build/functions 2018-06-08 16:12:22 +0000
3+++ live-build/functions 2018-10-31 20:38:42 +0000
4@@ -77,6 +77,17 @@
5 return 0
6 }
7
8+setup_resolvconf() {
9+ local mountpoint=${1}
10+ mv "${mountpoint}/etc/resolv.conf" resolv.conf.tmp
11+ cp /etc/resolv.conf "${mountpoint}/etc/resolv.conf"
12+}
13+
14+recover_resolvconf() {
15+ local mountpoint=${1}
16+ mv resolv.conf.tmp "${mountpoint}/etc/resolv.conf"
17+}
18+
19 setup_mountpoint() {
20 local mountpoint="$1"
21
22@@ -86,8 +97,7 @@
23 mount -t tmpfs none "$mountpoint/tmp"
24 mount -t tmpfs none "$mountpoint/var/lib/apt"
25 mount -t tmpfs none "$mountpoint/var/cache/apt"
26- mv "$mountpoint/etc/resolv.conf" resolv.conf.tmp
27- cp /etc/resolv.conf "$mountpoint/etc/resolv.conf"
28+ setup_resolvconf "${mountpoint}"
29 chroot "$mountpoint" apt-get update
30
31 }
32@@ -103,7 +113,7 @@
33 { print \$2 }" | LC_ALL=C sort -r); do
34 umount $submount
35 done
36- mv resolv.conf.tmp "$mountpoint/etc/resolv.conf"
37+ recover_resolvconf "${mountpoint}"
38 }
39
40 mount_partition() {

Subscribers

People subscribed via source and target branches