Subject: Patch to libc for sun3x
To: None <port-sun3@NetBSD.ORG>
From: Jeremy Cooper <jeremy@broder.com>
List: port-sun3
Date: 05/09/1997 00:20:10
The following shell script will patch the libc as distributed with
NetBSD/sun3 1.2 to workaround the USRSTACK problem with NetBSD/sun3x that 
I just posted.

This patch is meant for sun3x users who are using the sun3 1.2 binary 
distribution only!  Applying this patch is a delicate operation but
it should go flawlessly if you follow the directions carefully.

To use it, save the shell script found at the end of this message and:

    1) Verify that your current /usr/lib/libc.so.12.5 is 368751 bytes.
       If it is not, <<STOP>>; Do not apply this patch.

    2) Bring your system down to single user mode with 'shutdown now'.

    3) Make sure that the partition that contains /usr/lib is mounted.

    4) Edit the shell script to change the LIBC variable if the location
       of your /usr/lib directory is not /usr/lib.
       (example: you have it mounted on /mnt/usr/lib instead.)

    5) Make a backup copy of libc.so.12.5

    6) Run the shell script in a directory that will not be cleared
       when the system comes up multi-user.  (Do not use /tmp!)

       You should see:

           Extracting patch...
           Appying patch...
           1+0 records in
           1+0 records out
           32 bytes transferred in 1 secs (32 bytes/sec)

       If what you see does not match the above, put the backup copy of
       libc.so.12.5 back in place and <<STOP>>.

    7) Exit the single user shell and allow the system to come back up
       in multi-user mode.

       If it does not come back up, reboot into single user mode (b -s at
       the ROM prompt), move the backup copy of libc.so.12.5 back into
       place, and <<STOP>>.

    8) Try to ftp into your machine or run sendmail.  If you succeed
       without coredumps, you have successfully installed the patch.
        
       If you do not succeed, bring your system down to single user mode
       again, move the backup copy of libc.so.12.5 back, and <<STOP>>.

    9) You may now remove 'chunk.new' and the backup copy of libc.so.12.5.

Again, this patch applies to the sun3x port only! (Sun 3/80)  Do not
attempt to use it on any other sun3 machine.

-J

--8<-----------cut---------here----------8<------
#!/bin/sh
BLOCKOFFSET=2500
BLOCKSIZE=32
LIBC=/usr/lib/libc.so.12.5

echo "Extracting patch..."
uudecode <<'EOF'
begin 644 chunk.new
@3I!R`2/!]___]"/M"^#W___P3.XL`/_T3EY.=4Y6``#W
`
end
EOF

echo "Appying patch..."
dd if=chunk.new of=$LIBC  bs=$BLOCKSIZE seek=$BLOCKOFFSET count=1
--8<-----------cut---------here----------8<------