How long does it take to upgrade via cvsup?
One of the most powerful features of FreeBSD is the upgrade facility.
cvsup is a great tool when it comes to upgrading
your source code.
I was in the process of upgrading a friend’s box from 4.0-RELEASE to
4.1-STABLE. That’s when I thought it might be a good idea to record how long it
takes to cvsup and build everything. Hopefully, some of your will find this useful.
There is another article on how to upgrade your box,
but that will be updated after this article is completed. The upgrade instructions
have recently changed. Once I have confirmed that these instructions work for me,
I’ll refresh that article.
For what it’s worth, I’m using a script
to do this upgrade. It’s much easier than typing out the commands by hand.
NOTE: this script will be updated to the latest recommendations once this article is
finished and I’ve tested the changes for myself.
The box
These times need to be put into perspective. I’m working with a very
slow box. Here’s what dmesg has to say about the hardware:
Timecounter "i8254" frequency 1193182 Hz CPU: Cyrix 486DX2 (486-class CPU) Origin = "CyrixInstead" DIR=0x321b Stepping=3 Revision=2 real memory = 41943040 (40960K bytes)
That’s not very fast.
The connection
Unfortunately, my situation is hardly unique. I’m running my own
cvsup server, which is on my own 10 Mb LAN. The cvsup server in question is a very
low powered 486. I’ll take suggestions as to how this situation can be translated to
the real world.
cvsup
The cvsup started at 14:12 and finished at 16:19. That is
approximately 2 hours. That’s all of the source code from an empty /usr/src/
directory. In fact, /usr/src didn’t exist. Expect your times to be faster if
you already have a /usr/src/ or a faster CPU. cvsup is known to be CPU
hungry. Your cvsup will also be faster still if you have recently done a cvsup, say
from 4.0-RELEASE to 4.0-STABLE.
/usr/src contains about 268MB of source code.
That might help you to figure out how long your cvsup will take.
build world
The build started at 16:28 and it’s now 00:40; that’s about 8 hours.
Oops! -current not -stable (added on 18 August 2000)
I screwed up. The above build world failed. When asking for
help, it was suggested I had gone to -current, not -stable. DOH! I had.
When
I took my cvsup file from /usr/share/examples/cvsup/standard-supfile I forgot
to set my tag file properly. As a result, I upgraded to -current, not -stable.
I should have changed the following line:
*default release=cvs tag=.
to:
*default release=cvs tag=RELENG_4
As a result of my mistake, I decided to reinstall 4.0-RELEASE, and do the cvsup again
(for the record, this cvsup took 2hrs and 5 minues).
Here is the cvsup command I used:
cvsup -g -z -L2 /root/make/standard-supfile 2>&1 | tee $(LOGTO)/standard-cvs.$(DATE);
When using the script, this would be:
make update
build world – II
My second build world started at 07.31 and finished at 03:49, so that is
20hrs and 20minutes.
Here is the command I used:
cd /usr/src; \ make buildworld 2>&1 | tee $(LOGTO)/bw.$(DATE);
When using the script, this would be:
make build
install world
I’ve just started the install world.
Here is the command I used:
cd /usr/src; \ make installworld 2>&1 | tee $(LOGTO)/iw.$(DATE);
When using the script, this would be:
make install
The installworld took about 40 minutes.
the kernel
Here is the command I used to build the kernel:
(cd /usr/src && \ make buildkernel KERNEL=$(MYKERNEL) && \ make installkernel KERNEL=$(MYKERNEL)) \ 2>&1 | tee $(LOGTO)/kernel.$(DATE);
When using the script, this would be:
make kernel
The kernel build took about 2 hours and 40 minutes.
mergemaster
Here is the command I used:
/usr/sbin/mergemaster -w 120 -t $(LOGTO)/root.$(DATE) \ 2>&1 | tee $(LOGTO)/merge.$(DATE);
When using the script, this would be:
make merge
The merge took ten minutes, however, this is a manual process so your time may vary.
I’ve done a few merges in my time but your first merge might take you 30 minutes or
so.
What now?
I’ve updated my build world make script
to reflect recent changes to kernel building. There are now two methods for building
a kernel. One is used when building world (make kernel) and the other is
used at all other times (make kerneloldstyle). Here are the relevent
sections of the Makefile:
kerneloldstyle: # # use this method only if you are not building world # (cd /sys/i386/conf && \ config $(MYKERNEL) && \ cd ../../compile/$(MYKERNEL) && \ make depend && \ make && \ make install && \ make clean) 2>&1 | tee $(LOGTO)/kernel.$(DATE); kernel: # # if you are using FreeBSD 4.1-stable or later, use these instructions # NOTE: this method should only be used when building world. # if you use it otherwise, you will get an error. # you should use "make kerneloldstyle" instead # (cd /usr/src && \ make buildkernel KERNEL=$(MYKERNEL) && \ make installkernel KERNEL=$(MYKERNEL)) \ 2>&1 | tee $(LOGTO)/kernel.$(DATE);
Both of the above methods are document in the Building and Installing
a Custom Kernel of the FreeBSD Hanbook.