aboutsummaryrefslogtreecommitdiffstats
path: root/make_boot/makeboot.sh
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 /make_boot/makeboot.sh
parent4e860e3faed2a3bea16868a317f08071d0c1fc0e (diff)
downloadmtk-05655228858b3defa578cbaaa314ab8f7299ddeb.tar.gz
mtk-05655228858b3defa578cbaaa314ab8f7299ddeb.tar.bz2
mtk-05655228858b3defa578cbaaa314ab8f7299ddeb.zip
Some fixes
Diffstat (limited to 'make_boot/makeboot.sh')
-rwxr-xr-xmake_boot/makeboot.sh24
1 files changed, 15 insertions, 9 deletions
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