~ltrager/maas-images/add_ib

« back to all changes in this revision

Viewing changes to bin/maas-qcow2targz

  • Committer: Lee Trager
  • Date: 2017-08-01 17:21:04 UTC
  • mfrom: (376.2.2 canonical_cloudinit)
  • Revision ID: lee.trager@canonical.com-20170801172104-bjt5rqryrf9v1ulb
Use Canonical's version of cloud-init in the CentOS images.

Show diffs side-by-side

added added

removed removed

Lines of Context:
111
111
 
112
112
    if [ -n "$packages" ]; then
113
113
        # We need working DNS to pull packages from the repo
114
 
        mv "${root_d}/etc/resolv.conf" "${root_d}/etc/resolv.conf.orig"
115
114
        cp /etc/resolv.conf "${root_d}/etc/resolv.conf"
116
115
        for package in $(echo $packages | sed 's/,/ /g'); do
117
116
            LANG=C unshare-pidns chroot "$root_d" yum -y install $package || {
124
123
                error "failed to clear yum cache"
125
124
                exit 1
126
125
            }
127
 
        mv "${root_d}/etc/resolv.conf.orig" "${root_d}/etc/resolv.conf"
 
126
        # Upstream ships with DNS information in /etc/resolv.conf, ship a
 
127
        # clean version.
 
128
        rm "${root_d}/etc/resolv.conf"
 
129
        touch "${root_d}/etc/resolv.conf"
 
130
        chown root:root "${root_d}/etc/resolv.conf"
 
131
        chmod 644 "${root_d}/etc/resolv.conf"
128
132
    fi
129
133
 
130
134
    error "Taring up image contents... into $out"