~ubuntu-branches/ubuntu/trusty/cloud-utils/trusty-201404031857

« back to all changes in this revision

Viewing changes to debian/patches/sync-to-trunk.patch

  • Committer: Scott Moser
  • Date: 2014-04-03 16:30:11 UTC
  • Revision ID: smoser@ubuntu.com-20140403163011-vbjvnapc54hwl069
* sync to trunk at revno 259
  * fix mount-image-callback args --dev, --sys, or --proc (LP: #1302052)
  * ubuntu-ec2-run: know about more instance types
  * growpart: better --dry-run output for gpt disks

Show diffs side-by-side

added added

removed removed

Lines of Context:
1
 
Patch created with './debian/./update-sync-to-main ../trunk'
 
1
Patch created with './debian/update-sync-to-main ../trunk'
 
2
------------------------------------------------------------
 
3
revno: 259
 
4
fixes bug: https://launchpad.net/bugs/1302052
 
5
committer: Scott Moser <smoser@ubuntu.com>
 
6
branch nick: trunk
 
7
timestamp: Thu 2014-04-03 12:20:23 -0400
 
8
message:
 
9
  mount-image-callback: fix '--proc', '--sys', and '--dev'
 
10
  
 
11
  These didn't work as expected due to bad shell syntax.
 
12
------------------------------------------------------------
 
13
revno: 258
 
14
committer: Scott Moser <smoser@ubuntu.com>
 
15
branch nick: trunk
 
16
timestamp: Thu 2014-03-13 10:46:55 -0400
 
17
message:
 
18
  ubuntu-ec2-run: know about more instance types
 
19
------------------------------------------------------------
 
20
revno: 257
 
21
committer: Scott Moser <smoser@ubuntu.com>
 
22
branch nick: trunk
 
23
timestamp: Wed 2014-02-26 11:02:41 -0500
 
24
message:
 
25
  growpart: better --dry-run output for gpt disks
 
26
        
 
27
  provide the sgdisk command line that would be used.
2
28
------------------------------------------------------------
3
29
revno: 256
4
30
committer: Scott Moser <smoser@ubuntu.com>
323
349
Use --include-merged or -n0 to see merged revisions.
324
350
=== modified file 'ChangeLog'
325
351
--- old/ChangeLog       2013-03-27 13:10:52 +0000
326
 
+++ new/ChangeLog       2014-02-06 13:31:58 +0000
327
 
@@ -1,3 +1,30 @@
 
352
+++ new/ChangeLog       2014-03-13 14:46:55 +0000
 
353
@@ -1,3 +1,33 @@
328
354
+0.28
329
355
+ - ubuntu-cloudimg-query: change default release to 'precise'
330
356
+ - growpart: fix some issues in error path reporting
351
377
+ - ubuntu-cloudimg-query: allow 'ppc64el', 'arm64' as input. (LP: #1273769)
352
378
+ - ubuntu-cloudimg-query, ubuntu-ec2-run: know about trusty
353
379
+ - ubuntu-cloudimg-query: add '--arch' to specifically state the arch.
 
380
+ - growpart: better --dry-run output for gpt disks, providing sgdisk command
 
381
+   line that would be used.
 
382
+ - ubuntu-ec2-run: know about more instance types
354
383
+
355
384
 0.27
356
385
  - cloud-publish-image: add '--hook-img' flag to cloud-publish-image and
1310
1339
 
1311
1340
=== modified file 'bin/growpart'
1312
1341
--- old/bin/growpart    2013-03-21 08:40:05 +0000
1313
 
+++ new/bin/growpart    2013-12-11 19:57:19 +0000
 
1342
+++ new/bin/growpart    2014-02-26 16:02:41 +0000
1314
1343
@@ -63,9 +63,13 @@
1315
1344
                if ${RESTORE_FUNC} ; then
1316
1345
                        error "***** Appears to have gone OK ****"
1403
1432
        RESTORE_HUMAN="${pt_info}"
1404
1433
 
1405
1434
        debug 1 "$dev: original sgdisk info:"
1406
 
@@ -448,10 +465,18 @@
 
1435
@@ -357,6 +374,8 @@
 
1436
                fail "${dev}: failed to parse sgdisk details"
 
1437
 
 
1438
        debug 1 "${dev}: code=${code} guid=${guid} name='${name}'"
 
1439
+       local wouldrun=""
 
1440
+       [ "$DRY_RUN" -ne 0 ] && wouldrun="would-run"
 
1441
 
 
1442
        # Calculate the new size of the partition
 
1443
        new_size=$((${pt_max} - ${pt_start}))
 
1444
@@ -364,11 +383,8 @@
 
1445
        new="new: size=${new_size},end=${pt_max}"
 
1446
        change_info="${dev}: start=${pt_start} ${old} ${new}"
 
1447
        
 
1448
-       # Dry run
 
1449
-       [ "${DRY_RUN}" -ne 0 ] && change "${change_info}"
 
1450
-
 
1451
        # Backup the current partition table, we're about to modify it
 
1452
-       rq sgd_backup sgdisk "--backup=${GPT_BACKUP}" "${DISK}" ||
 
1453
+       rq sgd_backup $wouldrun sgdisk "--backup=${GPT_BACKUP}" "${DISK}" ||
 
1454
                fail "${dev}: failed to backup the partition table"
 
1455
 
 
1456
        # Modify the partition table. We do it all in one go (the order is
 
1457
@@ -379,16 +395,19 @@
 
1458
        #  - set the partition code
 
1459
        #  - set the partition GUID
 
1460
        #  - set the partition name
 
1461
-       rq sgdisk_mod sgdisk --move-second-header "--delete=${PART}" \
 
1462
+       rq sgdisk_mod $wouldrun sgdisk --move-second-header "--delete=${PART}" \
 
1463
                "--new=${PART}:${pt_start}:${pt_max}" \
 
1464
                "--typecode=${PART}:${code}" \
 
1465
                "--partition-guid=${PART}:${guid}" \
 
1466
                "--change-name=${PART}:${name}" "${DISK}" &&
 
1467
-               rq pt_update pt_update "$DISK" "$PART" || {
 
1468
+               rq pt_update $wouldrun pt_update "$DISK" "$PART" || {
 
1469
                RESTORE_FUNC=gpt_restore
 
1470
                fail "${dev}: failed to repartition"
 
1471
        }
 
1472
 
 
1473
+       # Dry run
 
1474
+       [ "${DRY_RUN}" -ne 0 ] && change "${change_info}"
 
1475
+
 
1476
        changed "${change_info}"
 
1477
 }
 
1478
 
 
1479
@@ -418,7 +437,20 @@
 
1480
        local label="$1" ret="" efile=""
 
1481
        efile="$TEMP_D/$label.err"
 
1482
        shift;
 
1483
-       debug 2 "running[$label][$_capture]" "$@"
 
1484
+
 
1485
+       local rlabel="running"
 
1486
+       [ "$1" = "would-run" ] && rlabel="would-run" && shift
 
1487
+
 
1488
+       local cmd="" x=""
 
1489
+       for x in "$@"; do
 
1490
+               [ "${x#* }" != "$x" -o "${x#* \"}" != "$x" ] && x="'$x'"
 
1491
+               cmd="$cmd $x"
 
1492
+       done
 
1493
+       cmd=${cmd# }
 
1494
+
 
1495
+       debug 2 "$rlabel[$label][$_capture]" "$cmd"
 
1496
+       [ "$rlabel" = "would-run" ] && return 0
 
1497
+
 
1498
        if [ "${_capture}" = "erronly" ]; then
 
1499
                "$@" 2>"$TEMP_D/$label.err"
 
1500
                ret=$?
 
1501
@@ -448,10 +480,18 @@
1407
1502
        fi
1408
1503
 
1409
1504
        if command -v partx >/dev/null 2>&1; then
1425
1520
        else
1426
1521
                reason="no 'partx' command"
1427
1522
                found="off"
1428
 
@@ -498,6 +523,8 @@
 
1523
@@ -498,6 +538,8 @@
1429
1524
        if ! $update; then
1430
1525
                return 0
1431
1526
        fi
1437
1532
 
1438
1533
=== added file 'bin/mount-image-callback'
1439
1534
--- old/bin/mount-image-callback        1970-01-01 00:00:00 +0000
1440
 
+++ new/bin/mount-image-callback        2013-08-27 19:37:56 +0000
 
1535
+++ new/bin/mount-image-callback        2014-04-03 16:20:23 +0000
1441
1536
@@ -0,0 +1,279 @@
1442
1537
+#!/bin/bash
1443
1538
+
1529
1624
+       while [ $# -ne 0 ]; do
1530
1625
+               cur=${1}; next=${2};
1531
1626
+               case "$cur" in
1532
 
+                       -d|--dev) bmounts="${bmounts:+${bmounts} /dev}";;
 
1627
+                       -d|--dev) bmounts="${bmounts:+${bmounts} }/dev";;
1533
1628
+                       -h|--help) Usage ; exit 0;;
1534
 
+                       -p|--proc) bmounts="${bmounts:+${bmounts} /proc}";;
1535
 
+                       -s|--sys) bmounts="${bmounts:+${bmounts} /sys}";;
 
1629
+                       -p|--proc) bmounts="${bmounts:+${bmounts} }/proc";;
 
1630
+                       -s|--sys) bmounts="${bmounts:+${bmounts} }/sys";;
1536
1631
+                          --system-mounts) bmounts="/dev /proc /sys";;
1537
1632
+                          --system-resolvconf) system_resolvconf=true;;
1538
1633
+                       -v|--verbose) VERBOSITY=$((${VERBOSITY}+1));;
1795
1890
 
1796
1891
=== modified file 'bin/ubuntu-ec2-run'
1797
1892
--- old/bin/ubuntu-ec2-run      2013-02-04 16:33:18 +0000
1798
 
+++ new/bin/ubuntu-ec2-run      2014-01-29 18:03:59 +0000
 
1893
+++ new/bin/ubuntu-ec2-run      2014-03-13 14:46:55 +0000
1799
1894
@@ -20,7 +20,7 @@
1800
1895
 #    along with this program.  If not, see <http://www.gnu.org/licenses/>.
1801
1896
 
1805
1900
 
1806
1901
 USAGE = """
1807
1902
 Usage: ubuntu-ec2-run [ options ] arguments
 
1903
@@ -76,6 +76,42 @@
 
1904
   "hvm", "paravirtual", "pv",
 
1905
 ]
 
1906
 
 
1907
+SSD = "ssd"
 
1908
+SPIN = "spin"
 
1909
+
 
1910
+# cleaned from http://aws.amazon.com/ec2/instance-types/
 
1911
+# (vcpu, compute-units, mem, disknum, disksize, diskback)
 
1912
+SIZE_DATA = {
 
1913
+    'm3.medium': (1,3,3.75,1,4,SSD),
 
1914
+    'm3.large': (2,6.5,7.5,1,32,SSD),
 
1915
+    'm3.xlarge': (4,13,15,2,40,SSD),
 
1916
+    'm3.2xlarge': (8,26,30,2,80,SSD),
 
1917
+    'm1.small': (1,1,1.7,1,160,SPIN),
 
1918
+    'm1.medium': (1,2,3.75,1,410,SPIN),
 
1919
+    'm1.large': (2,4,7.5,2,420,SPIN),
 
1920
+    'm1.xlarge': (4,8,15,4,420,SPIN),
 
1921
+    'c3.large': (2,7,3.75,2,16,SSD),
 
1922
+    'c3.xlarge': (4,14,7.5,2,40,SSD),
 
1923
+    'c3.2xlarge': (8,28,15,2,80,SSD),
 
1924
+    'c3.4xlarge': (16,55,30,2,160,SSD),
 
1925
+    'c3.8xlarge': (32,108,60,2,320,SSD),
 
1926
+    'c1.medium': (2,5,1.7,1,350,SPIN),
 
1927
+    'c1.xlarge': (8,20,7,4,420,SPIN),
 
1928
+    'cc2.8xlarge': (32,88,60.5,4,840,SPIN),
 
1929
+    'g2.2xlarge': (8,26,15,1,60,SSD),
 
1930
+    'cg1.4xlarge': (16,33.5,22.5,2,840,SPIN),
 
1931
+    'm2.xlarge': (2,6.5,17.1,1,420,SPIN),
 
1932
+    'm2.2xlarge': (4,13,34.2,1,850,SPIN),
 
1933
+    'm2.4xlarge': (8,26,68.4,2,840,SPIN),
 
1934
+    'cr1.8xlarge': (32,88,244,2,120,SSD),
 
1935
+    'i2.xlarge': (4,14,30.5,1,800,SSD),
 
1936
+    'i2.2xlarge': (8,27,61,2,800,SSD),
 
1937
+    'i2.4xlarge': (16,53,122,4,800,SSD),
 
1938
+    'i2.8xlarge': (32,104,244,8,800,SSD),
 
1939
+    'hs1.8xlarge': (16,35,117,2,2048,SPIN),
 
1940
+    'hi1.4xlarge': (16,35,60.5,2,1024,SSD),
 
1941
+    't1.micro': (1,.1,0.615,0x0,None),
 
1942
+}
 
1943
 
 
1944
 def get_argopt(args, optnames):
 
1945
     ret = None
 
1946
@@ -101,27 +137,13 @@
 
1947
 
 
1948
 
 
1949
 def get_block_device_mappings(itype):
 
1950
-    # cleaned from http://aws.amazon.com/ec2/instance-types/
 
1951
-    # t1.micro        0   # m1.large      850   # cg1.4xlarge  1690
 
1952
-    # m1.small      160   # m2.2xlarge    850   # m1.xlarge    1690
 
1953
-    # c1.medium     350   # c1.xlarge    1690   # m2.4xlarge   1690
 
1954
-    # m1.medium     410   # cc1.4xlarge  1690   # hi1.4xlarge  2048
 
1955
-    # m2.xlarge     420   # cc1.4xlarge  1690   # cc2.8xlarge  3370
 
1956
-    # m3.xlarge       0
 
1957
-    # m3.2xlarge      0
 
1958
     bdmaps = []
 
1959
-    if (itype in ("t1.micro", "m1.small", "c1.medium") or
 
1960
-        itype.startswith("m3.")):
 
1961
-        pass  # the first one is always attached. ephemeral0=sda2
 
1962
-    elif itype in ("m2.xlarge", "m1.medium"):
 
1963
-        bdmaps = ["/dev/sdb=ephemeral0"]
 
1964
-    elif (itype in ("m1.large", "m2.2xlarge", "hi1.4xlarge") or
 
1965
-          itype.startswith("cg1.") or itype.startswith("cc1.")):
 
1966
-        bdmaps = ["/dev/sdb=ephemeral0", "/dev/sdc=ephemeral1"]
 
1967
-    elif (itype in ("m1.xlarge", "m2.4xlarge", "c1.xlarge") or
 
1968
-          itype.startswith("cc2.8xlarge")):
 
1969
-        bdmaps = ["sdb=ephemeral0", "sdc=ephemeral1",
 
1970
-                  "sdd=ephemeral2", "sde=ephemeral3"]
 
1971
+    allmaps = ["/dev/sdb=ephemeral0", "/dev/sdc=ephemeral1",
 
1972
+               "/dev/sdd=ephemeral2", "/dev/sde=ephemeral3"]
 
1973
+    if itype in SIZE_DATA:
 
1974
+        (vcpu, ec2, mem, disknum, disksize, diskback) = SIZE_DATA[itype]
 
1975
+        bdmaps = allmaps[0:disknum]
 
1976
+
 
1977
     args = []
 
1978
     for m in bdmaps:
 
1979
         args.extend(("--block-device-mapping", m,))
1808
1980
 
1809
1981
=== added file 'bin/vcs-run'
1810
1982
--- old/bin/vcs-run     1970-01-01 00:00:00 +0000