tru64-unix-managers (formerly alpha-osf-managers) (1994-2012)
 help / color / mirror / Atom feed
* RIS client boot problem
@ 2002-06-18 16:53 LHERCAUD
  0 siblings, 0 replies; only message in thread
From: LHERCAUD @ 2002-06-18 16:53 UTC (permalink / raw)


[-- Attachment #1: Type: text/plain, Size: 3601 bytes --]

Tru64 Managers,

I want to submit here a problem I found when trying to install Tru64 version
5.1A thru RIS.
Actually, we found 2 problems both related to the reset of the ethernet
controller in conjuction with the topology of the Catalysts.

Symptoms: the RIS kernel booted onto the clients fails to access the root
file system (from the server) thru the network. Both the RIS server and the
clients are on the same subnet. 

It appears obvious to me that the reason for that is the RESET of the
ethernet controller done inside "vmunix1" provoques the rehash of the
Catalyst spaning tree for a period of time which is longer than the one hard
coded within the retries attempted by the kernel. The result is the lost of
ability of the booted kernel to timely access the network resulting to
systematic hung or crash thus preventing the installation to continue.
Inserting a HUB between the Catalyst port and the RIS client allows the
reset to be "hidden" thus the installation succeeds. Of course, the
additionnal HUB is not an acceptable solution and was put in place only for
testing and proving reasons.

I do not have access to source code but  I managed to find 2 subroutines
that access the ethernet using bootp, have some retry code but not
sufficient to allow enough time for the Catalyst to "calm" down:
======================== boot_info()
/* OLD: retrys=5 */
/* while (retrys--) { */

  [bootp_info:3464, 0xfffffc000067d24c] 	bis	zero, 0x4, s4 /* old
*/
  [bootp_info:3467, 0xfffffc000067d250] 	bis	zero, 0x5, s6 /* old
*/
/* !!! NEW: retrys=31 !!! */
  [bootp_info:3464, 0xfffffc000067d24c] 	bis	zero, 0x1e, s4 /*
new */
  [bootp_info:3467, 0xfffffc000067d250] 	bis	zero, 0x1f, s6 /*
new */
======================== netboot_bootp_open()
/* OLD tries 2 times */
  [netboot_bootp_open:467, 0xfffffc000023ab1c] 	bis	zero, 0x2, s5 /* old
*/
/* NEW tries 30 times */
  [netboot_bootp_open:467, 0xfffffc000023ab1c] 	bis	zero, 0x1e, s5 /*
new */
========================
Given that, I patched the binary Alpha code and augmented the retries which
allowed for the RIS clients to boot with no problem (see above  the
assembler lines for the original and the patched code).
Included in this mail, I attach the Patch.ksh script and the "zapb" program
I used to modify the above instructions in the RIS' binary kernel.
 <<Patch.ksh>>  <<zapb.c>> 
One more thing: I detected the same problem (related to the insufficient
number of retries in bootp_info()) in the RIS kernel coming with Tru64 4.0F
, I developped a similar fix/patch for that kernel and submitted the fix to
the Compaq local support organisation. Unfortunately, it seems that the
fix/patch I proposed did not make it thru to the engineering.

Then, you may ask why am I still sending this mail ?
Here are my 2 reasons:
1. I really think this workaround may help some people on this list fix
their RIS problems.
2. I hope that someone in HP/Compaq Tru64 engineering (maybe Dr. Blinn)  has
a look to the fix/patch I propose then to the actual "C" code and decides to
endorse the 2 minor changes regarding the retries count that allow the RIS
kernel to boot despite the Catalyst spaning tree effect. This way I can hope
to get a "supported" solution and obtain the satisfaction of my customer.

Best regards to all of you.

Lucien HERCAUD
Freelance / UNIX Consulting
former DEC OSF/1 Digital Support & UNIX Partner
* Tel. Fixe    +33 1 3945 4260	* BOUYGUES Telecom
*  Tel. Mobile  +33 6 0944 2880	* 24 Avenue de l'Europe
*   Fax          +33 1 3945 4322	* 78944 VELIZY Cedex
*   lhercaud@bouyguestelecom.fr
mailto:lhercaud@mail.dotcom.fr



[-- Attachment #2: Patch.ksh --]
[-- Type: application/octet-stream, Size: 1615 bytes --]

#!/bin/ksh
wd=$(pwd)
if [[ ! -r ./zapb ]] ;
then
	echo zapb is missing, please compile zapb.c with: '"cc -o zapb zapb.c"'
	exit 1
fi
cd /
grep ris.dec /etc/bootptab | tr ':' '\n' | grep bf= | sed 's/bf=//' | while read kr
do
	echo Found Ris Kernel: $kr
	if [[ -L $kr ]] && [[ -r $kr ]] ; then
		dr=$(dirname $kr)
		cd $dr
		fi=$(ls -l $kr | awk '{print $11}')
		kn=$(basename $fi)
		case $kn in
		vmunix*[0-9])
			sum $fi | read ck1 ck2 xx
			if [[ $ck1 = 18569 ]] && [[ $ck2 = 8716 ]]; then
				/bin/true
			else
				echo Ris Kernel: Original Checksum Not Match $fi
				exit 1
			fi
			/bin/cp -p $fi $fi.BT
			echo Patching: netboot_bootp_open:467
			echo '	"bis zero, 2, s5" ==> "bis zero, 30, s5"'
			$wd/zapb $fi.BT  171388 0x455ff10a47e3d40e
			echo Patching: bootp_info:3464
			echo '	"bis zero, 4, s4" ==> "bis zero, 30, s4"'
			echo '	"bis zero, 5, s6" ==> "bis zero, 31, s6"'
			$wd/zapb $fi.BT 3139788 0x47e3f40f47e3d40d
			sum $fi.BT | read ck1 ck2 xx
			if [[ $ck1 = 53020 ]] && [[ $ck2 = 8716 ]]; then
				/bin/rm -f $kr
				ln -s $fi.BT $kr
				echo Ris Kernel: $kr '->' $fi.BT Successfully Patched
				exit 0
			else
				echo Ris Kernel: $fi.BT Patch Failed Checksum Not Match
				exit 1
			fi
			;;
		vmunix*.BT)
			sum $fi | read ck1 ck2 xx
			if [[ $ck1 = 53020 ]] && [[ $ck2 = 8716 ]]; then
				echo Ris Kernel: Already Patched $fi
			else
				echo Ris Kernel: Patched Checksum Not Match $fi
				exit 1
			fi
			;;
		*)
			echo Ris Kernel: Illegal Name $fi
			exit 1
		esac
		
	else
		echo Ris Kernel: Invalid $kr
		exit 1
	fi
done

[-- Attachment #3: zapb.c --]
[-- Type: application/octet-stream, Size: 1326 bytes --]

#include <sys/types.h>
#include <sys/stat.h>
#include <unistd.h>
#include <fcntl.h>
#include <limits.h>
#include <stdio.h>
#include <stdlib.h>

#define ATOF atol

main(int ac, char *av[])
{
        int fd;
        off_t offset,pos;
        unsigned long new;
        unsigned long old;
        char *endptr;

        fd = open(av[1],O_RDWR,0666);
        if (-1 == fd) { perror("open"); exit(1); }
        offset = ATOF(av[2]);
        new = strtoul (av[3], &endptr, 16);
        if (offset != (pos = lseek(fd,offset,SEEK_SET)))
                { perror("lseek"); exit(2); }
        if (-1 == read(fd, &old, sizeof(long)))
                { perror("read"); exit(2); }
        printf("OLD:%lX\n",old);
        printf("NEW:%lX\n",new);
        if (offset != (pos = lseek(fd,offset,SEEK_SET)))
                { perror("lseek"); exit(2); }
        printf("Writing: %lX instead of %lX : ", new, old);
        fflush(stdout);
        sleep(5);
        if (-1 == write(fd, &new, sizeof(long)))
                { perror("write"); exit(2); }
        if (offset != (pos = lseek(fd,offset,SEEK_SET)))
                { perror("lseek"); exit(2); }
        if (-1 == read(fd, &old, sizeof(long)))
                { perror("read"); exit(2); }
        printf("CHK:%lX\n",old);
        close(fd);
}

^ permalink raw reply	[flat|nested] only message in thread

only message in thread, other threads:[~2002-06-18 16:53 UTC | newest]

Thread overview: (only message) (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2002-06-18 16:53 RIS client boot problem LHERCAUD

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox