[PATCH] 2.5.41: lkcd (3/8): kerntypes addition

From: Matt D. Robinson (yakker@aparity.com)
Date: Thu Oct 10 2002 - 15:04:23 EST


This adds kerntypes into the build so that symbols can be
extracted from a single build object in the kernel. This
also modifies the install process to copy the Kerntypes
file along with the kernel and map.

 Makefile | 11 ++++++++++-
 arch/i386/boot/Makefile | 2 +-
 arch/i386/boot/install.sh | 20 +++++++++++++-------
 init/kerntypes.c | 28 ++++++++++++++++++++++++++++
 4 files changed, 52 insertions(+), 9 deletions(-)

diff -Naur linux-2.5.41.orig/Makefile linux-2.5.41.lkcd/Makefile
--- linux-2.5.41.orig/Makefile Mon Oct 7 11:23:25 2002
+++ linux-2.5.41.lkcd/Makefile Tue Oct 8 01:15:48 2002
@@ -353,9 +353,17 @@
 
 # Finally the vmlinux rule
 
-vmlinux: $(vmlinux-objs) $(kallsyms.o) arch/$(ARCH)/vmlinux.lds.s FORCE
+vmlinux: $(vmlinux-objs) $(kallsyms.o) arch/$(ARCH)/vmlinux.lds.s Kerntypes FORCE
         $(call if_changed_rule,vmlinux)
 
+Kerntypes: init/kerntypes.o
+ @if [ -f init/kerntypes.o ]; then \
+ mv init/kerntypes.o Kerntypes; \
+ fi
+
+init/kerntypes.o: init/kerntypes.c include/config/MARKER
+ $(CC) $(CFLAGS) $(CFLAGS_KERNEL) -gstabs -c -o $*.o $<
+
 # The actual objects are generated when descending,
 # make sure no implicit rule kicks in
 
@@ -706,6 +714,7 @@
         .version .config* config.in config.old \
         .menuconfig.log \
         include/asm \
+ Kerntypes \
         .hdepend include/linux/modversions.h \
         tags TAGS kernel.spec \
         .tmp*
diff -Naur linux-2.5.41.orig/arch/i386/boot/Makefile linux-2.5.41.lkcd/arch/i386/boot/Makefile
--- linux-2.5.41.orig/arch/i386/boot/Makefile Mon Oct 7 11:24:08 2002
+++ linux-2.5.41.lkcd/arch/i386/boot/Makefile Tue Oct 8 01:16:35 2002
@@ -77,7 +77,7 @@
         if [ -x /sbin/lilo ]; then /sbin/lilo; else /etc/lilo/install; fi
 
 install: $(BOOTIMAGE)
- sh $(src)/install.sh $(KERNELRELEASE) $(BOOTIMAGE) System.map "$(INSTALL_PATH)"
+ sh $(src)/install.sh $(KERNELRELEASE) $(BOOTIMAGE) System.map $(TOPDIR)/Kerntypes "$(INSTALL_PATH)"
 
 clean:
         @echo 'Cleaning up (boot)'
diff -Naur linux-2.5.41.orig/arch/i386/boot/install.sh linux-2.5.41.lkcd/arch/i386/boot/install.sh
--- linux-2.5.41.orig/arch/i386/boot/install.sh Mon Oct 7 11:24:50 2002
+++ linux-2.5.41.lkcd/arch/i386/boot/install.sh Tue Oct 8 01:15:13 2002
@@ -16,7 +16,8 @@
 # $1 - kernel version
 # $2 - kernel image file
 # $3 - kernel map file
-# $4 - default install path (blank if root directory)
+# $4 - kernel type file
+# $5 - default install path (blank if root directory)
 #
 
 # User may have a custom install script
@@ -26,15 +27,20 @@
 
 # Default install - same as make zlilo
 
-if [ -f $4/vmlinuz ]; then
- mv $4/vmlinuz $4/vmlinuz.old
+if [ -f $5/vmlinuz ]; then
+ mv $5/vmlinuz $5/vmlinuz.old
 fi
 
-if [ -f $4/System.map ]; then
- mv $4/System.map $4/System.old
+if [ -f $5/System.map ]; then
+ mv $5/System.map $5/System.old
 fi
 
-cat $2 > $4/vmlinuz
-cp $3 $4/System.map
+if [ -f $5/Kerntypes ]; then
+ mv $5/Kerntypes $5/Kerntypes.old
+fi
+
+cat $2 > $5/vmlinuz
+cp $3 $5/System.map
+cp $4 $5/Kerntypes
 
 if [ -x /sbin/lilo ]; then /sbin/lilo; else /etc/lilo/install; fi
diff -Naur linux-2.5.41.orig/init/kerntypes.c linux-2.5.41.lkcd/init/kerntypes.c
--- linux-2.5.41.orig/init/kerntypes.c Wed Dec 31 16:00:00 1969
+++ linux-2.5.41.lkcd/init/kerntypes.c Tue Oct 8 01:15:13 2002
@@ -0,0 +1,28 @@
+/*
+ * kerntypes.c
+ *
+ * Copyright (C) 2000 Tom Morano (tjm@sgi.com) and
+ * Matt D. Robinson (yakker@alacritech.com)
+ *
+ * Dummy module that includes headers for all kernel types of interest.
+ * The kernel type information is used by the lcrash utility when
+ * analyzing system crash dumps or the live system. Using the type
+ * information for the running system, rather than kernel header files,
+ * makes for a more flexible and robust analysis tool.
+ *
+ * This source code is released under version 2 of the GNU GPL.
+ */
+#ifndef __KERNEL__
+#define __KERNEL__
+#endif
+#include <linux/module.h>
+#include <linux/autoconf.h>
+#include <linux/mm.h>
+#include <linux/config.h>
+#include <linux/utsname.h>
+#include <linux/dump.h>
+
+void
+kerntypes_dummy(void)
+{
+}
-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/



This archive was generated by hypermail 2b29 : Tue Oct 15 2002 - 22:00:38 EST