1
1
Patch created with './debian/update-sync-to-main ../trunk'
2
2
------------------------------------------------------------
4
committer: Scott Moser <smoser@ubuntu.com>
6
timestamp: Mon 2016-02-01 11:42:39 +0100
8
ubuntu-cloudimg-query: support arch input of 'powerpc' and 's390x'
10
cloud images are now available for s390 and support powerpc there also.
11
------------------------------------------------------------
13
committer: Scott Moser <smoser@ubuntu.com>
15
timestamp: Wed 2016-01-27 12:53:13 -0500
17
mount-image-callback: better waiting for devices
19
on power8 systems we were failing to mount partitioned images.
20
The reason was mostly that we were looking for nbd0p1 too quickly.
21
The change here is to wait with 'sfdisk' to return success on the
22
nbd device. That should then indicate it is ready to use.
24
We use it to determine if 'auto' (no --partition flag) should
25
be 0 or 1. We can then wait more intently for the block device
26
to appear as we know whether or not nbd0p1 *should* appear.
27
------------------------------------------------------------
4
29
committer: Scott Moser <smoser@ubuntu.com>
6
timestamp: Mon 2016-01-18 21:25:27 -0500
31
timestamp: Tue 2016-01-19 13:07:02 -0500
8
33
sync packaging with what is in xenial and split euca2ools pieces
572
597
Use --include-merged or -n0 to see merged revisions.
573
598
=== modified file 'ChangeLog'
574
599
--- old/ChangeLog 2013-03-27 13:10:52 +0000
575
+++ new/ChangeLog 2015-11-04 20:48:16 +0000
600
+++ new/ChangeLog 2016-02-01 10:42:39 +0000
578
603
+ - ubuntu-cloudimg-query: change default release to 'precise'
579
604
+ - growpart: fix some issues in error path reporting
610
635
+ - mount-image-callback: add '--mountpoint' flag to mount to an existing dir
611
636
+ - mount-image-callback: add '--overlay' to use overlayfs mounts
612
637
+ - mount-image-callback: use qemu-nbd --read-only for safer read only
638
+ - mount-image-callback: improved waiting for devices. part=auto now default.
639
+ - ubuntu-cloudimg-query: support arch input of 'powerpc' and 's390x'
615
642
- cloud-publish-image: add '--hook-img' flag to cloud-publish-image and
2225
2252
=== added file 'bin/mount-image-callback'
2226
2253
--- old/bin/mount-image-callback 1970-01-01 00:00:00 +0000
2227
+++ new/bin/mount-image-callback 2015-11-04 20:48:16 +0000
2254
+++ new/bin/mount-image-callback 2016-01-27 17:53:13 +0000
2254
2281
+ --read-only use read-only mount.
2255
2282
+ -m | --mountpoint MP mount to directory MP rather than a temp dir
2256
2283
+ --overlay mount via overlayfs
2257
+ -P | --partition PARTNUM mount partition PARTNUM (default 1)
2284
+ -P | --partition PARTNUM mount partition PARTNUM (default 'auto')
2285
+ if 'auto', then mount part 1 if image is
2286
+ partitioned otherwise mount image
2258
2287
+ -p | --proc bind mount /proc
2259
2288
+ -s | --sys bind mount /sys
2260
2289
+ -d | --dev bind mount /dev
2289
2318
+bad_Usage() { Usage 1>&2; [ $# -eq 0 ] || error "$@"; exit 1; }
2291
2320
+disconnect_qemu() {
2292
+ local out="" nbd="$1"
2321
+ [ -n "$QEMU_DISCONNECT" ] || return 0
2322
+ local out="" nbd="$QEMU_DISCONNECT"
2323
+ local pid="" pfile="/sys/block/${nbd#/dev/}/pid"
2324
+ { read pid < "$pfile" ; } >/dev/null 2>&1
2325
+ [ -n "$pid" -a ! -d "/proc/$pid" ] &&
2326
+ error "qemu-nbd process seems to have died. was '$pid'"
2293
2327
+ out=$(qemu-nbd --disconnect "$nbd" 2>&1) &&
2294
2328
+ QEMU_DISCONNECT="" || {
2295
2329
+ error "failed to disconnect $nbd";
2323
2357
+ debug 2 "umounts: ${UMOUNTS[*]}"
2324
2358
+ do_umounts "${UMOUNTS[@]}"
2326
+ if [ -n "$QEMU_DISCONNECT" ]; then
2328
+ out=$(qemu-nbd --disconnect "$QEMU_DISCONNECT" 2>&1) || {
2329
+ error "warning: failed: qemu-nbd --disconnect $QEMU_DISCONNECT"
2333
2361
+ [ -z "${TEMP_D}" -o ! -d "${TEMP_D}" ] ||
2334
2362
+ rm --one-file-system -Rf "${TEMP_D}" ||
2335
2363
+ error "removal of temp dir failed!"
2380
+ # return in _RET the 'auto' partition for a image.
2381
+ # return partition number for a partitioned image
2382
+ # return 0 for unpartitioned
2383
+ # return 0 if image is partitioned, 1 if not
2385
+ out=$(LANG=C sfdisk --list -uS "$img" 2>&1) || {
2386
+ error "failed determining if partitioned: $out";
2389
+ if echo "$out" | grep -q 'Device.*Start.*End'; then
2351
2396
+mount_callback_umount() {
2352
2397
+ local img_in="$1" dev="" out="" mp="" ret="" img="" readonly=""
2353
+ local opts="" bmounts="" system_resolvconf=false ptnum=1
2398
+ local opts="" bmounts="" system_resolvconf=false ptnum=auto
2354
2399
+ local cd_mountpoint=false fmt="" mp_is_tmp=false overlay=false
2355
2400
+ local img_mp="" workd=""
2514
+ debug 1 "connected $img_in ($fmt) to $nbd. now udev-settling"
2560
+ debug 1 "connected $img_in ($fmt) to $nbd. waiting for device."
2562
+ while i=$(($i+1)):; do
2563
+ get_partition "$nbd" && nptnum="$_RET" && break
2564
+ [ $i -eq 40 ] && {
2565
+ error "gave up on $nbd"
2568
+ [ $(($i%10)) -eq 0 ] &&
2569
+ debug 1 "waiting for $nbd to be ready."
2515
2573
+ udevadm settle >/dev/null 2>&1
2518
+ if [ -b "${nbd}p${ptnum}" ]; then
2574
+ if [ "${ptnum}" = "auto" ]; then
2575
+ if [ "$nptnum" = "0" ]; then
2576
+ debug 1 "unpartitioned disk."
2578
+ debug 1 "partitioned disk."
2582
+ if [ "$ptnum" -ne 0 ]; then
2519
2583
+ mdev="${nbd}p${ptnum}"
2589
+ [ -b "$mdev" ] && break
2591
+ [ $i -eq 100 ] && {
2592
+ error "gave up on waiting for $mdev"
2595
+ [ $(($i%10)) -eq 0 ] &&
2596
+ debug 1 "waiting for $mdev part=$ptnum to be ready."
2521
2600
+ if ( set -f; mount ${ro:+-o ${ro}} $opts "$mdev" "$img_mp" ) &&
2522
2601
+ UMOUNTS[${#UMOUNTS[@]}]="$img_mp"; then
2523
2602
+ debug 1 "mounted $mdev via qemu-nbd $nbd"
2609
2687
=== modified file 'bin/ubuntu-cloudimg-query'
2610
2688
--- old/bin/ubuntu-cloudimg-query 2013-02-04 16:32:56 +0000
2611
+++ new/bin/ubuntu-cloudimg-query 2015-03-11 18:12:55 +0000
2689
+++ new/bin/ubuntu-cloudimg-query 2016-02-01 10:42:39 +0000
2612
2690
@@ -5,7 +5,8 @@
2613
2691
NAME="ubuntu-cloudimg-query"
2614
2692
DOT_D="$HOME/.$NAME"
2658
2736
daily) stream=${i};;
2659
2737
server|desktop) bname=${i};;
2660
2738
- i386|amd64|x86_64) arch=${i}; [ "${i}" = "x86_64" ] && arch="amd64";;
2661
+ i386|amd64|x86_64|armhf|ppc64el|arm64)
2739
+ i386|amd64|x86_64|armhf|ppc64el|arm64|s390x|powerpc)
2663
2741
+ [ "${i}" = "x86_64" ] && arch="amd64";;
2664
2742
*-*-[0-9]) region=${i};;