Merge lp:~smoser/maas-images/manifests into lp:maas-images

Proposed by Scott Moser
Status: Merged
Merged at revision: 247
Proposed branch: lp:~smoser/maas-images/manifests
Merge into: lp:maas-images
Diff against target: 140 lines (+30/-14)
3 files modified
bin/fake-maas-cloudimg2eph2 (+19/-11)
bin/maas-cloudimg2eph2 (+6/-1)
meph2/commands/cloudimg_sync.py (+5/-2)
To merge this branch: bzr merge lp:~smoser/maas-images/manifests
Reviewer Review Type Date Requested Status
maintainers of maas images Pending
Review via email: mp+276909@code.launchpad.net

Commit message

Add manifest files for root-image.gz

This adds manifest files similar to cloud image manifests.
These are nice to have, and also will help in testing things later
as we have some changes coming where we'll want to easily compare image contents.

To post a comment you must log in.

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
=== modified file 'bin/fake-maas-cloudimg2eph2'
--- bin/fake-maas-cloudimg2eph2 2015-02-13 21:20:35 +0000
+++ bin/fake-maas-cloudimg2eph2 2015-11-06 21:12:31 +0000
@@ -4,7 +4,7 @@
4error() { echo "$@" 1>&2; }4error() { echo "$@" 1>&2; }
55
6short_opts="a:k:p:v"6short_opts="a:k:p:v"
7long_opts="arch:,kernel:,krd-pack:,verbose"7long_opts="arch:,kernel:,krd-pack:,manifest:,verbose"
8getopt_out=$(getopt --name "${0##*/}" \8getopt_out=$(getopt --name "${0##*/}" \
9 --options "${short_opts}" --long "${long_opts}" -- "$@") &&9 --options "${short_opts}" --long "${long_opts}" -- "$@") &&
10 eval set -- "${getopt_out}" ||10 eval set -- "${getopt_out}" ||
@@ -13,18 +13,20 @@
13gzip=true13gzip=true
14arch=""14arch=""
15kernel=""15kernel=""
16manif=""
16kpacks=( )17kpacks=( )
17while [ $# -ne 0 ]; do18while [ $# -ne 0 ]; do
18 cur=$119 cur=$1
19 next=$220 next=$2
20 case "$cur" in21 case "$cur" in
21 -a|--arch) arch="$next"; shift;;22 -a|--arch) arch="$next"; shift;;
22 -k|--kernel) kernel=$next; shift;;23 -k|--kernel) kernel=$next; shift;;
23 -p|--krd-pack) kpacks[${#kpacks[@]}]=$next; shift;;24 -p|--krd-pack) kpacks[${#kpacks[@]}]=$next; shift;;
24 --no-gzip) gzip=false;;25 --manifest) manif="$next"; shift;;
25 --) shift; break;;26 --no-gzip) gzip=false;;
26 esac27 --) shift; break;;
27 shift;28 esac
29 shift;
28done30done
2931
30src=$132src=$1
@@ -37,6 +39,12 @@
3739
38error "src=$src arch=$arch kernel=$kernel output=$root_gz"40error "src=$src arch=$arch kernel=$kernel output=$root_gz"
39dd if=/dev/zero bs=1024 count=1024 2>/dev/null | $gzip_prog > "$root_gz"41dd if=/dev/zero bs=1024 count=1024 2>/dev/null | $gzip_prog > "$root_gz"
42if [ -n "$manif" ]; then
43 npkg=10
44 for((i=0;i<$npkg;i++)); do
45 printf "bogus-package-%02d\t0.$((($npkg-$i)%$npkg))\n" "$i"
46 done > "$manif"
47fi
4048
41OIFS="$IFS"49OIFS="$IFS"
42for kpack in "${kpacks[@]}"; do50for kpack in "${kpacks[@]}"; do
4351
=== modified file 'bin/maas-cloudimg2eph2'
--- bin/maas-cloudimg2eph2 2015-10-26 19:07:07 +0000
+++ bin/maas-cloudimg2eph2 2015-11-06 21:12:31 +0000
@@ -20,6 +20,7 @@
20 -k | --kernel K keep/install the kernel package 'k' inside image20 -k | --kernel K keep/install the kernel package 'k' inside image
21 -p | --krd-pack P create a kernel / ramdisk pack21 -p | --krd-pack P create a kernel / ramdisk pack
22 P is ',' delimited: kernel-name,kernel,ramdisk[,flags]22 P is ',' delimited: kernel-name,kernel,ramdisk[,flags]
23 --manifest M write the dpkg manifest to M
23 -v | --verbose increase verbosity24 -v | --verbose increase verbosity
2425
25 Example:26 Example:
@@ -309,7 +310,7 @@
309310
310main() {311main() {
311 local short_opts="a:hk:p:v"312 local short_opts="a:hk:p:v"
312 local long_opts="arch:,help,kernel:,krd-pack:,no-gzip,verbose"313 local long_opts="arch:,help,kernel:,krd-pack:,manifest:,no-gzip,verbose"
313 local getopt_out=""314 local getopt_out=""
314 getopt_out=$(getopt --name "${0##*/}" \315 getopt_out=$(getopt --name "${0##*/}" \
315 --options "${short_opts}" --long "${long_opts}" -- "$@") &&316 --options "${short_opts}" --long "${long_opts}" -- "$@") &&
@@ -319,6 +320,7 @@
319 local cur="" next="" output="" gzip=true kpkg=""320 local cur="" next="" output="" gzip=true kpkg=""
320 local kpacks="" src_in="" src="" arch="" vflags=""321 local kpacks="" src_in="" src="" arch="" vflags=""
321 local working_space="1024M" zero_img="true" fs_img_size="1400M"322 local working_space="1024M" zero_img="true" fs_img_size="1400M"
323 local manifest_out=""
322 kpacks=( )324 kpacks=( )
323325
324 while [ $# -ne 0 ]; do326 while [ $# -ne 0 ]; do
@@ -327,6 +329,7 @@
327 -h|--help) Usage ; exit 0;;329 -h|--help) Usage ; exit 0;;
328 -a|--arch) arch="$next"; shift;;330 -a|--arch) arch="$next"; shift;;
329 -k|--kernel) kpkg=$next; shift;;331 -k|--kernel) kpkg=$next; shift;;
332 --manifest) manifest_out="$next";;
330 -p|--krd-pack) kpacks[${#kpacks[@]}]="$next"; shift;;333 -p|--krd-pack) kpacks[${#kpacks[@]}]="$next"; shift;;
331 --no-gzip) gzip=false;;334 --no-gzip) gzip=false;;
332 -v|--verbose) VERBOSITY=$((${VERBOSITY}+1)); vflags="${vflags}v";;335 -v|--verbose) VERBOSITY=$((${VERBOSITY}+1)); vflags="${vflags}v";;
@@ -404,6 +407,8 @@
404 ${arch:+"--arch=$arch"} "$imgfile" \407 ${arch:+"--arch=$arch"} "$imgfile" \
405 "$kpkg" "$pkout" "$piout" "$manif" ||408 "$kpkg" "$pkout" "$piout" "$manif" ||
406 { error "failed to turn $imgfile to ephemeral"; return 1; }409 { error "failed to turn $imgfile to ephemeral"; return 1; }
410 [ -z "$manifest_out" ] || cp "$manif" "$manifest_out" ||
411 { error "failed copying manifest to $manifest_out"; return 1; }
407412
408 local i="" oifs="$IFS"413 local i="" oifs="$IFS"
409 ddebug 1 "starting kpacks: ${kpacks[*]}"414 ddebug 1 "starting kpacks: ${kpacks[*]}"
410415
=== modified file 'meph2/commands/cloudimg_sync.py'
--- meph2/commands/cloudimg_sync.py 2015-09-11 14:15:58 +0000
+++ meph2/commands/cloudimg_sync.py 2015-11-06 21:12:31 +0000
@@ -46,6 +46,7 @@
46DI_COMMON = PATH_COMMON + "di/%(di_version)s/%(krel)s/%(flavor)s"46DI_COMMON = PATH_COMMON + "di/%(di_version)s/%(krel)s/%(flavor)s"
47PATH_FORMATS = {47PATH_FORMATS = {
48 'root-image.gz': PATH_COMMON + "%(version_name)s/root-image.gz",48 'root-image.gz': PATH_COMMON + "%(version_name)s/root-image.gz",
49 'manifest': PATH_COMMON + "%(version_name)s/root-image.manifest",
49 'boot-dtb': BOOT_COMMON + "/boot-dtb%(suffix)s",50 'boot-dtb': BOOT_COMMON + "/boot-dtb%(suffix)s",
50 'boot-kernel': BOOT_COMMON + "/boot-kernel%(suffix)s",51 'boot-kernel': BOOT_COMMON + "/boot-kernel%(suffix)s",
51 'boot-initrd': BOOT_COMMON + "/boot-initrd%(suffix)s",52 'boot-initrd': BOOT_COMMON + "/boot-initrd%(suffix)s",
@@ -259,13 +260,15 @@
259 'version_name': vername, 'version': version}260 'version_name': vername, 'version': version}
260261
261 rootimg_path = PATH_FORMATS['root-image.gz'] % subs262 rootimg_path = PATH_FORMATS['root-image.gz'] % subs
263 manifest_path = PATH_FORMATS['manifest'] % subs
262264
263 mci2e = os.environ.get('MAAS_CLOUDIMG2EPH2', "maas-cloudimg2eph2")265 mci2e = os.environ.get('MAAS_CLOUDIMG2EPH2', "maas-cloudimg2eph2")
264 gencmd = ([mci2e] + self.vflags +266 gencmd = ([mci2e] + self.vflags +
265 ["--kernel=%s" % builtin_kernel, "--arch=%s" % arch,267 ["--kernel=%s" % builtin_kernel, "--arch=%s" % arch,
268 "--manifest=%s" % os.path.join(self.out_d, manifest_path),
266 contentsource.url, os.path.join(self.out_d, rootimg_path)])269 contentsource.url, os.path.join(self.out_d, rootimg_path)])
267 krd_packs = []270 krd_packs = []
268 newpaths = set((rootimg_path,))271 newpaths = set((rootimg_path, manifest_path,))
269272
270 kdata_defaults = {'suffix': "", 'di-format': "default", 'dtb': ""}273 kdata_defaults = {'suffix': "", 'di-format': "default", 'dtb': ""}
271274
@@ -301,7 +304,7 @@
301 di_keys = ['di-kernel', 'di-initrd']304 di_keys = ['di-kernel', 'di-initrd']
302 boot_keys = ['boot-kernel', 'boot-initrd']305 boot_keys = ['boot-kernel', 'boot-initrd']
303 ikeys = ['boot-kernel', 'boot-initrd', 'di-kernel',306 ikeys = ['boot-kernel', 'boot-initrd', 'di-kernel',
304 'di-initrd', 'root-image.gz']307 'di-initrd', 'root-image.gz', 'manifest']
305308
306 if kdata.get('dtb'):309 if kdata.get('dtb'):
307 ikeys.append('di-dtb')310 ikeys.append('di-dtb')

Subscribers

People subscribed via source and target branches