]>
Commit | Line | Data |
---|---|---|
fef4fb4a LO |
1 | #!/bin/bash |
2 | full_version=`uname -r` | |
3 | ||
4 | # First check for a fully qualified version. | |
5 | this="/usr/lib/linux-tools/$full_version/`basename $0`" | |
6 | if [ -f "$this" ]; then | |
7 | exec "$this" "$@" | |
8 | fi | |
9 | ||
10 | # Removing flavour from version i.e. generic or server. | |
11 | flavour_abi=${full_version#*-} | |
12 | flavour=${flavour_abi#*-} | |
13 | version=${full_version%-$flavour} | |
14 | this="$0_$version" | |
15 | if [ -f "$this" ]; then | |
16 | exec "$this" "$@" | |
17 | fi | |
18 | ||
19 | # Before saucy kernels we had no flavour linkage. | |
20 | if dpkg --compare-versions "$version" lt "3.11.0"; then | |
21 | flavour='' | |
22 | else | |
23 | flavour="-$flavour" | |
24 | fi | |
25 | # Hint at the cloud tools if they exist (trusty and later) | |
26 | if dpkg --compare-versions "$version" ge "3.13.0"; then | |
27 | cld="" | |
28 | else | |
29 | cld=":" | |
30 | fi | |
31 | # Work out if this is an LTS backport or not. | |
32 | codename=`lsb_release -cs` | |
33 | case "$codename" in | |
34 | precise) base='3.2.0-9999' ;; | |
35 | trusty) base='3.13.0-9999' ;; | |
36 | *) base='' ;; | |
37 | esac | |
38 | std="" | |
39 | lts=":" | |
40 | if [ "$base" != "" ]; then | |
41 | if dpkg --compare-versions "$version" gt "$base"; then | |
42 | std=":" | |
43 | lts="" | |
44 | fi | |
45 | fi | |
46 | ||
47 | # Give them a hint as to what to install. | |
48 | echo "WARNING: `basename $0` not found for kernel $version" >&2 | |
49 | echo "" >&2 | |
50 | echo " You may need to install the following packages for this specific kernel:" >&2 | |
51 | echo " linux-tools-$version$flavour" >&2 | |
52 | $cld echo " linux-cloud-tools-$version$flavour" >&2 | |
53 | echo "" >&2 | |
54 | echo " You may also want to install one of the following packages to keep up to date:" >&2 | |
55 | $std echo " linux-tools$flavour" >&2 | |
56 | $std $cld echo " linux-cloud-tools$flavour" >&2 | |
57 | $lts echo " linux-tools$flavour-lts-<series>" >&2 | |
58 | $lts $cld echo " linux-cloud-tools$flavour-lts-<series>" >&2 | |
59 | ||
60 | exit 2 |