]> git.proxmox.com Git - pve-qemu.git/commitdiff
move cleanup of unused ROMs from d/rules to build-dir generation
authorThomas Lamprecht <t.lamprecht@proxmox.com>
Mon, 22 May 2023 10:00:03 +0000 (12:00 +0200)
committerThomas Lamprecht <t.lamprecht@proxmox.com>
Mon, 22 May 2023 11:29:59 +0000 (13:29 +0200)
this way we save a bit of space and should make build also slightly
faster, otherwise nothing should change.

Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
Makefile
debian/rules

index 3191ca93038f8aa1eea3059b98509f89dd83b531..d9af21213e9d189d7a4e459dfc2a030c09944f4c 100644 (file)
--- 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 $@
 
index 0f6d522fb65cfbbbb97d01d51d7423f8edef0f8e..6286f364dc9289e1023c6579e5f728c581fee5fd 100755 (executable)
@@ -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