Created
February 16, 2012 16:35
-
-
Save mafice/1846291 to your computer and use it in GitHub Desktop.
create a build environment for XNU kernel (does not work well)
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/sh | |
# | |
# xcodeがなんやかんやなせいなのか、動かなくなっちゃいました(ゝω・)v | |
# | |
# | |
# Run this shell script on Mac OS X *Lion*. | |
# I referred to http://osx86.boeaja.info/2009/10/building-xnu-kernel-on-snow-leopard/ | |
# You can download XNU kernel source code from http://www.opensource.apple.com/tarballs/xnu/ | |
# | |
cd /tmp | |
mkdir prepare_env_for_build_xnu | |
cd prepare_env_for_build_xnu | |
# | |
# Download tarballs | |
# | |
curl -O http://www.opensource.apple.com/tarballs/cxxfilt/cxxfilt-9.tar.gz | |
curl -O http://www.opensource.apple.com/tarballs/dtrace/dtrace-90.tar.gz | |
curl -O http://www.opensource.apple.com/tarballs/kext_tools/kext_tools-252.2.tar.gz | |
curl -O http://www.opensource.apple.com/tarballs/bootstrap_cmds/bootstrap_cmds-80.tar.gz | |
# | |
# Extract tarballs | |
# | |
tar xf cxxfilt-9.tar.gz | |
tar xf dtrace-90.tar.gz | |
tar xf kext_tools-252.2.tar.gz | |
tar xf bootstrap_cmds-80.tar.gz | |
# | |
# Build and Install softwares | |
# | |
cd cxxfilt-9 | |
mkdir -p obj sym dst | |
make install RC_ARCHS="i386 x86_64" RC_CFLAGS="-arch i386 -arch x86_64 -pipe" \ | |
RC_OS=macos RC_RELEASE=Lion SRCROOT=$PWD \ | |
OBJROOT=$PWD/obj SYMROOT=$PWD/sym DSTROOT=$PWD/dst | |
sudo ditto $PWD/dst/usr/local /usr/local | |
cd .. | |
cd dtrace-90 | |
mkdir -p obj sym dst | |
xcodebuild install -target ctfconvert -target ctfdump -target ctfmerge \ | |
ARCHS="i386 x86_64" \ | |
SRCROOT=$PWD OBJROOT=$PWD/obj SYMROOT=$PWD/sym DSTROOT=$PWD/dst | |
sudo ditto $PWD/dst/usr/local /usr/local | |
cd .. | |
cd kext_tools-252.2 | |
mkdir -p obj sym dst | |
xcodebuild install -target kextsymboltool -target setsegname \ | |
ARCHS="i386 x86_64" \ | |
SRCROOT=$PWD OBJROOT=$PWD/obj SYMROOT=$PWD/sym DSTROOT=$PWD/dst | |
sudo ditto $PWD/dst/usr/local /usr/local | |
cd .. | |
cd bootstrap_cmds-80 | |
make install RC_ARCHS="i386" RC_CFLAGS="-arch i386 -pipe" RC_OS=macos RC_RELEASE=Lion \ | |
SRCROOT=$PWD OBJROOT=$PWD/obj SYMROOT=$PWD/sym DSTROOT=$PWD/dst | |
sudo ditto $PWD/dst/usr/local /usr/local | |
echo "Done" |
whenever I try to build kextsymboltool, xcode tells me: xcodebuild: error: The project 'kext_tools.xcodeproj' does not contain a target named 'kextsymboltool
@Hnasar I have the same issue. Maybe the official documentation helps you.
Apparently TargetConfig
is required too.
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Thank you for letting me know.
I'll refer to your comments when I build XNU.