Commit 6cc28377 authored by Leann Ogasawara's avatar Leann Ogasawara Committed by Tim Gardner

UBUNTU: [debian] Initial debian and ubuntu directories

Ignore: yes
Signed-off-by: default avatarTim Gardner <tim.gardner@canonical.com>
parent 2134d97a
UBUNTU: Bump ABI
Ignore: yes
#
# This template is used for commit messages that don't need to
# show up in debian/changelog. Administrative stuff like config
# updates, ABI bumps, etc. Setting 'Ignore: yes' prevents
# 'debian/rules insertchanges' from inserting this commit meesage
# as a changelog entry.
#
# Please give a one-line description of the config change followed
# by a detailed explanation if necessary
UBUNTU: [Config] XXXX
# BugLink: http://bugs.launchpad.net/bugs/<enter bug# here>
# Ignore: yes
# Other text below here.
# Ubuntu external driver commit.
#
# NOTE: This gets reformatted for README.Ubuntu-External-Drivers and
# debian/changelog.
#
# This is only needed when a driver is added, updated or removed. It is
# not needed when patches or fixes are applied to the driver. If the
# driver is being removed, add the line:
#
# Removing: yes
#
# to the commit, and you can remove all other tags (except UBUNTU:).
#
UBUNTU:
ExternalDriver:
Description:
Url:
Mask:
Version:
UBUNTU: build/modules: Add modules that have intentionally gone missing
Ignore: yes
UBUNTU: Start new release
Ignore: yes
# Ubuntu commit template.
#
# NOTE: This gets reformatted for debian/changelog
#
#
# SAUCE refers to the fact that this patch might not go upstream, but we need to
# carry it to successive releases. In most cases you DONOT want to use this
# template.
#
# An example of a SAUCE patch is the ACPI DSDT-in-initramfs patch which has been
# refused upstream, but still provides useful functionality to users with broken
# BIOSes.
#
#-------------------------------------------------------------------------
#
# The initial UBUNTU is a flag that this is an Ubuntu commit. It will be
# referenced to the Author in the debian/changelog entry.
#
# The text following is the short message that will be placed in the
# changelog. Extra text on the following lines will be ignored, but left
# in the git commit. Lines with # will be ignored in the commit.
#
# OriginalAuthor allows for alternate attribution.
#
# OriginalLocation allows for a URL or description of where the patch came
# from.
#
# BugLink is a URL to a Malone bug.
#
# Ignore: yes will keep this commit from showing up in the changelog.
#
UBUNTU: SAUCE:
<Why is this patch not going upstream?>
# OriginalAuthor:
# OriginalLocation:
# BugLink: http://bugs.launchpad.net/bugs/<enter bug# here>
# Ignore: yes
# Other text below here.
# Ubuntu commit template.
#
# NOTE: This gets reformatted for debian/changelog
#
# The initial UBUNTU is a flag that this is an Ubuntu commit. It will be
# referenced to the Author in the debian/changelog entry.
#
# The text following is the short message that will be placed in the
# changelog. Extra text on the following lines will be ignored, but left
# in the git commit. Lines with # will be ignored in the commit.
#
# OriginalAuthor allows for alternate attribution.
#
# OriginalLocation allows for a URL or description of where the patch came
# from.
#
# BugLink is a URL to a Malone bug.
#
# Ignore: yes will keep this commit from showing up in the changelog.
#
UBUNTU: [Upstream]
# OriginalAuthor:
# OriginalLocation:
# BugLink: http://bugs.launchpad.net/bugs/<enter bug# here>
# Ignore: yes
# Other text below here.
#!/usr/bin/perl
# -*- Mode: Cperl -*-
# debian.postinst ---
# Author : Manoj Srivastava ( srivasta@pilgrim.umass.edu )
# Created On : Sat Apr 27 05:42:43 1996
# Created On Node : melkor.pilgrim.umass.edu
# Last Modified By : Manoj Srivastava
# Last Modified On : Sat Aug 5 13:20:22 2006
# Last Machine Used: glaurung.internal.golden-gryphon.com
# Update Count : 45
# Status : Unknown, Use with caution!
# HISTORY :
# Description :
#
#
#
# arch-tag: 1c716174-2f0a-476d-a626-a1322e62503a
#
$|=1;
# Predefined values:
my $version = "=V";
my $kimage = "=K";
my $package_name = "linux-image-$version";
# Ignore all invocations uxcept when called on to configure.
exit 0 unless ($ARGV[0] && $ARGV[0] =~ /configure/);
#known variables
my $image_dest = "/";
my $realimageloc = "/boot/";
my $silent_modules = '';
my $modules_base = '/lib/modules';
my $CONF_LOC = '/etc/kernel-img.conf';
# remove multiple leading slashes; make sure there is at least one.
$realimageloc =~ s|^/*|/|o;
$realimageloc =~ s|/+|/|o;
chdir '/usr/src' or die "Could not chdir to /usr/src:$!";
if (-r "$CONF_LOC" && -f "$CONF_LOC" ) {
if (open(CONF, "$CONF_LOC")) {
while (<CONF>) {
chomp;
s/\#.*$//g;
next if /^\s*$/;
$header_postinst_hook = "$1" if /^\s*header_postinst_hook\s*=\s*(\S+)/ig;
}
close CONF;
}
}
sub exec_script {
my $type = shift;
my $script = shift;
print STDERR "Running $type hook script $script.\n";
system ("$script $version $realimageloc$kimage-$version") &&
print STDERR "User $type hook script [$script] ";
if ($?) {
if ($? == -1) {
print STDERR "failed to execute: $!\n";
}
elsif ($? & 127) {
printf STDERR "died with signal %d, %s coredump\n",
($? & 127), ($? & 128) ? 'with' : 'without';
}
else {
printf STDERR "exited with value %d\n", $? >> 8;
}
exit $? >> 8;
}
}
sub run_hook {
my $type = shift;
my $script = shift;
if ($script =~ m,^/,) {
# Full path provided for the hook script
if (-x "$script") {
&exec_script($type,$script);
}
else {
die "The provided $type hook script [$script] could not be run.\n";
}
}
else {
# Look for it in a safe path
for my $path ('/bin', '/sbin', '/usr/bin', '/usr/sbin') {
if (-x "$path/$script") {
&exec_script($type, "$path/$script");
return 0;
}
}
# No luck
print STDERR "Could not find $type hook script [$script].\n";
die "Looked in: '/bin', '/sbin', '/usr/bin', '/usr/sbin'\n";
}
}
## Run user hook script here, if any
if (-x "$header_postinst_hook") {
&run_hook("postinst", $header_postinst_hook);
}
if (-d "/etc/kernel/header_postinst.d") {
print STDERR "Examining /etc/kernel/header_postinst.d.\n";
system ("run-parts --verbose --exit-on-error --arg=$version " .
"--arg=$realimageloc$kimage-$version " .
"/etc/kernel/header_postinst.d") &&
die "Failed to process /etc/kernel/header_postinst.d";
}
if (-d "/etc/kernel/header_postinst.d/$version") {
print STDERR "Examining /etc/kernel/header_postinst.d/$version.\n";
system ("run-parts --verbose --exit-on-error --arg=$version " .
"--arg=$realimageloc$kimage-$version " .
"/etc/kernel/header_postinst.d/$version") &&
die "Failed to process /etc/kernel/header_postinst.d/$version";
}
exit 0;
__END__
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
DEBIAN=debian.master
This README describes the reason for, and the use of, module
inclusion lists.
The original Hardy release had the notion of sub-flavours,
e.g., a flavour that was constructed as a subset of an existing flavour.
For example, the virtual flavour was extracted from the server flavour using
a subset of the server flavour modules. However, there were some difficult
mainteneance issues with regard to packaging, make rules, and scripts. This
re-implementation of the sub-flavours philosophy is hopefully simpler,
and retrofitable to all releases.
A module inclusion list looks at the problem of of constructing a package
from the perspective of what modules do we _want_ in the package, as opposed
to what modules we _don't_ want. As the kernel matures, more and more devices are added
which makes the problem of configuration maintenance a real pain in the ass.
If we took the approach of disabling all of the config options that we don't want,
then the differences between flavours will quickly become quite large, making
it difficult to quickly compare the individual flavour configs. Each time a
new config option is added then we also have to make a decision about disabling in
order to continue to keep the minimal number of modules.
A module inclusion list is applied on a per-flavour basis. For example,
debian.<BRANCH>/control.d/${flavour}.inclusion-list. For example, the
config for virtual is very close to server and generic, but the inclusion list
causes the virtual package to be constructed with _only_ the modules described
in the inclusion list.
The inclusion list format is a simple bash regular expression list of files. For example,
arch/*/{crypto,kernel,oprofile}
drivers/acpi/*
drivers/ata/ahci.ko
These 3 regular expression forms are suitable for expansion by bash and as inputs to 'find'.
See debian/scripts/module-inclusion for details.
There are 2 log files created as a side effect of the application of the module
inclusion list; $(flavour).inclusion-list.log and $(flavour).depmod.log.
$(flavour).inclusion-list.log : This log is created while the inclusion list
modules are being copied. If any are missing, then those warnings go in this log.
While its not considered a fatal error, you should endevour to correct your inclusion
list such that there are no missing modules.
$(flavour).depmod.log : The log is created as a result of running depmod on the
resulting set of modules. If there are missing symbols then you'll find that information
here. Again, you should modify your inclusion list such that there are no missing
symbols.
Tim Gardner <tim.gardner@canonical.com>
June 2, 2010
#!/usr/bin/make -f
#
# $(DEBIAN)/rules for Ubuntu linux
#
# Use this however you want, just give credit where credit is due.
#
# Copyright (c) 2007 Ben Collins <bcollins@ubuntu.com>
#
DEBIAN=$(shell awk -F= '($$1 == "DEBIAN") { print $$2 }' <debian/debian.env)
# dpkg-buildpackage passes options that are incomptatible
# with the kernel build.
unexport CFLAGS
unexport LDFLAGS
export LC_ALL=C
export SHELL=/bin/bash -e
# Where do we find the common configuration.
export DROOT=debian
# Common variables for all architectures
include $(DROOT)/rules.d/0-common-vars.mk
# Pull in some arch specific stuff
-include $(DEBIAN)/rules.d/$(arch).mk
# Maintainer targets
include $(DROOT)/rules.d/1-maintainer.mk
# Stages
ifeq ($(DEB_STAGE),stage1)
do_tools=false
do_doc_package=false
do_source_package=false
do_flavour_image_package=false
do_flavour_header_package=false
endif
# Debian Build System targets
binary: binary-indep binary-arch
build: build-arch build-indep
clean: debian/control
dh_testdir
dh_testroot
dh_clean
# d-i stuff
rm -rf $(DEBIAN)/d-i-$(arch)
# normal build junk
rm -rf $(DEBIAN)/abi/$(release)-$(revision)
rm -rf $(builddir)
rm -f $(stampdir)/stamp-*
rm -rf $(DEBIAN)/linux-*
# This gets rid of the d-i packages in control
cp -f $(DEBIAN)/control.stub $(DEBIAN)/control
cp $(DEBIAN)/changelog debian/changelog
# Install the copyright information.
cp $(DEBIAN)/copyright debian/copyright
distclean: clean
rm -rf $(DEBIAN)/control $(DEBIAN)/control.stub \
$(DEBIAN)/d-i/kernel-versions debian/changelog \
debian/control debian/control.stub debian/copyright
# Builds the image, arch headers and debug packages
include $(DROOT)/rules.d/2-binary-arch.mk
# Rules for building the udebs ($(DEBIAN)-installer)
include $(DROOT)/rules.d/5-udebs.mk
# Builds the source, doc and linux-headers indep packages
include $(DROOT)/rules.d/3-binary-indep.mk
# Various checks to be performed on builds
include $(DROOT)/rules.d/4-checks.mk
# Misc stuff
.PHONY: $(DEBIAN)/control.stub
$(DEBIAN)/control.stub: $(DEBIAN)/d-i/kernel-versions.in \
$(DROOT)/scripts/control-create \
$(DEBIAN)/control.stub.in \
$(DEBIAN)/changelog \
$(wildcard $(DEBIAN)/control.d/* $(DEBIAN)/sub-flavours/*.vars)
for i in $(DEBIAN)/d-i/kernel-versions.in $(DEBIAN)/control.stub.in; do \
new=`echo $$i | sed 's/\.in$$//'`; \
cat $$i | sed -e 's/PKGVER/$(release)/g' \
-e 's/ABINUM/$(abinum)/g' \
-e 's/SRCPKGNAME/$(src_pkg_name)/g' \
-e 's/=HUMAN=/$(human_arch)/g' \
> $$new; \
done
flavours="$(wildcard $(DEBIAN)/control.d/vars.* $(DEBIAN)/sub-flavours/*.vars)";\
for i in $$flavours; do \
$(SHELL) $(DROOT)/scripts/control-create $$i | \
sed -e 's/PKGVER/$(release)/g' \
-e 's/ABINUM/$(abinum)/g' \
-e 's/SRCPKGNAME/$(src_pkg_name)/g' \
-e 's/=HUMAN=/$(human_arch)/g' \
>> $(DEBIAN)/control.stub; \
done
cp $(DEBIAN)/control.stub $(DEBIAN)/control
.PHONY: debian/control
debian/control: $(DEBIAN)/control.stub
rm -rf $(builddir)/modules $(builddir)/firmware \
$(builddir)/kernel-versions $(builddir)/package-list \
$(builddir)/$(DEBIAN)
mkdir -p $(builddir)/modules/$(arch)/
cp $(DEBIAN)/d-i/modules/* $(builddir)/modules/$(arch)/
mkdir -p $(builddir)/firmware/$(arch)/
cp $(DEBIAN)/d-i/firmware/* $(builddir)/firmware/$(arch)/
cp $(DEBIAN)/d-i/package-list $(DEBIAN)/d-i/kernel-versions $(builddir)/
touch $(builddir)/modules/$(arch)/kernel-image
# kernel-wedge needs to poke around in $(DEBIAN)/
ln -nsf $(CURDIR)/debian $(builddir)/debian
# Some files may need to differ between architectures
if [ -d $(DEBIAN)/d-i/modules-$(arch) ]; then \
cp $(DEBIAN)/d-i/modules-$(arch)/* \
$(builddir)/modules/$(arch)/; \
fi
if [ -d $(DEBIAN)/d-i/firmware-$(arch) ]; then \
cp $(DEBIAN)/d-i/firmware-$(arch)/* \
$(builddir)/firmware/$(arch)/; \
fi
# Remove unwanted stuff for this architecture
if [ -r "$(DEBIAN)/d-i/exclude-modules.$(arch)" ]; then \
(cat $(DEBIAN)/d-i/exclude-modules.$(arch); \
ls $(builddir)/modules/$(arch)/) | sort | uniq -d | \
(cd $(builddir)/modules/$(arch)/; xargs rm -f); \
fi
if [ -r "$(DEBIAN)/d-i/exclude-firmware.$(arch)" ]; then \
(cat $(DEBIAN)/d-i/exclude-firmware.$(arch); \
ls $(builddir)/firmware/$(arch)/) | sort | uniq -d | \
(cd $(builddir)/firmware/$(arch)/; xargs rm -f); \
fi
# Per flavour module lists
flavour_modules=`ls $(DEBIAN)/d-i/modules.$(arch)-* 2>/dev/null` \
|| true; \
if [ "$$flavour_modules" != "" ]; then \
for flav in $$flavour_modules; do \
name=`echo $$flav | sed 's/.*\/modules.$(arch)-//'`; \
mkdir $(builddir)/modules/$(arch)-$$name; \
(cd $(builddir)/modules/; tar cf - `cat ../$$flav`) | \
(cd $(builddir)/modules/$(arch)-$$name/; tar xf -); \
touch $(builddir)/modules/$(arch)-$$name/kernel-image; \
done; \
fi
flavour_firmware=`ls $(DEBIAN)/d-i/firmware.$(arch)-* 2>/dev/null` \
|| true; \
if [ "$$flavour_firmware" != "" ]; then \
for flav in $$flavour_firmware; do \
name=`echo $$flav | sed 's/.*\/firmware.$(arch)-//'`; \
mkdir $(builddir)/firmware/$(arch)-$$name; \
(cd $(builddir)/firmware/; tar cf - `cat ../$$flav`) | \
(cd $(builddir)/firmware/$(arch)-$$name/; tar xf -);\
touch $(builddir)/firmware/$(arch)-$$name/kernel-image; \
done; \
fi
# Some files may need to differ between flavours
flavour_module_dirs=`ls -d $(DEBIAN)/d-i/modules-$(arch)-* 2>/dev/null`\
|| true; \
if [ "$$flavour_module_dirs" ]; then \
for flav in $$flavour_module_dirs; do \
name=`echo $$flav | sed 's/.*\/modules-$(arch)-//'`; \
[ -d $(builddir)/modules/$(arch)-$$name ] || \
cp -a $(builddir)/modules/$(arch) \
modules/$(arch)-$$name; \
cp $$flav/* $(builddir)/modules/$(arch)-$$name/; \
done; \
fi
flavour_firmware_dirs=`ls -d $(DEBIAN)/d-i/firmware-$(arch)-* 2>/dev/null`\
|| true; \
if [ "$$flavour_firmware_dirs" ]; then \
for flav in $$flavour_firmware_dirs; do \
name=`echo $$flav | sed 's/.*\/firmware-$(arch)-//'`; \
[ -d $(builddir)/firmware/$(arch)-$$name ] || \
cp -a $(builddir)/firmware/$(arch) \
firmware/$(arch)-$$name; \
cp $$flav/* $(builddir)/firmware/$(arch)-$$name/; \
done; \
fi
# Remove unwanted stuff for each flavour
flavour_exclude=`ls $(DEBIAN)/d-i/exclude-modules.$(arch)-* 2>/dev/null`\
|| true; \
if [ "$$flavour_exclude" ]; then \
for flav in $$flavour_exclude; do \
name=`echo $$flav | sed 's/.*\/exclude-modules.$(arch)-//'`;\
[ -d $(builddir)/modules/$(arch)-$$name ] || \
cp -a $(builddir)/modules/$(arch) \
$(builddir)/modules/$(arch)-$$name; \
(cat $$flav; \
ls $(builddir)/modules/$(arch)-$$name) | \
sort | uniq -d | \
(cd $(builddir)/modules/$(arch)-$$name/; \
xargs rm -f); \
done; \
fi
flavour_exclude=`ls $(DEBIAN)/d-i/exclude-firmware.$(arch)-* 2>/dev/null`\
|| true; \
if [ "$$flavour_exclude" ]; then \
for flav in $$flavour_exclude; do \
name=`echo $$flav | sed 's/.*\/exclude-firmware.$(arch)-//'`;\
[ -d $(builddir)/firmware/$(arch)-$$name ] || \
cp -a $(builddir)/firmware/$(arch) \
$(builddir)/firmware/$(arch)-$$name; \
(cat $$flav; \
ls $(builddir)/firmware/$(arch)-$$name) | \
sort | uniq -d | \
(cd $(builddir)/firmware/$(arch)-$$name/; \
xargs rm -f); \
done; \
fi
if [ ! -d $(builddir)/modules/$(build_arch) ]; then \
mkdir -p $(builddir)/modules/$(build_arch); \
cp $(builddir)/modules/$(arch)/* \
$(builddir)/modules/$(build_arch); \
fi
if [ ! -d $(builddir)/firmware/$(build_arch) ]; then \
mkdir -p $(builddir)/firmware/$(build_arch); \
cp $(builddir)/firmware/$(arch)/* \
$(builddir)/firmware/$(build_arch); \
fi
cp $(DEBIAN)/control.stub debian/control.stub
cd $(builddir) && kernel-wedge gen-control > $(CURDIR)/debian/control
#
# The source package name will be the first token from $(DEBIAN)/changelog
#
src_pkg_name=$(shell sed -n '1s/^\(.*\) (.*).*$$/\1/p' $(DEBIAN)/changelog)
# Get some version info
series := oneiric
release := $(shell sed -n '1s/^$(src_pkg_name).*(\(.*\)-.*).*$$/\1/p' $(DEBIAN)/changelog)
revisions := $(shell sed -n 's/^$(src_pkg_name)\ .*($(release)-\(.*\)).*$$/\1/p' $(DEBIAN)/changelog | tac)
revision ?= $(word $(words $(revisions)),$(revisions))
prev_revisions := $(filter-out $(revision),0.0 $(revisions))
prev_revision := $(word $(words $(prev_revisions)),$(prev_revisions))
family=ubuntu
# This is an internally used mechanism for the daily kernel builds. It
# creates packages whose ABI is suffixed with a minimal representation of
# the current git HEAD sha. If .git/HEAD is not present, then it uses the
# uuidgen program,
#
# AUTOBUILD can also be used by anyone wanting to build a custom kernel
# image, or rebuild the entire set of Ubuntu packages using custom patches
# or configs.
AUTOBUILD=
#
# This is a way to support some external variables. A good example is
# a local setup for ccache and distcc See LOCAL_ENV_CC and
# LOCAL_ENV_DISTCC_HOSTS in the definition of kmake.
# For example:
# LOCAL_ENV_CC="ccache distcc"
# LOCAL_ENV_DISTCC_HOSTS="localhost 10.0.2.5 10.0.2.221"
#
-include $(CURDIR)/../.$(series)-env
ifneq ($(AUTOBUILD),)
skipabi = true
skipmodule = true
skipdbg = true
gitver=$(shell if test -f .git/HEAD; then cat .git/HEAD; else uuidgen; fi)
gitverpre=$(shell echo $(gitver) | cut -b -3)
gitverpost=$(shell echo $(gitver) | cut -b 38-40)
abi_suffix = -$(gitverpre)$(gitverpost)
endif
ifneq ($(NOKERNLOG),)
ubuntu_log_opts += --no-kern-log
endif
ifneq ($(PRINTSHAS),)
ubuntu_log_opts += --print-shas
endif
# Get the kernels own extra version to be added to the release signature.
raw_kernelversion=$(shell make kernelversion)
#
# full_build -- are we doing a full buildd style build
#
ifeq ($(wildcard /CurrentlyBuilding),)
full_build?=false
else
full_build?=true
endif
#
# The debug packages are ginormous, so you probably want to skip
# building them (as a developer).
#
ifeq ($(full_build),false)
skipdbg=true
endif
abinum := $(shell echo $(revision) | sed -e 's/\..*//')$(abi_suffix)
prev_abinum := $(shell echo $(prev_revision) | sed -e 's/\..*//')$(abi_suffix)
abi_release := $(release)-$(abinum)
uploadnum := $(shell echo $(revision) | sed -e 's/.*\.//')
ifneq ($(full_build),false)
uploadnum := $(uploadnum)-Ubuntu
endif
# XXX: linux-libc-dev got bumped to -803.N inadvertantly by a ti-omap4 upload
# shift our version higher for this package only. Ensure this only
# occurs for the v2.6.35 kernel so that we do not propogate this into
# any other series.
raw_uploadnum := $(shell echo $(revision) | sed -e 's/.*\.//')
libc_dev_version :=
ifeq ($(DEBIAN),debian.master)
ifeq ($(release),2.6.35)
libc_dev_version := -v$(release)-$(shell expr "$(abinum)" + 1000).$(raw_uploadnum)
endif
endif
DEB_HOST_MULTIARCH = $(shell dpkg-architecture -qDEB_HOST_MULTIARCH)
DEB_HOST_GNU_TYPE = $(shell dpkg-architecture -qDEB_HOST_GNU_TYPE)
DEB_BUILD_GNU_TYPE = $(shell dpkg-architecture -qDEB_BUILD_GNU_TYPE)
DEB_HOST_ARCH = $(shell dpkg-architecture -qDEB_HOST_ARCH)
DEB_BUILD_ARCH = $(shell dpkg-architecture -qDEB_BUILD_ARCH)
#
# Detect invocations of the form 'fakeroot debian/rules binary arch=armel'
# within an x86'en schroot. This only gets you part of the way since the
# packaging phase fails, but you can at least compile the kernel quickly.
#
arch := $(DEB_HOST_ARCH)
ifneq ($(arch),$(DEB_HOST_ARCH))
CROSS_COMPILE ?= $(shell dpkg-architecture -a$(arch) -qDEB_HOST_GNU_TYPE -f 2>/dev/null)-
endif
#
# Detect invocations of the form 'dpkg-buildpackage -B -aarmel' within
# an x86'en schroot. This is the only way to build all of the packages
# (except for tools).
#
ifneq ($(DEB_BUILD_GNU_TYPE),$(DEB_HOST_GNU_TYPE))
CROSS_COMPILE ?= $(DEB_HOST_GNU_TYPE)-
endif
abidir := $(CURDIR)/$(DEBIAN)/abi/$(release)-$(revision)/$(arch)
prev_abidir := $(CURDIR)/$(DEBIAN)/abi/$(release)-$(prev_revision)/$(arch)
commonconfdir := $(CURDIR)/$(DEBIAN)/config
archconfdir := $(CURDIR)/$(DEBIAN)/config/$(arch)
sharedconfdir := $(CURDIR)/debian.master/config
builddir := $(CURDIR)/debian/build
stampdir := $(CURDIR)/debian/stamps
#
# The binary package name always starts with linux-image-$KVER-$ABI.$UPLOAD_NUM. There
# are places that you'll find linux-image hard coded, but I guess thats OK since the
# assumption that the binary package always starts with linux-image will never change.
#
bin_pkg_name=linux-image-$(abi_release)
extra_pkg_name=linux-image-extra-$(abi_release)
hdrs_pkg_name=linux-headers-$(abi_release)
#
# The generation of content in the doc package depends on both 'AUTOBUILD=' and
# 'do_doc_package_content=true'. There are usually build errors during the development
# cycle, so its OK to leave 'do_doc_package_content=false' until those build
# failures get sorted out. Finally, the doc package doesn't really need to be built
# for developer testing (its kind of slow), so only do it if on a buildd.
do_doc_package=true
do_doc_package_content=true
ifeq ($(full_build),false)
do_doc_package_content=false
endif
doc_pkg_name=$(src_pkg_name)-doc
#
# Similarly with the linux-source package, you need not build it as a developer. Its
# somewhat I/O intensive and utterly useless.
#
do_source_package=true
do_source_package_content=true
ifeq ($(full_build),false)
do_source_package_content=false
endif
# linux-libc-dev may not be needed, default to building it.
do_libc_dev_package=true
# common headers normally is built as an indep package, but may be arch
do_common_headers_indep=true
# add a 'full source' mode
do_full_source=false
# build tools
ifneq ($(wildcard $(CURDIR)/tools),)
ifeq ($(do_tools),)
ifneq ($(DEB_BUILD_GNU_TYPE),$(DEB_HOST_GNU_TYPE))
do_tools=false
endif
endif
do_tools?=true
else
do_tools?=false
endif
tools_pkg_name=$(src_pkg_name)-tools-$(abi_release)
tools_common_pkg_name=$(src_pkg_name)-tools-common
# The general flavour specific image package.
do_flavour_image_package=true
# The general flavour specific header package.
do_flavour_header_package=true
# Support parallel=<n> in DEB_BUILD_OPTIONS (see #209008)
#
# These 2 environment variables set the -j value of the kernel build. For example,
# CONCURRENCY_LEVEL=16 fakeroot $(DEBIAN)/rules binary-debs
# or
# DEB_BUILD_OPTIONS=parallel=16 fakeroot $(DEBIAN)/rules binary-debs
#
# The default is to use the number of CPUs.
#
COMMA=,
DEB_BUILD_OPTIONS_PARA = $(subst parallel=,,$(filter parallel=%,$(subst $(COMMA), ,$(DEB_BUILD_OPTIONS))))
ifneq (,$(DEB_BUILD_OPTIONS_PARA))
CONCURRENCY_LEVEL := $(DEB_BUILD_OPTIONS_PARA)
endif
ifeq ($(CONCURRENCY_LEVEL),)
# Check the environment
CONCURRENCY_LEVEL := $(shell echo $$CONCURRENCY_LEVEL)
# No? Then build with the number of CPUs on the host.
ifeq ($(CONCURRENCY_LEVEL),)
CONCURRENCY_LEVEL := $(shell expr `getconf _NPROCESSORS_ONLN` \* 1)
endif
# Oh hell, give 'em one
ifeq ($(CONCURRENCY_LEVEL),)
CONCURRENCY_LEVEL := 1
endif
endif
conc_level = -j$(CONCURRENCY_LEVEL)
# target_flavour is filled in for each step
kmake = make ARCH=$(build_arch) \
CROSS_COMPILE=$(CROSS_COMPILE) \
KERNELVERSION=$(abi_release)-$(target_flavour) \
CONFIG_DEBUG_SECTION_MISMATCH=y \
KBUILD_BUILD_VERSION="$(uploadnum)" \
LOCALVERSION= localver-extra=
ifneq ($(LOCAL_ENV_CC),)
kmake += CC=$(LOCAL_ENV_CC) DISTCC_HOSTS=$(LOCAL_ENV_DISTCC_HOSTS)
endif
# Locking is required in parallel builds to prevent loss of contents
# of the debian/files.
lockme_file = $(CURDIR)/debian/.LOCK
lockme_cmd = flock -w 60
lockme = $(lockme_cmd) $(lockme_file)
# The following targets are for the maintainer only! do not run if you don't
# know what they do.
.PHONY: printenv updateconfigs printchanges insertchanges startnewrelease diffupstream help updateportsconfigs editportsconfigs
help:
@echo "These are the targets in addition to the normal $(DEBIAN) ones:"
@echo
@echo " printenv : Print some variables used in the build"
@echo
@echo " updateconfigs : Update core arch configs"
@echo
@echo " editconfigs : Update core arch configs interractively"
@echo " genconfigs : Generate core arch configs in CONFIGS/*"
@echo
@echo " updateportsconfigs : Update ports arch configs"
@echo
@echo " editportsconfigs : Update ports arch configs interactivly"
@echo " genportconfigs : Generate ports arch configs in CONFIGS/*"
@echo
@echo " printchanges : Print the current changelog entries (from git)"
@echo
@echo " insertchanges : Insert current changelog entries (from git)"
@echo
@echo " startnewrelease : Start a new changelog set"
@echo
@echo " diffupstream : Diff stock kernel code against upstream (git)"
@echo
@echo " help : If you are kernel hacking, you need the professional"
@echo " version of this"
@echo
@echo "Environment variables:"
@echo
@echo " NOKERNLOG : Do not add upstream kernel commits to changelog"
@echo " CONCURRENCY_LEVEL=X"
@echo " : Use -jX for kernel compile"
@echo " PRINTSHAS : Include SHAs for commits in changelog"
printdebian:
@echo "$(DEBIAN)"
updateconfigs defaultconfigs editconfigs genconfigs dumpconfigs:
dh_testdir;
$(SHELL) $(DROOT)/scripts/misc/kernelconfig $@
rm -rf build
updateportsconfigs defaultportsconfigs editportsconfigs genportsconfigs askconfigs:
dh_testdir;
$(SHELL) $(DROOT)/scripts/misc/kernelconfig $@ ports
rm -rf build
printenv:
dh_testdir
@echo "src package name = $(src_pkg_name)"
@echo "release = $(release)"
@echo "revisions = $(revisions)"
@echo "revision = $(revision)"
@echo "uploadnum = $(uploadnum)"
@echo "prev_revisions = $(prev_revisions)"
@echo "prev_revision = $(prev_revision)"
@echo "abinum = $(abinum)"
@echo "gitver = $(gitver)"
@echo "flavours = $(flavours)"
@echo "skipabi = $(skipabi)"
@echo "skipmodule = $(skipmodule)"
@echo "skipdbg = $(skipdbg)"
@echo "ubuntu_log_opts = $(ubuntu_log_opts)"
@echo "CONCURRENCY_LEVEL = $(CONCURRENCY_LEVEL)"
@echo "bin package name = $(bin_pkg_name)"
@echo "hdr package name = $(hdrs_pkg_name)"
@echo "doc package name = $(doc_pkg_name)"
@echo "do_doc_package = $(do_doc_package)"
@echo "do_doc_package_content = $(do_doc_package_content)"
@echo "do_source_package = $(do_source_package)"
@echo "do_source_package_content = $(do_source_package_content)"
@echo "do_libc_dev_package = $(do_libc_dev_package)"
@echo "do_flavour_image_package = $(do_flavour_image_package)"
@echo "do_flavour_header_package = $(do_flavour_header_package)"
@echo "do_common_headers_indep = $(do_common_headers_indep)"
@echo "do_full_source = $(do_full_source)"
@echo "do_tools = $(do_tools)"
@echo "full_build = $(full_build)"
@echo "libc_dev_version = $(libc_dev_version)"
@echo "DEB_HOST_GNU_TYPE = $(DEB_HOST_GNU_TYPE)"
@echo "DEB_BUILD_GNU_TYPE = $(DEB_BUILD_GNU_TYPE)"
@echo "DEB_HOST_ARCH = $(DEB_HOST_ARCH)"
@echo "DEB_BUILD_ARCH = $(DEB_BUILD_ARCH)"
@echo "arch = $(arch)"
@echo "kmake = $(kmake)"
prev_release="$(release)-$(prev_revision)"
printchanges:
@baseCommit=$$(git log --pretty=format:'%H %s' | \
awk '/UBUNTU: '".*Ubuntu-$(prev_release)"'$$/ { print $$1; exit }'); \
git log "$$baseCommit"..HEAD | \
perl -w -f $(DROOT)/scripts/misc/git-ubuntu-log $(ubuntu_log_opts)
insertchanges:
@perl -w -f $(DROOT)/scripts/misc/insert-changes.pl $(DROOT) $(DEBIAN)
diffupstream:
@git diff-tree -p refs/remotes/linux-2.6/master..HEAD $(shell ls | grep -vE '^(ubuntu|$(DEBIAN)|\.git.*)')
startnewrelease:
dh_testdir
@nextminor=$(shell expr `echo $(revision) | awk -F. '{print $$2}'` + 1); \
now="$(shell date -R)"; \
echo "Creating new changelog set for $(abi_release).$$nextminor..."; \
echo -e "$(src_pkg_name) ($(abi_release).$$nextminor) UNRELEASED; urgency=low\n" > $(DEBIAN)/changelog.new; \
echo " CHANGELOG: Do not edit directly. Autogenerated at release." >> \
$(DEBIAN)/changelog.new; \
echo " CHANGELOG: Use the printchanges target to see the curent changes." \
>> $(DEBIAN)/changelog.new; \
echo " CHANGELOG: Use the insertchanges target to create the final log." \
>> $(DEBIAN)/changelog.new; \
echo -e "\n -- $$DEBFULLNAME <$$DEBEMAIL> $$now\n" >> \
$(DEBIAN)/changelog.new ; \
cat $(DEBIAN)/changelog >> $(DEBIAN)/changelog.new; \
mv $(DEBIAN)/changelog.new $(DEBIAN)/changelog
This diff is collapsed.
build-indep:
@echo Debug: $@
docpkg = $(doc_pkg_name)
docdir = $(CURDIR)/debian/$(docpkg)/usr/share/doc/$(docpkg)
install-doc: install-headers
@echo Debug: $@
ifeq ($(do_doc_package),true)
dh_testdir
dh_testroot
dh_clean -k -p$(docpkg)
install -d $(docdir)
ifeq ($(do_doc_package_content),true)
# First the html docs. We skip these for autobuilds
if [ -z "$(AUTOBUILD)" ]; then \
install -d $(docdir)/$(doc_pkg_name)-tmp; \
$(kmake) O=$(docdir)/$(doc_pkg_name)-tmp htmldocs; \
mv $(docdir)/$(doc_pkg_name)-tmp/Documentation/DocBook \
$(docdir)/html; \
rm -rf $(docdir)/$(doc_pkg_name)-tmp; \
fi
endif
# Copy the rest
cp -a Documentation/* $(docdir)
rm -rf $(docdir)/DocBook
find $(docdir) -name .gitignore | xargs rm -f
endif
indep_hdrpkg = $(hdrs_pkg_name)
indep_hdrdir = $(CURDIR)/debian/$(indep_hdrpkg)/usr/src/$(indep_hdrpkg)
install-headers:
@echo Debug: $@
ifeq ($(do_flavour_header_package),true)
dh_testdir
dh_testroot
dh_clean -k -p$(indep_hdrpkg)
install -d $(indep_hdrdir)
find . -path './debian' -prune -o -path './$(DEBIAN)' -prune \
-o -path './include/*' -prune \
-o -path './scripts/*' -prune -o -type f \
\( -name 'Makefile*' -o -name 'Kconfig*' -o -name 'Kbuild*' -o \
-name '*.sh' -o -name '*.pl' -o -name '*.lds' \) \
-print | cpio -pd --preserve-modification-time $(indep_hdrdir)
cp -a drivers/media/dvb/dvb-core/*.h $(indep_hdrdir)/drivers/media/dvb/dvb-core
cp -a drivers/media/video/*.h $(indep_hdrdir)/drivers/media/video
cp -a drivers/media/dvb/frontends/*.h $(indep_hdrdir)/drivers/media/dvb/frontends
cp -a scripts include $(indep_hdrdir)
(find arch -name include -type d -print | \
xargs -n1 -i: find : -type f) | \
cpio -pd --preserve-modification-time $(indep_hdrdir)
endif
srcpkg = $(src_pkg_name)-source-$(release)
srcdir = $(CURDIR)/debian/$(srcpkg)/usr/src/$(srcpkg)
balldir = $(CURDIR)/debian/$(srcpkg)/usr/src/$(srcpkg)/$(srcpkg)
install-source: install-doc
@echo Debug: $@
ifeq ($(do_source_package),true)
dh_testdir
dh_testroot
dh_clean -k -p$(srcpkg)
install -d $(srcdir)
ifeq ($(do_source_package_content),true)
find . -path './debian' -prune -o -path './$(DEBIAN)' -prune -o \
-path './.*' -prune -o -print | \
cpio -pd --preserve-modification-time $(balldir)
(cd $(srcdir); tar cf - $(srcpkg)) | bzip2 -9c > \
$(srcdir)/$(srcpkg).tar.bz2
rm -rf $(balldir)
find './debian' './$(DEBIAN)' \
-path './debian/linux-*' -prune -o \
-path './debian/$(src_pkg_name)-*' -prune -o \
-path './debian/build' -prune -o \
-path './debian/files' -prune -o \
-path './debian/stamps' -prune -o \
-path './debian/tmp' -prune -o \
-print | \
cpio -pd --preserve-modification-time $(srcdir)
ln -s $(srcpkg)/$(srcpkg).tar.bz2 $(srcdir)/..
endif
endif
install-tools: toolspkg = $(tools_common_pkg_name)
install-tools: toolsbin = $(CURDIR)/debian/$(toolspkg)/usr/bin
install-tools: toolssbin = $(CURDIR)/debian/$(toolspkg)/usr/sbin
install-tools: toolsman = $(CURDIR)/debian/$(toolspkg)/usr/share/man
install-tools: install-source $(stampdir)/stamp-build-perarch
@echo Debug: $@
ifeq ($(do_tools),true)
dh_testdir
dh_testroot
dh_clean -k -p$(toolspkg)
install -d $(toolsbin)
install -d $(toolsman)/man1
install -m755 debian/tools/perf $(toolsbin)/perf
if [ "$(arch)" = "amd64" ] || [ "$(arch)" = "i386" ]; then \
install -m755 debian/tools/x86_energy_perf_policy $(toolsbin)/x86_energy_perf_policy; \
install -m755 debian/tools/turbostat $(toolsbin)/turbostat; \
if [ "$(do_hyperv)" = "true" ]; then \
install -d $(toolssbin) ; \
install -m755 debian/tools/generic $(toolssbin)/hv_kvp_daemon; \
fi; \
fi
rm -rf $(builddir)/tools
install -d $(builddir)/tools
for i in *; do ln -s $(CURDIR)/$$i $(builddir)/tools/; done
rm $(builddir)/tools/tools
rsync -a tools/ $(builddir)/tools/tools/
cd $(builddir)/tools/tools/perf && make man
install -m644 $(builddir)/tools/tools/perf/Documentation/*.1 \
$(toolsman)/man1
if [ "$(arch)" = "amd64" ] || [ "$(arch)" = "i386" ]; then \
install -d $(toolsman)/man8; \
install -m644 $(CURDIR)/tools/power/x86/x86_energy_perf_policy/*.8 $(toolsman)/man8; \
install -m644 $(CURDIR)/tools/power/x86/turbostat/*.8 $(toolsman)/man8; \
if [ "$(do_hyperv)" = "true" ]; then \
install -m644 $(CURDIR)/tools/hv/*.8 $(toolsman)/man8; \
fi; \
fi
endif
install-indep: install-tools
@echo Debug: $@
# This is just to make it easy to call manually. Normally done in
# binary-indep target during builds.
binary-headers: install-headers
@echo Debug: $@
dh_testdir
dh_testroot
dh_installchangelogs -p$(indep_hdrpkg)
dh_installdocs -p$(indep_hdrpkg)
dh_compress -p$(indep_hdrpkg)
dh_fixperms -p$(indep_hdrpkg)
dh_installdeb -p$(indep_hdrpkg)
$(lockme) dh_gencontrol -p$(indep_hdrpkg)
dh_md5sums -p$(indep_hdrpkg)
dh_builddeb -p$(indep_hdrpkg)
binary-indep: install-indep
@echo Debug: $@
dh_testdir
dh_testroot
dh_installchangelogs -i
dh_installdocs -i
dh_compress -i
dh_fixperms -i
dh_installdeb -i
$(lockme) dh_gencontrol -i
dh_md5sums -i
dh_builddeb -i
# Check ABI for package against last release (if not same abinum)
abi-check-%: $(stampdir)/stamp-build-%
@echo Debug: $@
install -d $(abidir)
sed -e 's/^\(.\+\)[[:space:]]\+\(.\+\)[[:space:]]\(.\+\)$$/\3 \2 \1/' \
$(builddir)/build-$*/Module.symvers | sort > $(abidir)/$*
@perl -f $(DROOT)/scripts/abi-check "$*" "$(prev_abinum)" "$(abinum)" \
"$(prev_abidir)" "$(abidir)" "$(skipabi)"
# Check the module list against the last release (always)
module-check-%: $(stampdir)/stamp-build-%
@echo Debug: $@
install -d $(abidir)
find $(builddir)/build-$*/ -name \*.ko | \
sed -e 's/.*\/\([^\/]*\)\.ko/\1/' | sort > $(abidir)/$*.modules
@perl -f $(DROOT)/scripts/module-check "$*" \
"$(prev_abidir)" "$(abidir)" $(skipmodule)
checks-%: module-check-% abi-check-%
@echo Debug: $@
# Check the config against the known options list.
config-prepare-check-%: $(stampdir)/stamp-prepare-tree-%
@echo Debug: $@
@perl -f $(DROOT)/scripts/config-check \
$(builddir)/build-$*/.config "$(arch)" "$*" "$(sharedconfdir)" "$(skipconfig)"
# Do udebs if not disabled in the arch-specific makefile
binary-udebs: binary-debs
@echo Debug: $@
ifeq ($(disable_d_i),)
@$(MAKE) --no-print-directory -f $(DROOT)/rules DEBIAN=$(DEBIAN) \
do-binary-udebs
endif
do-binary-udebs: debian/control
@echo Debug: $@
dh_testdir
dh_testroot
# unpack the kernels into a temporary directory
mkdir -p debian/d-i-${arch}
imagelist=$$(cat $(builddir)/kernel-versions | grep ^${arch} | awk '{print $$4}') && \
for i in $$imagelist; do \
dpkg -x $$(ls ../linux-image-$$i\_$(release)-$(revision)_${arch}.deb) \
debian/d-i-${arch}; \
if [ -f ../linux-image-extra-$$i\_$(release)-$(revision)_${arch}.deb ] ; then \
dpkg -x ../linux-image-extra-$$i\_$(release)-$(revision)_${arch}.deb \
debian/d-i-${arch}; \
fi; \
/sbin/depmod -b debian/d-i-${arch} $$i; \
done
# kernel-wedge will error if no modules unless this is touched
touch $(CURDIR)/debian/build/no-modules
touch ignore-dups
export SOURCEDIR=$(CURDIR)/debian/d-i-${arch} && \
cd $(builddir) && \
kernel-wedge install-files && \
kernel-wedge check
# Build just the udebs
dilist=$$(dh_listpackages -s | grep "\-di$$") && \
[ -z "$dilist" ] || \
for i in $$dilist; do \
dh_fixperms -p$$i; \
$(lockme) dh_gencontrol -p$$i; \
dh_builddeb -p$$i; \
done
#!/usr/bin/perl -w
my $flavour = shift;
my $prev_abinum = shift;
my $abinum = shift;
my $prev_abidir = shift;
my $abidir = shift;
my $skipabi = shift;
my $fail_exit = 1;
my $EE = "EE:";
my $errors = 0;
my $abiskip = 0;
my $count;
print "II: Checking ABI for $flavour...\n";
if (-f "$prev_abidir/ignore"
or -f "$prev_abidir/$flavour.ignore" or "$skipabi" eq "true") {
print "WW: Explicitly asked to ignore ABI, running in no-fail mode\n";
$fail_exit = 0;
$abiskip = 1;
$EE = "WW:";
}
if ($prev_abinum != $abinum) {
print "II: Different ABI's, running in no-fail mode\n";
$fail_exit = 0;
$EE = "WW:";
}
if (not -f "$abidir/$flavour" or not -f "$prev_abidir/$flavour") {
print "EE: Previous or current ABI file missing!\n";
print " $abidir/$flavour\n" if not -f "$abidir/$flavour";
print " $prev_abidir/$flavour\n" if not -f "$prev_abidir/$flavour";
# Exit if the ABI files are missing, but return status based on whether
# skip ABI was indicated.
if ("$abiskip" eq "1") {
exit(0);
} else {
exit(1);
}
}
my %symbols;
my %symbols_ignore;
my %modules_ignore;
my %module_syms;
# See if we have any ignores
my $ignore = 0;
print " Reading symbols/modules to ignore...";
for $file ("$prev_abidir/../blacklist", "$prev_abidir/../../perm-blacklist") {
if (-f $file) {
open(IGNORE, "< $file") or
die "Could not open $file";
while (<IGNORE>) {
chomp;
if ($_ =~ m/M: (.*)/) {
$modules_ignore{$1} = 1;
} else {
$symbols_ignore{$_} = 1;
}
$ignore++;
}
close(IGNORE);
}
}
print "read $ignore symbols/modules.\n";
sub is_ignored($$) {
my ($mod, $sym) = @_;
die "Missing module name in is_ignored()" if not defined($mod);
die "Missing symbol name in is_ignored()" if not defined($sym);
if (defined($symbols_ignore{$sym}) or defined($modules_ignore{$mod})) {
return 1;
}
return 0;
}
# Read new syms first
print " Reading new symbols ($abinum)...";
$count = 0;
open(NEW, "< $abidir/$flavour") or
die "Could not open $abidir/$flavour";
while (<NEW>) {
chomp;
m/^(\S+)\s(.+)\s(0x[0-9a-f]+)\s(.+)$/;
$symbols{$4}{'type'} = $1;
$symbols{$4}{'loc'} = $2;
$symbols{$4}{'hash'} = $3;
$module_syms{$2} = 0;
$count++;
}
close(NEW);
print "read $count symbols.\n";
# Now the old symbols, checking for missing ones
print " Reading old symbols ($prev_abinum)...";
$count = 0;
open(OLD, "< $prev_abidir/$flavour") or
die "Could not open $prev_abidir/$flavour";
while (<OLD>) {
chomp;
m/^(\S+)\s(.+)\s(0x[0-9a-f]+)\s(.+)$/;
$symbols{$4}{'old_type'} = $1;
$symbols{$4}{'old_loc'} = $2;
$symbols{$4}{'old_hash'} = $3;
$count++;
}
close(OLD);
print "read $count symbols.\n";
print "II: Checking for missing symbols in new ABI...";
$count = 0;
foreach $sym (keys(%symbols)) {
if (!defined($symbols{$sym}{'type'})) {
print "\n" if not $count;
printf(" MISS : %s%s\n", $sym,
is_ignored($symbols{$sym}{'old_loc'}, $sym) ? " (ignored)" : "");
$count++ if !is_ignored($symbols{$sym}{'old_loc'}, $sym);
}
}
print " " if $count;
print "found $count missing symbols\n";
if ($count) {
print "$EE Symbols gone missing (what did you do!?!)\n";
$errors++;
}
print "II: Checking for new symbols in new ABI...";
$count = 0;
foreach $sym (keys(%symbols)) {
if (!defined($symbols{$sym}{'old_type'})) {
print "\n" if not $count;
print " NEW : $sym\n";
$count++;
}
}
print " " if $count;
print "found $count new symbols\n";
if ($count and $prev_abinum == $abinum) {
print "WW: Found new symbols within same ABI. Not recommended\n";
}
print "II: Checking for changes to ABI...\n";
$count = 0;
my $moved = 0;
my $changed_type = 0;
my $changed_hash = 0;
foreach $sym (keys(%symbols)) {
if (!defined($symbols{$sym}{'old_type'}) or
!defined($symbols{$sym}{'type'})) {
next;
}
# Changes in location don't hurt us, but log it anyway
if ($symbols{$sym}{'loc'} ne $symbols{$sym}{'old_loc'}) {
printf(" MOVE : %-40s : %s => %s\n", $sym, $symbols{$sym}{'old_loc'},
$symbols{$sym}{'loc'});
$moved++;
}
# Changes to export type are only bad if new type isn't
# EXPORT_SYMBOL. Changing things to GPL are bad.
if ($symbols{$sym}{'type'} ne $symbols{$sym}{'old_type'}) {
printf(" TYPE : %-40s : %s => %s%s\n", $sym, $symbols{$sym}{'old_type'}.
$symbols{$sym}{'type'}, is_ignored($symbols{$sym}{'loc'}, $sym)
? " (ignored)" : "");
$changed_type++ if $symbols{$sym}{'type'} ne "EXPORT_SYMBOL"
and !is_ignored($symbols{$sym}{'loc'}, $sym);
}
# Changes to the hash are always bad
if ($symbols{$sym}{'hash'} ne $symbols{$sym}{'old_hash'}) {
printf(" HASH : %-40s : %s => %s%s\n", $sym, $symbols{$sym}{'old_hash'},
$symbols{$sym}{'hash'}, is_ignored($symbols{$sym}{'loc'}, $sym)
? " (ignored)" : "");
$changed_hash++ if !is_ignored($symbols{$sym}{'loc'}, $sym);
$module_syms{$symbols{$sym}{'loc'}}++;
}
}
print "WW: $moved symbols changed location\n" if $moved;
print "$EE $changed_type symbols changed export type and weren't ignored\n" if $changed_type;
print "$EE $changed_hash symbols changed hash and weren't ignored\n" if $changed_hash;
$errors++ if $changed_hash or $changed_type;
if ($changed_hash) {
print "II: Module hash change summary...\n";
foreach $mod (sort { $module_syms{$b} <=> $module_syms{$a} } keys %module_syms) {
next if ! $module_syms{$mod};
printf(" %-40s: %d\n", $mod, $module_syms{$mod});
}
}
print "II: Done\n";
if ($errors) {
exit($fail_exit);
} else {
exit(0);
}
This diff is collapsed.
#!/bin/bash
. debian/debian.env
vars=$1
. $vars
if [ "$is_sub" = "" ]; then
flavour=$(basename $vars | sed 's/.*\.//')
stub=${DEBIAN}/control.d/flavour-control.stub
else
flavour=$(basename $vars .vars)
stub=${DEBIAN}/sub-flavours/control.stub
fi
cat $stub | grep -v '^#' | sed \
-e "s#FLAVOUR#$flavour#g" \
-e "s#DESC#$desc#g" \
-e "s#ARCH#$arch#g" \
-e "s#SUPPORTED#$supported#g" \
-e "s#TARGET#$target#g" \
-e "s#BOOTLOADER#$bootloader#g" \
-e "s#=PROVIDES=#$provides#g" \
-e "s#=CONFLICTS=#$conflicts#g"
#!/bin/bash -e
. debian/debian.env
hdrdir="$1"
symdir="$2"
flavour="$3"
echo "Symlinking and copying headers for $flavour..."
excludes="( -path ./debian -prune -o -path ./${DEBIAN} -prune -o -path ./.git ) -prune -o"
(
find . $excludes -type f \
\( -name 'Makefile*' -o -name 'Kconfig*' -o -name 'Kbuild*' -o \
-name '*.sh' -o -name '*.pl' -o -name '*.lds' \) -print
find ./include ./scripts -name .gitignore -prune -o -type f -print
find ./include -mindepth 1 -maxdepth 1 $excludes -type d -print
) | (
while read file; do
dir=$file
lastdir=$file
if [ -e "$hdrdir/$file" -o -L "$hdrdir/$file" ]; then
continue
fi
while [ ! -e "$hdrdir/$dir" -a ! -L "$hdrdir/$dir" ]; do
lastdir=$dir
dir=`dirname $dir`
done
# If the last item to exist is a symlink we assume all is good
if [ ! -L "$hdrdir/$dir" ]; then
# Turns things like "./foo" into "../"
deref="`echo -n $lastdir | sed -e 's/^\.//' -e's,/[^/]*,../,g'`"
item="`echo -n $lastdir | sed -e 's/^\.\///'`"
ln -s $deref$symdir/$item $hdrdir/$item
fi
done
)
exit
#!/bin/bash
#
# Find all files in linux-firmware that are new or different since the previous release
# and copy them into the kernel firmware directory. You should only do this on the
# backport branch since it would be redundant on the released kernel. It assumed you've
# unpacked linux-firmware from each release into separate directories.
#
# Example: $0 ~/ubuntu/linux-firmware-precise ~/ubuntu/linux-firmware-quantal
if [ "$1" = "" ] || [ "$2" = "" ] || [ ! -f $1/WHENCE ] || [ ! -f $2/WHENCE ]
then
echo You must supply 2 firmware directories.
exit 1
fi
if [ ! -f debian/debian.env ]
then
echo You must run this script from the root of the repo
exit 1
fi
CDIR=`pwd`
OFW=$1
NFW=$2
cd $NFW
#
# Find all files in $NFW that are new or different from $1
#
(find . -type f | egrep -v "debian|git|LICEN|WHEN|READ|Make|configure" | sed 's;\./;;' | \
while read f
do
if [ ! -f $OFW/$f ]
then
echo $f
elif ! cmp $f $OFW/$f > /dev/null
then
echo $f
fi
done) |\
while read f
do
mkdir -p $CDIR/firmware/`dirname $f`
cp -v $f $CDIR/firmware/`dirname $f`
done
#!/bin/bash
if [ "$#" != "2" ]; then
echo "Usage: $0 <release> <revision>" 1>&2
exit 1
fi
if [ "$DEBIAN" = "" ]; then
. debian/debian.env
fi
ver=$1
revision=$2
abi=$(echo $revision | awk -F. '{print $1}')
verabi=$ver-$abi
verfull=$ver-$revision
WGET="wget --tries=1 --timeout=10 --quiet -c"
abidir="`pwd`/$DEBIAN/abi/$verfull"
tmpdir="`pwd`/abi-tmp-$verfull"
origdir="`pwd`"
fwinfo=$abidir/fwinfo
test -d $tmpdir || mkdir $tmpdir
package_prefixes() {
__package_prefixes="$@"
}
getall() {
arch=$1
shift
mkdir -p $abidir/$arch
for sub in $@; do
if [ -f $abidir/$arch/$sub ]; then
echo "Exists: $sub"
continue
fi
echo -n "Fetching $sub($arch)..."
prefixes=""
filenames=""
cd $tmpdir
for prefix in $__package_prefixes
do
filename=${prefix}-${verabi}-${sub}_${verfull}_${arch}.deb
for r in "${repo_list[@]}"
do
if ! [ -f $filename ]; then
$WGET $r/$filename
fi
if [ -f $filename ]; then
prefixes="$prefixes $prefix"
filenames="$filenames $filename"
break
fi
done
done
if [ "$filenames" != "" ]; then
echo -n "extracting$prefixes..."
for filename in $filenames
do
dpkg-deb --extract $filename tmp
done
find tmp -name "*.ko" | while read f; do
modinfo $f | grep ^firmware >> $fwinfo
done
if [ -f tmp/boot/abi-* ]; then
mv tmp/boot/abi-* $abidir/$arch/$sub
else
echo -n "NO ABI FILE..."
fi
(cd tmp; find lib/modules/$verabi-$sub/kernel -name '*.ko') | \
sed -e 's/.*\/\([^\/]*\)\.ko/\1/' | sort > \
$abidir/$arch/$sub.modules
(
cd tmp;
# Prevent exposing some errors when called by python scripts. SIGPIPE seems to get
# exposed when using the `find ...` form of the command.
ko=$(find lib/modules/$verabi-$sub/kernel \
-name '*.ko' | head -1)
readelf -p .comment "$ko" | awk '
($1 == "[") {
printf("%s", $3);
for (n=4; n<=NF; n++) {
printf(" %s", $n);
}
print ""
}' | sort -u >$abidir/$arch/$sub.compiler
version=`cat $abidir/$arch/$sub.compiler`
echo -n "$version..."
)
rm -rf tmp $filenames
echo "done."
else
echo "FAILED."
fi
cd $origdir
done
}
# MAIN
# Setup abi directory
mkdir -p $abidir
echo $abi > $abidir/abiname
# NOTE: The flavours are hardcoded, because they may have changed from the
# current build.
__package_prefixes="linux-image"
. $DEBIAN/etc/getabis
compilers=`cat $abidir/*/*.compiler | sort -u | wc -l`
if [ "$compilers" != 1 ]; then
echo "WARNING: inconsistant compiler versions detected" 1>&2
fi
sort < $fwinfo | uniq > fwinfo.tmp
mv fwinfo.tmp $fwinfo
rmdir $tmpdir
#!/usr/bin/perl -w
use strict;
use Text::Wrap;
my $kernel_auth = "Upstream Kernel Changes";
my (%map, @reverts);
my $pstate = 1;
my $no_kern_log = 0;
my $print_shas = 0;
my $first_print = 1;
while (@ARGV) {
my $opt = $ARGV[0];
shift;
if ($opt eq "--no-kern-log") {
$no_kern_log = 1;
} elsif ($opt eq "--print-shas") {
$print_shas = 1;
} else {
print STDERR "Unknown options: $opt\n";
exit(1);
}
}
sub check_reverts($) {
my ($entry) = @_;
my ($check);
foreach $check (reverse @reverts) {
my $desc = "Revert \"" . $entry->{'desc'} . "\"";
if ($check->{'desc'} eq $desc) {
@reverts = grep($_->{'desc'} ne $desc, @reverts);
return 1;
}
}
return 0;
}
sub add_entry($) {
my ($entry) = @_;
my $key = $entry->{'author'};
# store description in array, in email->{desc list} map
if (exists $map{$key}) {
# grab ref
my $obj = $map{$key};
# add desc to array
push(@$obj, $entry);
} else {
# create new array, containing 1 item
my @arr = ($entry);
# store ref to array
$map{$key} = \@arr;
}
}
sub shortlog_entry($$$$$) {
my ($name, $desc, $bug, $cve, $commit) = @_;
my $entry;
$desc =~ s#/pub/scm/linux/kernel/git/#/.../#g;
$desc =~ s#\[PATCH\] ##g;
$desc =~ s#^\s*##g;
$desc =~ s# *UBUNTU: ##g;
$entry->{'desc'} = $desc;
if ($bug ne '') {
$entry->{'bugno'} = $bug;
}
$entry->{'cve'} = $cve;
$entry->{'commit'} = $commit;
$entry->{'author'} = $name;
if ($desc =~ /^Revert "/) {
push(@reverts, $entry);
return;
}
return if check_reverts($entry);
add_entry($entry);
}
# sort comparison function
sub by_name($$) {
my ($a, $b) = @_;
uc($a) cmp uc($b);
}
sub shortlog_output {
my ($obj, $key, $entry);
foreach $key (sort by_name keys %map) {
next if $key eq $kernel_auth and $no_kern_log;
print "\n" unless $first_print;
$first_print = 0;
# output author
printf " [ %s ]\n\n", $key;
# output author's 1-line summaries
$obj = $map{$key};
foreach $entry (reverse @$obj) {
print wrap(" * ", " ", $entry->{'desc'}) . "\n";
# For non upstream changes, add other info.
if ($key ne $kernel_auth) {
if ($print_shas) {
print " - GIT-SHA " . $entry->{'commit'} .
"\n";
}
}
if (defined($entry->{'bugno'})) {
print " - LP: #" . $entry->{'bugno'} . "\n";
}
if (defined($entry->{'cve'})) {
print " - " . $entry->{'cve'} . "\n";
}
}
}
}
sub changelog_input {
my ($author, $desc, $commit, $entry, $cve);
while (<STDIN>) {
# get commit
if ($pstate == 1) {
next unless /^commit (.*)/;
$commit = $1;
$pstate++;
}
# get author and email
elsif ($pstate == 2) {
my ($email);
next unless /^[Aa]uthor:?\s*(.*?)\s*<(.*)>/;
$author = $1;
$email = $2;
$desc = undef;
$cve = undef;
# cset author fixups
if (!$author) {
$author = $email;
}
$pstate++;
}
# skip to blank line
elsif ($pstate == 3) {
next unless /^\s*$/;
$pstate++;
}
# skip to non-blank line
elsif ($pstate == 4) {
next unless /^\s*?(.*)/;
my $ignore = 0;
my $do_ignore = 0;
my $bug = undef;
my %bugz = ();
my $k;
# skip lines that are obviously not
# a 1-line cset description
next if /^\s*From: /;
chomp;
$desc = $1;
if ($desc =~ /^ *(Revert "|)UBUNTU:/) {
$do_ignore = 1;
} else {
$do_ignore = 0;
$author = $kernel_auth;
$ignore = 1 if $desc =~ /Merge /;
}
while (<STDIN>) {
$ignore = 1 if ($do_ignore && /^ *Ignore: yes/i);
if (/^ *Bug: *(#|)([0-9#,\s]*)\s*$/i) {
foreach $k (split('(,|\s)\s*(#|)', $2)) {
$bugz{$k} = 1 if (($k ne '') and ($k =~ /[0-9]+/));
}
}
elsif (/^ *BugLink: *http.*:\/\/.*\/([0-9]+)/i) {
$bugz{$1} = 1;
}
elsif (/^ *(CVE-.*)/) {
$cve = $1
}
last if /^commit /;
}
$bug = join(", #", sort keys(%bugz));
if (!$ignore) {
&shortlog_entry($author, $desc, $bug,
$cve, $commit, 0);
}
$pstate = 1;
if ($_ && /^commit (.*)/) {
$commit = $1;
$pstate++;
}
}
else {
die "invalid parse state $pstate";
}
}
foreach $entry (@reverts) {
add_entry($entry);
}
}
&changelog_input;
&shortlog_output;
exit(0);
#!/usr/bin/perl -w
my $debian;
$droot = $ARGV[0] if (defined $ARGV[0]);
$droot = 'debian' if (!defined $droot);
$debian = $ARGV[1] if (defined $ARGV[1]);
$debian = 'debian.master' if (!defined $debian);
system("make -s -f $droot/rules printchanges > $debian/changes");
open(CHANGELOG, "< $debian/changelog") or die "Cannot open changelog";
open(CHANGES, "< $debian/changes") or die "Cannot open new changes";
open(NEW, "> $debian/changelog.new") or die "Cannot open new changelog";
$printed = 0;
while (<CHANGELOG>) {
if (/^ CHANGELOG: /) {
next if $printed;
while (<CHANGES>) {
print NEW;
}
$printed = 1;
} else {
print NEW;
}
}
close(NEW);
close(CHANGES);
close(CHANGELOG);
rename("$debian/changelog.new", "$debian/changelog");
unlink("$debian/changes");
#!/usr/bin/perl
if ($#ARGV != 2) {
warn "Usage: $0 <changelog> <to> <range>\n";
die " $0 debian.master/changelog v3.2.3 v3.2.2..v3.2.3\n";
}
my ($changelog, $to, $range) = @ARGV;
my @changes = ();
push(@changes, "\n");
push(@changes, " [ Upstream Kernel Changes ]\n\n");
push(@changes, " * rebase to $to\n");
open(LOG, "git log '$range'|") || die "$0: git log failed: - $!\n";
while (<LOG>) {
if (m@BugLink: .*launchpad.net/.*/([0-9]+)\s$@) {
push(@changes, " - LP: #$1\n");
}
}
close(LOG);
open(CHANGELOG, "< $changelog") or die "Cannot open changelog";
open(NEW, "> $changelog.new") or die "Cannot open new changelog";
$printed = 3;
while (<CHANGELOG>) {
if (/^ CHANGELOG: /) {
$printed--;
print NEW;
if ($printed == 0) {
print NEW @changes;
}
next;
}
print NEW;
}
close(NEW);
close(CHANGELOG);
rename("$changelog.new", "$changelog");
#!/usr/bin/perl
if ($#ARGV != 2) {
die "Usage: $0 <changelog> <stop at> <start at>\n";
}
my ($changelog, $end, $start) = @ARGV;
$end =~ s/.*\.//;
$start =~ s/.*\.//;
my @changes = ();
my $output = 0;
open(CHG, "<debian.master/changelog") ||
open(CHG, "<debian/changelog") ||
die "$0: debian/changelog: open failed - $!\n";
while (<CHG>) {
if (/^\S+\s+\((.*\.(\d+))\)/) {
if ($2 <= $end) {
last;
}
if ($2 == $start) {
$output = 1;
}
if ($output) {
push(@changes, "\n [ Ubuntu: $1 ]\n\n");
next;
}
}
next if ($output == 0);
next if (/^\s*$/);
next if (/^\s--/);
next if (/^\s\s[^\*\s]/);
push(@changes, $_);
}
close(CHG);
open(CHANGELOG, "< $changelog") or die "Cannot open changelog";
open(NEW, "> $changelog.new") or die "Cannot open new changelog";
$printed = 3;
while (<CHANGELOG>) {
if (/^ CHANGELOG: /) {
$printed--;
print NEW;
if ($printed == 0) {
print NEW @changes;
}
next;
}
print NEW;
}
close(NEW);
close(CHANGELOG);
rename("$changelog.new", "$changelog");
This diff is collapsed.
#!/usr/bin/perl -w
open(TAGS, "git tag -l |") or die "Could not get list of tags";
@tags = <TAGS>;
close(TAGS);
open(LOGS, "git log --pretty=short |") or die "ERROR: Calling git log";
my $commit = "";
while (<LOGS>) {
my $origtag;
if (m|^commit (.*)$|) {
$commit = $1;
next;
}
m|\s*UBUNTU: (Ubuntu-2\.6\..*)| or next;
$tag = $1;
($origtag) = grep(/^$tag.orig$/, @tags);
if (!defined($origtag)) {
print "I: Adding original tag for $tag\n";
system("git tag -m $tag $tag.orig $tag");
}
print "I: Tagging $tag => $commit\n";
system("git tag -f -m $tag $tag $commit");
}
close(LOGS);
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
Scripts placed in this directory get called one at a time by run-parts(8).
The scripts are expected to perform some sort of sanity checks on the
finished build. Scripts will be called once for each flavour.
Some environment variables are exported to make life a little easier:
DPKG_ARCH : The dpkg architecture (e.g. "amd64")
KERN_ARCH : The kernel architecture (e.g. "x86_64")
FLAVOUR : The specific flavour for this run (e.g. "generic")
VERSION : The full version of this build (e.g. 2.6.22-1)
REVISION : The exact revision of this build (e.g. 1.3)
PREV_REVISION : The revision prior to this one
ABI_NUM : The specific ABI number for this build (e.g. 2)
PREV_ABI_NUM : The previous ABI number. Can be the same as ABI_NUM.
BUILD_DIR : The directory where this build took place
INSTALL_DIR : The directory where the package is prepared
SOURCE_DIR : Where the main kernel source is
Scripts are expected to have a zero exit status when no problems occur,
and non-zero when an error occurs that should stop the build. Scripts
should print whatever info they deem needed to deduce the problem.
#!/usr/bin/perl -w
my %map;
print "Checking for dupe aliases in $ENV{'FLAVOUR'}...\n";
$aliases =
"$ENV{'INSTALL_DIR'}/lib/modules/$ENV{'VERSION'}-$ENV{'FLAVOUR'}/modules.alias";
open(ALIASES, "< $aliases") or die "Could not open $aliases";
while (<ALIASES>) {
chomp;
my ($junk, $alias, $module) = split;
if (defined($map{$alias})) {
printf("%s %20s / %-20s : %s \n", ("$map{$alias}" eq "$module")
? "INT" : " ", $map{$alias}, $module, $alias);
} else {
$map{$alias} = $module;
}
}
exit(0);
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This is the list of patches/features which have been temporarily
reverted or disabled for Q:
UBUNTU: SAUCE: AppArmor: basic networking rules
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment