From cb2b3190a4fcdc0d289f8b8b53aa406f3ab21c14 Mon Sep 17 00:00:00 2001 From: Thomas Lamprecht Date: Mon, 22 May 2023 12:00:03 +0200 Subject: [PATCH] move cleanup of unused ROMs from d/rules to build-dir generation this way we save a bit of space and should make build also slightly faster, otherwise nothing should change. Signed-off-by: Thomas Lamprecht --- Makefile | 18 ++++++++++++++++++ debian/rules | 15 --------------- 2 files changed, 18 insertions(+), 15 deletions(-) diff --git a/Makefile b/Makefile index 3191ca9..d9af212 100644 --- a/Makefile +++ b/Makefile @@ -19,6 +19,22 @@ all: $(DEBS) submodule: test -f "${SRCDIR}/configure" || git submodule update --init --recursive +PC_BIOS_FW_PURGE_LIST_IN = \ + openbios-ppc \ + openbios-sparc32 \ + openbios-sparc64 \ + palcode-clipper \ + s390-ccw.img \ + s390-netboot.img \ + u-boot.e500 \ + .*\.dtb \ + qemu_vga.ndrv \ + slof.bin \ + opensbi-riscv.*-generic-fw_dynamic.bin \ + +BLOB_PURGE_SED_CMDS = $(foreach FILE,$(PC_BIOS_FW_PURGE_LIST_IN),-e "/$(FILE)/d") +BLOB_PURGE_FILTER = $(foreach FILE,$(PC_BIOS_FW_PURGE_LIST_IN),-e "$(FILE)") + $(BUILDDIR): keycodemapdb | submodule # check if qemu/ was used for a build # if so, please run 'make distclean' in the submodule and try again @@ -28,6 +44,8 @@ $(BUILDDIR): keycodemapdb | submodule cp -a debian $@.tmp/debian rm -rf $@.tmp/ui/keycodemapdb cp -a keycodemapdb $@.tmp/ui/ + find $@.tmp/pc-bios -type f | grep $(BLOB_PURGE_FILTER) | xargs rm -f + sed -i $(BLOB_PURGE_SED_CMDS) $@.tmp/pc-bios/meson.build echo "git clone git://git.proxmox.com/git/pve-qemu.git\\ngit checkout $(GITVERSION)" > $@.tmp/debian/SOURCE mv $@.tmp $@ diff --git a/debian/rules b/debian/rules index 0f6d522..6286f36 100755 --- a/debian/rules +++ b/debian/rules @@ -122,21 +122,6 @@ install: build # Add here commands to install the package into debian/pve-kvm. $(MAKE) DESTDIR=$(destdir) install - # we do not need openbios files (sparc/ppc) - rm -rf $(destdir)/usr/share/kvm/openbios-* - # remove ppc files - rm $(destdir)/usr/share/kvm/*.dtb - rm $(destdir)/usr/share/kvm/s390-ccw.img - rm $(destdir)/usr/share/kvm/s390-netboot.img - rm $(destdir)/usr/share/kvm/qemu_vga.ndrv - rm $(destdir)/usr/share/kvm/slof.bin - rm $(destdir)/usr/share/kvm/u-boot.e500 - # remove Alpha files - rm $(destdir)/usr/share/kvm/palcode-clipper - # remove RISC-V files - rm $(destdir)/usr/share/kvm/opensbi-riscv32-generic-fw_dynamic.bin - rm $(destdir)/usr/share/kvm/opensbi-riscv64-generic-fw_dynamic.bin - # Remove things we don't package at all, would be a "kvm-dev" package rm -Rf $(destdir)/usr/include/linux/ rm -Rf $(destdir)/usr/include