Browse code

Update hack/install.sh with some more Ubuntu-specific installation stuff while we're still on AUFS (installing linux-image-extra-$(uname -r) when we can't find AUFS to try to find AUFS)

Tianon Gravi authored on 2013/10/20 14:40:28
Showing 1 changed files
... ...
@@ -75,16 +75,35 @@ case "$lsb_dist" in
75 75
 	Ubuntu|Debian)
76 76
 		export DEBIAN_FRONTEND=noninteractive
77 77
 		
78
-		# TODO remove this comment/section once device-mapper lands
79
-		echo 'Warning: Docker currently requires AUFS support in the kernel.'
80
-		echo 'Please ensure that your kernel includes such support.'
81
-		( set -x; sleep 10 )
78
+		did_apt_get_update=
79
+		apt_get_update() {
80
+			if [ -z "$did_apt_get_update" ]; then
81
+				( set -x; $sh_c 'sleep 3; apt-get update' )
82
+				did_apt_get_update=1
83
+			fi
84
+		}
85
+		
86
+		# TODO remove this section once device-mapper lands
87
+		if ! grep -q aufs /proc/filesystems && ! modprobe aufs; then
88
+			kern_extras="linux-image-extra-$(uname -r)"
89
+			
90
+			apt_get_update
91
+			( set -x; $sh_c 'sleep 3; apt-get install -y -q '"$kern_extras" ) || true
92
+			
93
+			if ! grep -q aufs /proc/filesystems && ! modprobe aufs; then
94
+				echo >&2 'Warning: tried to install '"$kern_extras"' (for AUFS)'
95
+				echo >&2 ' but we still have no AUFS.  Docker may not work. Proceeding anyways!'
96
+				( set -x; sleep 10 )
97
+			fi
98
+		fi
82 99
 		
83 100
 		if [ ! -e /usr/lib/apt/methods/https ]; then
84
-			( set -x; $sh_c 'sleep 3; apt-get update; apt-get install -y -q apt-transport-https' )
101
+			apt_get_update
102
+			( set -x; $sh_c 'sleep 3; apt-get install -y -q apt-transport-https' )
85 103
 		fi
86 104
 		if [ -z "$curl" ]; then
87
-			( set -x; $sh_c 'sleep 3; apt-get update; apt-get install -y -q curl' )
105
+			apt_get_update
106
+			( set -x; $sh_c 'sleep 3; apt-get install -y -q curl' )
88 107
 			curl='curl -sL'
89 108
 		fi
90 109
 		(