chroot?

Christophe Vandeplas elcascador at gmail.com
Mon Feb 26 21:37:44 PST 2007


Bob Zimmermann wrote:
> Hi-
> 
> I'm a new porter.  I want to submit some ports but also want to test my 
> ports on a clean machine first.  There is mention on the wiki about 
> chrooting the OS to do this, however, the link which describes it is 
> dead (from the old opendarwin page).  Can anyone let me know how this is 
> done?

Hi Bob,

have a look at the scripts I attached.
Edit them (variables) and run it from your shell.

There are still some things missing as I couldn't compile java-stuff.


Hope this helps


greets
-------------- next part --------------
#!/bin/bash

#IMG_PATH="/Volumes/10-4-chroot-hfs"
IMG_PATH="/Volumes/JfsDisc"

echo "-- Mounting required stuff"
sudo mount -t devfs devfs ${IMG_PATH}/dev
sudo mount -t fdesc -o union stdin ${IMG_PATH}/dev
sudo mount_volfs ${IMG_PATH}/.vol
#echo "-- Please enter the smb password"
#mount_smbfs //chri at 192.168.1.10/macports  ${IMG_PATH}/MacPorts
echo "-- Entering chroot";
sudo chroot ${IMG_PATH}/
echo "-- Unmounting mounted stuff";
#umount ${IMG_PATH}/MacPorts
sudo umount ${IMG_PATH}/.vol
sudo umount ${IMG_PATH}/dev
sudo umount ${IMG_PATH}/dev
echo "-- Finished";
-------------- next part --------------
#!/bin/bash
# Hail to http://gene-hacker.info/darwinports/osx_darwin_chroot/
# Copyleft Christophe Vandeplas <christophe at vandeplas.com>

#IMG_NAME="10-4-chroot-hfs"
IMG_NAME="JfsDisc"
IMG_PATH="/Volumes/${IMG_NAME}"
DVD_PATH="/Volumes/Mac OS X Install Disc 1"
CHROOT_SIZE="5g"

hdiutil create -fs HFS+ -volname ${IMG_NAME} -size ${CHROOT_SIZE} chroot

export CM_BUILD=CM_BUILD

echo "Please mount the created image (30 sec left)"
sleep 30s;


cd ${IMG_PATH}
sudo installer -pkg "${DVD_PATH}/System/Installation/Packages/BaseSystem.pkg" -target "${IMG_PATH}"
sudo installer -pkg "${DVD_PATH}/System/Installation/Packages/Essentials.pkg" -target "${IMG_PATH}"
sudo installer -pkg "${DVD_PATH}/System/Installation/Packages/BSD.pkg" -target "${IMG_PATH}"
sudo installer -pkg "${DVD_PATH}/System/Installation/Packages/X11User.pkg" -target "${IMG_PATH}"
sudo installer -pkg "${DVD_PATH}/System/Installation/Packages/Java.pkg" -target "${IMG_PATH}"

sudo installer -pkg "${DVD_PATH}/Xcode Tools/Packages/DeveloperTools.pkg" -target "${IMG_PATH}"
sudo installer -pkg "${DVD_PATH}/Xcode Tools/Packages/MacOSX10.4.Universal.pkg" -target "${IMG_PATH}"
sudo installer -pkg "${DVD_PATH}/Xcode Tools/Packages/gcc3.3.pkg" -target "${IMG_PATH}"
sudo installer -pkg "${DVD_PATH}/Xcode Tools/Packages/gcc4.0.pkg" -target "${IMG_PATH}"
sudo installer -pkg "${DVD_PATH}/Xcode Tools/Packages/X11SDK.pkg" -target "${IMG_PATH}"
sudo installer -pkg "${DVD_PATH}/Xcode Tools/Packages/BSDSDK.pkg" -target "${IMG_PATH}"
sudo installer -pkg "${DVD_PATH}/Xcode Tools/Packages/DevSDK.pkg" -target "${IMG_PATH}"
sudo installer -pkg "${DVD_PATH}/Xcode Tools/Packages/WebObjectsDevelopment.pkg" -target "${IMG_PATH}"
sudo installer -pkg "${DVD_PATH}/Xcode Tools/Packages/WebObjectsRuntime.pkg" -target "${IMG_PATH}"
sudo installer -pkg "${DVD_PATH}/Xcode Tools/Packages/WebKitSDK.pkg" -target "${IMG_PATH}"
sudo installer -pkg "${DVD_PATH}/Xcode Tools/Packages/QuickTimeSDK.pkg" -target "${IMG_PATH}"
sudo installer -pkg "${DVD_PATH}/Xcode Tools/Packages/OpenGLSDK.pkg" -target "${IMG_PATH}"
sudo installer -pkg "${DVD_PATH}/Xcode Tools/Packages/CoreAudioSDK.pkg" -target "${IMG_PATH}"


#mkdir -p ${IMG_PATH}/MacPorts


More information about the macports-dev mailing list