$Id: mip6.html,v 1.33 2011/06/23 07:45:38 t-momose Exp $
CAUTION!! This is very dangerous because it touchs kernel codes and must change the kernel. Plesae backup your system before change the kernel. It may break your system.The procedure to get Mobile IPv6 functinaliy onto darwin is little bit complicated. Because I guess distributing binary would be prohibited and I'm not even certain to distribute all of xnu sources.
I assume no responsibility whatsoever for any damages resulting from the use of this code.
I believe it's ok to redistribute modified source code and even binary form in terms of APSL Section 2.1, 2.2 and 2.3. But I'm not quite sure my recognition is right or not. License terms are difficult to me...
% cd $somewhere % cvs -d :pserver:anoncvs@anoncvs.kame.net:/cvsroot/kame login ; see the above link to know the password % cvs -d :pserver:anoncvs@anoncvs.kame.net:/cvsroot/kame co -P kame/Makefile kame/Makefile.inc % cd kame % bsdmake TARGET=darwin tree
% cd darwin % tar xfz xnu-792.17.14.tar.gz % mv xnu-792.17.14 xnufor Intel:
% cd darwin % tar xfz xnu-792.25.20.tar.gz % mv xnu-792.25.20 xnu
These patches intend to provide MIP6 capability on Darwin. However, they include several fixes that have no relations to MIP6 functionality such as:
- Drop routing header type0 packets. Packets which includes routing header type0 are regarded harmful and a serious security problem. (The fix is not included for intel patch because it is already done in 10.4.10)
- Ndp(8) with '-p' and '-r' prints appropriate values. The original one prints just a error message. It may prevent to shoot a problem when unappropriate ND messages are on the wires. Plese see here for more details.
% cd xnu % patch -p1 < ${thePatch}
% rm bsd/net/net_osdep.[ch] bsd/netinet/icmp6.h bsd/netinet6/dest6.c
if you don't have several commands to be needed for compilation of xnu kernel, acquire and install them as follows. It should work on ppc Mac as well.% curl -O http://www.macosforge.org/files/kernel-tools-8J2135.root.tar.gz % sudo tar xzf kernel-tools-8J2135.root.tar.gz -C /
% cd ../.. % pwd $somewhere/kame % bsdmake TARGET=darwin prepare % cd darwin/xnu % source SETUP/setup.csh ; In case of csh % sudo gcc_select 3.3 ; If you didn't it ever. It doesn't need to do this in case of Intel % makeNow, you got the new kernel at BUILD/obj/RELEASE_PPC/mach_kernel. Install the kernel as you like. I always install the kernel as follows to be safety in case of PPC. And note the permission, ower and group of the new kernel must be same as orginila ones.
% sudo cp BUILD/obj/RELEASE_PPC/mach_kernel /mach_kernel.test % chmod 644 /mach_kernel.test % sudo chown root /mach_kernel.test % sudo chgrp wheel /mach_kernel.test % nvram -p % sudo nvram boot-file="hd:9,\mach_kernel.test"The value 'hd:9,\mach_kernel.test' is for my environment. It depends on your environment.
In case of Intel Mac, there is no standard way to change boot up kernel. The only way to install your own kernel is replace the original kernel itself.
% sudo chmod /mach_kernel /mach_kernel.original % sudo cp BUILD/obj/RELEASE_I386/mach_kernel /mach_kernel % sudo chown root /mach_kernel % sudo chgrp wheel /mach_kernelBut note that you cannot recover the system other than reinstall if the booting system have failed. The only way to recover the system without reinstall is followed:
EDIT: In addition the above ways, you have another way to specify boot kernel. After copy your kernel to /, edit /Library/Preferences/SystemConfiguration/com.apple.Boot.plist as follows
<?xml version="1.0" encoding="UTF-8"?> <!DOCTYPE plist PUBLIC "-//Apple Computer//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd"> <plist version="1.0"> <dict> <key>Kernel</key> <string>your installed kernel</string> <key>Kernel Flags</key> <string></string> <key>Boot Graphics</key> <string>Yes</string> </dict> </plist>Leave other part as is other than red colored value. With this way, you don't need to touch the original kernel as Intel Mac did.
% pwd $somewhere/kame/darwin % tar xfz network_cmds-245.12.tar.gz % cd network_cmds-245.12 % patch < $somewhere/ifconfig.diff % cd ifconfig.tproj % sudo make install
% pwd $somewhere/kame/darwin % sudo bsdmake install
% cat startmn #!/bin/sh /usr/local/v6/sbin/ifconfig mip0 inet6 <Your Home Address> prefixlen 64 home /usr/local/v6/sbin/mnd -n -c /usr/local/src/kame/darwin/usr.sbin/shisad/mnd.conf.sample mip0 /usr/local/v6/sbin/cnd -n /usr/local/v6/sbin/babymdd -h mip0 % sudo startmn
Enjoy Mobile IPv6 on your Mac ! And any reports and feedbacks are welcome.