File: rules

package info (click to toggle)
kdump-tools 1%3A1.6.8.4
  • links: PTS, VCS
  • area: main
  • in suites: bullseye
  • size: 284 kB
  • sloc: sh: 1,258; makefile: 54
file content (65 lines) | stat: -rwxr-xr-x 2,505 bytes parent folder | download
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
#!/usr/bin/make -f

include /usr/share/dpkg/default.mk

ifeq ($(shell $(call dpkg_vendor_derives_from,Ubuntu)),yes)
	SUBSTVARS = -Vdist:Depends="kexec-tools (>= 1:2.0.10-2)"
else
	SUBSTVARS = -Vdist:Depends="kexec-tools"
endif

KDUMP_CMDLINE_APPEND = reset_devices systemd.unit=kdump-tools-dump.service
ifeq ($(DEB_HOST_ARCH),arm64)
	KDUMP_CMDLINE_APPEND += nr_cpus=1
else ifeq ($(DEB_HOST_ARCH),ppc64el)
	KDUMP_CMDLINE_APPEND += maxcpus=1 irqpoll noirqdistrib nousb
else
	KDUMP_CMDLINE_APPEND += nr_cpus=1 irqpoll nousb ata_piix.prefer_ms_hyperv=0
endif

%:
	dh $@

override_dh_gencontrol:
	dh_gencontrol -- $(SUBSTVARS)

kdump_cmdline_insert = sed "s/@KDUMP_CMDLINE_APPEND@/$(KDUMP_CMDLINE_APPEND)/" < $< > $@
debian/kdump-config: debian/kdump-config.in
	$(kdump_cmdline_insert)
debian/kdump-tools.conf: debian/kdump-tools.conf.in
	$(kdump_cmdline_insert)
debian/kdump-tools.5: debian/kdump-tools.5.in
	$(kdump_cmdline_insert)

override_dh_install: debian/kdump-config debian/kdump-tools.conf debian/kdump-tools.5
	dh_install
	dh_installdirs
	install -D -m 755 debian/kernel-postinst-generate-initrd debian/kdump-tools/etc/kernel/postinst.d/kdump-tools
	install -D -m 755 debian/kernel-postrm-delete-initrd debian/kdump-tools/etc/kernel/postrm.d/kdump-tools
	install -D -m 755 debian/initramfs.hook debian/kdump-tools/usr/share/initramfs-tools/hooks/kdump-tools
	install -D -m 755 debian/initramfs.local-bottom \
debian/kdump-tools/usr/share/initramfs-tools/scripts/local-bottom/kdump-sysctl
	[ ! -f debian/kdump-tools.grub.$(DEB_HOST_ARCH) ] || \
		install -D -m 644 debian/kdump-tools.grub.$(DEB_HOST_ARCH) debian/kdump-tools/etc/default/grub.d/kdump-tools.cfg
	[ -f debian/kdump-tools.grub.$(DEB_HOST_ARCH) ] || \
		install -D -m 644 debian/kdump-tools.grub.default debian/kdump-tools/etc/default/grub.d/kdump-tools.cfg

override_dh_installdeb:
	rm -f debian/kdump-tools.maintscript
	[ ! -f debian/kdump-tools.maintscript.$(DEB_HOST_ARCH) ] || \
		ln -s kdump-tools.maintscript.$(DEB_HOST_ARCH) \
		debian/kdump-tools.maintscript
	[ -h debian/kdump-tools.maintscript ] || \
		ln -s kdump-tools.maintscript.default \
		debian/kdump-tools.maintscript
	dh_installdeb

override_dh_auto_clean:
	rm -f debian/kdump-tools.maintscript
	rm -f debian/kdump-config debian/kdump-tools.conf debian/kdump-tools.5
	dh_auto_clean

override_dh_auto_test:
ifeq (,$(filter nocheck,$(DEB_BUILD_OPTIONS)))
	shellcheck -e SC1090,SC1091 $(shell find debian -maxdepth 1 -type f | xargs grep -l '^#! */bin/\(ba\)\?sh')
endif