Merge lp:~smoser/maas-images/trunk.lp1688606-add-rooturl into lp:maas-images

Proposed by Scott Moser
Status: Merged
Merged at revision: 373
Proposed branch: lp:~smoser/maas-images/trunk.lp1688606-add-rooturl
Merge into: lp:maas-images
Diff against target: 49 lines (+24/-5)
1 file modified
bin/kpack-from-image (+24/-5)
To merge this branch: bzr merge lp:~smoser/maas-images/trunk.lp1688606-add-rooturl
Reviewer Review Type Date Requested Status
Blake Rouse (community) Approve
Review via email: mp+323914@code.launchpad.net

Commit message

bin/kpack-from-image: install rooturl if not already installed.

This modifies the build of the initramfs so that they include
cloud-initramfs-rooturl. It will fail if that package is not available.

cloud-initramfs-rooturl is marked for SRU to current releases under
bug 1688606.

The code will install the package in precise if it is available but
not fail if not available. On other releases that is fatal.

To post a comment you must log in.
Revision history for this message
Scott Moser (smoser) wrote :

This should be good to merge as soon as bug 1688606 lets the rooturl package into the archive for each supported release.

Revision history for this message
Blake Rouse (blake-rouse) wrote :

Looks good. Any timeline on precise? Or what did we decide to do with precise?

review: Approve
Revision history for this message
Scott Moser (smoser) wrote :

I believe we decided not to do precise.
Users who want to use precise will need to do so with an older MAAS.

That could change, but it would then require SRU to precise of that package also.

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1=== modified file 'bin/kpack-from-image'
2--- bin/kpack-from-image 2017-05-05 16:17:17 +0000
3+++ bin/kpack-from-image 2017-05-11 14:49:35 +0000
4@@ -289,11 +289,30 @@
5
6 copymods="cloud-initramfs-copymods"
7 if [ -f /usr/share/initramfs-tools/hooks/copymods ]; then
8- error "$copymods already installed"
9- copymods=""
10+ debug 1 "package '$copymods' already installed."
11 else
12 apt-cache show $copymods >/dev/null 2>&1 ||
13- { error "copymods not available"; return 1; }
14+ { error "package '$copymods' not available."; return 1; }
15+ debug 1 "adding package '$copymods'."
16+ pkgs=( "$copymods" "${pkgs[@]}" )
17+ fi
18+
19+ local rooturl="cloud-initramfs-rooturl"
20+ if [ -f /usr/share/initramfs-tools/hooks/rooturl ]; then
21+ debug 1 "package '$rooturl' already installed."
22+ else
23+ if ! apt-cache show $rooturl >/dev/null 2>&1; then
24+ case "$rel" in
25+ precise)
26+ debug 1 "package '$rooturl' not available on '$rel'";;
27+ *)
28+ error "package '$rooturl' not available.";
29+ return 1;;
30+ esac
31+ else
32+ debug 1 "adding package '$rooturl' (LP: #1688606)."
33+ pkgs=( "$rooturl" "${pkgs[@]}" )
34+ fi
35 fi
36
37 zzgrub=/etc/kernel/postinst.d/zz-update-grub
38@@ -322,9 +341,9 @@
39 vrun 1 "installing packages" \
40 env DEBIAN_FRONTEND=noninteractive FLASH_KERNEL_SKIP=1 \
41 $emd apt-get install --assume-yes --quiet \
42- $copymods "${pkgs[@]}" </dev/null
43+ "${pkgs[@]}" </dev/null
44 [ $? -eq 0 ] ||
45- { error "failed install of $copymods ${pkgs[*]}"; return 1; }
46+ { error "failed install of ${pkgs[*]}"; return 1; }
47
48 undisable_services / ||
49 { error "failed to re-enable services after apt installs"; return 1; }

Subscribers

People subscribed via source and target branches