View Single Post
  #2   (View Single Post)  
Old 8th February 2009
phoenix's Avatar
phoenix phoenix is offline
Risen from the ashes
 
Join Date: May 2008
Posts: 696
Default

Note: please use [ code ] tags and not [ quote ] tags, as using quotes will break replies for people, as the forum doesn't do multi-level quoting in replies.

Code:
1. Turn OFF kern_securelevel=2 in rc.conf

2. Reboot

3. cd /boot

4. tar cf KERNELCONF-NAME.tar kernel
Don't use tar, as you then can't select it from the loader menu/prompt. Instead, use
# cd /boot
# cp -Rp kernel kernel.works
(name it after the kernconf file name, version number, or something that is easy to remember). This isn't as big a deal when doing remote upgrades as you can't get a loader prompt (unless using a serial console), but it's a good habit to get into. Then you can use
load /boot/kernel.works/kernel
load /boot/kernel.works/acpi.ko

to load the known-good kernel.

Code:
5. Edit stable-supfile file to required version

6. run: cvsup stable-supfile
You can uninstall cvsup and all the modula-3 packages. csup comes with the base OS now, and can be used in place of cvsup.

Code:
7. cd /usr/src

8. less UPDATE - check for important notes

9.  make -j12 buildworld

10.  make -j12 buildkernel KERNCONF=MYKERNEL *
-j12 is extreme overkill. The standard recommendation is to use (NUMCPUS + 1). Using too high of a -j setting will slow things down immensely. You may want to do a few test runs to find the optimum setting for your systems. Run the following with various -j settings:
# /usr/bin/time -h make -jX buildworld

Code:
11.  make installkernel
Reboot after installing the new kernel, to make sure the kernel works. You can run an old world on a new kernel, but you can't run a new world on an old kernel. So if you reboot after installworld and things fail, you may be screwed, requiring the use of a fixit CD.

You should also get in the habit of using:
# make KODIR=/boot/kernel.new KERNCONF=whatever installkernel

This will install the kernel as /boot/kernel.new and leave the working kernel as /boot/kernel. Then you can use:
# nextboot -k kernel.new

to boot using the new kernel for the next reboot only. If things fail, just reboot again, and you are back to using the old kernel. If the boot succeeds, then you can just rename /boot/kernel.new to /boot/kernel.

Code:
12. mergemaster -p *

13. make installworld

14.  mergemaster -viU *
You should do a reboot here as well, to make sure the system will come up properly when using both the new kernel and the new world. Before setting securelevel. Just to be safe.

Quote:
11. I use custom kernel so need to declare what kernel, i have read somewhere that you can have entry in make.conf that will build generic and custom kernel but only use custom kernel, but have not been able to find it?
KERNCONF= is a space separated list of kernels to build/install, in the order to build/install them. So you can use things like:
# make KERNCONF="MYKERNEL GENERIC" buildkernel
# make KERNCONF=GENERIC KODIR=/boot/kernel.generic installkernel
# make KERNCONF=MYKERNEL KODIR=/boot/kernel.custom installkernel

to build the two kernels one after the other, then install them individually. You can also use the following, which will install the two kernel one after the other, which has the effect of making /boot/kernel==GENERIC and /boot/kernel.old==MYKERNEL:
# make KERNCONF="MYKERNEL GENERIC" installkernel

Quote:
12 & 14
During mergemaster the question about deleting /tmp/temproot kept coming up and was not sure if i should or not, here is explanation given:
Delete it. Unless you are running mergemaster on a daily basis, there's no point wasting the space to save a few extra seconds.

Quote:
Single user mode.
In handbook and guides tell you to enter single user mode before doing make installworld, trouble is on remote server this is not possible so you have bypass this step. I am told there is risk but with so many remote servers it does appear to work ok.
It's safest to use single-user mode, as nothing is loaded into memory except the kernel, and no users can login. However, if you manually stop as many running processes as possible (except sshd of course), and know that no users will be logging in, you can run installworld without dropping to single-user mode.
__________________
Freddie

Help for FreeBSD: Handbook, FAQ, man pages, mailing lists.
Reply With Quote