[darwinbuild] Building Intel xnu with darwinbuild

Shantonu Sen ssen at opendarwin.org
Mon Aug 21 11:32:35 PDT 2006


Currently, the build instructions at <http://kernel.macosforge.org/intel-build-instructions.html 
 > require downloading a tarball of kernel build tools, and building  
the kernel with "make". Instead of doing so, you can use darwinbuild,  
which will do things like save the symboled version of the kernel,  
etc.. Instead of:

• Download and install the kernel tools, a small set of additional  
command line tools (from the bootstrap_cmds and cctools projects)  
required to compile xnu.
• Download the xnu-792.10.96 sources.
• Extract the sources and build the kernel:

You can now do the following. Since all dependencies are built from  
source except for the BuildRoot loaded from your root filesystem, this  
avoids the problem of downloading binary roots that may not be  
compatible with your system. Note that the other instructions on that  
page, specifically installing Xcode 2.4 and the updated kernel  
extensions, are still needed.

1) Download and install CVS darwinbuild. darwinbuild 0.7.2 does not  
have the required functionality
2) Download <http://www.opendarwin.org/~ssen/darwinbuild-xnu-support.tar.gz 
 > and extract it in your build area
3) Initialize your build area:

# /usr/local/bin/darwinbuild -init 8K1079.plist

4) Using the tips at <http://forums.macosxhints.com/archive/index.php/t-50441.html 
 >, download required APSL source. If your cookie times out, you may  
need to re-issue the curl line, and remove malformed tarballs from  
Sources/

# cookiepath=/tmp/com.apple.daw.apsl.cookie
# username=XXX
# password=YYY
# curl -L "https://daw.apple.com$(curl -sL http://www.opensource.apple.com/darwinsource/tarballs/apsl/ 
  | grep appleConnectForm | awk 'BEGIN { RS = "\"" } ;
  {print $1}' | grep cgi)?theAccountName=$username&theAccountPW= 
$password" -c $cookiepath
# export CURLARGS="-b $cookiepath"
# /usr/local/bin/darwinbuild -source bootstrap_cmds
# /usr/local/bin/darwinbuild -source cctools
# /usr/local/bin/darwinbuild -source cctools_ofiles
# /usr/local/bin/darwinbuild -source kext_tools
# /usr/local/bin/darwinbuild -source xnu

5) Load BuildRoot, based on the contents of your root filesystem. Then  
build required dependencies, in order
# /usr/local/share/darwinbuild/createChroot
# /usr/local/bin/darwinbuild bootstrap_cmds
# /usr/local/bin/darwinbuild -load bootstrap_cmds
# /usr/local/bin/darwinbuild -headers xnu
# /usr/local/bin/darwinbuild -headers -load xnu
# /usr/local/bin/darwinbuild cctools
# /usr/local/bin/darwinbuild -load cctools
# /usr/local/bin/darwinbuild cctools_ofiles
# /usr/local/bin/darwinbuild -load cctools_ofiles
# /usr/local/bin/darwinbuild kext_tools
# /usr/local/bin/darwinbuild -load kext_tools

6) Build xnu
# /usr/local/bin/darwinbuild xnu

At this point, you can install the results however you'd like,  
including the updated drivers that are needed.

Shantonu
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.macosforge.org/pipermail/darwinbuild-dev/attachments/20060821/6dd707d0/attachment.html


More information about the darwinbuild-dev mailing list