]> git.proxmox.com Git - pve-firmware.git/blob - Makefile
drop outdated firmware lists
[pve-firmware.git] / Makefile
1 include /usr/share/dpkg/pkg-info.mk
2
3 PACKAGE = pve-firmware
4
5 BUILDDIR ?= $(PACKAGE)-$(DEB_VERSION_UPSTREAM)
6 ORIG_SRC_TAR=$(PACKAGE)_$(DEB_VERSION_UPSTREAM).orig.tar.gz
7
8 DSC=$(PACKAGE)_$(DEB_VERSION_UPSTREAM_REVISION).dsc
9 FW_DEB=$(PACKAGE)_$(DEB_VERSION)_all.deb
10 DEBS=$(FW_DEB)
11
12 .PHONY: deb
13 deb: $(DEBS)
14
15 $(FW_DEB): $(BUILDDIR)
16 cd $(BUILDDIR); dpkg-buildpackage -b -us -uc
17
18 .PHONY: dsc
19 dsc:
20 $(MAKE) clean
21 $(MAKE) $(DSC)
22 lintian $(DSC)
23
24 $(DSC): $(ORIG_SRC_TAR) $(BUILDDIR)
25 cd $(BUILDDIR); dpkg-buildpackage -S -us -uc -d
26
27 sbuild: $(DSC)
28 sbuild $(DSC)
29
30 # NOTE: when collapsing FW lists keep major.minor still separated, so we can sunset the older ones
31 # without user impact safely. The last oldstable list needs to be kept avoid breakage on upgrade
32 .PHONY: fw.list
33 fw.list: fwlist-5.15.5-1-pve
34 fw.list: fwlist-5.15.19-1-pve
35 fw.list: fwlist-5.15.27-1-pve
36 fw.list: fwlist-5.15.35-1-pve
37 fw.list: fwlist-5.15.53-1-pve
38 fw.list: fwlist-5.19-iwlwifi-extra
39 fw.list: fwlist-6.2.2-1-pve
40 fw.list: fwlist-6.2.6-1-pve
41 rm -f $@.tmp $@
42 sort -u $^ > $@.tmp
43 mv $@.tmp $@
44
45 $(ORIG_SRC_TAR): $(BUILDDIR)
46 tar czf $(ORIG_SRC_TAR) --exclude="$(BUILDDIR)/debian" $(BUILDDIR)
47
48 $(BUILDDIR): linux-firmware.git/WHENCE dvb-firmware.git/README fw.list
49 rm -rf $@ $@.tmp
50 mkdir -p $@.tmp/lib/firmware
51 cp -a debian $@.tmp
52 echo "git clone git://git.proxmox.com/git/pve-firmware.git\\ngit checkout $$(git rev-parse HEAD)" >$@.tmp/debian/SOURCE
53 cd linux-firmware.git; ./copy-firmware.sh -v ../$@.tmp/lib/firmware/
54 ./assemble-firmware.pl fw.list $@.tmp/lib/firmware
55 find $@.tmp/lib/firmware -empty -type d -delete
56 install -d $@.tmp/usr/share/doc/pve-firmware
57 cp linux-firmware.git/WHENCE $@.tmp/usr/share/doc/pve-firmware/README
58 install -d $@.tmp/usr/share/doc/pve-firmware/licenses
59 cp linux-firmware.git/LICEN[CS]E* $@.tmp/usr/share/doc/pve-firmware/licenses
60 # we only compress big ones that almost definitively ain't required in the initrd
61 # or are so big and unbuyable (netronome...)
62 cd $@.tmp/lib/firmware; find . -type f \( -name 'i[wb][lt]*' -o -path '*/netronome/*' \) -print0 | xargs -0 -n1 -P0 -- xz -C crc32
63 cd $@.tmp/lib/firmware; find . -xtype l -print0 | xargs -0 -n1 -P0 -- sh -c 'ln -sf "$$(readlink "$$0").xz" "$$0"; mv "$$0" "$$0.xz"'
64 mv $@.tmp $@
65
66 # upgrade to current master
67 .PHONY: update_modules
68 update_modules: submodule
69 git submodule foreach 'git pull --ff-only origin master'
70
71 # make sure submodules were initialized
72 .PHONY: submodule
73 submodule dvb-firmware.git/README linux-firmware.git/WHENCE:
74 test -f "linux-firmware.git/WHENCE" || git submodule update --init
75
76 .PHONY: upload
77 upload: $(DEBS)
78 tar cf - $(DEBS) | ssh repoman@repo.proxmox.com -- upload --product pve,pmg,pbs --dist bullseye
79
80 .PHONY: clean
81 clean:
82 rm -rf $(PACKAGE)-[0-9]*/
83 rm -f $(PACKAGE)*.tar* *.deb *.dsc *.changes *.dsc *.buildinfo *.build