[PATCH Precise SRU V2] UBUNTU: [Debian] Improve tools version message

Andy Whitcroft apw at canonical.com
Thu Dec 5 14:39:40 UTC 2013


On Wed, Dec 04, 2013 at 10:21:48AM -0700, Tim Gardner wrote:
> BugLink: http://bugs.launchpad.net/bugs/1257715
> 
> Signed-off-by: Tim Gardner <tim.gardner at canonical.com>
> ---
>  debian/tools/generic |   21 ++++++++++++++++++++-
>  1 file changed, 20 insertions(+), 1 deletion(-)
> 
> diff --git a/debian/tools/generic b/debian/tools/generic
> index 4aa5649..870e4cb 100644
> --- a/debian/tools/generic
> +++ b/debian/tools/generic
> @@ -24,7 +24,26 @@ if [ -d "/usr/lib/linux-tools/$full_version" ]; then
>  	exit 2
>  fi
>  
> +case `uname -r` in
> +	3.2.0-*) mpackage="linux-tools"
> +		case `uname -a` in
> +			*generic*) mflavour="-generic" ;;
> +			*virtual*) mflavour="-virtual" ;;

That will barf on the versions from other kernels like -lowlatency or
-ec2 or -powerpc64.

> +			*) echo "Unknown kernel flavour. Are you running an Ubuntu kernel ?" >&2
> +				exit 2
> +			;;
> +		esac
> +		;;
> +	3.5.0-*) mpackage="linux-tools-lts-quantal" ;;
> +	3.8.0-*) mpackage="linux-tools-lts-raring" ;;
> +	3.11.0-*) mpackage="linux-tools-lts-saucy" ;;
> +	3.13.0-*) mpackage="linux-tools-lts-trusty" ;;
> +	*)	echo "This does not appear to be an Ubuntu kernel"  >&2
> +		exit 2
> +		;;
> +esac
> +		
>  # Give them a hint as to what to install.
>  echo "`basename $0` not found for kernel $version" >&2
> -echo "You may need to install linux-tools-$version-$flavour" >&2
> +echo "You may need to install $mpackage$mflavour" >&2
>  exit 2


Installing linux-tools-lts-raring may be the right one for the series
you are on, but not the right one for the actual version you are
running.  For example if you are running a versions previosu to the tip,
installing the meta package will not be right.  The
linux-tools-version-flavour should always be right for the kernel you
have involved regardless.

So.  If you are doing this.  I think you actually want to say:

 linux-tools-$version-$flavour _and_ $mpackage...

Though note that -flavour only exists for saucy and trusty and not the
others.

-apw




More information about the kernel-team mailing list