Welcome to FreeBSDFreaks.net!
FAQFAQ    SearchSearch      ProfileProfile    Private MessagesPrivate Messages   Log inLog in

Rebuilding FreeBSD from sources

 
   FreeBSD Hosting (Home) -> FreeBSD Handbook RSS
Next:  need help with scsi hardware raid.  
Author Message
Matt Pearce

External


Since: Aug 05, 2003
Posts: 3



(Msg. 1) Posted: Fri Aug 08, 2003 8:38 pm
Post subject: Rebuilding FreeBSD from sources
Archived from groups: comp>unix>bsd>freebsd>misc (more info?)

Hi All,

Got a bit of an interesting question. I figured I would start playing
around with my kernel a bit and try taking a couple of settings out
(settings relating to IPFilter cause I wanted to try module not kernel
loaded for a change). I have been running cvsup for a while and updating to
tag=RELENG_4, and updating all the ports, docs etc at the same time.

After making the changes to the kernel I rebuilt it, now things like top and
ps dont work giving me memory errors (bugger), not hardware error though. I
figured it had rebuilt the kernel from the new sources and I now need to
rebuild the rest of the stuff (make world etc or what its called, i've got
it all printed out here somewhere). How ever I have been trying to follow
the instructions from the FreeBSD handbook and I only get as far as the
mergermaster cause it says cant find /etc/make.conf and boots me out. So I
tried copying it from etc/defaults to /etc, and now it says :-

BDECFLAGS= -W -Wall -ansi -pedantic -Wbad-function-cast -Wcast-align \
* No example variable with this name

Can anyone tell me where to go from here or if I should have really done
this first then the kernel ?? I am prepared to wipe the machine and start
again if need be, however I still need to learn how to do this and there is
no time like the present !!

Thanks for your help,

Matt.

 >> Stay informed about: Rebuilding FreeBSD from sources 
Back to top
Login to vote
Simon Barner

External


Since: Oct 07, 2003
Posts: 18



(Msg. 2) Posted: Fri Aug 08, 2003 8:38 pm
Post subject: Re: Rebuilding FreeBSD from sources [Login to view extended thread Info.]
Archived from groups: per prev. post (more info?)

Hi Matt,

> After making the changes to the kernel I rebuilt it, now things like top and
> ps dont work giving me memory errors (bugger), not hardware error though. I
> figured it had rebuilt the kernel from the new sources and I now need to
> rebuild the rest of the stuff (make world etc or what its called, i've got
> it all printed out here somewhere). How ever I have been trying to follow
> the instructions from the FreeBSD handbook and I only get as far as the
> mergermaster cause it says cant find /etc/make.conf and boots me out. So I
> tried copying it from etc/defaults to /etc, and now it says :-
>
> BDECFLAGS= -W -Wall -ansi -pedantic -Wbad-function-cast -Wcast-align \
> * No example variable with this name
>
> Can anyone tell me where to go from here or if I should have really done
> this first then the kernel ?? I am prepared to wipe the machine and start
> again if need be, however I still need to learn how to do this and there is
> no time like the present !!

I think the following should bring your system in a sane again:

1.) Delete /etc/make.conf! You should _never_ copy something from
/etc/default to /etc or edit files in /etc/default. The files in
/etc/default are updated with the normal system update, and /etc/
contains only the differencens to the defaults that are specific for
your environment and needs.

I think, you should put the following into your /etc/make.conf, but an
empty /etc/make.conf should satisfy mergemaster, too.

MASTER_SITE_OVERRIDE=ftp://<your closest freebsd mirror>/pub/FreeBSD/ports/distfiles/
CPUTYPE=<your cpu-type, see "man gcc">
CFLAGS=-O -pipe

# Documentation settings
DOC_LANG=en_US.ISO8859-1

2.) Delete /usr/obj + /usr/src/sys/compile/YOUR_KERNEL_HERE

3.) Start a buildworld+buildkernel procedure as described in
/usr/src/Makefile:

# 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).
# 5. `reboot' (in single user mode: boot -s from the loader prompt).
# 6. `mergemaster -p'
# 7. `make installworld'
# 8. `mergemaster'
# 9. `reboot'

HTH,
Simon

 >> Stay informed about: Rebuilding FreeBSD from sources 
Back to top
Login to vote
Simon Barner

External


Since: Oct 07, 2003
Posts: 18



(Msg. 3) Posted: Fri Aug 08, 2003 8:38 pm
Post subject: Re: Rebuilding FreeBSD from sources [Login to view extended thread Info.]
Archived from groups: per prev. post (more info?)

Hi Matt,

> After making the changes to the kernel I rebuilt it, now things like top and
> ps dont work giving me memory errors (bugger), not hardware error though. I
> figured it had rebuilt the kernel from the new sources and I now need to
> rebuild the rest of the stuff (make world etc or what its called, i've got
> it all printed out here somewhere). How ever I have been trying to follow
> the instructions from the FreeBSD handbook and I only get as far as the
> mergermaster cause it says cant find /etc/make.conf and boots me out. So I
> tried copying it from etc/defaults to /etc, and now it says :-
>
> BDECFLAGS= -W -Wall -ansi -pedantic -Wbad-function-cast -Wcast-align \
> * No example variable with this name
>
> Can anyone tell me where to go from here or if I should have really done
> this first then the kernel ?? I am prepared to wipe the machine and start
> again if need be, however I still need to learn how to do this and there is
> no time like the present !!

I think the following should bring your system into a sane state again:

1.) Delete /etc/make.conf! You should _never_ copy something from
/etc/default to /etc or edit files in /etc/default. The files in
/etc/default are updated with the normal system update, and /etc/
contains only the differences to the defaults that are specific for
your environment and needs.

I think, you should put the following into your /etc/make.conf, but an
empty /etc/make.conf should satisfy mergemaster, too.

MASTER_SITE_OVERRIDE=ftp://<your closest freebsd mirror>/pub/FreeBSD/ports/distfiles/
CPUTYPE=<your cpu-type, see "man gcc">
CFLAGS=-O -pipe

# Documentation settings
DOC_LANG=en_US.ISO8859-1

2.) Delete /usr/obj + /usr/src/sys/compile/YOUR_KERNEL_HERE

3.) Start a buildworld+buildkernel procedure as described in
/usr/src/Makefile:

# 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).
# 5. `reboot' (in single user mode: boot -s from the loader prompt).
# 6. `mergemaster -p'
# 7. `make installworld'
# 8. `mergemaster'
# 9. `reboot'

HTH,
Simon
 >> Stay informed about: Rebuilding FreeBSD from sources 
Back to top
Login to vote
Donn Miller

External


Since: Aug 24, 2003
Posts: 21



(Msg. 4) Posted: Fri Aug 08, 2003 8:38 pm
Post subject: Re: Rebuilding FreeBSD from sources [Login to view extended thread Info.]
Archived from groups: per prev. post (more info?)

Matt Pearce wrote:
> Hi All,
>
> Got a bit of an interesting question. I figured I would start playing
> around with my kernel a bit and try taking a couple of settings out
> (settings relating to IPFilter cause I wanted to try module not kernel
> loaded for a change). I have been running cvsup for a while and updating to
> tag=RELENG_4, and updating all the ports, docs etc at the same time.
>
> After making the changes to the kernel I rebuilt it, now things like top and
> ps dont work giving me memory errors (bugger), not hardware error though. I
> figured it had rebuilt the kernel from the new sources and I now need to
> rebuild the rest of the stuff (make world etc or what its called, i've got
> it all printed out here somewhere). How ever I have been trying to follow
> the instructions from the FreeBSD handbook and I only get as far as the
> mergermaster cause it says cant find /etc/make.conf and boots me out. So I
> tried copying it from etc/defaults to /etc, and now it says :-
>
> BDECFLAGS= -W -Wall -ansi -pedantic -Wbad-function-cast -Wcast-align \
> * No example variable with this name

You should start with a blank /etc/make.conf. How it works is that you
examine /etc/defaults/make.conf for variables you want to override, and
copy them to /etc/make.conf with their new values (the variables).

The next step is to do a make buildworld. Your userland and kernel are
out of sync. In a nutshell, the steps to building a kernel are doing a
make buildworld first, followed by a make buildkernel, like so. First,
do a "mergemaster -p" to make sure all important config files pertinent
to the build process are updated. Also be sure to read /usr/src/UPDATING.

make buildworld buildkernel
shutdown now # go into single-user mode
make installkernel installworld
mergemaster
reboot



-----= Posted via Newsfeeds.Com, Uncensored Usenet News =-----
http://www.newsfeeds.com - The #1 Newsgroup Service in the World!
-----== Over 80,000 Newsgroups - 16 Different Servers! =-----
 >> Stay informed about: Rebuilding FreeBSD from sources 
Back to top
Login to vote
Matt Pearce

External


Since: Aug 05, 2003
Posts: 3



(Msg. 5) Posted: Sat Aug 09, 2003 10:30 am
Post subject: Re: Rebuilding FreeBSD from sources [Login to view extended thread Info.]
Archived from groups: per prev. post (more info?)

Thanks All for your help, I learnt some important lessons today, namely dont
build a kernel without first having built everything else !! Might seem
logical to some people but being a newbie to this sorta thing I didnt fully
understand what I was doing, now I have a lot better idea and my system is
back running like it should have been in the first place !!

Thanks again,

Matt.


"Donn Miller" wrote in message

> Matt Pearce wrote:
> > Hi All,
> >
> > Got a bit of an interesting question. I figured I would start playing
> > around with my kernel a bit and try taking a couple of settings out
> > (settings relating to IPFilter cause I wanted to try module not kernel
> > loaded for a change). I have been running cvsup for a while and
updating to
> > tag=RELENG_4, and updating all the ports, docs etc at the same time.
> >
> > After making the changes to the kernel I rebuilt it, now things like top
and
> > ps dont work giving me memory errors (bugger), not hardware error
though. I
> > figured it had rebuilt the kernel from the new sources and I now need to
> > rebuild the rest of the stuff (make world etc or what its called, i've
got
> > it all printed out here somewhere). How ever I have been trying to
follow
> > the instructions from the FreeBSD handbook and I only get as far as the
> > mergermaster cause it says cant find /etc/make.conf and boots me out.
So I
> > tried copying it from etc/defaults to /etc, and now it says :-
> >
> >
BDECFLAGS= -W -Wall -ansi -pedantic -Wbad-function-cast -Wcast-align \
> > * No example variable with this name
>
> You should start with a blank /etc/make.conf. How it works is that you
> examine /etc/defaults/make.conf for variables you want to override, and
> copy them to /etc/make.conf with their new values (the variables).
>
> The next step is to do a make buildworld. Your userland and kernel are
> out of sync. In a nutshell, the steps to building a kernel are doing a
> make buildworld first, followed by a make buildkernel, like so. First,
> do a "mergemaster -p" to make sure all important config files pertinent
> to the build process are updated. Also be sure to read /usr/src/UPDATING.
>
> make buildworld buildkernel
> shutdown now # go into single-user mode
> make installkernel installworld
> mergemaster
> reboot
>
>
>
> -----= Posted via Newsfeeds.Com, Uncensored Usenet News =-----
> http://www.newsfeeds.com - The #1 Newsgroup Service in the World!
> -----== Over 80,000 Newsgroups - 16 Different Servers! =-----
 >> Stay informed about: Rebuilding FreeBSD from sources 
Back to top
Login to vote
Donn Miller

External


Since: Aug 24, 2003
Posts: 21



(Msg. 6) Posted: Sat Aug 09, 2003 10:30 am
Post subject: Re: Rebuilding FreeBSD from sources [Login to view extended thread Info.]
Archived from groups: per prev. post (more info?)

Matt Pearce wrote:
> Thanks All for your help, I learnt some important lessons today, namely dont
> build a kernel without first having built everything else !! Might seem
> logical to some people but being a newbie to this sorta thing I didnt fully
> understand what I was doing, now I have a lot better idea and my system is
> back running like it should have been in the first place !!

It depends. If you're simply changing a kernel config, and you haven't
updated your sources, then it's safe to build the kernel without
everything else. It's when things like libkvm, top, and w get updated
that you have to update everything. If no changes to the sources of
libkvm, top, and w, then it's (probably) safe to build the kernel
without building the world first.



-----= Posted via Newsfeeds.Com, Uncensored Usenet News =-----
http://www.newsfeeds.com - The #1 Newsgroup Service in the World!
-----== Over 80,000 Newsgroups - 16 Different Servers! =-----
 >> Stay informed about: Rebuilding FreeBSD from sources 
Back to top
Login to vote
Kris Kennaway

External


Since: Aug 08, 2003
Posts: 15



(Msg. 7) Posted: Sun Aug 10, 2003 12:00 am
Post subject: Re: Rebuilding FreeBSD from sources [Login to view extended thread Info.]
Archived from groups: per prev. post (more info?)

In article , Donn Miller wrote:
> Matt Pearce wrote:
>> Thanks All for your help, I learnt some important lessons today, namely dont
>> build a kernel without first having built everything else !! Might seem
>> logical to some people but being a newbie to this sorta thing I didnt fully
>> understand what I was doing, now I have a lot better idea and my system is
>> back running like it should have been in the first place !!
>
> It depends. If you're simply changing a kernel config, and you haven't
> updated your sources, then it's safe to build the kernel without
> everything else. It's when things like libkvm, top, and w get updated
> that you have to update everything. If no changes to the sources of
> libkvm, top, and w, then it's (probably) safe to build the kernel
> without building the world first.

It's not just the libkvm et. al sources themselves, but the system
headers they depend on for information about the structure of the
running kernel.

The moral of the story is: if you update your sources you must do a
world + kernel build; if you don't update your sources and just tinker
with your kernel configuration you do not have to do a world build.

kris
 >> Stay informed about: Rebuilding FreeBSD from sources 
Back to top
Login to vote
Display posts from previous:   
Related Topics:
Can I back-up my sources? - Hi, I only have a 4.9 cd and to upgrade to 4.10 or later versions, first, I install the sources from my 4.9 cd and then I use cvsup. Same as with FreeBSD Handbook and Ports. Question: In upgrading to a higher version of FreeBSD(e.g; 4.9 to 4.10)..

[FreeBSD-Announce] FreeBSD 5.3-RELEASE Announcement - This is an OpenPGP/MIME signed message (RFC 2440 and 3156) --------------enig59305AECC7EFDF2CAA9A02BA Content-Type: text/plain; charset=us-ascii; format=flowed Content-Transfer-Encoding: 7bit It is my great pleasure and privilege to announce the..

FreeBSD From Scratch (ie. My Own Custom FreeBSD) -

FreeBSD weakness. - On Mon, 21 Jun 2004 00:59:58 -0600 Lloyd Hayes <wyoming_antelope@yahoo.com> wrote: > >Linux is for people who hate Micro$oft. > >BSD is for people who love Unix. > > Under these conditions, I guess that I need to go for Linux......

Reference to freeBSD 5.3 - In the FreeBSD Handbook, < http://www.freebsd.org/doc/en_US.ISO8859-1/books/handbook/sound-setup.html > there is a reference to freeBSD 5.3. Is this a misprint, wishfull thinking, or perhaps a glimpse of what is to come? Thanks Gerard Seibert..
   FreeBSD Hosting (Home) -> FreeBSD Handbook All times are: Pacific Time (US & Canada)
Page 1 of 1

 
You can post new topics in this forum
You can reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum



[ Contact us | Terms of Service/Privacy Policy ]