# Issues building FreeBSD



## rlorentz (Apr 23, 2011)

I've got a box running FreeBSD, -RELEASE 8.2, where I am trying to build the -CURRENT 9.0 sources that I've obtained from svn.  I checked out the sources to ~/current/head where ~ is /home/rcl.  The actual target is an amd64 architecture machine.  I've put together some flags to run this build with, but I appear to be missing something:


```
(rootshell)# make buildworld DESTDIR=/FreeBSD-CURRENT/build TARGET=amd64 TARGET_ARCH=amd64 && make installworld DESTDIR=/FreeBSD-CURRENT/build
 TARGET=amd64 TARGET_ARCH=amd64 && make installkernel DESTDIR=/FreeBSD-CURRENT/build TARGET=amd64 TARGET_ARCH=amd64 && make distribution
 DESTDIR=/FreeBSD-CURRENT/build TARGET=amd64 TARGET_ARCH=amd64
```

Things go great for a while, until:


```
--------------------------------------------------------------
>>> Installing kernel GENERIC
--------------------------------------------------------------
cd /usr/obj/amd64.amd64/usr/home/rcl/current/head/sys/GENERIC;  MAKEOBJDIRPREFIX=/usr/obj/amd64.amd64  MACHINE_ARCH=amd64
  MACHINE=amd64  CPUTYPE= GROFF_BIN_PATH=/usr/obj/amd64.amd64/usr/home/rcl/current/head/tmp/legacy/usr/bin 
 GROFF_FONT_PATH=/usr/obj/amd64.amd64/usr/home/rcl/current/head/tmp/legacy/usr/share/groff_font 
 GROFF_TMAC_PATH=/usr/obj/amd64.amd64/usr/home/rcl/current/head/tmp/legacy/usr/share/tmac
 PATH=/usr/obj/amd64.amd64/usr/home/rcl/current/head/tmp/legacy/usr/sbin:/usr/obj/amd64.amd64/usr/home/rcl/current/head/tmp/legacy/usr/bin:/usr/
obj/amd64.amd64/usr/home/rcl/current/head/tmp/legacy/usr/games:/usr/obj/amd64.amd64/usr/home/rcl/current/head/tmp/usr/sbin:/usr/obj/amd64.amd64/
usr/home/rcl/current/head/tmp/usr/bin:/usr/obj/amd64.amd64/usr/home/rcl/current/head/tmp/usr/games:/sbin:/bin:/usr/sbin:/usr/bin  make 
 KERNEL=kernel install
cd: can't cd to /usr/obj/amd64.amd64/usr/home/rcl/current/head/sys/GENERIC
*** Error code 2
```

First off, I'm not so sure I want to be putting anything in /usr/obj - this is all for an export to another machine, I don't want the build to leave anything behind.  Secondly, /usr/obj/amd64.amd64/usr/home/rcl/current/head/sys/ does exist, but the only directory there is boot/, there's no GENERIC/.

I have a feeling I missed a flag or something similar.  What's going on?

Also, my plan for installation is to go grab all this stuff over NFS - what directories am I going to have to export?  I thought I would be ok just exporting /FreeBSD-CURRENT/build but that doesn't seem to be the case now.

Thanks,

Robert


----------



## mamalos (Apr 23, 2011)

I haven't checked your flags, but when I want to do the same thing as you do, I just:

`# mv /usr/obj /usr/obj.old&& mkdir /usr/obj`

Then I run all needed commands to make world/kernel, and then I install everything on a location based on the contents of DESTDIR.

My new /usr/obj might be a symlink to another partition/folder.


----------



## rlorentz (Apr 23, 2011)

Mamalos -

Thanks, this as a workaround is fine - I don't mind using /usr/obj instead of another path. However, even with your suggestion I assume I will get the same error about no GENERIC/ .. so I'm not sure that this solves the problem. I will give it a try later today though.


----------



## poh-poh (Apr 23, 2011)

rlorentz said:
			
		

> ```
> (rootshell)# make buildworld ... && make installworld ... && make installkernel ... && make distribution ...
> --------------------------------------------------------------
> >>> Installing kernel GENERIC
> ...



Are you trying to install a kernel that you haven't previously built with *buildkernel*?


----------

