X-MimeOLE: Produced By Microsoft Exchange V6.5
Received: by onstor-exch02.onstor.net 
	id <01C82235.2419562C@onstor-exch02.onstor.net>; Thu, 8 Nov 2007 10:28:21 -0800
MIME-Version: 1.0
Content-Type: text/plain;
	charset="us-ascii"
Content-Transfer-Encoding: quoted-printable
Content-class: urn:content-classes:message
Subject: RE: EverON-3.1.0.5-install.sh
Date: Thu, 8 Nov 2007 10:28:20 -0800
Message-ID: <BB375AF679D4A34E9CA8DFA650E2B04E06794503@onstor-exch02.onstor.net>
In-Reply-To: <20071108081508.456bb7c4@ripper.onstor.net>
X-MS-Has-Attach: 
X-MS-TNEF-Correlator: 
Thread-Topic: EverON-3.1.0.5-install.sh
Thread-Index: AcgiIokAQ74fy4NHTTq0MWakuJGplwAECWiA
References: <BB375AF679D4A34E9CA8DFA650E2B04E067942A4@onstor-exch02.onstor.net> <20071108081508.456bb7c4@ripper.onstor.net>
From: "Ed Kwan" <ed.kwan@onstor.com>
To: "Andy Sharp" <andy.sharp@onstor.com>
Cc: "Brian Nguyen" <brian.nguyen@onstor.com>

Hi Andy,

Well, customers are using it to upgrade from 3.x to 3.x.  Whether it's a
bug or ECR or PVR, it's giving Brian and me headaches.

Before I sent you the email yesterday evening, I wasted 1/2 hr trying
similar code change you suggested, and it didn't work:

eng236# cat s1
#!/bin/sh

get_free_space() {
        set -vx
        fs=3D$1

        df -k | grep '^/dev' | while read dev sz used avail crack mpt ;
do
                        echo $dev $avail
                        return
                        echo "after return"
        done
        echo "should not reach"
}

p=3D"/ /tmp"
a=3D`get_free_space "$p"`
echo a is $a

eng236# ./s1
+ fs=3D/ /tmp
+ df -k
+ grep ^/dev
+ read dev sz used avail crack mpt
+ echo /dev/wd1a 29692
+ return
+ echo should not reach
a is /dev/wd1a 29692 should not reach

The "return" statement causes the while-loop to exit, but we continue
execution in get_free_space(). =20

Ed


> -----Original Message-----
> From: Andy Sharp
> Sent: Thursday, November 08, 2007 8:15 AM
> To: Ed Kwan
> Cc: Brian Nguyen
> Subject: Re: EverON-3.1.0.5-install.sh
>=20
> On Wed, 7 Nov 2007 19:27:52 -0800 "Ed Kwan" <ed.kwan@onstor.com>
wrote:
>=20
> > Hi Andy,
>=20
> Hi Eric,
>=20
> > While researching TED 20993, I noticed a bug in the EverON install
> > script.  When a customer use it on a 3.x system, /usr/local/agile
and
> > /usr don't exist, so get_free_space() won't echo any numbers.  This
> > causes a syntax error in line 497:
>=20
> First of all, let's get something straight.  It's not a bug in the
> script, as the requirements for the script never included this use,
> ie., upgrading from a 3.x to something else.  Customers should really
> use upgrade.
>=20
> Phew, now that we have that major issue straightened out, on to the
> next part.
>=20
> What is bug 20993?
>=20
> You do have /usr and /usr/local/agile, if you are on a system the
script
> was designed to run on, so you need to take a good long look at this
> script to see where else there might be parts that expect similar
> circumstances; there may actually be quite a few.
>=20
> Of course, you could just assign the bug to me^H^HLarry.
>=20
> Or just change get_free_space thusly:
>=20
> get_free_space() {
> 	fs=3D$1
>=20
> 	df -k | grep '^/dev' | while read dev sz used avail crack mpt ;
do
> 		if [ "$mpt" =3D "$fs" ] ; then
> 			echo $avail
> 			return
> 		fi
> 	done
> 	echo 0
> }
>=20
> Cheers,
>=20
> a
>=20
> >     475 findspace() {
> >
> >     481         # find the biggest chunk of free space
> >     482         for p in / /usr /usr/local/agile /var ; do
> >
> >     496                 a=3D`get_free_space "$p"`
> >     497                 if [ $a -gt $fkb ] ; then, and
> >
> > Here are my proposed changes.  Please review.
> >
> > Thanks,
> > Ed
> >
> > [edk@edk-linux Tools]$ p4 diff -dc
> > =3D=3D=3D=3D //depot/dev/nfx-tree/Tools/cw_install.in#3 -
> > /homes/edk/p4/dev/nfx-tree/Tools/cw_install.in =3D=3D=3D=3D
> > ***************
> > *** 465,470 ****
> > --- 465,471 ----
> >         df -k | grep '^/dev' | while read dev sz used avail crack
> > mpt ; do
> >                 if [ "$mpt" =3D "$fs" ] ; then
> >                         echo $avail
> > +                         break
> >                 fi
> >         done
> >   }
> > ***************
> > *** 494,500 ****
> >                         fi
> >                 fi
> >                 a=3D`get_free_space "$p"`
> > !               if [ $a -gt $fkb ] ; then
> >                         d=3D`expr $a - $fkb`
> >                         if [ $d -ge 10240 ] ; then
> >                                 # 10 MB is enough, we're out of here
> > --- 495,501 ----
> >                         fi
> >                 fi
> >                 a=3D`get_free_space "$p"`
> > !               if [ "$a" -gt $fkb ] ; then
> >                         d=3D`expr $a - $fkb`
> >                         if [ $d -ge 10240 ] ; then
> >                                 # 10 MB is enough, we're out of here
> >
> >
