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 71 72 73 74 75 76 77 78 79 80 81 82 83 84
|
ARCH = $(shell arch | sed 's/i.86/i386/')
KERN = $(shell uname -r)
KVER = $(shell uname -r | cut -d '.' -f 2)
CFLAGS= -Wall -O -ggdb
DEBUG=
DESTDIR=
INSTALL=install
all: savedump configdump
savedump: savedump.c savedump.h ftp.h ftp.c parseconf.h parseconf.c
gcc ${CFLAGS} -o savedump savedump.c ftp.c parseconf.c -D${ARCH} ${DEBUG}
configdump : configdump.c parseconf.h parseconf.c
gcc ${CFLAGS} -Wall -o configdump configdump.c parseconf.c ${DEBUG}
install: all
$(INSTALL) -d $(DESTDIR)/etc/init.d
$(INSTALL) -m 755 etc.init.d.dumputils $(DESTDIR)/etc/init.d/dumputils
$(INSTALL) -d $(DESTDIR)/var/log/dump
$(INSTALL) -d $(DESTDIR)/usr/sbin
$(INSTALL) -m 755 savedump $(DESTDIR)/usr/sbin/savedump
$(INSTALL) -m 755 configdump $(DESTDIR)/usr/sbin/configdump
$(INSTALL) -d $(DESTDIR)/etc
$(INSTALL) -m 644 etc.dumputils.conf $(DESTDIR)/etc/dumputils.conf
$(INSTALL) -d $(DESTDIR)/usr/share/man/man1
$(INSTALL) -m 544 savedump.1 $(DESTDIR)/usr/share/man/man1
$(INSTALL) -m 544 configdump.1 $(DESTDIR)/usr/share/man/man1
ifeq ($(KVER),6)
$(INSTALL) -d $(DESTDIR)/etc/modprobe.d
$(INSTALL) -m 644 etc.modprobe.d.dumputils $(DESTDIR)/etc/modprobe.d/dumputils
echo "DUMP_FLAGS=0x80000000" >> $(DESTDIR)/etc/dumputils.conf
@echo "Creating character special /dev/dump..."
/bin/rm -f $(DESTDIR)/dev/dump
/bin/mknod $(DESTDIR)/dev/dump c 10 230
else
$(INSTALL) -d $(DESTDIR)/etc/modutils
$(INSTALL) -m 644 etc.modutils.dumputils $(DESTDIR)/etc/modutils/dumputils
echo "DUMP_FLAGS=0" >> $(DESTDIR)/etc/dumputils.conf
@echo "Creating character special /dev/dump..."
/bin/rm -f $(DESTDIR)/dev/dump
/bin/mknod $(DESTDIR)/dev/dump c 227 0
endif
@echo
@echo
@echo
@echo " ******************************************************************"
@echo " * I M P O R T A N T "
@echo " ******************************************************************"
@echo " * *"
@echo " * To complete the installation, manual intervention is required! *"
@echo " * *"
@echo " * 1. You must manually create the appropriate symbolic link from *"
@echo " * the appropriate run level to /etc/init.d/dumputils! See the *"
@echo " * README file for specific information. *"
@echo " * *"
@echo " * 2. You must create a link to your dump partition/device. *"
@echo " * *"
@echo " * 3. You must configure and enable LKCD by editing *"
@echo " * /etc/dumputils.conf *"
@echo " * *"
@echo " ******************************************************************"
@echo " * See the README file for more information! *"
@echo " ******************************************************************"
@echo
@echo
uninstall:
rm -f $(DESTDIR)/usr/sbin/savedump
rm -f $(DESTDIR)/usr/sbin/configdump
rm -f $(DESTDIR)/etc/dumputils.conf
rm -f $(DESTDIR)/etc/init.d/dumputils
rm -f $(DESTDIR)/usr/share/man/man1/savedump.1
rm -f $(DESTDIR)/usr/share/man/man1/configdump.1
rm -f $(DESTDIR)/dev/dump
ifeq ($(KVER),6)
rm -f $(DESTDIR)/etc/modprobe.d/dumputils
else
rm -f $(DESTDIR)/etc/modutils/dumputils
endif
clean clobber:
rm -f *.o savedump configdump
|