Merge lp:~ubuntu-branches/ubuntu/precise/lxc/precise-201203170940 into lp:ubuntu/precise/lxc

Proposed by Ubuntu Package Importer
Status: Rejected
Rejected by: James Westby
Proposed branch: lp:~ubuntu-branches/ubuntu/precise/lxc/precise-201203170940
Merge into: lp:ubuntu/precise/lxc
Diff against target: 442 lines (+418/-0) (has conflicts)
4 files modified
.pc/.quilt_patches (+1/-0)
.pc/.quilt_series (+1/-0)
.pc/0059-reenable-daily-cloudimg/templates/lxc-ubuntu-cloud.in (+351/-0)
debian/patches/0059-reenable-daily-cloudimg (+65/-0)
Conflict adding file .pc/0059-reenable-daily-cloudimg.  Moved existing file to .pc/0059-reenable-daily-cloudimg.moved.
Conflict adding file debian/patches/0059-reenable-daily-cloudimg.  Moved existing file to debian/patches/0059-reenable-daily-cloudimg.moved.
To merge this branch: bzr merge lp:~ubuntu-branches/ubuntu/precise/lxc/precise-201203170940
Reviewer Review Type Date Requested Status
Ubuntu branches Pending
Review via email: mp+98046@code.launchpad.net

Description of the change

The package importer has detected a possible inconsistency between the package history in the archive and the history in bzr. As the archive is authoritative the importer has made lp:ubuntu/precise/lxc reflect what is in the archive and the old bzr branch has been pushed to lp:~ubuntu-branches/ubuntu/precise/lxc/precise-201203170940. This merge proposal was created so that an Ubuntu developer can review the situations and perform a merge/upload if necessary. There are three typical cases where this can happen.
  1. Where someone pushes a change to bzr and someone else uploads the package without that change. This is the reason that this check is done by the importer. If this appears to be the case then a merge/upload should be done if the changes that were in bzr are still desirable.
  2. The importer incorrectly detected the above situation when someone made a change in bzr and then uploaded it.
  3. The importer incorrectly detected the above situation when someone just uploaded a package and didn't touch bzr.

If this case doesn't appear to be the first situation then set the status of the merge proposal to "Rejected" and help avoid the problem in future by filing a bug at https://bugs.launchpad.net/udd linking to this merge proposal.

(this is an automatically generated message)

To post a comment you must log in.

Unmerged revisions

80. By Stéphane Graber

Re-enable apparmor profile now that the userspace was fixed.
Some part of the profile are still disabled because of missing kernel
or userspace features, see the FIXMEs for these, hopefully fixed soon.

79. By Serge Hallyn

0059-reenable-daily-cloudimg: let user specify daily cloud images.

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1=== added file '.pc/.quilt_patches'
2--- .pc/.quilt_patches 1970-01-01 00:00:00 +0000
3+++ .pc/.quilt_patches 2012-03-17 09:44:19 +0000
4@@ -0,0 +1,1 @@
5+debian/patches
6
7=== added file '.pc/.quilt_series'
8--- .pc/.quilt_series 1970-01-01 00:00:00 +0000
9+++ .pc/.quilt_series 2012-03-17 09:44:19 +0000
10@@ -0,0 +1,1 @@
11+series
12
13=== added directory '.pc/0059-reenable-daily-cloudimg'
14=== renamed directory '.pc/0059-reenable-daily-cloudimg' => '.pc/0059-reenable-daily-cloudimg.moved'
15=== added directory '.pc/0059-reenable-daily-cloudimg/templates'
16=== added file '.pc/0059-reenable-daily-cloudimg/templates/lxc-ubuntu-cloud.in'
17--- .pc/0059-reenable-daily-cloudimg/templates/lxc-ubuntu-cloud.in 1970-01-01 00:00:00 +0000
18+++ .pc/0059-reenable-daily-cloudimg/templates/lxc-ubuntu-cloud.in 2012-03-17 09:44:19 +0000
19@@ -0,0 +1,351 @@
20+#!/bin/bash
21+
22+# template script for generating ubuntu container for LXC based on released cloud
23+# images
24+#
25+# Copyright © 2012 Serge Hallyn <serge.hallyn@canonical.com>
26+#
27+# This program is free software; you can redistribute it and/or modify
28+# it under the terms of the GNU General Public License version 2, as
29+# published by the Free Software Foundation.
30+
31+# This program is distributed in the hope that it will be useful,
32+# but WITHOUT ANY WARRANTY; without even the implied warranty of
33+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
34+# GNU General Public License for more details.
35+
36+# You should have received a copy of the GNU General Public License along
37+# with this program; if not, write to the Free Software Foundation, Inc.,
38+# 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
39+#
40+
41+set -e
42+
43+if [ -r /etc/default/lxc ]; then
44+ . /etc/default/lxc
45+fi
46+
47+copy_configuration()
48+{
49+ path=$1
50+ rootfs=$2
51+ name=$3
52+ arch=$4
53+
54+ if [ $arch = "i386" ]; then
55+ arch="i686"
56+ fi
57+
58+ # if there is exactly one veth network entry, make sure it has an
59+ # associated hwaddr.
60+ nics=`grep -e '^lxc\.network\.type[ \t]*=[ \t]*veth' $path/config | wc -l`
61+ if [ $nics -eq 1 ]; then
62+ grep -q "^lxc.network.hwaddr" $path/config || cat <<EOF >> $path/config
63+lxc.network.hwaddr= 00:16:3e:$(openssl rand -hex 3| sed 's/\(..\)/\1:/g; s/.$//')
64+EOF
65+ fi
66+
67+ cat <<EOF >> $path/config
68+lxc.utsname = $name
69+
70+lxc.tty = 4
71+lxc.pts = 1024
72+lxc.rootfs = $rootfs
73+lxc.mount = $path/fstab
74+lxc.arch = $arch
75+lxc.cap.drop = sys_module mac_admin
76+
77+lxc.cgroup.devices.deny = a
78+# Allow any mknod (but not using the node)
79+lxc.cgroup.devices.allow = c *:* m
80+lxc.cgroup.devices.allow = b *:* m
81+# /dev/null and zero
82+lxc.cgroup.devices.allow = c 1:3 rwm
83+lxc.cgroup.devices.allow = c 1:5 rwm
84+# consoles
85+lxc.cgroup.devices.allow = c 5:1 rwm
86+lxc.cgroup.devices.allow = c 5:0 rwm
87+#lxc.cgroup.devices.allow = c 4:0 rwm
88+#lxc.cgroup.devices.allow = c 4:1 rwm
89+# /dev/{,u}random
90+lxc.cgroup.devices.allow = c 1:9 rwm
91+lxc.cgroup.devices.allow = c 1:8 rwm
92+lxc.cgroup.devices.allow = c 136:* rwm
93+lxc.cgroup.devices.allow = c 5:2 rwm
94+# rtc
95+lxc.cgroup.devices.allow = c 254:0 rwm
96+#fuse
97+lxc.cgroup.devices.allow = c 10:229 rwm
98+#tun
99+lxc.cgroup.devices.allow = c 10:200 rwm
100+#full
101+lxc.cgroup.devices.allow = c 1:7 rwm
102+#hpet
103+lxc.cgroup.devices.allow = c 10:228 rwm
104+#kvm
105+lxc.cgroup.devices.allow = c 10:232 rwm
106+EOF
107+
108+ cat <<EOF > $path/fstab
109+proc $rootfs/proc proc nodev,noexec,nosuid 0 0
110+sysfs $rootfs/sys sysfs defaults 0 0
111+EOF
112+
113+ return 0
114+}
115+
116+usage()
117+{
118+ cat <<EOF
119+LXC Container configuration for Ubuntu Cloud images.
120+
121+Generic Options
122+[ -r | --release <release> ]: Release name of container, defaults to host
123+[ -a | --arch ]: Arhcitecture of container, defaults to host arcitecture
124+[ -C | --cloud ]: Configure container for use with meta-data service, defaults to no
125+[ -T | --tarball ]: Location of tarball
126+[ -d | --debug ]: Run with 'set -x' to debug errors
127+
128+Options, mutually exclusive of "-C" and "--cloud":
129+ [ -i | --hostid ]: HostID for cloud-init, defaults to random string
130+ [ -u | --userdata ]: Cloud-init user-data file to configure container on start
131+ [ -S | --auth-key ]: SSH Public key file to inject into container
132+ [ -L | --nolocales ]: Do not copy host's locales into container
133+
134+EOF
135+ return 0
136+}
137+
138+options=$(getopt -o a:hp:r:n:Fi:CLS:T:d -l arch:,help,path:,release:,name:,flush-cache,hostid:,auth-key:,cloud,no_locales,tarball:,debug -- "$@")
139+if [ $? -ne 0 ]; then
140+ usage $(basename $0)
141+ exit 1
142+fi
143+eval set -- "$options"
144+
145+release=lucid
146+if [ -f /etc/lsb-release ]; then
147+ . /etc/lsb-release
148+ case "$DISTRIB_CODENAME" in
149+ lucid|maverick|natty|oneiric|precise)
150+ release=$DISTRIB_CODENAME
151+ ;;
152+ esac
153+fi
154+
155+arch=$(arch)
156+
157+# Code taken from debootstrap
158+if [ -x /usr/bin/dpkg ] && /usr/bin/dpkg --print-architecture >/dev/null 2>&1; then
159+ arch=`/usr/bin/dpkg --print-architecture`
160+elif type udpkg >/dev/null 2>&1 && udpkg --print-architecture >/dev/null 2>&1; then
161+ arch=`/usr/bin/udpkg --print-architecture`
162+else
163+ arch=$(arch)
164+ if [ "$arch" = "i686" ]; then
165+ arch="i386"
166+ elif [ "$arch" = "x86_64" ]; then
167+ arch="amd64"
168+ elif [ "$arch" = "armv7l" ]; then
169+ # note: arm images don't exist before oneiric; are called armhf in
170+ # precise; and are not supported by the query, so we don't actually
171+ # support them yet (see check later on). When Query2 is available,
172+ # we'll use that to enable arm images.
173+ arch="armel"
174+ fi
175+fi
176+
177+debug=0
178+hostarch=$arch
179+cloud=0
180+locales=1
181+flushcache=0
182+while true
183+do
184+ case "$1" in
185+ -h|--help) usage $0 && exit 0;;
186+ -p|--path) path=$2; shift 2;;
187+ -n|--name) name=$2; shift 2;;
188+ -F|--flush-cache) flushcache=1; shift 1;;
189+ -r|--release) release=$2; shift 2;;
190+ -a|--arch) arch=$2; shift 2;;
191+ -i|--hostid) host_id=$2; shift 2;;
192+ -u|--userdata) userdata=$2; shift 2;;
193+ -C|--cloud) cloud=1; shift 1;;
194+ -S|--auth-key) auth_key=$2; shift 2;;
195+ -L|--no_locales) locales=0; shift 2;;
196+ -T|--tarball) tarball=$2; shift 2;;
197+ -d|--debug) debug=1; shift 1;;
198+ --) shift 1; break ;;
199+ *) break ;;
200+ esac
201+done
202+
203+if [ $debug -eq 1 ]; then
204+ set -x
205+fi
206+
207+if [ "$arch" == "i686" ]; then
208+ arch=i386
209+fi
210+
211+if [ $hostarch = "i386" -a $arch = "amd64" ]; then
212+ echo "can't create amd64 container on i386"
213+ exit 1
214+fi
215+
216+if [ $arch != "i386" -a $arch != "amd64" ]; then
217+ echo "Only i386 and amd64 are supported by the ubuntu cloud template."
218+ exit 1
219+fi
220+
221+if [ -z "$path" ]; then
222+ echo "'path' parameter is required"
223+ exit 1
224+fi
225+
226+if [ "$(id -u)" != "0" ]; then
227+ echo "This script should be run as 'root'"
228+ exit 1
229+fi
230+
231+rootfs=$path/rootfs
232+
233+type ubuntu-cloudimg-query
234+type wget
235+
236+# determine the url, tarball, and directory names
237+# download if needed
238+cache="/var/cache/lxc/cloud-$release"
239+
240+mkdir -p $cache
241+
242+if [ -n "$tarball" ]; then
243+ url2="$tarball"
244+else
245+ url1=`ubuntu-cloudimg-query $release released $arch --format "%{url}\n"`
246+ url2=`echo $url1 | sed -e 's/.tar.gz/-root\0/'`
247+fi
248+
249+filename=`basename $url2`
250+
251+buildcleanup()
252+{
253+ cd $rootfs
254+ umount -l $cache/$xdir || true
255+ rm -rf $cache
256+}
257+
258+# if the release doesn't have a *-rootfs.tar.gz, then create one from the
259+# cloudimg.tar.gz by extracting the .img, mounting it loopback, and creating
260+# a tarball from the mounted image.
261+build_root_tgz()
262+{
263+ url=$1
264+ filename=$2
265+
266+ xdir=`mktemp -d -p .`
267+ tarname=`basename $url`
268+ imgname="`basename $tarname .tar.gz`.img"
269+ trap buildcleanup EXIT
270+ if [ $flushcache -eq 1 -o ! -f $cache/$tarname ]; then
271+ rm -f $tarname
272+ echo "Downloading cloud image from $url"
273+ wget $url || { echo "Couldn't find cloud image $url."; exit 1; }
274+ fi
275+ echo "Creating new cached cloud image rootfs"
276+ tar zxf $tarname $imgname
277+ mount -o loop $imgname $xdir
278+ (cd $xdir; tar zcf ../$filename .)
279+ umount $xdir
280+ rm -f $tarname $imgname
281+ rmdir $xdir
282+ echo "New cloud image cache created"
283+ trap EXIT
284+}
285+
286+mkdir -p /var/lock/subsys/
287+(
288+ flock -n -x 200
289+
290+ cd $cache
291+ if [ $flushcache -eq 1 ]; then
292+ echo "Clearing the cached images"
293+ rm -f $filename
294+ fi
295+
296+ if [ ! -f $filename ]; then
297+ wget $url2 || build_root_tgz $url1 $filename
298+ fi
299+
300+ echo "Extracting container rootfs"
301+ mkdir -p $rootfs
302+ cd $rootfs
303+ tar -zxf $cache/$filename
304+
305+
306+ if [ $cloud -eq 0 ]; then
307+ echo "Configuring for running outside of a cloud environment"
308+ echo "If you want to configure for a cloud evironment, please use '-- -C' to create the container"
309+
310+ seed_d=$rootfs/var/lib/cloud/seed/nocloud-net
311+ rhostid=$(uuidgen | cut -c -8)
312+ host_id=${hostid:-$rhostid}
313+ mkdir -p $seed_d
314+
315+ cat > "$seed_d/meta-data" <<EOF
316+instance_id: lxc-$host_id
317+EOF
318+
319+ rm $rootfs/etc/hostname
320+
321+ if [ $locales -eq 1 ]; then
322+ cp /usr/lib/locale/locale-archive $rootfs/usr/lib/locale/locale-archive
323+ fi
324+
325+
326+ if [ -n "$auth_key" -a -f "$auth_key" ]; then
327+ u_path="/home/ubuntu/.ssh"
328+ root_u_path="$rootfs/$u_path"
329+ mkdir -p $root_u_path
330+ cp $auth_key "$root_u_path/authorized_keys"
331+ chroot $rootfs chown -R ubuntu: "$u_path"
332+
333+ echo "Inserted SSH public key from $auth_key into /home/ubuntu/.ssh/authorized_keys"
334+ fi
335+
336+ if [ ! -f $userdata ]; then
337+ cp $userdata $data_d/user-data
338+ else
339+
340+ if [ -z "$MIRROR" ]; then
341+ MIRROR="http://archive.ubuntu.com/ubuntu"
342+ fi
343+
344+ cat > "$seed_d/user-data" <<EOF
345+#cloud-config
346+output: {all: '| tee -a /var/log/cloud-init-output.log'}
347+apt-mirror: $MIRROR
348+manage_etc_hosts: localhost
349+locale: $(/usr/bin/locale | awk -F= '/LANG=/ {print$NF}')
350+EOF
351+
352+ fi
353+
354+ chroot $rootfs /usr/sbin/usermod -U ubuntu
355+ echo "ubuntu:ubuntu" | chroot $rootfs chpasswd
356+ echo "Please login as user ubuntu with password ubuntu."
357+
358+ else
359+
360+ echo "Configured for running in a cloud environment."
361+ echo "If you do not have a meta-data service, this container will likely be useless."
362+
363+ fi
364+
365+) 200>/var/lock/subsys/lxc-ubucloud
366+
367+copy_configuration $path $rootfs $name $arch
368+
369+echo "Container $name created."
370+exit 0
371
372=== added file 'debian/patches/0059-reenable-daily-cloudimg'
373--- debian/patches/0059-reenable-daily-cloudimg 1970-01-01 00:00:00 +0000
374+++ debian/patches/0059-reenable-daily-cloudimg 2012-03-17 09:44:19 +0000
375@@ -0,0 +1,65 @@
376+Description: re-enable use of daily cloud images
377+ There are two types of cloud images - released and daily ones. We were
378+ always using daily ones, instead of using released by default with an
379+ option for daily. Fix that.
380+Author: Serge Hallyn <serge.hallyn@ubuntu.com>
381+Forwarded: yes
382+
383+Index: lxc/templates/lxc-ubuntu-cloud.in
384+===================================================================
385+--- lxc.orig/templates/lxc-ubuntu-cloud.in 2012-03-16 09:40:19.027008000 -0500
386++++ lxc/templates/lxc-ubuntu-cloud.in 2012-03-16 09:49:47.882037866 -0500
387+@@ -105,6 +105,7 @@
388+ [ -C | --cloud ]: Configure container for use with meta-data service, defaults to no
389+ [ -T | --tarball ]: Location of tarball
390+ [ -d | --debug ]: Run with 'set -x' to debug errors
391++[ -s | --stream]: Use specified stream rather than 'released'
392+
393+ Options, mutually exclusive of "-C" and "--cloud":
394+ [ -i | --hostid ]: HostID for cloud-init, defaults to random string
395+@@ -116,7 +117,7 @@
396+ return 0
397+ }
398+
399+-options=$(getopt -o a:hp:r:n:Fi:CLS:T:d -l arch:,help,path:,release:,name:,flush-cache,hostid:,auth-key:,cloud,no_locales,tarball:,debug -- "$@")
400++options=$(getopt -o a:hp:r:n:Fi:CLS:T:ds: -l arch:,help,path:,release:,name:,flush-cache,hostid:,auth-key:,cloud,no_locales,tarball:,debug,stream: -- "$@")
401+ if [ $? -ne 0 ]; then
402+ usage $(basename $0)
403+ exit 1
404+@@ -160,6 +161,7 @@
405+ cloud=0
406+ locales=1
407+ flushcache=0
408++stream="released"
409+ while true
410+ do
411+ case "$1" in
412+@@ -176,6 +178,7 @@
413+ -L|--no_locales) locales=0; shift 2;;
414+ -T|--tarball) tarball=$2; shift 2;;
415+ -d|--debug) debug=1; shift 1;;
416++ -s|--stream) stream=$2; shift 2;;
417+ --) shift 1; break ;;
418+ *) break ;;
419+ esac
420+@@ -199,6 +202,11 @@
421+ exit 1
422+ fi
423+
424++if [ "$stream" != "daily" -a "$stream" != "released" ]; then
425++ echo "Only 'daily' and 'released' streams are supported"
426++ exit 1
427++fi
428++
429+ if [ -z "$path" ]; then
430+ echo "'path' parameter is required"
431+ exit 1
432+@@ -223,7 +231,7 @@
433+ if [ -n "$tarball" ]; then
434+ url2="$tarball"
435+ else
436+- url1=`ubuntu-cloudimg-query $release released $arch --format "%{url}\n"`
437++ url1=`ubuntu-cloudimg-query $release $stream $arch --format "%{url}\n"`
438+ url2=`echo $url1 | sed -e 's/.tar.gz/-root\0/'`
439+ fi
440+
441
442=== renamed file 'debian/patches/0059-reenable-daily-cloudimg' => 'debian/patches/0059-reenable-daily-cloudimg.moved'

Subscribers

People subscribed via source and target branches

to all changes: