forked from rhkdump/kdump-utils
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Makefile
70 lines (60 loc) · 2.66 KB
/
Makefile
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
66
67
68
69
70
prefix ?= /usr
libdir ?= ${prefix}/lib
datadir ?= ${prefix}/share
pkglibdir ?= ${libdir}/kdump
sysconfdir ?= /etc
bindir ?= ${prefix}/bin
sbindir ?= ${prefix}/sbin
mandir ?= ${prefix}/share/man
localstatedir ?= /var
sharedstatedir ?= /var/lib
udevrulesdir ?= ${libdir}/udev/rules.d
systemdsystemunitdir ?= ${libdir}/systemd/system/
ARCH ?= $(shell uname -m)
dracutmoddir = $(DESTDIR)${libdir}/dracut/modules.d
dracut-modules:
mkdir -p $(dracutmoddir)
cp -r dracut/99kdumpbase $(dracutmoddir)
cp -r dracut/99earlykdump $(dracutmoddir)
ifeq ($(ARCH), $(filter ppc64le ppc64,$(ARCH)))
cp -r dracut/99zz-fadumpinit $(dracutmoddir)
endif
kdump-conf: gen-kdump-conf.sh
./gen-kdump-conf.sh $(ARCH) > kdump.conf
kdump-sysconfig: gen-kdump-sysconfig.sh
./gen-kdump-sysconfig.sh $(ARCH) > kdump.sysconfig
manpages:
install -D -m 644 mkdumprd.8 kdumpctl.8 -t $(DESTDIR)$(mandir)/man8
install -D -m 644 kdump.conf.5 $(DESTDIR)$(mandir)/man5/kdump.conf.5
install: dracut-modules kdump-conf kdump-sysconfig manpages
mkdir -p $(DESTDIR)$(pkglibdir)
mkdir -p -m755 $(DESTDIR)$(sysconfdir)/kdump/pre.d
mkdir -p -m755 $(DESTDIR)$(sysconfdir)/kdump/post.d
mkdir -p -m755 $(DESTDIR)$(localstatedir)/crash
mkdir -p -m755 $(DESTDIR)$(udevrulesdir)
mkdir -p -m755 $(DESTDIR)$(sharedstatedir)/kdump
mkdir -p -m755 $(DESTDIR)$(libdir)/kernel/install.d/
install -D -m 755 kdumpctl $(DESTDIR)$(bindir)/kdumpctl
install -D -m 755 mkdumprd $(DESTDIR)$(sbindir)/mkdumprd
install -D -m 644 kdump.conf $(DESTDIR)$(sysconfdir)
install -D -m 644 kdump.sysconfig $(DESTDIR)$(sysconfdir)/sysconfig/kdump
install -D -m 755 kdump-lib.sh kdump-lib-initramfs.sh kdump-logger.sh -t $(DESTDIR)$(pkglibdir)
ifeq ($(ARCH), $(filter ppc64le ppc64,$(ARCH)))
install -m 755 mkfadumprd $(DESTDIR)$(sbindir)
install -m 755 kdump-migrate-action.sh kdump-restart.sh -t $(DESTDIR)$(pkglibdir)
install -m 755 60-fadump.install $(DESTDIR)$(libdir)/kernel/install.d/
endif
ifneq ($(ARCH),s390x)
install -m 755 kdump-udev-throttler $(DESTDIR)$(udevrulesdir)/../kdump-udev-throttler
# For s390x the ELF header is created in the kdump kernel and therefore kexec
# udev rules are not required
ifeq ($(ARCH), $(filter ppc64le ppc64,$(ARCH)))
install -m 644 98-kexec.rules.ppc64 $(DESTDIR)$(udevrulesdir)/98-kexec.rules
else
install -m 644 98-kexec.rules $(DESTDIR)$(udevrulesdir)/98-kexec.rules
endif
endif
install -D -m 644 kdump.service $(DESTDIR)$(systemdsystemunitdir)/kdump.service
install -m 755 -D kdump-dep-generator.sh $(DESTDIR)$(libdir)/systemd/system-generators/kdump-dep-generator.sh
install -m 755 60-kdump.install $(DESTDIR)$(libdir)/kernel/install.d/
install -m 755 92-crashkernel.install $(DESTDIR)$(libdir)/kernel/install.d/