]> git.proxmox.com Git - mirror_ubuntu-bionic-kernel.git/blame - debian/tools/generic
UBUNTU: [Packaging] Only install cloud init files when do_tools_common=true
[mirror_ubuntu-bionic-kernel.git] / debian / tools / generic
CommitLineData
0d34a427
LO
1#!/bin/bash
2full_version=`uname -r`
3
4# First check for a fully qualified version.
5this="/usr/lib/linux-tools/$full_version/`basename $0`"
6if [ -f "$this" ]; then
7 exec "$this" "$@"
8fi
9
10# Removing flavour from version i.e. generic or server.
11flavour_abi=${full_version#*-}
12flavour=${flavour_abi#*-}
13version=${full_version%-$flavour}
14this="$0_$version"
15if [ -f "$this" ]; then
16 exec "$this" "$@"
17fi
18
19# Before saucy kernels we had no flavour linkage.
20if dpkg --compare-versions "$version" lt "3.11.0"; then
21 flavour=''
22else
23 flavour="-$flavour"
24fi
25# Hint at the cloud tools if they exist (trusty and later)
26if dpkg --compare-versions "$version" ge "3.13.0"; then
27 cld=""
28else
29 cld=":"
30fi
31# Work out if this is an LTS backport or not.
32codename=`lsb_release -cs`
33case "$codename" in
34precise) base='3.2.0-9999' ;;
35trusty) base='3.13.0-9999' ;;
36*) base='' ;;
37esac
38std=""
39lts=":"
40if [ "$base" != "" ]; then
41 if dpkg --compare-versions "$version" gt "$base"; then
42 std=":"
43 lts=""
44 fi
45fi
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
60exit 2