Merge lp:~tribaal/livecd-rootfs/fix-ubuntu-ovf-attributes into lp:livecd-rootfs

Proposed by Chris Glass on 2017-01-13
Status: Merged
Merged at revision: 1459
Proposed branch: lp:~tribaal/livecd-rootfs/fix-ubuntu-ovf-attributes
Merge into: lp:livecd-rootfs
Diff against target: 115 lines (+42/-11)
4 files modified
live-build/ubuntu-cpc/hooks/041-vmdk-ova-image.binary (+20/-4)
live-build/ubuntu-cpc/hooks/042-vagrant.binary (+18/-5)
live-build/ubuntu-cpc/hooks/ovf/ubuntu-ova-v1-cloudcfg-vmdk.tmpl (+2/-1)
live-build/ubuntu-cpc/hooks/ovf/ubuntu-ova-v1-vmdk.tmpl (+2/-1)
To merge this branch: bzr merge lp:~tribaal/livecd-rootfs/fix-ubuntu-ovf-attributes
Reviewer Review Type Date Requested Status
Brian Murray 2017-01-13 Needs Information on 2017-02-15
Dan Watkins (community) Approve on 2017-01-19
Robert C Jennings (community) Approve on 2017-01-17
Philip Roche (community) Approve on 2017-01-13
Review via email: mp+314702@code.launchpad.net

Commit Message

This branch fixes the OVF's metadata to include Ubuntu-specific identifiers and descriptions instead of the generic linux ones (lp:1656293).

This applies to both the general image and the vagrant-specific one.

Description of the Change

This branch fixes the OVF creation attributes, using the OVF-specified ID and descriptions for Ubuntu 32 and 64 bits depending on the currently-built architecture.

To post a comment you must log in.
Philip Roche (philroche) wrote :

LGTM

review: Approve
Robert C Jennings (rcj) wrote :

+1 on the code changes. For the commit message I would like to see vmdk/ova mentioned, not just vagrant, plus the bug number.

review: Needs Fixing
1455. By Chris Glass on 2017-01-16

This branch fixes the OVF's metadata to include Ubuntu-specific identifiers and
descriptions instead of the generic linux ones (lp:1656293).

This applies to both the general image and the vagrant-specific one.

Chris Glass (tribaal) wrote :

Change commit message.

review: Needs Information
Robert C Jennings (rcj) wrote :

Chris, thanks for the commit msg change. I'm +1 once Dan's 'need info' comments are addressed.

Robert C Jennings (rcj) :
review: Needs Information
1456. By Chris Glass on 2017-01-17

Roll both switches on $ARCH into one, as suggested at review.

Robert C Jennings (rcj) wrote :

+1, thanks Chris

review: Approve
review: Approve
Brian Murray (brian-murray) wrote :

The changes to "041-vmdk-ova-image.binary" adds handling (well an error message) for arches other than amd64 or i386 but "042-vagrant.binary" does not. Was not adding an error message to 042-vagrant.binary deliberate?

review: Needs Information
1457. By Chris Glass on 2017-02-16

Rool both switches into one for all affected files (the vagrant file was still
doing two switches on $ARCH).

Chris Glass (tribaal) wrote :

> The changes to "041-vmdk-ova-image.binary" adds handling (well an error
> message) for arches other than amd64 or i386 but "042-vagrant.binary" does
> not. Was not adding an error message to 042-vagrant.binary deliberate?

Ah, good catch - I did collapse both switches on $ARCH into one for the vmdk hook, but forgot to do the same for the vagrant file (the same warning message was already in the file - just not in the diff).

It's functionally the same, but it's nicer now.

1458. By Chris Glass on 2017-02-16

Fixed template omission (found wile running a build withthis branch).

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1=== modified file 'live-build/ubuntu-cpc/hooks/041-vmdk-ova-image.binary'
2--- live-build/ubuntu-cpc/hooks/041-vmdk-ova-image.binary 2017-01-16 09:22:55 +0000
3+++ live-build/ubuntu-cpc/hooks/041-vmdk-ova-image.binary 2017-02-16 02:11:45 +0000
4@@ -9,11 +9,24 @@
5 #
6 # For this step, we re-use the VMDK's made in 040-vmdk-image.binary
7
8+
9+# Switch on $ARCH to determine which ID and description to use in the produced
10+# OVF. We have fancy Ubuntu-specific IDs in the OVF specification, we might as
11+# well use them.
12 case $ARCH in
13- amd64|i386) ;;
14- *) echo "OVA images are not supported for $ARCH yet.";
15- exit 0;;
16+ amd64)
17+ ovf_id=94
18+ ovf_os_type="ubuntu64Guest"
19+ ovf_desc_bits=64 ;;
20+ i386)
21+ ovf_id=93
22+ ovf_os_type="ubuntu32Guest"
23+ ovf_desc_bits=32 ;;
24+ *)
25+ echo "OVA images are not supported for $ARCH yet.";
26+ exit 0;;
27 esac
28+
29 cur_d=${PWD}
30 my_d=$(dirname $(readlink -f ${0}))
31
32@@ -57,7 +70,10 @@
33 -e "s/@@NUM_CPUS@@/2/g" \
34 -e "s/@@VERSION@@/${version}/g" \
35 -e "s/@@DATE@@/${serial_stamp}/g" \
36- -e "s/@@MEM_SIZE@@/1024/g"
37+ -e "s/@@MEM_SIZE@@/1024/g" \
38+ -e "s/@@OVF_ID@@/${ovf_id}/g" \
39+ -e "s/@@OVF_OS_TYPE@@/${ovf_os_type}/g" \
40+ -e "s/@@OVF_DESC_BITS@@/${ovf_desc_bits}/g"
41
42 # Get the checksums
43 vmdk_sha256=$(sha256sum ${vmdk_f} | cut -d' ' -f1)
44
45=== modified file 'live-build/ubuntu-cpc/hooks/042-vagrant.binary'
46--- live-build/ubuntu-cpc/hooks/042-vagrant.binary 2017-01-16 09:22:55 +0000
47+++ live-build/ubuntu-cpc/hooks/042-vagrant.binary 2017-02-16 02:11:45 +0000
48@@ -18,11 +18,21 @@
49 cur_d=${PWD}
50 my_d=$(dirname $(readlink -f ${0}))
51
52+# Switch on $ARCH to determine which ID and description to use in the produced
53+# OVF. We have fancy Ubuntu-specific IDs in the OVF specification, we might as
54+# well use them.
55 case $ARCH in
56- amd64|i386) ;;
57- *)
58- echo "Vagrant images are not supported for $ARCH"
59- exit 0
60+ amd64)
61+ ovf_id=94
62+ ovf_os_type="ubuntu64Guest"
63+ ovf_desc_bits=64 ;;
64+ i386)
65+ ovf_id=93
66+ ovf_os_type="ubuntu32Guest"
67+ ovf_desc_bits=32 ;;
68+ *)
69+ echo "Vagrant images are not supported for $ARCH"
70+ exit 0;;
71 esac
72
73 . /build/config/functions
74@@ -172,7 +182,10 @@
75 -e "s/@@NUM_CPUS@@/2/g" \
76 -e "s/@@VERSION@@/${version}/g" \
77 -e "s/@@DATE@@/${serial_stamp}/g" \
78- -e "s/@@MEM_SIZE@@/1024/g"
79+ -e "s/@@MEM_SIZE@@/1024/g" \
80+ -e "s/@@OVF_ID@@/${ovf_id}/g" \
81+ -e "s/@@OVF_OS_TYPE@@/${ovf_os_type}/g" \
82+ -e "s/@@OVF_DESC_BITS@@/${ovf_desc_bits}/g"
83
84 ovf_sha256=$(sha256sum ${ovf} | cut -d' ' -f1)
85
86
87=== modified file 'live-build/ubuntu-cpc/hooks/ovf/ubuntu-ova-v1-cloudcfg-vmdk.tmpl'
88--- live-build/ubuntu-cpc/hooks/ovf/ubuntu-ova-v1-cloudcfg-vmdk.tmpl 2015-11-12 21:49:25 +0000
89+++ live-build/ubuntu-cpc/hooks/ovf/ubuntu-ova-v1-cloudcfg-vmdk.tmpl 2017-02-16 02:11:45 +0000
90@@ -18,8 +18,9 @@
91 <VirtualSystem ovf:id="@@NAME@@">
92 <Info>A virtual machine</Info>
93 <Name>@@NAME@@</Name>
94- <OperatingSystemSection ovf:id="100" vmw:osType="other3xLinux64Guest">
95+ <OperatingSystemSection ovf:id="@@OVF_ID@@" vmw:osType="@@OVF_OS_TYPE@@">
96 <Info>The kind of installed guest operating system</Info>
97+ <Description>Ubuntu Linux (@@OVF_DESC_BITS@@-bit)</Description>
98 </OperatingSystemSection>
99
100 <ProductSection ovf:required="false">
101
102=== modified file 'live-build/ubuntu-cpc/hooks/ovf/ubuntu-ova-v1-vmdk.tmpl'
103--- live-build/ubuntu-cpc/hooks/ovf/ubuntu-ova-v1-vmdk.tmpl 2015-11-12 21:49:25 +0000
104+++ live-build/ubuntu-cpc/hooks/ovf/ubuntu-ova-v1-vmdk.tmpl 2017-02-16 02:11:45 +0000
105@@ -16,8 +16,9 @@
106 <VirtualSystem ovf:id="@@NAME@@">
107 <Info>A virtual machine</Info>
108 <Name>@@NAME@@</Name>
109- <OperatingSystemSection ovf:id="100" vmw:osType="other3xLinux64Guest">
110+ <OperatingSystemSection ovf:id="@@OVF_ID@@" vmw:osType="@@OVF_OS_TYPE@@">
111 <Info>The kind of installed guest operating system</Info>
112+ <Description>Ubuntu Linux (@@OVF_DESC_BITS@@-bit)</Description>
113 </OperatingSystemSection>
114
115 <ProductSection ovf:required="false">

Subscribers

People subscribed via source and target branches