Fixes #10859
Signed-off-by: Matt Bentley <mbentley@mbentley.net>
| ... | ... |
@@ -125,14 +125,21 @@ case "$lsb_dist" in |
| 125 | 125 |
|
| 126 | 126 |
# aufs is preferred over devicemapper; try to ensure the driver is available. |
| 127 | 127 |
if ! grep -q aufs /proc/filesystems && ! $sh_c 'modprobe aufs'; then |
| 128 |
- kern_extras="linux-image-extra-$(uname -r)" |
|
| 128 |
+ if uname -r | grep -q -- '-generic' && dpkg -l 'linux-image-*-generic' | grep -q '^ii' 2>/dev/null; then |
|
| 129 |
+ kern_extras="linux-image-extra-$(uname -r) linux-image-extra-virtual" |
|
| 129 | 130 |
|
| 130 |
- apt_get_update |
|
| 131 |
- ( set -x; $sh_c 'sleep 3; apt-get install -y -q '"$kern_extras" ) || true |
|
| 131 |
+ apt_get_update |
|
| 132 |
+ ( set -x; $sh_c 'sleep 3; apt-get install -y -q '"$kern_extras" ) || true |
|
| 132 | 133 |
|
| 133 |
- if ! grep -q aufs /proc/filesystems && ! $sh_c 'modprobe aufs'; then |
|
| 134 |
- echo >&2 'Warning: tried to install '"$kern_extras"' (for AUFS)' |
|
| 135 |
- echo >&2 ' but we still have no AUFS. Docker may not work. Proceeding anyways!' |
|
| 134 |
+ if ! grep -q aufs /proc/filesystems && ! $sh_c 'modprobe aufs'; then |
|
| 135 |
+ echo >&2 'Warning: tried to install '"$kern_extras"' (for AUFS)' |
|
| 136 |
+ echo >&2 ' but we still have no AUFS. Docker may not work. Proceeding anyways!' |
|
| 137 |
+ ( set -x; sleep 10 ) |
|
| 138 |
+ fi |
|
| 139 |
+ else |
|
| 140 |
+ echo >&2 'Warning: current kernel is not supported by the linux-image-extra-virtual' |
|
| 141 |
+ echo >&2 ' package. We have no AUFS support. Consider installing the packages' |
|
| 142 |
+ echo >&2 ' linux-image-virtual kernel and linux-image-extra-virtual for AUFS support.' |
|
| 136 | 143 |
( set -x; sleep 10 ) |
| 137 | 144 |
fi |
| 138 | 145 |
fi |