FreeBSD Kernel Compile Issue
Results 1 to 6 of 6

Thread: FreeBSD Kernel Compile Issue

  1. #1
    Junior Member Kye's Avatar
    Join Date
    Dec 2006
    Posts
    12

    FreeBSD Kernel Compile Issue

    I needed PF support on my freebsd box so i decided to compile a custom kernel.
    After making my CUSTOM kernel and adding the right devices that i needed to it i saved and CD to /usr/src but every time i try to "make buildkernel KERNCONF=CUSTOM" i get the error, make: don't know how to make buildkernel. Stop.
    Ive had this problem before but managed to fix it by lowering my kernel security level. But this time the kernel security is disabled and im stumped any help would be great.

  2. #2
    Just Another Geek
    Join Date
    Jul 2002
    Location
    Rotterdam, Netherlands
    Posts
    3,401
    Do you have the kernel/baseOS sources installed?
    What version of FreeBSD?

    While you're at it cvsup (sysutils/cvsup-without-gui) the source tree so you're up2date.

    For production machines I recommend RELENG_6_2 (RELEASE-6.2) for your own/test systems RELENG_6 (6-STABLE).
    Last edited by SirDice; January 2nd, 2007 at 05:53 PM.
    Oliver's Law:
    Experience is something you don't get until just after you need it.

  3. #3
    Junior Member Kye's Avatar
    Join Date
    Dec 2006
    Posts
    12
    Yes, i have the kernel sources / base OS installed and im currently running FreeBSD 6.1-RELEASE.

    Ok, ive downloaded all the sources for stable through cvsup but when trying to run:
    make buildworld
    make buildkernel
    make installkernel

    Im still getting the message "make: don't know how to make buildworld. Stop" and so on.

    Any ideas?

  4. #4
    Just Another Geek
    Join Date
    Jul 2002
    Location
    Rotterdam, Netherlands
    Posts
    3,401
    odd.. What does ls /usr/src say?

    Mine looks like this:
    Code:
    -rw-r--r--    1 root  wheel       6187 Feb  8  2006 COPYRIGHT
    -rw-r--r--    1 root  wheel        403 Feb  6  2006 LOCKS
    -rw-r--r--    1 root  wheel       6683 Jul 10 00:06 MAINTAINERS
    -rw-r--r--    1 root  wheel      11153 Dec  6 17:27 Makefile
    -rw-r--r--    1 root  wheel      36396 Dec  6 17:27 Makefile.inc1
    -rw-r--r--    1 root  wheel     138863 Nov 23 10:28 ObsoleteFiles.inc
    -rw-r--r--    1 root  wheel       2816 Mar  4  2006 README
    -rw-r--r--    1 root  wheel      20231 Oct  4 23:09 UPDATING
    drwxr-xr-x   37 root  wheel       1024 Nov 29 03:40 bin
    drwxr-xr-x   55 root  wheel       1024 Nov 29 03:49 contrib
    drwxr-xr-x    5 root  wheel        512 Nov 29 03:50 crypto
    drwxr-xr-x   21 root  wheel       2048 Dec 21 14:33 etc
    drwxr-xr-x   13 root  wheel        512 Nov 29 03:51 games
    drwxr-xr-x    4 root  wheel        512 Nov 29 03:51 gnu
    drwxr-xr-x    6 root  wheel       2048 Nov 29 03:51 include
    drwxr-xr-x    9 root  wheel        512 Nov 29 03:51 kerberos5
    drwxr-xr-x   74 root  wheel       1536 Nov 29 03:53 lib
    drwxr-xr-x   33 root  wheel       1024 Nov 29 03:53 libexec
    drwxr-xr-x   13 root  wheel        512 Nov 29 03:53 release
    drwxr-xr-x    4 root  wheel        512 Nov 29 03:53 rescue
    drwxr-xr-x   94 root  wheel       2048 Nov 29 03:53 sbin
    drwxr-xr-x    6 root  wheel        512 Nov 29 03:53 secure
    drwxr-xr-x   25 root  wheel        512 Nov 29 03:54 share
    drwxr-xr-x   58 root  wheel       1024 Nov 29 03:58 sys
    drwxr-xr-x   12 root  wheel        512 Nov 29 03:58 tools
    drwxr-xr-x  223 root  wheel       3584 Nov 29 03:59 usr.bin
    drwxr-xr-x  191 root  wheel       3584 Nov 29 03:59 usr.sbin
    If yours is different then you don't have the complete sources.
    Oliver's Law:
    Experience is something you don't get until just after you need it.

  5. #5
    Junior Member Kye's Avatar
    Join Date
    Dec 2006
    Posts
    12
    Ok, ive found the problem i was missing lib. So i re-downloaded everything from a different mirror and everything was working fine.

    One more question im now updating to STABLE and was wondering if i have to complete this enitre page in the freebsd handbook to update my kernel completely. http://www.freebsd.org/doc/en_US.ISO...makeworld.html

    Cheers

  6. #6
    Just Another Geek
    Join Date
    Jul 2002
    Location
    Rotterdam, Netherlands
    Posts
    3,401
    If you want to do it the "proper" way, yes.
    For me, I once created /etc/make.conf, I look it over every now and then. Mine looks like this:
    Code:
    KERNCONF=MYKERNEL
    CPUTYPE?=i686
    CFLAGS= -O2 -pipe
    COPTFLAGS= -O2 -pipe
    The KERNCONF options saves having to type it every time you buildkernel/installkernel. The CPU type should be modified for your CPU. The C and COPTFLAGS make sure I get a lean and mean system.
    With these settings you also get "everything" in the base system installed. You might want to look through the example file, there's a lot of stuff you probably don't need and can do without. The rest of my make.conf consist of build options for ports I use. Like WITH_MOZILLA=firefox. That will ensure that I build gnome with firefox. Yes, I build everything from source. That way I get all the options and tweaks I want. Not some pre-compiled package with half of it's functionality missing because it wasn't compiled in. It also means I get the best optimized binaries for my system, not the common denominator.

    Next step is very important! Read /usr/src/UPDATING! Things change and when upgrading the bad way you'll end up with a non-booting system. There will be a warning in UPDATING. Then the make buildworld && make buildkernel. That will take a while depending on your system's speed.
    Once that's done you should ideally boot to single user mode, I usually don't bother.. Make installkernel; mergemaster -p ; make installworld ; mergemaster ; reboot
    And pray it'll work

    Mind you, updating FreeBSD is more then just updating a kernel. You're actually updating an entire OS, from the ground up.
    Last edited by SirDice; January 3rd, 2007 at 11:09 PM.
    Oliver's Law:
    Experience is something you don't get until just after you need it.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •