Specify the linux-image-kvm kernel for ubuntu

This patch switches to using the linux-image-kvm kernel by default.
It produces images that are about 200MB smaller than ubuntu-minimal with
linux-image-generic by using the linux-image-kvm instead of the
linux-image-generic kernel.

Depends-On: https://review.opendev.org/666063
Change-Id: I4103bcbaab65ed5d7683d35aaf04955e59ed2471
This commit is contained in:
Michael Johnson 2019-06-17 21:59:12 -07:00
parent 09733a0c39
commit cd50ae5c0c
3 changed files with 22 additions and 4 deletions

View File

@ -107,7 +107,8 @@ Command syntax:
[-e]
[-f]
[-h]
[-i **ubuntu** | fedora | centos | rhel ]
[-i **ubuntu-minimal** | fedora | centos | rhel ]
[-k <kernel package name> ]
[-l <log file> ]
[-n]
[-o **amphora-x64-haproxy** | <filename> ]
@ -126,7 +127,8 @@ Command syntax:
'-e' enable complete mandatory access control systems when available (default: permissive)
'-f' disable tmpfs for build
'-h' display help message
'-i' is the base OS (default: ubuntu)
'-i' is the base OS (default: ubuntu-minimal)
'-k' is the kernel meta package name, currently only for ubuntu-minimal base OS (default: linux-image-kvm)
'-l' is output logfile (default: none)
'-n' disable sshd (default: enabled)
'-o' is the output image file name

View File

@ -28,6 +28,7 @@ usage() {
echo " [-f]"
echo " [-h]"
echo " [-i **ubuntu-minimal** | fedora | centos | rhel ]"
echo " [-k <kernel package name> ]"
echo " [-l <log file> ]"
echo " [-n]"
echo " [-o **amphora-x64-haproxy** | <filename> ]"
@ -46,7 +47,8 @@ usage() {
echo " '-e' enable complete mandatory access control systems when available (default: permissive)"
echo " '-f' disable tmpfs for build"
echo " '-h' display this help message"
echo " '-i' is the base OS (default: ubuntu)"
echo " '-i' is the base OS (default: ubuntu-minimal)"
echo " '-k' is the kernel meta package name, currently only for ubuntu-minimal base OS (default: linux-image-kvm)"
echo " '-l' is output logfile (default: none)"
echo " '-n' disable sshd (default: enabled)"
echo " '-o' is the output image file name"
@ -87,7 +89,7 @@ dib_enable_tracing=
AMP_LOGFILE=""
while getopts "a:b:c:d:efhi:l:no:pt:r:s:vw:x" opt; do
while getopts "a:b:c:d:efhi:k:l:no:pt:r:s:vw:x" opt; do
case $opt in
a)
AMP_ARCH=$OPTARG
@ -136,6 +138,9 @@ while getopts "a:b:c:d:efhi:l:no:pt:r:s:vw:x" opt; do
AMP_BASEOS="ubuntu-minimal"
fi
;;
k)
AMP_KERNEL=$OPTARG
;;
l)
AMP_LOGFILE="--logfile=$OPTARG"
;;
@ -215,6 +220,10 @@ AMP_IMAGETYPE=${AMP_IMAGETYPE:-"qcow2"}
AMP_IMAGESIZE=${AMP_IMAGESIZE:-2}
if [ "$AMP_BASEOS" = "ubuntu-minimal" ]; then
export DIB_UBUNTU_KERNEL=${AMP_KERNEL:-"linux-image-kvm"}
fi
AMP_DISABLE_SSHD=${AMP_DISABLE_SSHD:-0}
AMP_PACKAGE_INSTALL=${AMP_PACKAGE_INSTALL:-0}

View File

@ -0,0 +1,7 @@
---
features:
- |
The default kernel for the amphora image has switched from
linux-image-generic to linux-image-kvm, resulting in an image size
reduction of about 200MB. The linux-image-kvm kernel works with kvm,
qemu tcg, and Xen hypervisors among others.