lkml.org 
[lkml]   [1998]   [Jan]   [24]   [last100]   RSS Feed
Views: [more markup]  [less markup]  [headers]  [forward] 
 
Messages in this thread
Patch in this message
/
DateSat, 24 Jan 1998 15:48:19 +0300 (MSK)
FromBastard Operator from Hell <>
Subject[Patch to 2.0.34] Changes to arch/i386/boot/Makefile
	The following is a patch that (probably) excludes /usr/bin/encaps
gotcha. Too many people forget to remove it. May be it worth to be
included into 2.0.34 (2.1.xx don't need it).
							Cheers,
								Al

diff -urN v2.0.33/linux/arch/i386/boot/Makefile linux/arch/i386/boot/Makefile
--- v2.0.33/linux/arch/i386/boot/Makefile	Wed Jul 17 07:59:14 1996
+++ linux/arch/i386/boot/Makefile	Fri Jan 16 12:48:23 1998
@@ -18,7 +18,7 @@
 
 zImage: $(CONFIGURE) bootsect setup compressed/vmlinux tools/build
 ifdef CONFIG_KERNEL_ELF
-	if hash $(ENCAPS) 2> /dev/null; then \
+	if ./check_binutils $(ENCAPS) $(OBJDUMP) 2>/dev/null; then \
 	  $(OBJDUMP) $(OBJDUMP_FLAGS) -o $(ZIMAGE_OFFSET) compressed/vmlinux > compressed/vmlinux.out; \
 	else \
 	  $(OBJCOPY) compressed/vmlinux compressed/vmlinux.out; \
@@ -31,7 +31,7 @@
 
 bzImage: $(CONFIGURE) bbootsect setup compressed/bvmlinux tools/bbuild
 ifdef CONFIG_KERNEL_ELF
-	if hash $(ENCAPS) 2> /dev/null; then \
+	if ./check_binutils $(ENCAPS) $(OBJDUMP) 2> /dev/null; then \
 	  $(OBJDUMP) $(OBJDUMP_FLAGS) -o $(IMAGE_OFFSET) compressed/bvmlinux > compressed/bvmlinux.out; \
 	else \
 	  $(OBJCOPY) compressed/bvmlinux compressed/bvmlinux.out; \
diff -urN v2.0.33/linux/arch/i386/boot/check_binutils linux/arch/i386/boot/check_binutils
--- v2.0.33/linux/arch/i386/boot/check_binutils	Wed Dec 31 19:00:00 1969
+++ linux/arch/i386/boot/check_binutils	Fri Jan 16 12:33:14 1998
@@ -0,0 +1,26 @@
+#!/bin/sh
+
+#
+# Usage: check_binutils ENCAPS_NAME OBJDUMP_NAME
+# returns true if binutils are "encaps-modified"
+#
+
+
+if hash $1 2>/dev/null; then
+    if hash $2 2>/dev/null; then
+	OBJDUMP_PATH=`hash|grep $2|sed "s/.*[0-9] *//"`
+	LIBBFD_VER=`ldd $OBJDUMP_PATH 2>/dev/null|grep libbfd|\
+	    sed "s/=>.*//g;s/.*so//;s/\./ /g"|\
+	    awk "{print \\\$1*10000+\\\$2*100+\\\$3}"`
+	if [ x$LIBBFD_VER = x ]; then
+	    true # Statically linked. Sad.
+	else
+	    test $LIBBFD_VER -l 20709;
+	fi;
+    else 
+	true     # encaps present, but no objdump? Time for flame, IMHO
+    fi;
+else
+    false
+fi
+


\
 
 \ /
  Last update: 2005-03-22 13:41    [W:3.513 / U:0.010 seconds]
©2003-2008 Jasper Spaans