]> git.proxmox.com Git - pve-firmware.git/blob - Makefile
add new FW from 6.5.13 build
[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.x.y-pve
34 fw.list: fwlist-iwlwifi-extra
35 fw.list: fwlist-6.2.2-1-pve
36 fw.list: fwlist-6.2.6-1-pve
37 fw.list: fwlist-6.2.16-11-pve
38 fw.list: fwlist-6.5.3-1-pve
39 rm -f $@.tmp $@
40 sort -u $^ > $@.tmp
41 mv $@.tmp $@
42
43 $(ORIG_SRC_TAR): $(BUILDDIR)
44 tar czf $(ORIG_SRC_TAR) --exclude="$(BUILDDIR)/debian" $(BUILDDIR)
45
46 $(BUILDDIR): linux-firmware.git/WHENCE dvb-firmware.git/README fw.list
47 rm -rf $@ $@.tmp
48 mkdir -p $@.tmp/lib/firmware
49 cp -a debian $@.tmp
50 echo "git clone git://git.proxmox.com/git/pve-firmware.git\\ngit checkout $$(git rev-parse HEAD)" >$@.tmp/debian/SOURCE
51 cd linux-firmware.git; ./copy-firmware.sh -v ../$@.tmp/lib/firmware/
52 ./assemble-firmware.pl fw.list $@.tmp/lib/firmware
53 find $@.tmp/lib/firmware -empty -type d -delete
54 install -d $@.tmp/usr/share/doc/pve-firmware
55 cp linux-firmware.git/WHENCE $@.tmp/usr/share/doc/pve-firmware/README
56 install -d $@.tmp/usr/share/doc/pve-firmware/licenses
57 cp linux-firmware.git/LICEN[CS]E* $@.tmp/usr/share/doc/pve-firmware/licenses
58 # we only compress big ones that almost definitively ain't required in the initrd
59 # or are so big and unbuyable (netronome...)
60 cd $@.tmp/lib/firmware; find . -type f \( -name 'i[wb][lt]*' -o -path '*/netronome/*' \) -print0 | xargs -0 -n1 -P0 -- xz -C crc32
61 cd $@.tmp/lib/firmware; find . -xtype l -print0 | xargs -0 -n1 -P0 -- sh -c 'ln -sf "$$(readlink "$$0").xz" "$$0"; mv "$$0" "$$0.xz"'
62 mv $@.tmp $@
63
64 # upgrade to current master
65 .PHONY: update_modules
66 update_modules: submodule
67 git submodule foreach 'git pull --ff-only origin master'
68
69 # make sure submodules were initialized
70 .PHONY: submodule
71 submodule dvb-firmware.git/README linux-firmware.git/WHENCE:
72 test -f "linux-firmware.git/WHENCE" || git submodule update --init
73
74 .PHONY: upload
75 upload: UPLOAD_DIST ?= $(DEB_DISTRIBUTION)
76 upload: $(DEBS)
77 tar cf - $(DEBS) | ssh repoman@repo.proxmox.com -- upload --product pve,pmg,pbs --dist $(UPLOAD_DIST)
78
79 .PHONY: clean
80 clean:
81 rm -rf $(PACKAGE)-[0-9]*/
82 rm -f $(PACKAGE)*.tar* *.deb *.dsc *.changes *.dsc *.buildinfo *.build