DaemonForums  

Go Back   DaemonForums > FreeBSD > FreeBSD Installation and Upgrading

FreeBSD Installation and Upgrading Installing and upgrading FreeBSD.

Reply
 
Thread Tools Display Modes
  #1   (View Single Post)  
Old 15th August 2008
bsdforlife bsdforlife is offline
Real Name: Ridge Allen
Port Guard
 
Join Date: Aug 2008
Location: /dev/null
Posts: 10
Thanked 0 Times in 5 Posts
Default Updating FreeBSD and Building a Custom Kernel

Please Help me. I am a noob when it comes to the *BSD's and I installed
FreeBSD on several of my Machines and I wanted to update the Operating System but I have no idea . I tried using a guide on BSDGuides
but it didn't really help me. Could somebody explain to me how to update my existing FreeBSD OS. Also can anybody give a link to a guide to building a custom kernel.

Thanks for the advice

John
Reply With Quote
  #2   (View Single Post)  
Old 15th August 2008
corey_james corey_james is offline
Uber Geek
 
Join Date: Apr 2008
Location: Brisbane, Australia
Posts: 238
Thanked 4 Times in 10 Posts
Default

custom kernel http://www.freebsd.org/doc/en_US.ISO...nelconfig.html

more or less:
grab the src using cvsup
edit kernel config file
#cd /usr/src
#make buildkernel KERNCONF=MYKERNEL
# make installkernel KERNCONF=MYKERNEL


Updating your system:

http://www.freebsd.org/doc/en_US.ISO...makeworld.html

cut it short for ya:
use cvsup to get the updated sources
read /usr/src/UPDATING to see if you need to do anything special for the upgrade
# cd /usr/src
# make buildworld
# make buildkernel
# make installkernel
# reboot

# mergemaster -p
# cd /usr/src
# make installworld
# mergemaster
# reboot


Even though it's probably obvious i'm going to point out that freebsd is an OS not just a kernel ( like linux ) hence, you need to keep the userland and kernel in sync. ie. do NOT install an updated kernel without updating the userland and vice versa
__________________
"No, that's wrong, Cartman. But don't worry, there are no stupid answers, just stupid people." -- Mr. Garrison

Forum Netiquette
Reply With Quote
  #3   (View Single Post)  
Old 15th August 2008
TomAmundsen TomAmundsen is offline
Real Name: Tom Amundsen
Computional Linguist
 
Join Date: Jul 2008
Location: Los Angeles, CA
Posts: 23
Thanked 1 Time in 1 Post
Default

Quote:
Originally Posted by corey_james View Post
custom kernel http://www.freebsd.org/doc/en_US.ISO...nelconfig.html

more or less:
grab the src using cvsup
edit kernel config file
#cd /usr/src
#make buildkernel KERNCONF=MYKERNEL
# make installkernel KERNCONF=MYKERNEL
Alternatively, you can just
Code:
# make KERNCONF=MYKERNEL kernel
which will build and install the kernel so that it boots to the new kernel after your next reboot. Don't worry, it will copy the old kernel out to /boot/kernel.old.

Even so, it isn't a bad idea to do this first:
Code:
# cp -Rp /boot/kernel /boot/kernel.good
Reply With Quote
  #4   (View Single Post)  
Old 15th August 2008
hunteronline hunteronline is offline
Fdisk Soldier
 
Join Date: Jul 2008
Posts: 52
Thanked 6 Times in 5 Posts
Default

For system updating I use:

cd /boot/ ; cp -Rp kernel kernel.good ; cd /usr/src ; cvsup -gL2 /usr/share/examples/cvsup/standard-supfile ; make -j4 buildworld ; make buildkernel ; make installkernel ; make installworld; mergermaster ; reboot
Reply With Quote
  #5   (View Single Post)  
Old 15th August 2008
Carpetsmoker's Avatar
Carpetsmoker Carpetsmoker is offline
Real Name: Martin
Old man from scene 24
 
Join Date: Apr 2008
Location: Eindhoven, Netherlands
Posts: 2,068
Thanked 198 Times in 156 Posts
Default

The ``official instructions'' are in /usr/src/Makefile:

Code:
# For individuals wanting to upgrade their sources (even if only a
# delta of a few days):
#
#  1.  `cd /usr/src'       (or to the directory containing your source tree).
#  2.  `make buildworld'
#  3.  `make buildkernel KERNCONF=YOUR_KERNEL_HERE'     (default is GENERIC).
#  4.  `make installkernel KERNCONF=YOUR_KERNEL_HERE'   (default is GENERIC).
#       [steps 3. & 4. can be combined by using the "kernel" target]
#  5.  `reboot'        (in single user mode: boot -s from the loader prompt).
#  6.  `mergemaster -p'
#  7.  `make installworld'
#  8.  `make delete-old'
#  9.  `mergemaster'                         (you may wish to use -U or -ai).
# 10.  `reboot'
# 11.  `make delete-old-libs' (in case no 3rd party program uses them anymore)
Quote:
cd /boot/ ; cp -Rp kernel kernel.good ;
When installing a kernel, the current kernel automatically gets copied to /boot/kernel.old, so this is a bit redundant ...
__________________
UNIX was not designed to stop you from doing stupid things, because that would also stop you from doing clever things.
Reply With Quote
  #6   (View Single Post)  
Old 15th August 2008
bsdforlife bsdforlife is offline
Real Name: Ridge Allen
Port Guard
 
Join Date: Aug 2008
Location: /dev/null
Posts: 10
Thanked 0 Times in 5 Posts
Default Installing and Upgrading FreeBSD

Thanks everybody
I have updated everything
I owe everybody a favor
Reply With Quote
  #7   (View Single Post)  
Old 15th August 2008
ninjatux's Avatar
ninjatux ninjatux is offline
Real Name: Baqir Majlisi
Spam Deminer
 
Join Date: May 2008
Location: Antarctica
Posts: 293
Thanked 15 Times in 15 Posts
Default

I have this section in my make.conf that pertains to updating:

Code:
SUP_UPDATE=     yes
SUPHOST=        cvsup3.us.freebsd.org
SUP=            /usr/bin/csup
SUPFILE=        /usr/share/examples/cvsup/stable-supfile
PORTSSUPFILE=   /usr/share/examples/cvsup/ports-supfile
I also have a cronjob that updates my source and ports trees daily between 2 to 3 AM, and the command the cronjob uses, which I can also use manually in both /usr/ports and /usr/src is:

Code:
make update
I also have my kernel configured and src.conf customized as well. I have the following in make.conf as well:

Code:
KERNCONF=       STARBOX_KERNEL
This is the sequence for my updating:

Code:
cd /usr/src
make buildworld # I use -j20
make buildkernel
make installkernel
mergemaster -p
make installworld
megemaster
The last three commands are generally done in single user mode.
__________________
"UNIX is basically a simple operating system, but you have to be a genius to understand the simplicity."
MacBook Pro (Darwin 9), iMac (Darwin 9), iPod Touch (Darwin 9), Dell Optiplex GX620 (FreeBSD 7.1-STABLE)
Reply With Quote
  #8   (View Single Post)  
Old 15th August 2008
TerryP's Avatar
TerryP TerryP is offline
Arp Constable
 
Join Date: May 2008
Location: USofA
Posts: 1,547
Thanked 112 Times in 104 Posts
Default

Quote:
Originally Posted by Carpetsmoker View Post
When installing a kernel, the current kernel automatically gets copied to /boot/kernel.old, so this is a bit redundant ...
What if you compile a new kernel, it fails to boot, you boot off 'kernel.old', to fix and build another kernel. Then the makefile nukes kernel.old with the broken kernel?


--> people should copy it to something else like kernel.GENERIC

Quote:
Originally Posted by If Something Goes Wrong
Note: If you are having trouble building a kernel, make sure to keep a GENERIC, or some other kernel that is known to work on hand as a different name that will not get erased on the next build. You cannot rely on kernel.old because when installing a new kernel, kernel.old is overwritten with the last installed kernel which may be non-functional. Also, as soon as possible, move the working kernel to the proper /boot/kernel location or commands such as ps(1) may not work properly. To do this, simply rename the directory containing the good kernel:

I don't know about you, but I don't like reaching for a boot disk!!!!



I've never had a kernel that *compiled* and failed to work correctly but as I always say.... "If curiosity killed the cat, paranoia saved its ninth life". I doubt it's possible to get royally screwed but better safe then sorrier.
__________________
My Journal

Thou shalt check the array bounds of all strings (indeed, all arrays), for surely where thou typest ``foo'' someone someday shall type ``supercalifragilisticexpialidocious''.
Reply With Quote
  #9   (View Single Post)  
Old 16th August 2008
phoenix's Avatar
phoenix phoenix is offline
Risen from the ashes
 
Join Date: May 2008
Posts: 699
Thanked 90 Times in 81 Posts
Default

The easier method, which doesn't require nearly as much time compiling things: freebsd-update(8) in conjunction with portmaster(8) or even portupgrade(1) (in conjunction with the -P option to use binary packages).
__________________
Freddie

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

Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
Updating FreeBSD carpman FreeBSD Installation and Upgrading 6 26th October 2008 11:49 AM
Updating FreeBSD Jails after rebuilding world on host anomie Guides 0 10th September 2008 03:23 AM
FreeBSD 7.0 kernel building... daemonFromHeaven FreeBSD Installation and Upgrading 4 3rd September 2008 02:42 PM
Unable to build custom kernel [Wrong configuration?] jrick FreeBSD General 3 31st July 2008 01:53 PM
Utility to make FreeBSD custom ISO mtx FreeBSD General 5 9th June 2008 11:13 PM


All times are GMT. The time now is 03:53 PM.


Powered by vBulletin® Version 3.8.4
Copyright ©2000 - 2014, Jelsoft Enterprises Ltd.
Content copyright © 2007-2010, the authors
Daemon image copyright ©1988, Marshall Kirk McKusick