Google Groups no longer supports new Usenet posts or subscriptions. Historical content remains viewable.
Dismiss

upgrade from 2.0 to 2.0.2

4 views
Skip to first unread message

Peter I. Hansen

unread,
Apr 15, 2005, 2:59:24 AM4/15/05
to
Hi

What is the canonical method for upgrading from 2.0 to 2.0.2?

-Peter

--
Posted automagically by a mail2news gateway at muc.de e.V.
Please direct questions, flames, donations, etc. to news-...@muc.de

Martti Kuparinen

unread,
Apr 15, 2005, 3:08:54 AM4/15/05
to
Martti Kuparinen wrote:

> Peter I. Hansen wrote:
>
>> What is the canonical method for upgrading from 2.0 to 2.0.2?
>
>
> This is how I did it (from the sources):
>
> cd /usr/src
> cvs update -dPA -r netbsd-2-0
> cd /usr/xsrc
> cvs update -dPA -r netbsd-2-0
>
> cd /usr/src
> ./build.sh -uxE -D / build
>
> cd sys/arch/i386/conf
> config GENERIC
> cd ../compile/GENERIC
> make dependall install
>
> sh /usr/src/etc/postinstall fix
> reboot

Or get the binaries and extract them

cd /tmp
ftp ftp://ftp.netbsd.org/pub/NetBSD/NetBSD-2.0.2/i386/binary/sets/
bi
prompt
mg *tgz
bye

rm etc.tgz
for i in *tgz
do
tar xpfz $i -C /
done

Then get or compile your kernel...

Martti Kuparinen

unread,
Apr 15, 2005, 3:05:20 AM4/15/05
to
Peter I. Hansen wrote:

> What is the canonical method for upgrading from 2.0 to 2.0.2?

This is how I did it (from the sources):

cd /usr/src
cvs update -dPA -r netbsd-2-0
cd /usr/xsrc
cvs update -dPA -r netbsd-2-0

cd /usr/src
./build.sh -uxE -D / build

cd sys/arch/i386/conf
config GENERIC
cd ../compile/GENERIC
make dependall install

sh /usr/src/etc/postinstall fix
reboot

--

Klaus Klein

unread,
Apr 15, 2005, 3:40:30 AM4/15/05
to
Martti Kuparinen wrote:

> Martti Kuparinen wrote:
> > Peter I. Hansen wrote:
> >
> >> What is the canonical method for upgrading from 2.0 to 2.0.2?

> Or get the binaries and extract them
>

> [...]


>
> Then get or compile your kernel...

It should be noted that it's generally a bad idea to upgrade userland
before upgrading the kernel, albeit it should not matter between 2.0
and 2.0.2.


- Klaus

Peter I. Hansen

unread,
Apr 15, 2005, 3:59:13 AM4/15/05
to
On Fri, Apr 15, 2005 at 09:40:30AM +0200, Klaus Klein wrote:
> Martti Kuparinen wrote:
>
> > Martti Kuparinen wrote:
> > > Peter I. Hansen wrote:
> > >
> > >> What is the canonical method for upgrading from 2.0 to 2.0.2?
> > Or get the binaries and extract them
> >
> > [...]
> >
> > Then get or compile your kernel...
>
> It should be noted that it's generally a bad idea to upgrade userland
> before upgrading the kernel, albeit it should not matter between 2.0
> and 2.0.2.
>
>
> - Klaus

So, you recommend the reverse method of the one Martti use? :

cd /usr/src
cvs update -dPA -r netbsd-2-0
cd /usr/xsrc
cvs update -dPA -r netbsd-2-0

cd sys/arch/i386/conf


config GENERIC
cd ../compile/GENERIC
make dependall install

cd /usr/src
./build.sh -uxE -D / build

sh /usr/src/etc/postinstall fix
reboot

-Peter

Klaus Klein

unread,
Apr 15, 2005, 4:20:19 AM4/15/05
to
On Friday, 15. April 2005 09:59, Peter I. Hansen wrote:

> So, you recommend the reverse method of the one Martti use? :

It's not quite "reverse", but... :-) Some nits:

> cd /usr/src
> cvs update -dPA -r netbsd-2-0
> cd /usr/xsrc
> cvs update -dPA -r netbsd-2-0

While I'm at it, note that this won't get you the 2.0.2 release but
the latest from the netbsd-2-0 branch. This shouldn't matter much
and even is convenient when building from source since the changes
will consist of bug fixes only, but if it's the netbsd-2-0-2-RELEASE
tag which you should check out if you really need 2.0.2.

> cd sys/arch/i386/conf
> config GENERIC
> cd ../compile/GENERIC
> make dependall install

(Or obtain the binary from the release sets.)
I'd throw in a "reboot" here.

> cd /usr/src
> ./build.sh -uxE -D / build

(Or install the binary sets.)

Jukka Salmi

unread,
Apr 15, 2005, 5:30:40 AM4/15/05
to
Peter I. Hansen --> netbsd-help (2005-04-15 09:59:13 +0200):
[...]

> cd sys/arch/i386/conf
> config GENERIC
> cd ../compile/GENERIC
> make dependall install

Alternatively, you could do

$ cd /usr/src
$ ./build.sh kernel=GENERIC

and copy the resulting kernel manually.


Cheers, Jukka

--
bashian roulette:
$ ((RANDOM%6)) || rm -rf ~

Martti Kuparinen

unread,
Apr 15, 2005, 6:06:15 AM4/15/05
to
Peter I. Hansen wrote:

>>Or get the binaries and extract them
>>
>>cd /tmp
>>ftp ftp://ftp.netbsd.org/pub/NetBSD/NetBSD-2.0.2/i386/binary/sets/
>> bi
>> prompt
>> mg *tgz
>> bye
>>
>>rm etc.tgz
>>for i in *tgz
>>do
>> tar xpfz $i -C /
>>done
>>
>>Then get or compile your kernel...
>
>

> I'm a bit confused here. You prefer compiling the new kernel as
> the last step. I know it should not make a big difference when
> it's only from 2.0->2.0.2, but there must be a 'best way' of
> doing things...

My mistake: always compile a new kernel (or install it from the
binary sets), reboot and install (or compile) everything else.

Martti

Peter I. Hansen

unread,
Apr 15, 2005, 6:02:16 AM4/15/05
to
On Fri, Apr 15, 2005 at 10:08:54AM +0300, Martti Kuparinen wrote:
> Martti Kuparinen wrote:
> >Peter I. Hansen wrote:
> >
> >>What is the canonical method for upgrading from 2.0 to 2.0.2?
> >
> >
> >This is how I did it (from the sources):
> >
[...]

>
> Or get the binaries and extract them
>
> cd /tmp
> ftp ftp://ftp.netbsd.org/pub/NetBSD/NetBSD-2.0.2/i386/binary/sets/
> bi
> prompt
> mg *tgz
> bye
>
> rm etc.tgz
> for i in *tgz
> do
> tar xpfz $i -C /
> done
>
> Then get or compile your kernel...

I'm a bit confused here. You prefer compiling the new kernel as


the last step. I know it should not make a big difference when
it's only from 2.0->2.0.2, but there must be a 'best way' of
doing things...

-Peter

Peter I. Hansen

unread,
Apr 15, 2005, 6:17:52 AM4/15/05
to
On Fri, Apr 15, 2005 at 01:06:15PM +0300, Martti Kuparinen wrote:
> Peter I. Hansen wrote:
>
> >>Or get the binaries and extract them
> >>
> >>cd /tmp
> >>ftp ftp://ftp.netbsd.org/pub/NetBSD/NetBSD-2.0.2/i386/binary/sets/
> >> bi
> >> prompt
> >> mg *tgz
> >> bye
> >>
> >>rm etc.tgz
> >>for i in *tgz
> >>do
> >> tar xpfz $i -C /
> >>done
> >>
> >>Then get or compile your kernel...
> >
> >
> >I'm a bit confused here. You prefer compiling the new kernel as
> >the last step. I know it should not make a big difference when
> >it's only from 2.0->2.0.2, but there must be a 'best way' of
> >doing things...
>
> My mistake: always compile a new kernel (or install it from the
> binary sets), reboot and install (or compile) everything else.
>

ok, so I would want to get kern-GENERIC.tgz, unpack and copy it
to root?
But, is operation not included in your recipe above, where you
get fetch all the binary sets?

-Peter

Martti Kuparinen

unread,
Apr 15, 2005, 6:22:14 AM4/15/05
to
Peter I. Hansen wrote:

>>>>ftp ftp://ftp.netbsd.org/pub/NetBSD/NetBSD-2.0.2/i386/binary/sets/

> ok, so I would want to get kern-GENERIC.tgz, unpack and copy it
> to root?
> But, is operation not included in your recipe above, where you
> get fetch all the binary sets?

Mistake #2: the kernel images are fetched as well and the for loop
in fact extracted all kernels (so you end up having GENERIC_TINY).
Just make sure you extract the correct kernel:

tar xpfz kern-GENERIC.tgz -C /

Martti

Peter I. Hansen

unread,
Apr 15, 2005, 6:37:57 AM4/15/05
to
On Fri, Apr 15, 2005 at 01:22:14PM +0300, Martti Kuparinen wrote:
> Peter I. Hansen wrote:
>
> >>>>ftp ftp://ftp.netbsd.org/pub/NetBSD/NetBSD-2.0.2/i386/binary/sets/

>
> >ok, so I would want to get kern-GENERIC.tgz, unpack and copy it
> >to root?
> >But, is operation not included in your recipe above, where you
> >get fetch all the binary sets?
>
> Mistake #2: the kernel images are fetched as well and the for loop
> in fact extracted all kernels (so you end up having GENERIC_TINY).
> Just make sure you extract the correct kernel:
>
> tar xpfz kern-GENERIC.tgz -C /
>
> Martti

In other words a complete upgrade with the GENERIC kernel would
be made with:

rm etc.tgz kern-GENERIC.MP.tgz kern-GENERIC_*.tgz


for i in *tgz
do
tar xpfz $i -C /
done

If this is correct, it could easily be run as an upgrade script.

Rich Neswold

unread,
Apr 15, 2005, 10:52:50 AM4/15/05
to
On 4/15/05, Peter I. Hansen <p...@xbase.dk> wrote:
> What is the canonical method for upgrading from 2.0 to 2.0.2?

I'm attempting to do my first upgrade via source, too. I've put
together the following steps that I found by doing searches through
the mail archives, the Handbook, Google, and /usr/src/UPDATING.

My machine is currently rebuilding the userland stuff, so I'm not far
into the steps. However, I fully intend to follow through (unless
someone finds a glaring problem with these directions.)

I've already checked out the netbsd-2 branch into /usr/src. Once the
source has been updated, build the tools and a new kernel:

# mkdir /usr/obj
# cd /usr/src
# ./build.sh tools kernel=GENERIC

Now rebuild the userland (replace ${TOOLDIR} with the directory that
was built in the previous step. On my system, it turned out to be
"/usr/obj/tooldir.NetBSD-2.0.1-i386" -- I'm assuming the 2.0.1 portion
of that directory is an oversight when 2.0.2 was released.):

# ./build.sh -U -T ${TOOLDIR} -D /usr/i386build distribution

Next, install and boot the new kernel to make sure things work:

# cd /usr/src/sys/arch/i386/compile/GENERIC
# make install
# shutdown -r now

If the kernel looks good, install the userland that was built in the
earlier steps.

# ./build.sh -u -U -T ${TOOLDIR} -D /usr/i386build install=/

The install finishes by running postinstall to test whether things are
out of date. It'll generate a list of "broken" things. Run the
following command, substituting the list given by the postinstall
command:

# /usr/src/etc/postinstall -s /usr/src -d <LIST OF BROKEN THINGS>

Reboot the machine!

If you have a custom kernel, you can replace GENERIC with your custom
kernel name.

If anyone thinks there's a problem with any of these steps, please let
me know. I'll follow-up to this post if the steps change.

--
Rich

AIM : rnezzy
ICQ : 174908475

Jukka Salmi

unread,
Apr 15, 2005, 11:02:58 AM4/15/05
to
Probably just a typo, but...

Rich Neswold --> netbsd-help (2005-04-15 09:52:50 -0500):


> # /usr/src/etc/postinstall -s /usr/src -d <LIST OF BROKEN THINGS>

either remove -d (defaults to / then), or specify a destdir.

--
bashian roulette:
$ ((RANDOM%6)) || rm -rf ~

--

Rich Neswold

unread,
Apr 15, 2005, 11:19:10 AM4/15/05
to
Already received an update:

On 4/15/05, Rich Neswold <rich.n...@gmail.com> wrote:
> # /usr/src/etc/postinstall -s /usr/src -d <LIST OF BROKEN THINGS>

# /usr/src/etc/postinstall -s /usr/src/etc -d / fix <LIST OF BROKEN THINGS>

Alex Cavnar

unread,
Apr 15, 2005, 11:54:14 AM4/15/05
to
On 4/15/05, Peter I. Hansen <p...@xbase.dk> wrote:
>
> In other words a complete upgrade with the GENERIC kernel would
> be made with:
>
> cd /tmp
> ftp
> ftp://ftp.netbsd.org/pub/NetBSD/NetBSD-2.0.2/i386/binary/sets/
> bi
> prompt
> mg *tgz
> bye
>
> rm etc.tgz kern-GENERIC.MP.tgz kern-GENERIC_*.tgz

> for i in *tgz
> do
> tar xpfz $i -C /
> done
>
> If this is correct, it could easily be run as an upgrade script.
>
> -Peter
>
That's a good idea, except I would use wget, rather than your simple
FTP client:

> cd /tmp
> ftp
> ftp://ftp.netbsd.org/pub/NetBSD/NetBSD-2.0.2/i386/binary/sets/
> bi
> prompt
> mg *tgz
> bye

Could be shortened to:

cd /tmp
ftp
wget ftp://ftp.netbsd.org/pub/NetBSD/NetBSD-2.0.2/i386/binary/sets/*tgz

rm etc.tgz kern-GENERIC.MP.tgz kern-GENERIC_*.tgz


for i in *tgz
do
tar xpfz $i -C /
done

Just a simpler way of doing things,
--Alex Cavnar

Peter I. Hansen

unread,
Apr 15, 2005, 12:12:40 PM4/15/05
to
Alex Cavnar wrote:
> On 4/15/05, Peter I. Hansen <p...@xbase.dk> wrote:
>
>>In other words a complete upgrade with the GENERIC kernel would
>>be made with:
>>
>>cd /tmp
>>ftp
>>ftp://ftp.netbsd.org/pub/NetBSD/NetBSD-2.0.2/i386/binary/sets/
>>bi
>>prompt
>>mg *tgz
>>bye
>>
>>rm etc.tgz kern-GENERIC.MP.tgz kern-GENERIC_*.tgz

>>for i in *tgz
>>do
>>tar xpfz $i -C /
>>done
>>
>>If this is correct, it could easily be run as an upgrade script.
>>
>>-Peter
>>
>
> That's a good idea, except I would use wget, rather than your simple
> FTP client:
>
>
>>cd /tmp
>>ftp
>>ftp://ftp.netbsd.org/pub/NetBSD/NetBSD-2.0.2/i386/binary/sets/
>>bi
>>prompt
>>mg *tgz
>>bye
>
>
> Could be shortened to:
>
> cd /tmp
> wget ftp://ftp.netbsd.org/pub/NetBSD/NetBSD-2.0.2/i386/binary/sets/*tgz
>
> rm etc.tgz kern-GENERIC.MP.tgz kern-GENERIC_*.tgz
> for i in *tgz
> do
> tar xpfz $i -C /
> done
>
> Just a simpler way of doing things,
> --Alex Cavnar

Yes. This would make a shorter script, but then you would have
to install wget. I know wget is a small package, but still.

The more important thing is to get the procedure verified. For
example; there is no postinstall in this, and I'm not sure how
that works. Specially since that seems to come with etc, and we
delete that here.

I will have to try this out on a test-PC, before I gamble with
my production system.

Peter Ibsen Hansen

unread,
Apr 17, 2005, 10:20:52 AM4/17/05
to

Can I be absolutely sure that there are no changes in etc?

-Peter

Peter I. Hansen

unread,
Apr 18, 2005, 4:02:50 PM4/18/05
to
Peter I. Hansen wrote:
> Hi
>
> What is the canonical method for upgrading from 2.0 to 2.0.2?
>
> -Peter

To summarize:

With the good advice I got here I've tested the following method
for doing a binary upgrade from 2.0 to 2.0.2

http://xbase.dk/~pih/howto/netbsd_update_release_bin.php

This worked out quite fine for me on two machines.

Thanks to the people who helped out on this.

0 new messages