Google
 
 
Home

Main Menu
 Home
 Linux Articles
 FreeBSD Articles
 Apache Articles
 Perl Articles
 Other Articles
 Program Downloads
 Free Books
 News
 The Web Links
 Contact Us

Most Read
Automating SFTP using expect
FreeBSD PPTP VPN
SnortShorwall - Using Snort And Shorewall Together
Shorewall Router on Linux
Shorewall Stand Alone Firewall

Polls
Favorite Linux/BSD
Fedora
Mandrake
Debian
Slackware
Gentoo
Suse
FreeBSD
Other
  

Syndicate
Latest news direct to your desktop
RSS

Login Form
Username

Password

Remember me
Forgotten your password?
No account yet? Create one

Members Online
 Linux-BSD-Central Has a Total of 14089 Members   Members (14089) # Online
 We have 10 Guests Online. Guests 10
 We have 0 Users Online. Users 0

Online Users
No Users Online

Statistics
OS: Linux w
PHP: 5.2.17
MySQL: 5.1.56
Time: 09:45
Members: 14089
Hits: 1789874
News: 281
WebLinks: 15





Recompile FreeBSD kernel   PDF  Print  E-mail 
Contributed by Chad Brandt  
Saturday, 19 June 2004

Sometimes there are security updates that force you to recompile the kernel, fortunately with FreeBSD this is very easy and quick to do.

1. If your kernel security level set you must turn this off in /etc/rc.conf and reboot

/etc/rc.conf
kern_securelevel_enable="NO"
#kern_securelevel_enable="YES"
#kern_securelevel="1"


2. Go to /usr/src/sys/i386/conf. This directory will hold your kernel configuration.


3. Configure the file you want to use for your kernel. eg. /usr/sbin/config GENERIC


4. The config command will place your configuration in /usr/src/sys/compile/<kernel config>. Now change to that directory eg. cd ../../compile/GENERIC


5. Now make the kernel eg. make depend && make && make install

Reboot your machine and make sure to turn the security level back on and change your rc.conf back again

Here is a small script I use to recompile my kernel

#!/bin/sh

cd /usr/src/sys/i386/conf
/usr/sbin/config GENERIC
cd ../../compile/GENERIC
make depend && make && make install

 

 

Comments
change this in your script
Written by Guest on 2005-08-09 18:54:29
on FreeBSD 5.4 i had to change this line: 
cd ../../compile/GENERIC 
to: 
cd ../compile/GENERIC 
 
and than use: 
make depend && make && make install 
 
Written by Guest on 2005-09-03 08:25:32
a faster way in atleast 5.x is after editing your kernel 
 
 
cd /usr/src 
make buildkernel KERNCONF= && make installkernel KERNCONF= 
 
an example having copied the GENERIC to (prefered the hostname of the machine) WORKSTATION 
 
cd /usr/src 
make buildkernel KERNCONF=WORKSTATION && make installkernel KERNCONF=WORKSTATION 
Written by tomse on 2005-09-03 08:34:08
a faster way in 5.x is after editing the kernel file, 
 
cd /usr/src 
make buildkernel KERNCONF= && make installkernel KERNCONF= 
 
preferedly you make copy of the GENERIC file, for instance call it the same as the workstation name. Updates of the source might overwrite the GENERIC file and your changes will be lost. 
as an example we'll call the copied kernel file WORKSTATION 
 
cd /usr/src 
make buildkernel KERNCONF=WORKSTATION && make installkernel KERNCONF=WORKSTATION  
 
ref: http://www.freebsd.org/doc/en_US.ISO8859-1/books/handbook/kernelconfig-building.html 

Only registered users can write comments.
Please login or register.

Powered by AkoComment 1.0 beta 2!




 


 

Check out TwistByte - The best mobile apps available For awesome Android and IPhone applications!!