# Pull in some arch specific stuff
-include $(DEBIAN)/rules.d/$(arch).mk
+# Pull in some branch specific stuff. Used by LTS backport
+# branches to override master branch settings such as do_tools_common.
+-include $(DEBIAN)/rules.d/hooks.mk
+
# Maintainer targets
include $(DROOT)/rules.d/1-maintainer.mk
-# Don't build tools in a cross compile environment.
+do_linux_tools=$(sort $(filter-out false,$(do_tools_usbip) $(do_tools_cpupower) $(do_tools_perf) $(do_tools_x86)))
+do_cloud_tools=$(sort $(filter-out false,$(do_tools_hyperv)))
+do_tools_common=true
+
+# Don't build tools or udebs in a cross compile environment.
ifneq ($(DEB_HOST_ARCH),$(DEB_BUILD_ARCH))
- do_tools = false
+ do_tools=false
+ disable_d_i=true
+ do_zfs=false
endif
# Stages -- support both DEB_STAGE=stage1 and DEB_BUILD_PROFILE=bootstrap
ifeq ($(DEB_STAGE),stage1)
- DEB_BUILD_PROFILE=bootstrap
+ DEB_BUILD_PROFILES=stage1
+endif
+ifneq ($(DEB_BUILD_PROFILE),)
+ DEB_BUILD_PROFILES=$(DEB_BUILD_PROFILE)
endif
-ifeq ($(DEB_BUILD_PROFILE),bootstrap)
+ifneq ($(filter stage1,$(DEB_BUILD_PROFILES)),)
do_tools=false
do_doc_package=false
do_source_package=false
do_flavour_header_package=false
endif
+# Being used to build a mainline build -- turn off things which do not work.
+ifeq ($(do_mainline_build),true)
+ do_extras_package=false
+ do_tools=false
+ no_dumpfile=1
+ do_zfs=false
+endif
+
+# Disable tools build and packaging if do_tools != true
+ifneq ($(do_tools),true)
+ do_linux_tools=
+ do_cloud_tools=
+ do_tools_common=
+endif
+
+# Either tools package needs the common source preparation
+do_any_tools=$(sort $(filter-out false,$(do_linux_tools) $(do_cloud_tools)))
+
# autopkgtest -- rebuild support
# only build the first flavour on the assumption it is representative
ifeq ($(DEB_BUILD_PROFILE),autopkgtest)
rm -rf $(DEBIAN)/linux-*
# This gets rid of the d-i packages in control
- cp -f $(DEBIAN)/control.stub $(DEBIAN)/control
+ cp -f $(DEBIAN)/control.stub $(DROOT)/control
cp $(DEBIAN)/changelog debian/changelog
# Install the copyright information.
cp $(DEBIAN)/copyright debian/copyright
+ # If we have a reconstruct script use it.
+ [ -f $(DEBIAN)/reconstruct ] && bash $(DEBIAN)/reconstruct
+
+ # Remove generated intermediate files
+ rm -f $(DROOT)/control.stub $(DEBIAN)/control.stub \
+ $(DEBIAN)/d-i/kernel-versions
+
distclean: clean
- rm -rf $(DEBIAN)/control $(DEBIAN)/control.stub \
- $(DEBIAN)/d-i/kernel-versions debian/changelog \
+ rm -rf $(DROOT)/control debian/changelog \
debian/control debian/control.stub debian/copyright
# Builds the image, arch headers and debug packages
-e 's/=HUMAN=/$(human_arch)/g' \
> $$new; \
done
- flavours="$(wildcard $(DEBIAN)/control.d/vars.* $(DEBIAN)/sub-flavours/*.vars)";\
+ flavours="$(sort $(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/=HUMAN=/$(human_arch)/g' \
>> $(DEBIAN)/control.stub; \
done
- cp $(DEBIAN)/control.stub $(DEBIAN)/control
.PHONY: debian/control
debian/control: $(DEBIAN)/control.stub
$(builddir)/firmware/$(build_arch); \
fi
- cp $(DEBIAN)/control.stub debian/control.stub
- cd $(builddir) && kernel-wedge gen-control > $(CURDIR)/debian/control
+ echo "# placebo control.stub for kernel-wedge flow change" >debian/control.stub
+ cp $(DEBIAN)/control.stub debian/control
+ cd $(builddir) && LANG=C kernel-wedge gen-control >> $(CURDIR)/debian/control