linux-base-4.0ubuntu1/0000775000000000000000000000000012645503747011655 5ustar linux-base-4.0ubuntu1/lib/0000775000000000000000000000000012560306524012411 5ustar linux-base-4.0ubuntu1/lib/t/0000775000000000000000000000000012560306524012654 5ustar linux-base-4.0ubuntu1/lib/t/DebianLinux.t0000664000000000000000000000406312560306524015246 0ustar use strict; use warnings; use Test; use DebianLinux qw(version_cmp); BEGIN { plan test => 34; } # Simple numeric comparison ok(version_cmp('2', '2'), 0); ok(version_cmp('2', '3'), -1); ok(version_cmp('3', '2'), 1); # Multiple components ok(version_cmp('2.6.32', '2.6.32'), 0); ok(version_cmp('2.6.32', '2.6.33'), -1); ok(version_cmp('2.6.33', '2.6.32'), 1); # Extra components (non-numeric, non-pre-release) > null ok(version_cmp('2.6.32-local', '2.6.32-local'), 0); ok(version_cmp('2.6.32', '2.6.32-local'), -1); ok(version_cmp('2.6.32-local', '2.6.32'), 1); # Extra numeric components > null ok(version_cmp('2.6.32', '2.6.32.1'), -1); ok(version_cmp('2.6.32.1', '2.6.32'), 1); ok(version_cmp('2.6.32', '2.6.32-1'), -1); ok(version_cmp('2.6.32-1', '2.6.32'), 1); # Extra pre-release components < null ok(version_cmp('2.6.33-rc1', '2.6.33-rc1'), 0); ok(version_cmp('2.6.33-rc1', '2.6.33'), -1); ok(version_cmp('2.6.33', '2.6.33-rc1'), 1); ok(version_cmp('2.6.33-trunk', '2.6.33-trunk'), 0); ok(version_cmp('2.6.33-rc1', '2.6.33-trunk'), -1); ok(version_cmp('2.6.33-trunk', '2.6.33'), -1); # Pre-release < numeric ok(version_cmp('2.6.32-1', '2.6.32-trunk'), 1); ok(version_cmp('2.6.32-trunk', '2.6.32-1'), -1); # Pre-release < non-numeric non-pre-release ok(version_cmp('2.6.32-local', '2.6.32-trunk'), 1); ok(version_cmp('2.6.32-trunk', '2.6.32-local'), -1); # Pre-release cases including flavour (#761614) ok(version_cmp('2.6.33-trunk-flavour', '2.6.33-trunk-flavour'), 0); ok(version_cmp('2.6.33-rc1', '2.6.33-trunk-flavour'), -1); ok(version_cmp('2.6.33-rc1-flavour', '2.6.33-trunk-flavour'), -1); ok(version_cmp('2.6.32-1-flavour', '2.6.32-trunk-flavour'), 1); ok(version_cmp('2.6.32-trunk-flavour', '2.6.32-1-flavour'), -1); ok(version_cmp('2.6.32-local', '2.6.32-trunk-flavour'), 1); ok(version_cmp('2.6.32-trunk-flavour', '2.6.32-local'), -1); # Numeric < non-numeric non-pre-release ok(version_cmp('2.6.32-1', '2.6.32-local'), -1); ok(version_cmp('2.6.32-local', '2.6.32-1'), 1); # Hyphen < dot ok(version_cmp('2.6.32-2', '2.6.32.1'), -1); ok(version_cmp('2.6.32.1', '2.6.32-2'), 1); linux-base-4.0ubuntu1/lib/DebianLinux.pm0000664000000000000000000000525412560306524015157 0ustar # Copyright 2011 Ben Hutchings # # This program is free software; you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by # the Free Software Foundation; either version 2 of the License, or # (at your option) any later version. # # This program is distributed in the hope that it will be useful, # but WITHOUT ANY WARRANTY; without even the implied warranty of # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the # GNU General Public License for more details. # # You should have received a copy of the GNU General Public License # along with this program; if not, write to the Free Software # Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA package DebianLinux; use strict; use warnings; use POSIX qw(uname); BEGIN { use Exporter (); our @ISA = qw(Exporter); our @EXPORT_OK = qw(version_cmp image_list); } sub version_split { # Split into numbers and non-numeric strings, but break the non- # numeric strings at hyphens my $version = shift; return $version =~ /(?:\d+|-?[^-\d]*)/g; } sub version_cmp { my ($left_ver, $right_ver) = @_; my @left_comp = version_split($left_ver); my @right_comp = version_split($right_ver); for (my $i = 0; ; $i++) { my $left = $left_comp[$i]; my $right = $right_comp[$i]; # Do the components indicate pre-releases? my $left_pre = defined($left) && $left =~ /^-(?:rc|trunk)$/; my $right_pre = defined($right) && $right =~ /^-(?:rc|trunk)$/; # Are the components numeric? my $left_num = defined($left) && $left =~ /^\d+/; my $right_num = defined($right) && $right =~ /^\d+/; # Pre-releases sort before anything, even end-of-string if ($left_pre or $right_pre) { return -1 if !$right_pre; return 1 if !$left_pre; } # End-of-string sorts before anything else. # End-of-string on both sides means equality. if (!defined($left) or !defined($right)) { return -1 if defined($right); return defined($left) || 0; } # Use numeric comparison if both sides numeric. # Otherwise use ASCII comparison. if ($left_num && $right_num) { return -1 if $left < $right; return 1 if $left > $right; } else { # Note that '.' > '-' thus 2.6.x.y > 2.6.x-z for any y, z. return -1 if $left lt $right; return 1 if $left gt $right; } } } # Find kernel image name stem for this architecture my $image_stem; if ((uname())[4] =~ /^(?:mips|parisc|powerpc|ppc)/) { $image_stem = 'vmlinux'; } else { $image_stem = 'vmlinuz'; } sub image_list { my @results; my $prefix = "/boot/$image_stem-"; for (glob("$prefix*")) { push @results, [substr($_, length($prefix)), $_]; } return @results; } 1; linux-base-4.0ubuntu1/debian/0000775000000000000000000000000012645520350013064 5ustar linux-base-4.0ubuntu1/debian/compat0000664000000000000000000000000212560306524014263 0ustar 7 linux-base-4.0ubuntu1/debian/control0000664000000000000000000000123412645502703014471 0ustar Source: linux-base Section: kernel Priority: optional Maintainer: Debian Kernel Team Uploaders: Bastian Blank , Frederik Schüler , maximilian attems , Ben Hutchings Standards-Version: 3.9.6 Build-Depends: debhelper (>> 7) Vcs-Svn: svn://anonscm.debian.org/svn/kernel/dists/trunk/linux-base/ Vcs-Browser: http://anonscm.debian.org/viewvc/kernel/dists/trunk/linux-base/ Package: linux-base Architecture: all Depends: ${misc:Depends} Multi-Arch: foreign Description: Linux image base package This package contains files and support scripts for all Linux images. linux-base-4.0ubuntu1/debian/linux-base.manpages0000664000000000000000000000002412645503545016653 0ustar man/linux-version.1 linux-base-4.0ubuntu1/debian/NEWS0000664000000000000000000000152012560306524013562 0ustar linux-base (3) unstable; urgency=low * Some HP Smart Array controllers are now handled by the new 'hpsa' driver, rather than the 'cciss' driver. While the cciss driver presented disk device names beginning with 'cciss/', hpsa makes disk arrays appear as ordinary SCSI disks and presents device names beginning with 'sd'. In a system that already has other SCSI or SCSI-like devices, names may change unpredictably. During the upgrade from earlier versions, you will be prompted to update configuration files which refer to device names that may change. You can choose to do this yourself or to follow an automatic upgrade process. All changed configuration files are backed up with a suffix of '.old' (or '^old' in one case). -- Ben Hutchings Wed, 16 Mar 2011 13:19:34 +0000 linux-base-4.0ubuntu1/debian/linux-base.install0000664000000000000000000000007512645503541016530 0ustar bin/linux-version usr/bin lib/DebianLinux.pm usr/share/perl5 linux-base-4.0ubuntu1/debian/rules0000775000000000000000000000070412645503571014153 0ustar #!/usr/bin/make -f build: ifeq ($(filter nocheck,$(DEB_BUILD_OPTIONS)),) perl -Ilib -MTest::Harness -e 'runtests(@ARGV)' lib/t/*.t endif binary: binary-arch binary-indep binary-arch: binary-indep: dh_testdir dh_testroot dh_prep dh_install dh_installman dh_installdebconf dh_installchangelogs dh_installdocs dh_strip dh_compress dh_fixperms dh_perl dh_installdeb dh_shlibdeps dh_gencontrol dh_md5sums dh_builddeb clean: dh_clean linux-base-4.0ubuntu1/debian/changelog0000664000000000000000000001037212645520350014741 0ustar linux-base (4.0ubuntu1) xenial; urgency=low * Merge from Debian unstable. Remaining changes: - do not install /usr/bin/perf or perf.8 which are provided by linux-tools-common (LP: #1008713) -- Andy Whitcroft Wed, 13 Jan 2016 17:18:53 +0000 linux-base (4.0) unstable; urgency=low * Remove obsolete postinst upgrade code and translations (Closes: #580435, #660670, #670775, #686211, #686384, #686431, #686445, #686459, #686480, #686602, #686610, #686662, #686687, #686704, #686705, #686717, #686720, #686748, #698203) * Run version_cmp() unit tests at build time * linux-version: Fix sorting of version strings containing -trunk (Closes: #761614) * perf: Update error message for missing perf executable, to refer to linux-perf- for Linux 4.1 onward * debian/control: Drop support for pre-multiarch releases * debian/control: Update Vcs-* fields to use anonscm.debian.org * debian/control: Update policy version to 3.9.6; no changes required -- Ben Hutchings Tue, 04 Aug 2015 21:24:05 +0100 linux-base (3.5ubuntu4) quantal-proposed; urgency=low * Remove perf man page since its provided by (and conflicts with) linux-tools-common. -LP: #1008713 -- Tim Gardner Tue, 25 Sep 2012 14:24:56 -0600 linux-base (3.5ubuntu3) quantal; urgency=low * remove the postinst script, in ubuntu we did the UUID transition years ago and it does not seem to take u-boot into account as a bootloader. this results in a debconf error message on all arm systems. -- Thu, 31 May 2012 17:39:54 +0200 linux-base (3.5ubuntu2) quantal; urgency=low * Added 'Build-Depends: quilt' -- Tim Gardner Wed, 23 May 2012 13:54:16 -0600 linux-base (3.5ubuntu1) quantal; urgency=low * Added quilt patch support * Remove /usr/bin/perf from this package as it conflicts with the Ubuntu kernel tools package linux-tools-common (which provides the real /usr/bin/perf). I can think of no reason why this should cause a problem. /usr/bin/perf is kernel ABI version specific, therefore it can only be provided by the correct version of linux-tools-$version-$abi. debian/patches/0001-remove-bin-perf.patch -LP: #931353 -- Tim Gardner Wed, 23 May 2012 13:35:38 -0600 linux-base (3.5) unstable; urgency=low * debian/control: Set Multi-Arch: foreign to allow for installation of foreign linux-image packages -- Ben Hutchings Sun, 04 Mar 2012 15:21:57 +0000 linux-base (3.4) unstable; urgency=low * perf: Fix lookup of the real command and package names for official packages of Linux 3.1 onward and for custom kernels with stable updates -- Ben Hutchings Mon, 14 Nov 2011 05:42:35 +0000 linux-base (3.3) unstable; urgency=low * debian/control: Fix VCS URLs (Closes: #620609) * Update debconf template translations: - Slovak (Slavko) (Closes: #622118) - Dutch (Jeroen Schot) (Closes: #629389) * linux-version: Fix interpolation of command name in help, thanks to Jakub Wilk (Closes: #624795) * debian/postinst: Fix warning produced when checking a device that does not exist or has no recognisable filesystem (Closes: #620608) -- Ben Hutchings Mon, 04 Jul 2011 05:12:18 +0100 linux-base (3.2) unstable; urgency=low * Add the linux-version command, providing: - compare and sort operations on Linux kernel version strings - list of installed versions (and optionally the image paths) -- Ben Hutchings Fri, 01 Apr 2011 04:07:32 +0100 linux-base (3.1) unstable; urgency=low * Consider a boot-loader package as installed if it is only unpacked (Closes: #618958) -- Ben Hutchings Mon, 28 Mar 2011 04:54:52 +0100 linux-base (3) unstable; urgency=low * Update device names for the cciss/hpsa transition, similarly to the libata transition (Closes: #617256) -- Ben Hutchings Wed, 16 Mar 2011 13:15:05 +0000 linux-base (3~experimental) experimental; urgency=low * Separate linux-base from the linux-2.6 source package -- Ben Hutchings Sat, 12 Mar 2011 08:50:41 +0000 linux-base-4.0ubuntu1/debian/copyright0000664000000000000000000000303612560306524015022 0ustar Copyright 2010-2011 Ben Hutchings Catalan translation: Copyright 2010 Jordi Mallach Czech translation: Copyright 2010 Michal Simunek Danish translation: Copyright 2010 Joe Hansen German translation: Copyright 2010 Holger Wansing Spanish translation: Copyright 2010 Omar Campagne, Javier Fernández-Sanguino Estonian translation: Copyright 2010 mihkel French translation: Copyright 2010 Debian French l10n team Italian translation: Copyright 2010 Luca Bruno Japanese translation: Copyright 2010 Kenshi Muto, Nobuhiro Iwamatsu Portugese translation: Copyright 2010 Américo Monteiro Brazilian Portugese translation: Copyright 2010 Flamarion Jorge Russian translation: Copyright 2010 Yuri Kozlov Swedish translation: Copyright 2010 Martin Bagge Vietnamese translation: Copyright 2010 Clytie Siddall This package is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License version 2 as published by the Free Software Foundation. This package is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. You should have received a copy of the GNU General Public License along with this package; if not, write to the Free Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA On Debian systems, the complete text of the GNU General Public License version 2 can be found in `/usr/share/common-licenses/GPL-2'. linux-base-4.0ubuntu1/bin/0000775000000000000000000000000012560306524012413 5ustar linux-base-4.0ubuntu1/bin/perf0000664000000000000000000000132012560306524013266 0ustar #!/bin/bash # Execute the right version of perf for the current kernel. # Remove flavour or custom suffix and fix number of version components: # - For 2.6.x, use 3 components # - For 3.0 or 3.0.x, use 3.0.0 # - Otherwise, use 2 components version="$(uname -r)" version="${version%%-*}" case "$version" in 2.6.*.*) version="${version%.*}" ;; 2.6.*) ;; 3.0 | 3.0.*) version=3.0.0 ;; *.*.*) version="${version%.*}" ;; esac shopt -s execfail exec "perf_$version" "$@" # Not found? Tell the user which package to install. case "$version" in 2.6.* | 3.* | 4.0 | 4.0.*) package=linux-tools-$version ;; *) package=linux-perf-$version ;; esac echo >&2 "E: $package is not installed." exit 1 linux-base-4.0ubuntu1/bin/linux-version0000775000000000000000000000521012560306524015161 0ustar #!/usr/bin/perl # Copyright 2011 Ben Hutchings # # This program is free software; you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by # the Free Software Foundation; either version 2 of the License, or # (at your option) any later version. # # This program is distributed in the hope that it will be useful, # but WITHOUT ANY WARRANTY; without even the implied warranty of # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the # GNU General Public License for more details. # # You should have received a copy of the GNU General Public License # along with this program; if not, write to the Free Software # Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA use strict; use warnings; use DebianLinux qw(version_cmp image_list); sub usage { my $fh = shift; print $fh (<< "EOT"); Usage: $0 compare VERSION1 OP VERSION2 $0 sort [--reverse] [VERSION1 VERSION2 ...] $0 list [--paths] The version arguments should be kernel version strings as shown by 'uname -r' and used in filenames. The valid comparison operators are: lt le eq ge gt EOT } sub usage_error { usage(*STDERR{IO}); exit 2; } sub compare_versions { my %op_map = qw(lt < le <= eq == ge >= gt >); # Check arguments if (@_ != 3) { usage_error(); } my ($left, $op, $right) = @_; if (!exists($op_map{$op})) { usage_error(); } my $sign = version_cmp($left, $right); exit !eval("$sign ${op_map{$op}} 0"); } sub sort_versions { # Check for --reverse option my $sign = 1; if (@_ >= 1 and $_[0] eq '--reverse') { $sign = -1; shift; } # Collect versions from argv or stdin (with optional suffix after a space) my @versions; if (@_) { @versions = map({[$_, "\n"]} @_); } else { while () { /^([^ ]*)(.*\n?)$/ or die; push @versions, [$1, $2]; } } for (sort({version_cmp($a->[0], $b->[0]) * $sign} @versions)) { print @$_; } exit 0; } sub list_versions { my $show_paths; if (@_ == 1 and $_[0] eq '--paths') { $show_paths = 1; } elsif (@_ != 0) { usage_error(); } for (image_list()) { my ($version, $path) = @$_; if ($show_paths) { print "$version $path\n"; } else { print "$version\n"; } } exit 0; } if (@ARGV == 0) { usage_error(); } my $command = shift; if ($command eq 'help' or grep({$_ eq '--help'} $command, @ARGV)) { usage(*STDOUT{IO}); exit 0; } elsif ($command eq 'compare') { compare_versions(@ARGV); } elsif ($command eq 'sort') { sort_versions(@ARGV); } elsif ($command eq 'list') { list_versions(@ARGV); } usage_error(); linux-base-4.0ubuntu1/man/0000775000000000000000000000000012560306524012416 5ustar linux-base-4.0ubuntu1/man/perf.10000664000000000000000000000133112560306524013432 0ustar .TH PERF 1 "4 July 2010" .SH NAME perf \- performance analysis tools for Linux .SH SYNOPSIS .HP \fBperf\fR [\fB\-\-version\fR] [\fB\-\-help\fR] \fICOMMAND\fR [\fIARGS\fR] .SH DESCRIPTION .LP Performance counters for Linux are are a new kernel\-based subsystem that provide a framework for all things performance analysis. It covers hardware level (CPU/PMU, Performance Monitoring Unit) features and software features (software counters, tracepoints) as well. .LP Each version of the perf tools may depend on new kernel features, so you must install a different version for each kernel version. The \fBperf\fR command will automatically run the correct version for the running kernel version. .SH SEE ALSO perf_\fIversion\fR(1) linux-base-4.0ubuntu1/man/linux-version.10000664000000000000000000000346012560306524015325 0ustar .TH LINUX-VERSION 1 "30 March 2011" .SH NAME linux\-version \- operate on Linux kernel version strings .SH SYNOPSIS .HP .BI linux\-version\ compare \ VERSION1\ OP\ VERSION2 .HP .BR linux\-version\ sort \ [ \-\-reverse ] .RI [ VERSION1\ VERSION2 \ ...] .HP .BR linux\-version\ list \ [ \-\-paths ] .SH DESCRIPTION \fBlinux\-version\fR operates on Linux kernel version strings as reported by \fBuname -r\fR and used in file and directory names. These version strings do not follow the same rules as Debian package version strings and should not be compared as such or as arbitrary strings. .TP .BI compare \ VERSION1\ OP\ VERSION2 Compare version strings, where \fIOP\fP is a binary operator. \fBlinux\-version\fP returns success (zero result) if the specified condition is satisfied, and failure (nonzero result) otherwise. The valid operators are: \fBlt le eq ne ge gt\fP .TP \fBsort\fR [\fB\-\-reverse\fR] [\fIVERSION1 VERSION2\fR ...] Sort the given version strings and print them in order from lowest to highest. If the \fB\-\-reverse\fR option is used, print them in order from highest to lowest. .RS .PP If no version strings are given as arguments, the version strings will instead be read from standard input, one per line. They may be suffixed by arbitrary text after a space, which will be included in the output. This means that, for example: .PP .EX linux\-version list \-\-paths | linux\-version sort \-\-reverse .EE .PP will list the installed versions and corresponding paths in order from highest to lowest version. .RE .TP \fBlist\fR [\fB\-\-paths\fR] List kernel versions installed in the customary location. If the \fB\-\-paths\fR option, show the corresponding path for each version. .SH AUTHOR \fBlinux\-version\fR and this manual page were written by Ben Hutchings as part of the Debian \fBlinux\-base\fR package.