Gentoo for MacOS Project Wiki
[ PantherChroot ]
Other Languages
Panther Chroot
This is an attempt to build a disk image containing a "pristine" development environment for
Gentoo for Mac OS X on OSX.
We'll start with making the disk image. We will use HFSX file system to obtain case sensitivity. I am calling mine Dargentoo , use whatever name you want.
hdiutil create -size 4g -type UDIF -fs HFSX -volname Dargentoo -uid 0 -gid 0 -attach Dargentoo.dmg
Next, we need to set an environment variable to make the os x installer let us install the packages into a non-bootable Volume (a directory that is not /)
for bash and zsh:
export CM_BUILD=CM_BUILD
for tcsh
setenv CM_BUILD CM_BUILD
First get into your so fresh and so clean clean disk image and become root
cd /Volumes/Dargentoo sudo su
Ok, different OS X install cds/dvds have different volume names, so edit your paths accordingly, and replace /Volumes/$MACOSINSTALL with the actual path to the pkgs.
We start by installing the base system in -verbose mode so we can see if anything goes wrong (and it could, the installer is very unpredictable) and tell it we are installing from a -pkg and the files are to be installed on -target /Volumes/Dargentoo .
In case any weird browser wrapping occurs, this should be all on one line
installer -verbose -pkg /Volumes/$MACOSINSTALL/System/Installation/Packages/BaseSystem.pkg -target /Volumes/Dargentoo
Hopefully yer golden pony boy.... If you get errors, make sure you set the CM_BUILD var, and try again, like i said, the installer can be finicky.
If you got the base system installed, next finish up by system essentials and the bsd subsystem.
sudo installer -pkg Volumes/$MACOSINSTALL/System/Installation/Packages/Essentials.pkg -target /Volumes/Dargentoo
sudo installer -pkg Volumes/$MACOSINSTALL/System/Installation/Packages/BSD.pkg -target /Volumes/Dargentoo
Yeehaw. If there were no errors, you have a pristine osx install image. Now we need Dev tools.
Download the latest version available from Apple and either burn them to a cd or copy them to your harddrive.
Note: as it turns out, you can use an "update" version as well. These usually refuse to install if no prior version is found, but seem to work if installed via the command line, like described here.
Now lets install the basics(you can install everything if you want/need to, i.e. additional sdk's , headers, etc)
sudo installer -verbose -pkg /Volumes/Xcode Tools/Packages/DeveloperTools.pkg -target /Volumes/Dargentoo
sudo installer -verbose -pkg /Volumes/Xcode Tools/Packages/DevSDK.pkg -target /Volumes/Dargentoo/
sudo installer -verbose -pkg /Volumes/Xcode Tools/Packages/BSDSDK.pkg -target /Volumes/Dargentoo/
sudo installer -verbose -pkg /Volumes/Xcode Tools/Packages/gcc3.3.pkg -target /Volumes/Dargentoo/
OK!
Now the whole point of all this is to get Gentoo for Mac OS going so lets do it.
Download the latest version and mount the .dmg. Issue the same installer commands as we did for os x and xcode.
sudo installer -verbose -pkg /Volumes/gentoo-macos/gentoo-macos.pkg -target /Volumes/Dargentoo/
Lets remove some extras like gui apps and docs(who needs thos?) to save space
cd /Volumes/Dargentoo/Developer sudo rm -rf Applications/ Documentation/ Palettes/ Extras/
Done!
See UsingChroot to actually start playing around in it =)
This page was started by Kito Dietrich. It was compiled from various sources on the web, including irc
chats, Apples Documentation and the brilliant folks at Opendarwin