| 1 |
|
| 2 |
|
| 3 |
|
| 4 |
|
| 5 |
|
| 6 |
PACKAGE := intel-microcode |
| 7 |
DEBDIR := $(CURDIR)/debian |
| 8 |
PKGDIR := $(DEBDIR)/$(PACKAGE) |
| 9 |
|
| 10 |
DEB_HOST_ARCH ?= $(shell dpkg-architecture -qDEB_HOST_ARCH) |
| 11 |
|
| 12 |
export PATH := $(PATH):/sbin:/usr/sbin |
| 13 |
IUCODE_TOOL := iucode_tool |
| 14 |
|
| 15 |
|
| 16 |
export DH_ALWAYS_EXCLUDE=CVS:.svn:.git |
| 17 |
|
| 18 |
ifneq (,$(filter amd64 x32,$(DEB_HOST_ARCH))) |
| 19 |
IUCODE_FILE := intel-microcode-64.bin |
| 20 |
FWDIR_TARGET := intel-ucode-fw64 |
| 21 |
else |
| 22 |
IUCODE_FILE := intel-microcode.bin |
| 23 |
FWDIR_TARGET := intel-ucode-fw |
| 24 |
endif |
| 25 |
|
| 26 |
|
| 27 |
INITRAMFS_NAME := $(subst -,_,$(subst +,_,$(subst .,_,$(PACKAGE)))) |
| 28 |
|
| 29 |
%: |
| 30 |
dh $@ |
| 31 |
|
| 32 |
override_dh_auto_install: |
| 33 |
dh_testdir |
| 34 |
dh_install |
| 35 |
|
| 36 |
|
| 37 |
$(MAKE) FWDIR="$(PKGDIR)/usr/lib/firmware/intel-ucode" $(FWDIR_TARGET) |
| 38 |
|
| 39 |
|
| 40 |
if [ -r debian/ucode-blacklist.txt ] ; then \ |
| 41 |
cat debian/ucode-blacklist.txt | while read -r fn crap ; do \ |
| 42 |
if [ -r "$(PKGDIR)/usr/lib/firmware/intel-ucode/$${fn}" ] ; then \ |
| 43 |
mv "$(PKGDIR)/usr/lib/firmware/intel-ucode/$${fn}" "$(PKGDIR)/usr/lib/firmware/intel-ucode/$${fn}.initramfs" ;\ |
| 44 |
echo "Renaming blacklisted microcode $${fn}" ; \ |
| 45 |
fi ; \ |
| 46 |
done ; \ |
| 47 |
fi |
| 48 |
|
| 49 |
mkdir -p "$(PKGDIR)/usr/share/initramfs-tools/hooks" |
| 50 |
install -m 755 "$(DEBDIR)/initramfs.hook" \ |
| 51 |
"$(PKGDIR)/usr/share/initramfs-tools/hooks/$(INITRAMFS_NAME)" |
| 52 |
mkdir -p "$(PKGDIR)/etc/kernel/preinst.d" |
| 53 |
install -m 755 "$(DEBDIR)/$(PACKAGE).kpreinst" \ |
| 54 |
"$(PKGDIR)/etc/kernel/preinst.d/$(PACKAGE)" |
| 55 |
|
| 56 |
|
| 57 |
install -m 644 "$(DEBDIR)/$(PACKAGE).default" "$(PKGDIR)/etc/default/$(PACKAGE)" |
| 58 |
|
| 59 |
|
| 60 |
install -m 644 "$(DEBDIR)/$(PACKAGE).modprobe-blacklist" "$(PKGDIR)/etc/modprobe.d/$(PACKAGE)-blacklist.conf" |
| 61 |
|
| 62 |
override_dh_installchangelogs: |
| 63 |
dh_installchangelogs changelog |
| 64 |
|
| 65 |
override_dh_installdocs: |
| 66 |
dh_installdocs |
| 67 |
(cd "$(DEBDIR)/$(PACKAGE)/usr/share/doc/$(PACKAGE)/" && sed -i -E 's/\r//g' *.md) |
| 68 |
|