Skip to content

Instantly share code, notes, and snippets.

@rockpapergoat
Created July 13, 2012 15:39
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save rockpapergoat/3105550 to your computer and use it in GitHub Desktop.
Save rockpapergoat/3105550 to your computer and use it in GitHub Desktop.
recovery partition creation pkg
#
# Copyright 2009 Joe Block <jpb@ApesSeekingKnowledge.net>
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.
#
#
include /usr/local/share/luggage/luggage.make
TITLE=create_recovery_partition
REVERSE_DOMAIN=com.example
PAYLOAD=\
pack-tmp-RecoveryHDUpdate.dmg\
pack-script-postflight\
pack-tmp-%: % package_root
@sudo mkdir -pv ${WORK_D}/private/tmp
@sudo ditto -V $< ${WORK_D}/private/tmp/$<
#!/bin/bash
/usr/bin/hdiutil attach -nobrowse -noverify /tmp/RecoveryHDUpdate.dmg
/usr/bin/hdiutil attach -nobrowse -noverify /Volumes/RecoveryHDUpdate/RecoveryHDUpdate.pkg/RecoveryHDMeta.dmg
/tmp/RecoveryHDUpdate/RecoveryHDUpdate.pkg/Scripts/Tools/dmtest ensureRecoveryPartition / /Volumes/Recovery\ HD\ Update/BaseSystem.dmg 0 0 /Volumes/Recovery\ HD\ Update/BaseSystem.chunklist
/usr/bin/hdiutil eject /Volumes/Recovery\ HD\ Update
/usr/bin/hdiutil eject /Volumes/RecoveryHDUpdate
/usr/bin/touch /Library/Preferences/SystemConfiguration/com.apple.Boot.plist
/usr/sbin/kextcache -f -u /
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment