Subject: Re: updating, build and install order
To: David Brownlee <abs@netbsd.org>
From: Frederick Bruckman <fredb@immanent.net>
List: current-users
Date: 06/20/2003 11:00:57
On Fri, 20 Jun 2003, David Brownlee wrote:

> On Fri, 20 Jun 2003, Frederick Bruckman wrote:
>
> > On Fri, 20 Jun 2003, William Allen Simpson wrote:
> >
> > >   mv /netbsd /netbsd.old
> > >   mv ../obj/sys/arch/i386/compile/GENERIC/netbsd /
> >
> > With that, there's a chance that an inopportune power failure could
> > render the system unbootable. Better (IMO):
> >
> >     rm /netbsd.old
> >     ln /netbsd /netbsd.old
> >     sync; sync
> >     install -cpr ../obj/sys/arch/i386/compile/GENERIC/netbsd /
> >     sync; sync
> >
> 	'make install' in the compile directory should do the right thing.

It doesn't seem to...

    # make -n install
    rm -f /onetbsd
    ln /netbsd /onetbsd
    cp netbsd /nnetbsd
    mv /nnetbsd /netbsd

For one thing, the i386 bootblocks won't fall back to "/onetbsd" if
"/netbsd" is missing -- they fall back to "/netbsd.old". For another,
"cp" plus "mv" is not the same thing as "install -pr" -- you're going
to end up overwriting your backup kernel in "/onetbsd". To get the
same effect, you'd need to unlink "/netbsd" before the copy. Thirdly,
the single "install" command, besides being more elegant, also sets
the permissions consistently.

Frederick