do_tools=false
disable_d_i=true
do_zfs=false
+ do_zfs_disable:=$(shell cat $(DROOT)/zfs-modules.ignore >>$(prev_abidir)/../modules.ignore)
endif
# Stages -- support both DEB_STAGE=stage1 and DEB_BUILD_PROFILE=bootstrap
# autopkgtest -- rebuild support
# only build the first flavour on the assumption it is representative
-ifeq ($(DEB_BUILD_PROFILE),autopkgtest)
+ifneq ($(filter autopkgtest,$(DEB_BUILD_PROFILES)),)
flavours := $(firstword $(flavours))
endif
# d-i stuff
rm -rf $(DEBIAN)/d-i-$(arch)
# Generated on the fly.
- rm -f $(DEBIAN)/d-i/firmware/kernel-image
+ rm -f $(DEBIAN)/d-i/firmware/$(arch)/kernel-image
# normal build junk
rm -rf $(DEBIAN)/abi/$(release)-$(revision)
cp $(DEBIAN)/copyright debian/copyright
# If we have a reconstruct script use it.
- [ -f $(DEBIAN)/reconstruct ] && bash -x $(DEBIAN)/reconstruct
+ [ -f $(DEBIAN)/reconstruct ] && bash $(DEBIAN)/reconstruct
+
+ # Remove generated intermediate files
+ rm -f $(DROOT)/control.stub $(DEBIAN)/control.stub
distclean: clean
- rm -rf $(DROOT)/control $(DROOT)/control.stub $(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
# Misc stuff
.PHONY: $(DEBIAN)/control.stub
-$(DEBIAN)/control.stub: $(DEBIAN)/d-i/kernel-versions.in \
+$(DEBIAN)/control.stub: \
$(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 \
+ for i 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' \
.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
-
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
+ export KW_DEFCONFIG_DIR=$(DEBIAN)/d-i && \
+ export KW_CONFIG_DIR=$(DEBIAN)/d-i && \
+ LANG=C kernel-wedge gen-control $(release)-$(abinum) | \
+ perl -f $(DROOT)/scripts/misc/kernel-wedge-arch.pl $(arch) \
+ >>$(CURDIR)/debian/control