Browse Source

Handle missing of package linux-image-extra-virtual

This package doesn't present at ec2 Ubuntu instance. Docker
installation may or may not work in this case. This commit
detect the presence of these packages and print a warning.

Change-Id: I2c5b4ed1446d63949be4d181da696933df4c64f8
Hongbin Lu 1 year ago
parent
commit
e39a806b9f
1 changed files with 5 additions and 1 deletions
  1. 5
    1
      devstack/lib/docker

+ 5
- 1
devstack/lib/docker View File

@@ -46,7 +46,11 @@ function install_docker {
46 46
     local dist_version=${os_CODENAME}
47 47
     local arch=$(dpkg --print-architecture)
48 48
     if is_ubuntu; then
49
-        apt_get install linux-image-extra-$(uname -r) linux-image-extra-virtual
49
+        if uname -r | grep -q -- '-generic' && dpkg -l 'linux-image-*-generic' | grep -qE '^ii|^hi' 2>/dev/null; then
50
+            apt_get install linux-image-extra-$(uname -r) linux-image-extra-virtual
51
+        else
52
+            warn $LINENO "Current kernel is not supported by the linux-image-extra-virtual package. Docker may not work."
53
+        fi
50 54
         apt_get install apt-transport-https ca-certificates software-properties-common
51 55
         curl -fsSL https://download.docker.com/linux/ubuntu/gpg | sudo apt-key add -
52 56
         sudo add-apt-repository -y \

Loading…
Cancel
Save