pkgsrc-Changes-HG archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

[pkgsrc/trunk]: pkgsrc/www/navigator Bump i386 packages communicator-4.75 (li...



details:   https://anonhg.NetBSD.org/pkgsrc/rev/09603e316fe6
branches:  trunk
changeset: 478392:09603e316fe6
user:      atatat <atatat%pkgsrc.org@localhost>
date:      Fri Jul 23 03:46:06 2004 +0000

description:
Bump i386 packages communicator-4.75 (linux) and communicator-4.80
(bsdi) for i386 to revision 1 after adding scripts that apply tiny
binary patches that stop them from closing fd 0 before running
"netstat -in".

I finally got tired of the warnings from my kernel, so I made the
binaries stop doing it.

diffstat:

 www/navigator/Makefile.common                             |  14 ++-
 www/navigator/files/binpatch-x86-bsdi-bsd2-4.75.sh        |  70 +++++++++++++++
 www/navigator/files/binpatch-x86-unknown-linux2.2-4.80.sh |  58 ++++++++++++
 3 files changed, 141 insertions(+), 1 deletions(-)

diffs (179 lines):

diff -r bf2890d3a13c -r 09603e316fe6 www/navigator/Makefile.common
--- a/www/navigator/Makefile.common     Fri Jul 23 03:41:47 2004 +0000
+++ b/www/navigator/Makefile.common     Fri Jul 23 03:46:06 2004 +0000
@@ -1,4 +1,4 @@
-# $NetBSD: Makefile.common,v 1.69 2004/05/11 05:18:59 snj Exp $
+# $NetBSD: Makefile.common,v 1.70 2004/07/23 03:46:06 atatat Exp $
 #
 # Common include file for communicator and navigator packages
 
@@ -57,6 +57,7 @@
 
 .elif ${MACHINE_ARCH} == "i386" && defined(NS_USE_BSDI)
 NS_VERS=       4.75
+PKGREVISION=   1
 PKGNAME=       ${BINNAME}-${NS_VERS}
 PLIST_ARCH=    bsdi-i386
 DISTUNAME=     x86-bsdi-bsd2
@@ -64,7 +65,13 @@
 WRKNAME=       x86-bsdi-bsd2
 VENDOR_NAME=   BSD/OS 2.1
 
+BUILD_DEPENDS=  binpatch>=1.0:../../pkgtools/binpatch
+post-install:
+       sh ../../www/navigator/files/binpatch-x86-bsdi-bsd2-4.75.sh \
+           ${LOCALBASE} ${MOZILLA_HOME}/netscape
+
 .elif ${MACHINE_ARCH} == "i386"
+PKGREVISION=   1
 PLIST_ARCH=    linux-i386
 DISTUNAME=     x86-unknown-linux2.2
 DIST_DIR_NAME= supported/linux22
@@ -74,6 +81,11 @@
 DEPENDS+=      ns-flash>4.0:../../multimedia/ns-flash
 .  endif
 
+BUILD_DEPENDS=  binpatch>=1.0:../../pkgtools/binpatch
+post-install:
+       sh ../../www/navigator/files/binpatch-x86-unknown-linux2.2-4.80.sh \
+           ${LOCALBASE} ${MOZILLA_HOME}/netscape
+
 .elif ((${MACHINE_ARCH} == "sparc" || ${MACHINE_ARCH} == "sparc64") && defined(NS_USE_SUNOS))
 .  if !exists(/emul/sunos/usr/lib/ld.so)
 PKG_FAIL_REASON= "${PKGNAME} requires SunOS libraries - see compat_sunos(8)"
diff -r bf2890d3a13c -r 09603e316fe6 www/navigator/files/binpatch-x86-bsdi-bsd2-4.75.sh
--- /dev/null   Thu Jan 01 00:00:00 1970 +0000
+++ b/www/navigator/files/binpatch-x86-bsdi-bsd2-4.75.sh        Fri Jul 23 03:46:06 2004 +0000
@@ -0,0 +1,70 @@
+#!/bin/sh
+
+# $NetBSD: binpatch-x86-bsdi-bsd2-4.75.sh,v 1.1 2004/07/23 03:46:06 atatat Exp $
+#
+# ------------------------------------------------------------------------
+# "THE BEER-WARE LICENSE" (Revision 42):
+# Andrew Brown <atatat%NetBSD.org@localhost> wrote this file.  As long as you
+# retain this notice you can do whatever you want with this stuff.
+# If we meet some day, and you think this stuff is worth it, you can
+# buy me a beer in return.
+# ------------------------------------------------------------------------
+
+PATH=$1/bin:$PATH
+export PATH
+
+# conversion from "386 compact demand paged pure executable" to "ELF
+# 32-bit LSB relocatable, Intel 80386, version 1 (SYSV), not stripped"
+# at the same load address so that objdump can disassemble the binary
+# adds 0x34, so keep that in mind.  the size below is taken from
+# before the objcopy.
+#
+# % objcopy -I binary -O elf32-i386 -B i386 \
+#   --rename-section .data=.text,contents,alloc,load,readonly,code \
+#   --adjust-vma 0x1000 netscape
+#
+# % objdump -h netscape
+# netscape:     file format elf32-i386
+#
+file=$2
+size=10739712
+
+# % objdump -h netscape
+# Sections:
+# Idx Name          Size      VMA       LMA       File off  Algn
+#   0 .text         00a3e000  00001000  00001000  00000034  2**0
+#                   CONTENTS, ALLOC, LOAD, READONLY, CODE
+# ...
+#
+# % objdump -d -j .text netscape
+# ...
+#   76df83:       68 bb 33 a2 00          push   $0xa233bb
+#   76df88:       e8 57 fd ff ff          call   76dce4 <_binary_netscape_start+0x76cce4>
+#   76df8d:       89 c6                   mov    %eax,%esi
+# ...
+#
+# 0x0076df83 - 0x00001000 (+ 0x00000034) = 0x0076cf83
+#
+# note: 0x34 not added since objcopy added that overhead
+#
+offset=0x0076cf83
+
+# compare the push/call/mov instruction bytes
+#
+compare=68bb33a200e857fdffff89c6
+
+# the push instruction is five bytes long
+#
+skip=5
+
+# five nops will overwrite the call to 0x76dce4
+#
+replace=9090909090
+
+binpatch \
+    file=$file \
+    size=$size \
+    offset=$offset \
+    compare=$compare \
+    skip=$skip \
+    replace=$replace
diff -r bf2890d3a13c -r 09603e316fe6 www/navigator/files/binpatch-x86-unknown-linux2.2-4.80.sh
--- /dev/null   Thu Jan 01 00:00:00 1970 +0000
+++ b/www/navigator/files/binpatch-x86-unknown-linux2.2-4.80.sh Fri Jul 23 03:46:06 2004 +0000
@@ -0,0 +1,58 @@
+#!/bin/sh
+
+# $NetBSD: binpatch-x86-unknown-linux2.2-4.80.sh,v 1.1 2004/07/23 03:46:06 atatat Exp $
+#
+# ------------------------------------------------------------------------
+# "THE BEER-WARE LICENSE" (Revision 42):
+# Andrew Brown <atatat%NetBSD.org@localhost> wrote this file.  As long as you
+# retain this notice you can do whatever you want with this stuff.
+# If we meet some day, and you think this stuff is worth it, you can
+# buy me a beer in return.
+# ------------------------------------------------------------------------
+
+PATH=$1/bin:$PATH
+export PATH
+
+# % objdump -h netscape
+# netscape:     file format elf32-i386
+#
+file=$2
+size=13823336
+
+# % objdump -h netscape
+# Sections:
+# Idx Name          Size      VMA       LMA       File off  Algn
+# ...
+#  12 .text         006c77ac  082819e0  082819e0  002399e0  2**4
+#                   CONTENTS, ALLOC, LOAD, READONLY, CODE
+#
+# % objdump -d -j .text netscape
+# ...
+#  884f3e9:       6a 00                   push   $0x0
+#  884f3eb:       e8 24 06 a3 ff          call   0x827fa14
+#  884f3f0:       e8 1f 0c a3 ff          call   0x8280014
+# ...
+#
+# 0x00884f3e9 - 0x0082819e0 + 0x002399e0 = 0x008073e9
+#
+offset=0x008073e9
+
+# compare the push/call/call instruction bytes
+#
+compare=6a00e82406a3ffe81f0ca3ff
+
+# the push instruction is two bytes long
+#
+skip=2
+
+# five nops will overwrite the call to 0x827fa14
+#
+replace=9090909090
+
+binpatch \
+    file=$file \
+    size=$size \
+    offset=$offset \
+    compare=$compare \
+    skip=$skip \
+    replace=$replace



Home | Main Index | Thread Index | Old Index