From b255c4a026f9811725f43a6be7a54695ec36cb10 Mon Sep 17 00:00:00 2001 From: Baoquan He Date: Thu, 14 Mar 2013 14:10:17 +0800 Subject: [PATCH] Support for eppic language as a subpackage This feature enables us to specify rules to scrub data in a dumpfile with eppic macro instead of the current configuration file (makedumpfile.conf). Currently, this feature works only for symbols in vmlinux while the current feature can work also for module symbols. This library is backported from upstream, integrated and tested by Dave Anderson. --- .gitignore | 1 + ...ild-makedumpfile-eppic-shared-object.patch | 20 +++++++++++++++++ kexec-tools.spec | 22 ++++++++++++++++++- sources | 1 + 4 files changed, 43 insertions(+), 1 deletion(-) create mode 100644 kexec-tools-2.0.3-build-makedumpfile-eppic-shared-object.patch diff --git a/.gitignore b/.gitignore index 493d792..1965bc4 100644 --- a/.gitignore +++ b/.gitignore @@ -9,3 +9,4 @@ makedumpfile-1.3.5.tar.gz /makedumpfile-1.5.0.tar.gz /makedumpfile-1.5.1.tar.gz /makedumpfile-1.5.3.tar.gz +/eppic_030413.tar.gz diff --git a/kexec-tools-2.0.3-build-makedumpfile-eppic-shared-object.patch b/kexec-tools-2.0.3-build-makedumpfile-eppic-shared-object.patch new file mode 100644 index 0000000..7460158 --- /dev/null +++ b/kexec-tools-2.0.3-build-makedumpfile-eppic-shared-object.patch @@ -0,0 +1,20 @@ +--- kexec-tools-2.0.3/makedumpfile-1.5.3/Makefile.orig ++++ kexec-tools-2.0.3/makedumpfile-1.5.3/Makefile +@@ -60,7 +60,7 @@ LIBS := -lsnappy $(LIBS) + CFLAGS += -DUSESNAPPY + endif + +-all: makedumpfile ++all: makedumpfile eppic_makedumpfile.so + + $(OBJ_PART): $(SRC_PART) + $(CC) $(CFLAGS) -c -o ./$@ ./$(@:.o=.c) +@@ -80,7 +80,7 @@ makedumpfile: $(SRC) $(OBJ_PART) $(OBJ_A + gzip -c ./makedumpfile.conf.5 > ./makedumpfile.conf.5.gz + + eppic_makedumpfile.so: extension_eppic.c +- $(CC) $(CFLAGS) -shared -rdynamic -o $@ extension_eppic.c -fPIC -leppic -ltinfo ++ $(CC) $(CFLAGS) -shared -rdynamic -o $@ extension_eppic.c -I../eppic/libeppic -fPIC ../eppic/libeppic/libeppic.a -ltinfo + + clean: + rm -f $(OBJ) $(OBJ_PART) $(OBJ_ARCH) makedumpfile makedumpfile.8.gz makedumpfile.conf.5.gz diff --git a/kexec-tools.spec b/kexec-tools.spec index 2cf2d26..a84981e 100644 --- a/kexec-tools.spec +++ b/kexec-tools.spec @@ -23,6 +23,7 @@ Source15: kdump.conf.5 Source16: kdump.service Source17: rhcrashkernel-param Source18: kdump.sysconfig.s390x +Source19: eppic_030413.tar.gz ####################################### # These are sources for mkdumpramfs @@ -37,7 +38,7 @@ Requires(preun): systemd-units Requires(postun): systemd-units Requires(pre): coreutils sed zlib Requires: dracut, dracut-network -BuildRequires: zlib-devel zlib zlib-static elfutils-devel-static glib2-devel bzip2-devel +BuildRequires: zlib-devel zlib zlib-static elfutils-devel-static glib2-devel bzip2-devel ncurses-devel bison flex BuildRequires: pkgconfig intltool gettext BuildRequires: systemd-units %ifarch %{ix86} x86_64 ppc64 ia64 ppc s390x @@ -80,6 +81,7 @@ Patch501: kexec-tools-2.0.3-ppc-exec-stack-fix.patch Patch601: kexec-tools-2.0.3-disable-kexec-test.patch Patch602: kexec-tools-2.0.3-vmcore-dmesg-Do-not-write-beyond-end-of-buffer.patch Patch603: kexec-tools-2.0.3-vmcore-dmesg-vmcore-dmesg-Make-it-work-with-new-stru.patch +Patch604: kexec-tools-2.0.3-build-makedumpfile-eppic-shared-object.patch %description kexec-tools provides /sbin/kexec binary that facilitates a new @@ -88,11 +90,22 @@ normal or a panic reboot. This package contains the /sbin/kexec binary and ancillary utilities that together form the userspace component of the kernel's kexec feature. +%package eppic +Requires: %{name} = %{version} +Summary: Additional eppic_makedumpfile.so shared object +Group: Applications/System + +%description eppic +The eppic_makedumpfile.so shared object is loaded by the +"makedumpfile --eppic" option, and is used to erase sensitive +or confidential kernel data from a dumpfile. + %prep %setup -q mkdir -p -m755 kcp tar -z -x -v -f %{SOURCE9} +tar -z -x -v -f %{SOURCE19} %patch001 -p1 @@ -102,6 +115,7 @@ tar -z -x -v -f %{SOURCE9} %patch601 -p1 %patch602 -p1 %patch603 -p1 +%patch604 -p1 tar -z -x -v -f %{SOURCE13} @@ -131,6 +145,7 @@ cp %{SOURCE10} . make %ifarch %{ix86} x86_64 ia64 ppc64 s390x +make -C eppic/libeppic make -C makedumpfile-1.5.3 LINKTYPE=dynamic %endif make -C kexec-tools-po @@ -146,6 +161,7 @@ mkdir -p -m755 $RPM_BUILD_ROOT%{_datadir}/kdump mkdir -p -m755 $RPM_BUILD_ROOT%{_sysconfdir}/udev/rules.d mkdir -p $RPM_BUILD_ROOT%{_unitdir} mkdir -p -m755 $RPM_BUILD_ROOT%{_bindir} +mkdir -p -m755 $RPM_BUILD_ROOT%{_libdir} install -m 755 %{SOURCE1} $RPM_BUILD_ROOT%{_bindir}/kdumpctl SYSCONFIG=$RPM_SOURCE_DIR/kdump.sysconfig.%{_target_cpu} @@ -167,6 +183,7 @@ install -m 755 %{SOURCE17} $RPM_BUILD_ROOT/usr/sbin/rhcrashkernel-param %ifarch %{ix86} x86_64 ia64 ppc64 s390x install -m 755 makedumpfile-1.5.3/makedumpfile $RPM_BUILD_ROOT/sbin/makedumpfile install -m 644 makedumpfile-1.5.3/makedumpfile.8.gz $RPM_BUILD_ROOT/%{_mandir}/man8/makedumpfile.8.gz +install -m 755 makedumpfile-1.5.3/eppic_makedumpfile.so $RPM_BUILD_ROOT/%{_libdir}/eppic_makedumpfile.so %endif make -C kexec-tools-po install DESTDIR=$RPM_BUILD_ROOT %find_lang %{name} @@ -304,6 +321,9 @@ done %doc TODO %doc kexec-kdump-howto.txt +%files eppic +%{_libdir}/* +%{_libdir}/eppic_makedumpfile.so %changelog * Thu Mar 14 2013 Baoquan He - 2.0.3-68 diff --git a/sources b/sources index e4afafc..443d46d 100644 --- a/sources +++ b/sources @@ -1,3 +1,4 @@ b3ced2097ce3981abba38ceedc84f939 kexec-tools-2.0.3.tar.bz2 344933eab912fedc27c6bd4587b206ed kexec-tools-po.tar.gz 3af415c63f828b18d3f61a35c2a17b96 makedumpfile-1.5.3.tar.gz +64f3186de4261518730c525168c5e923 eppic_030413.tar.gz