Merge lp:~smoser/maas-images/trunk.dyn-netconf-krd-only into lp:maas-images

Proposed by Scott Moser
Status: Rejected
Rejected by: Scott Moser
Proposed branch: lp:~smoser/maas-images/trunk.dyn-netconf-krd-only
Merge into: lp:maas-images
Diff against target: 87 lines (+19/-37)
2 files modified
bin/kpack-from-image (+11/-35)
bin/maas-cloudimg2ephemeral (+8/-2)
To merge this branch: bzr merge lp:~smoser/maas-images/trunk.dyn-netconf-krd-only
Reviewer Review Type Date Requested Status
maintainers of maas images Pending
Review via email: mp+337606@code.launchpad.net

Commit message

Add cloud-initramfs-dyn-netconf in initramfs generation.

The package cloud-initramfs-dyn-netconf is not needed inside the image.
For releases less than bionic, leave it there. In those releases it
was either always installed (xenial) or installed via the ubuntu-server
meta-package.

For bionic, it is not needed in the image, and was removed from the
ubuntu-server seed and meta-package.

Thus, for bionic, we have to add it in the initramfs generation.
The mechanism for doing so that is added ensures it is added if not
present.

To post a comment you must log in.
393. By Scott Moser

Add cloud-initramfs-dyn-netconf in initramfs generation.

The package cloud-initramfs-dyn-netconf is not needed inside the image.
For releases less than bionic, leave it there. In those releases it
was either always installed (xenial) or installed via the ubuntu-server
meta-package.

For bionic, it is not needed in the image, and was removed from the
ubuntu-server seed and meta-package.

Thus, for bionic, we have to add it in the initramfs generation.
The mechanism for doing so that is added ensures it is added if not
present.

This change is actually not meaningful if the squashfs image is
the one used in publication (maas v3 streams). But is meaningful
for v2 streams, where the maas-image build process produces
the root-image.gz.

394. By Scott Moser

much simpler installation of required packages.

Just let apt figure it out.

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

The first hunk of this (cloud-initramfs-dyn-netconf added)
got fixed under revno 392 (fdebb643909b4dc8d62453ce657f2705a038b29d).

The remaining chunk is a simplification for sure. but Im' not going to push on that now.

Unmerged revisions

394. By Scott Moser

much simpler installation of required packages.

Just let apt figure it out.

393. By Scott Moser

Add cloud-initramfs-dyn-netconf in initramfs generation.

The package cloud-initramfs-dyn-netconf is not needed inside the image.
For releases less than bionic, leave it there. In those releases it
was either always installed (xenial) or installed via the ubuntu-server
meta-package.

For bionic, it is not needed in the image, and was removed from the
ubuntu-server seed and meta-package.

Thus, for bionic, we have to add it in the initramfs generation.
The mechanism for doing so that is added ensures it is added if not
present.

This change is actually not meaningful if the squashfs image is
the one used in publication (maas v3 streams). But is meaningful
for v2 streams, where the maas-image build process produces
the root-image.gz.

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 2018-01-06 02:12:26 +0000
3+++ bin/kpack-from-image 2018-02-13 18:21:38 +0000
4@@ -307,43 +307,19 @@
5 { skip_update=false; debug 1 "enabling update due to proposed"; }
6 fi
7
8- # trusty and wily do not have mdadm or lvm2 installed in the image
9- # but we want those modules included (LP: #1519470)
10- # the packages are expected to be in xenial already
11- case "$rel" in
12- precise|trusty|wily) pkgs=( lvm2 mdadm "${pkgs[@]}" );;
13- esac
14-
15 $skip_update || apt-get update -q ||
16 { error "apt-get update failed"; return 1; }
17
18- copymods="cloud-initramfs-copymods"
19- if [ -f /usr/share/initramfs-tools/hooks/copymods ]; then
20- debug 1 "package '$copymods' already installed."
21- else
22- apt-cache show $copymods >/dev/null 2>&1 ||
23- { error "package '$copymods' not available."; return 1; }
24- debug 1 "adding package '$copymods'."
25- pkgs=( "$copymods" "${pkgs[@]}" )
26- fi
27-
28- local rooturl="cloud-initramfs-rooturl"
29- if [ -f /usr/share/initramfs-tools/hooks/rooturl ]; then
30- debug 1 "package '$rooturl' already installed."
31- else
32- if ! apt-cache show $rooturl >/dev/null 2>&1; then
33- case "$rel" in
34- precise)
35- debug 1 "package '$rooturl' not available on '$rel'";;
36- *)
37- error "package '$rooturl' not available.";
38- return 1;;
39- esac
40- else
41- debug 1 "adding package '$rooturl' (LP: #1688606)."
42- pkgs=( "$rooturl" "${pkgs[@]}" )
43- fi
44- fi
45+ local reqpkgs=""
46+ reqpkgs=(
47+ lvm2 # LP: #1519470
48+ mvadm # LP: #1519470
49+ cloud-initramfs-copymods
50+ cloud-initramfs-rooturl # LP: #1688606
51+ cloud-initramfs-dyn-netconf # LP: #1749019
52+ # rooturl is not available in precise.
53+ $( [ "$rel" != "precise" ] && echo cloud-initramfs-rooturl )
54+ )
55
56 zzgrub=/etc/kernel/postinst.d/zz-update-grub
57 [ ! -x "$zzgrub" ] || chmod ugo-x $zzgrub
58@@ -374,7 +350,7 @@
59 vrun 1 "installing packages" \
60 env DEBIAN_FRONTEND=noninteractive FLASH_KERNEL_SKIP=1 \
61 $emd apt-get install --assume-yes --quiet \
62- "${pkgs[@]}" </dev/null
63+ "${pkgs[@]}" "${reqpkgs[@]}" </dev/null
64 [ $? -eq 0 ] ||
65 { error "failed install of ${pkgs[*]}"; return 1; }
66
67
68=== modified file 'bin/maas-cloudimg2ephemeral'
69--- bin/maas-cloudimg2ephemeral 2018-02-12 22:10:35 +0000
70+++ bin/maas-cloudimg2ephemeral 2018-02-13 18:21:38 +0000
71@@ -347,8 +347,14 @@
72 fi
73
74 # additional packages that we have to add
75- add_pkgs="cloud-initramfs-dyn-netconf" # LP: #1749019
76- add_pkgs="${add_pkgs} open-iscsi overlayroot"
77+ add_pkgs="open-iscsi overlayroot"
78+ case "$release" in
79+ precise|trusty|xenial|artful)
80+ # initrd still adds cloud-initramfs-dyn-netconf. But not needed
81+ # in the root image (LP: 1749019).
82+ add_pkgs="${add_pkgs} cloud-initramfs-dyn-netconf";;
83+ esac
84+
85 if [ -n "${add_packages}" ]; then
86 debug 1 "add_packages=$add_packages (from M2E_ADD_PACKAGES)"
87 add_pkgs="${add_pkgs} ${add_packages}"

Subscribers

People subscribed via source and target branches