aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorFilipp Lepalaan <filipp@mac.com>2010-02-20 12:37:10 +0200
committerFilipp Lepalaan <filipp@mac.com>2010-02-20 12:37:10 +0200
commit05655228858b3defa578cbaaa314ab8f7299ddeb (patch)
tree926929c7e10c27c6e49541062922665519701d49
parent4e860e3faed2a3bea16868a317f08071d0c1fc0e (diff)
downloadmtk-05655228858b3defa578cbaaa314ab8f7299ddeb.tar.gz
mtk-05655228858b3defa578cbaaa314ab8f7299ddeb.tar.bz2
mtk-05655228858b3defa578cbaaa314ab8f7299ddeb.zip
Some fixes
-rw-r--r--.gitignore1
-rwxr-xr-xbuild_rsync.sh15
-rwxr-xr-xmake_boot/exclude.txt31
-rwxr-xr-xmake_boot/include.txt7
-rwxr-xr-xmake_boot/makeboot.sh24
5 files changed, 66 insertions, 12 deletions
diff --git a/.gitignore b/.gitignore
index 9ea0f13..304c556 100644
--- a/.gitignore
+++ b/.gitignore
@@ -1,2 +1,3 @@
.*
!.gitignore
+rsync \ No newline at end of file
diff --git a/build_rsync.sh b/build_rsync.sh
index 5f28dab..249f282 100755
--- a/build_rsync.sh
+++ b/build_rsync.sh
@@ -16,11 +16,22 @@ fi
RSYNC_VERSION=$1
mkdir /tmp/build_rsync > /dev/null 2>&1
+
cd /tmp/build_rsync
+MIRROR="http://rsync.samba.org/ftp/rsync"
+
echo "Downloading rsync..."
-curl --progress -O http://rsync.samba.org/ftp/rsync/rsync-${RSYNC_VERSION}.tar.gz > /dev/null 2>&1
-curl --progress -O http://rsync.samba.org/ftp/rsync/rsync-patches-${RSYNC_VERSION}.tar.gz > /dev/null 2>&1
+curl --progress -O ${MIRROR}/rsync-${RSYNC_VERSION}.tar.gz > /dev/null 2>&1
+if [[ $? -ne 0 ]]; then
+ echo "Failed to download rsync" 2>&1
+ exit 1
+fi
+curl --progress -O ${MIRROR}/rsync-patches-${RSYNC_VERSION}.tar.gz > /dev/null 2>&1
+if [[ $? -ne 0 ]]; then
+ echo "Failed to download rsync-patches" 2>&1
+ exit 1
+fi
echo "Extracting rsync..."
tar -zxvf rsync-${RSYNC_VERSION}.tar.gz
diff --git a/make_boot/exclude.txt b/make_boot/exclude.txt
index eec1ff3..c06e890 100755
--- a/make_boot/exclude.txt
+++ b/make_boot/exclude.txt
@@ -1,3 +1,34 @@
private/var/vm/sleepimage
private/var/logs/*
usr/X11/*
+usr/standalone/bootcaches.plist
+
+System/Library/Extensions.mkext
+System/Library/Extensions/IO80211Family.kext
+
+System/Library/Caches/*
+
+System/Library/Core Services/Setup Assistant.app
+System/Library/Core Services/RawCamera.bundle
+System/Library/Core Services/Server Assistant.app
+System/Library/Core Services/Front Row.app
+
+System/Library/Frameworks/JavaVM.framework
+System/Library/Frameworks/JavaFrameEmbedding.framework
+System/Library/Frameworks/CoreWLAN.framework
+System/Library/Frameworks/XgridFoundation.framework
+System/Library/Frameworks/Ruby.framework
+System/Library/Frameworks/Python.framework
+
+System/Library/PrivateFrameworks/iLifeSlideshow.framework
+System/Library/PrivateFrameworks/iLifeMediaBrowser.framework
+System/Library/PrivateFrameworks/MobileDevice.framework
+System/Library/PrivateFrameworks/Apple80211.framework
+System/Library/PrivateFrameworks/CoreChineseEngine.framework
+System/Library/PrivateFrameworks/VideoConference.framework
+System/Library/PrivateFrameworks/OfficeImport.framework
+System/Library/PrivateFrameworks/GeoKit.framework
+System/Library/PrivateFrameworks/ExchangeWebServices.framework
+System/Library/PrivateFrameworks/BackRow.framework
+System/Library/PrivateFrameworks/Helium.framework
+System/Library/PrivateFrameworks/LiveType.framework
diff --git a/make_boot/include.txt b/make_boot/include.txt
index 0ad5ffe..f577e25 100755
--- a/make_boot/include.txt
+++ b/make_boot/include.txt
@@ -20,7 +20,6 @@ System/Library/ColorSync
System/Library/Displays
System/Library/Extensions
System/Library/Filesystems
-System/Library/Fonts
System/Library/Frameworks
System/Library/KerberosPlugins
System/Library/LaunchDaemons
@@ -35,6 +34,12 @@ System/Library/Sounds
System/Library/SystemConfiguration
System/Library/SystemProfiler
+System/Library/Fonts/LastResort.ttf
+System/Library/Fonts/Helvetica.dfont
+System/Library/Fonts/Menlo.ttc
+System/Library/Fonts/LucidaGrande.ttc
+System/Library/Fonts/Apple Symbols.ttf
+
bin
etc
private
diff --git a/make_boot/makeboot.sh b/make_boot/makeboot.sh
index 042f0c5..3ef33af 100755
--- a/make_boot/makeboot.sh
+++ b/make_boot/makeboot.sh
@@ -1,6 +1,7 @@
#!/usr/bin/env bash
# makeboot.sh
# Create NetBoot Image from any OS X volume
+# Much of this is borrowed from DeployStudio/sys_builder.sh
# usage makeboot..sh source destination
if [ $USER != "root" ]; then
@@ -16,8 +17,9 @@ if [[ -z $1 ]]; then
fi
RSYNC_VERSION=$(rsync --version | head -n 1 | cut -d ' ' -f 8)
+
if [[ $RSYNC_VERSION -lt 30 ]]; then
- echo "Sorry but your rsync is too old" 2>&1
+ echo "Sorry, but your rsync is too old. You can get the latest from http://github.com/filipp/mtk" 2>&1
exit 1
fi
@@ -27,30 +29,34 @@ TMP_MOUNT_POINT_PATH=/tmp/MakeBoot
mkdir $TMP_MOUNT_POINT_PATH
DMG_FILE=./boot.sparseimage
+echo "Creating disk image..."
hdiutil create "${DMG_FILE}" -volname "${VOL_NAME}"\
-size 5G -type SPARSE -fs HFS+ -stretch 10G\
-uid 0 -gid 80 -mode 775 -layout NONE 2>&1
chmod 777 "${DMG_FILE}"
+echo "Mounting disk image..."
hdiutil attach "${DMG_FILE}" -mountpoint "${TMP_MOUNT_POINT_PATH}"
+echo "Preparing disk image..."
mdutil -i off "${TMP_MOUNT_POINT_PATH}"
mdutil -E "${TMP_MOUNT_POINT_PATH}"
defaults write "${TMP_MOUNT_POINT_PATH}"/.Spotlight-V100/_IndexPolicy Policy -int 3
mkdir "${TMP_MOUNT_POINT_PATH}/Library/Caches"
-echo "Cloning system..."
-/Volumes/KINGSTON/rsync\
- --progress\
- --protect-args --fileflags --force-change -aNHAXxr\
- --files-from=include.txt --exclude-from=exclude.txt
- "${SOURCE}" /tmp/MakeBoot
+echo "Cloning system (this will take a while)..."
+/usr/local/bin/rsync\
+ --protect-args --fileflags --force-change -aNHAXxrP\
+ --files-from=./include.txt --exclude-from=./exclude.txt\
+ "${SOURCE}" ${TMP_MOUNT_POINT_PATH}
echo "Doing boot things..."
-ditto /mach_kernel "${TMP_MOUNT_POINT_PATH}/mach_kernel"
-ln -s "${TMP_MOUNT_POINT_PATH}/mach_kernel" "${TMP_MOUNT_POINT_PATH}/mach"
+ditto /mach_kernel "${TMP_MOUNT_POINT_PATH}"/mach_kernel
+ln -s "${TMP_MOUNT_POINT_PATH}"/mach_kernel "${TMP_MOUNT_POINT_PATH}"/mach
+kextcache -l -m "${TMP_MOUNT_POINT_PATH}"/System/Library/Extensions.mkext "${SOURCE}"/System/Library/Extensions
+bless --folder "${TMP_MOUNT_POINT_PATH}"/System/Library/CoreServices --label "${VOL_NAME}" --botinfo --bootefi --verbose
#kextcache -a i386 -s -l -n -z -m /tmp/macnbi-i386/mach.macosx.mkext /System/Library/Extensions