Archive_location correct in profile, but fails to mount
My NAS log where the flash archives are stored shows that jumpstart is trying to mount the file along with the path:
02/08/08 09:24:54 mountd/v3:denied 10.166.57.14 to /vol0/Images/FLAR/209/portal1.flar
When the install bombs to a command prompt, I can successfully mount:
mount -F nfs 10.166.57.14 to /vol0/Images/FLAR/209 /mnt
It does show that check_client runs properly:
02/08/08 09:19:54 mountd/v3:granted 10.166.57.13 to /vol0/Images/FLAR/209
Is there a tweek or config point I can modify to prevent this from happening?
Pete
Edited by: peteziu on Feb 8, 2008 2:50 PM
Thanks for your help Chris,
My flash_archive_locations was entered as: nfs://<ip>/<path>/myflash.flar
In the profile, it shows up as the same : nfs://<ip>/<path>/myflash.flar
The problem is that when the new client machine is performing a jumpstart flash install, it fails reporting: cannot mount <ip>:/<path>/myflash.flar because it is trying to mount a filename, not a directory on the nfs server (NAS)
See above post for what is logged on the NAS, the remote location where my flars are stored. ( nfs://<ip>/<path> )
If I set flash_archive_locations to nfs://<ip>/<path>, the ../SUNWjet/Products/flash/check_client fails.
For some reason, jumpstart is effectively issuing a command equivalent to:
mount -F nfs <ip>:/<path>/myflash.flar /<somemountpoint>
Since the install bombs out, I can open a console and type the following, and see that it mounts:
mount -F nfs <ip>:/<path> /<somemountpoint>
I can then cd /<somemountpoint> and do an ls and see myflash.flar.
So, what is causing the jumpstart script to try to mount a file, and not a directory?
I was thinking that I may have some weird n1sps 6.0 with n1osp 5.2 problem, so I am rebuilding w/ pure 6.0. If not related to this, I will certainly have the same problem again.
I don't need the mountpoint to change for each client, just the flash archive name. But right now no matter what I do, jumpstart tries to mount the FILE, not the directory where the file resides.
The evidence I have of this is that when I manually try to mount the file, I get the same error showing in the NAS access log as jumpstart when it tries to mount. (see first post this topic)
Edited by: peteziu on Feb 12, 2008 7:07 PM
Edited by: peteziu on Feb 12, 2008 7:08 PM
Edited by: peteziu on Feb 12, 2008 7:12 PM
Similar Messages
-
Test cases runs correctly on IDE but fails on the test runner
Hi Guys,
I have a test case here that works fine on my Mars IDE with RCPTT but fails when I run it via the Maven plugin on the same machine.
The summary of the test case here is that it auto-generates some java files based on changes done to a DSL type language. You will see that there is a Generator project there that does this. Any changes to the type file will trigger the java file to be regenerated with whatever was defined in the Generator project. On the IDE it all works but when it's run via the test runner, it always fails for some reason.
One interesting thing to note there is if that test case is run first, it does not fail. I initially suspected that the previous test case might have done something to the AUT workspace/environment but it's difficult to prove. The test case in question does have contexts to clear the workspace and to add projects as well as a context for setting the preferences. I did try removing all the contexts except for the workspace context that contains the project that it needs but the execution result is still the same. If I manually ran the same AUT (extracted somewhere else) with the generated test-runner aut workspace right after and made some changes to the type file, the java files are generated correctly.
So the problem now is, we're not sure what the test runner is doing differently with the RCPTT IDE in this case. It would seem like the test runner is preventing the AUT from generating the files or there might be an error that prevents the generation from happening.
I've attached the results folder from the test runner execution and the log file from the from the runner-workspace folder.
cheers!
JosephHi Folks,
We've found out the cause of the problem and have found out that this is not entirely RCPTT related. Apologies for the disturbance. Marking this as a non-issue.
cheers!
Joseph -
Custom Stamp displays correct in reader but fails in acrobat
Our company has a rather old work ticket form which our technicians have been filling out on their laptops for years. I believe it was originally created in lifecycle designer 6 but don't quote me on that. The issue is that when the form is opened in any version of Adobe Reader, it displays correctly and the letter head with the company name and address is properly displayed at the top of the page. However when you open the same document in acrobat you can see that someone used a custom stamp to redo our address on this form when we moved several years ago and the stamp does not display correctly.
Additionally if a user edits the file in anyway with acrobat and saves it the improperly displayed letterhead becomes permanent and also shows up when trying to view that file from adobe reader. Can anyone tell me whats going on and how to fix this issue?That is a static XFA form and it appears as though something is wrong with the stamp. I recall someone reporting an issue with Acrobat 10 that can cause this sort of thing. I was able to open the file in Acrobat 9, delete the problematic stamp after unlocking it, and the correct one remained. If you're unable to do the same, I can send you the the file I fixed.
-
I have a Windows 2008 R2 single domain forest. I have a problem deploying settings to devices in the forest, where only 29 devices of 500 are picking up new WSUS settings. We frequently have problems getting new settings to certain devices.
For example, I have four Exchange servers in an OU with identical GPO settings configured through GPMC and two of them receive their new GPO settings and two don't. The servers are in two different datacentres, but the two that report are
in different ones and the ones that don't report are right next to them in the same VLAN. Running GPUPDATE /FORCE doesn't have any effect. Sometimes rebooting the server will effect the change but it then reverts to the old settings within a few hours.
Similarly we have PC VLANs that aren't picking any settings either, despite being rebooted regularly.
Any ideas would be very helpful?Hi Brian,
Based on your description, please run command gpresult/h report.html on the troubled machines to collect group policy to check this. Note, to collect computer part settings, we need to run the command with admin privileges.
Alternative, we can use Group Policy Result Wizard in GPMC on domain controllers to remotely collect group policy result report:
1. On domain controller, click Start -> Run, type GPMC.MSC, it will load the GPMC console.
2. Right click on "Group Policy Result" and choose wizard to generate a report for the problematic computer and user account (please place appropriately). (Choose computer and select
the proper user in the wizard)
3. Right click the resulting group policy result and click the "Save Report…" => save report to save the report to a HTML file.
If necessary, when you get the report, you may upload it to the Skydrive and provide the download link for us to troubleshoot
the issue.
Best regards,
Frank Shen
Please remember to mark the replies as answers if they help and unmark them if they provide no help. If you have feedback for TechNet Subscriber Support, contact [email protected] -
Ext HD recognized but won't mount
Trying to use my firewire/usb ext HD. It is recognized in disc utility and system profiler, but won't mount. I honestly can't remember whether the HD was disconnected or turned off before unmounting, but that's my suspicion. Tried connecting through usb---nothing. I've tried repairing with disc utility, but still nothing. I even had my neighbor plug it into his pc which wasn't any help (but nevermind that). Any advice?
Hi, Jason. Is the drive powered by its own AC adapter, or is it a bus-powered unit? If the latter, its power requirements may exceed what the bus can provide, and the solution will be to power it externally (or if there's no place on it to plug in an AC adapter, replace its enclosure with one that can be powered externally).
Spinning up but failing to mount is classic behavior for a bus-powered drive that exceeds the bus's power budget. That your drive won't mount when connected either through a FW or a USB port strongly indicates that it isn't your connecting cable(s) at fault, since the likelihood that both types of cable are bad is very small.
You don't say whether the drive was recognized by the PC you connected it to. Was it?
Has this drive ever mounted properly on your Mac's desktop, or is it a new drive that has never been formatted on a Mac? Is Disk Utility able to format it (as Mac OS Extended) or not? -
I am having issues with USB 2.0 External Hardrives and my 15inch Retina MacBook Pro running OS 10.8.1. I was able to read write to the drives fine prior to using disk utility to erase and reformat the drives. Both drives show up in the side bar of Disk Utility, but fail to mount. Both drives Verify and Repair without issue, but still fail to mount. I have tried switching USB Ports, powering on/off, etc. I tried seeing them through terminal, but they do not show.
I first lost my Lacie 500GB HD when reformatting it with Disk Utility. I gave me an error message, but I can't remember what it said.
Thinking my drive died, I plugged in a McAlly external USB 2.0 500GB drive that originally worked fine, but then locked the entire computer completely, forcing a power button reset after 10 min of total freeze. Now that drive is unusable as well and fails to mount.
I am unable to Partition either drive because they will not mount.
Any help would be appreciated.
Thanks,
ChrisI called Apple Support after getting no usuable help through the Apple Forums. The rep felt is was a problem with the two older USB 2.0 drives compatablility with the Retina Macbook Pro's USB 3.0. He kindly offered to send me a Compatable USB 3.0 Drive, but could not offer a solution.
FYI, I tried using different cords and both USB 3.0 ports on my Retina MacBook Pro and both are self powered.
Thanks,
Chris -
Firewaire Drives (Lacie) fail to mount
This is probably going to be a hardware problem, but let's see. I have 3 x 500Gb Lacie firewire drives, they connect using FW 800 cables, I connect them and they power up, but fail to mount. I have tried them individually and the same goes for all 3, they power up, but never mount. I then try them on my Powerbook, and they mount fine. Hardware issue on my G5 perhaps?
Thought you could use this info about getting FireWire to work!
First, you should always Repair Permissions in Disk Utility before and after any update; I would do that now. If you installed your update with FireWire plugged in, your Mac may not recognize it anymore.
Try resetting your FireWire ports by disconnecting all FW devices, shut down your Mac and unplug it from AC power (wall socket) for 15 minutes. plug it back in and try FW.
If that did'nt work, download the combo update from this site (yours may be corrupt), not Software Update, disconnect all firewire + USB devices except keyboard + mouse, Repair Permissions, re-install update, Repair Permissions again + try.
If that still did'nt get it Zap the PRAM. While restarting Mac hold down the following key combo Command-Option-P-R. Keep holding those keys down till you hear the second start-up chime, then release.
For those of you with Macs that are not PowerBooks or iBooks, a bad internal battery can cause FireWire to not be recognized, so make sure it's good!
Good Luck!
Cheers!
DALE -
Tried to use iphone connecting to wifi but failed dispite password correct, cable connection ok, and even reset network setting in iphone. Anyone can help?
Kin ChiI get in now with the following procedures taken:
1. Reset network as suggested in Apple app.
2. In the wifi connection, instead click in the user name as shown in the screen, I click Others and re-type the user name as appeared before. In the security, instead of none, I click WEP. It will then prompt you to put in password. I then put in password as I know for that user name again.
Then, it joined the wifi..
Hope this can help someone who get this problem.
Kin Chi -
System Image Utility "volume on diskxsx failed to mount"
I've been trying to create a NetRestore image using System Image Utility (SIU) for the past couple of days, but no matter what I do it fails. I was oringally using OSX 10.8.4, but have now upgraded to 10.8.5.
After reading through the logs, I can see SIU fails whilst it's trying to mount the volume. Has anyone else had this issue, and if so, were you able to fix it?
I also noticed the "Create image of /Volume/Macintosh HD/" function stops at 48% instead of 100%. Is that normal?
Below is a copy of the log that SIU produced.
Starting image creation.
Workflow Started (2013-09-24 08:41:36 +0100)
OS X Server 10.8.5 (12F37), System Image Utility 10.8.3 (624)
Starting action: Define Image Source (1.4)
Finished running action: Define Image Source
Starting action: Create Image (1.7.2)
Starting image creation process...
Create NetRestore Image
Initiating NetRestore from installed volume.
progressPrefix="_progress"
++ progressPrefix=_progress
scriptsDebugKey="DEBUG"
++ scriptsDebugKey=DEBUG
imageIsUDIFKey="1"
++ imageIsUDIFKey=1
imageFormatKey="UDZO"
++ imageFormatKey=UDZO
mountPoint=""
++ mountPoint=
ownershipInfoKey="501:20"
++ ownershipInfoKey=501:20
blockCopyDeviceKey="0"
++ blockCopyDeviceKey=0
dmgTarget="NetInstall"
++ dmgTarget=NetInstall
potentialRecoveryDevice="disk4s3"
++ potentialRecoveryDevice=disk4s3
asrSource="ASRInstall.pkg"
++ asrSource=ASRInstall.pkg
destPath="/Users/morgan/Desktop/NetRestore of Macintosh HD_2.nbi"
++ destPath='/Users/morgan/Desktop/NetRestore of Macintosh HD_2.nbi'
skipReorderingKey="0"
++ skipReorderingKey=0
sourceVol="/Volumes/Macintosh HD"
++ sourceVol='/Volumes/Macintosh HD'
postInstallHelperKey="1"
++ postInstallHelperKey=1
. "${1}/createCommon.sh"
+ . /tmp/niutemp.rDvE48RI/createCommon.sh
# createCommon.sh
# Common functionality for the Image creation process.
# sourced in by the various SIU scripts
# Copyright © 2007-2012 Apple Inc. All rights reserved.
# Using dscl, create a user account
AddLocalUser()
# $1 volume whose local node database to modify
# $2 long name
# $3 short name
# $4 isAdminUser key
# $5 password data
# $6 password hint
# $7 user picture path
# $8 Language string
local databasePath="/Local/Default/Users/${3}"
local targetVol="${1}"
# Find a free UID between 501 and 599
for ((i=501; i<600; i++)); do
output=`/usr/bin/dscl -f "${targetVol}/var/db/dslocal/nodes/Default" localonly -search /Local/Default/Users UniqueID $i`
# If there is already an account dscl returns it, so we're looking for an empty return value.
if [ "$output" == "" ]; then
break
fi
done
# Create the user record
/usr/bin/dscl -f "${targetVol}/var/db/dslocal/nodes/Default" localonly -create $databasePath
if [ $? != 0 ]; then
echo "Failed to create '${databasePath}'."
return 1
fi
# Add long name
/usr/bin/dscl -f "${targetVol}/var/db/dslocal/nodes/Default" localonly -append $databasePath RealName "${2}"
if [ $? != 0 ]; then
echo "Failed to set the RealName."
return 1
fi
# Set up the users group information
/usr/bin/dscl -f "${targetVol}/var/db/dslocal/nodes/Default" localonly -append $databasePath PrimaryGroupID 20
if [ $? != 0 ]; then
echo "Failed to set the PrimaryGroupID."
return 1
fi
# Add some additional stuff if the user is an admin
if [ "${4}" == 1 ]; then
/usr/bin/dscl -f "${targetVol}/var/db/dslocal/nodes/Default" localonly -append "/Local/Default/Groups/admin" GroupMembership "${3}"
if [ $? != 0 ]; then
echo "Failed to add the user to the admin group."
return 1
fi
/usr/bin/dscl -f "${targetVol}/var/db/dslocal/nodes/Default" localonly -append "/Local/Default/Groups/_appserveradm" GroupMembership "${3}"
if [ $? != 0 ]; then
echo "Failed to add the user to the _appserveradm group."
return 1
fi
/usr/bin/dscl -f "${targetVol}/var/db/dslocal/nodes/Default" localonly -append "/Local/Default/Groups/_appserverusr" GroupMembership "${3}"
if [ $? != 0 ]; then
echo "Failed to add the user to the _appserverusr group."
return 1
fi
fi
# Add UniqueID
/usr/bin/dscl -f "${targetVol}/var/db/dslocal/nodes/Default" localonly -append $databasePath UniqueID ${i}
if [ $? != 0 ]; then
echo "Failed to set the UniqueID."
return 1
fi
# Add Home Directory entry
/usr/bin/dscl -f "${targetVol}/var/db/dslocal/nodes/Default" localonly -append $databasePath NFSHomeDirectory /Users/${3}
if [ $? != 0 ]; then
echo "Failed to set the NFSHomeDirectory."
fi
if [ "${6}" != "" ]; then
/usr/bin/dscl -f "${targetVol}/var/db/dslocal/nodes/Default" localonly -append $databasePath AuthenticationHint "${6}"
if [ $? != 0 ]; then
echo "Failed to set the AuthenticationHint."
return 1
fi
fi
/usr/bin/dscl -f "${targetVol}/var/db/dslocal/nodes/Default" localonly -append $databasePath picture "${7}"
if [ $? != 0 ]; then
echo "Failed to set the picture."
return 1
fi
/usr/bin/dscl -f "${targetVol}/var/db/dslocal/nodes/Default" localonly -passwd $databasePath "${5}"
if [ $? != 0 ]; then
echo "Failed to set the passwd."
return 1
fi
# Add shell
/usr/bin/dscl -f "${targetVol}/var/db/dslocal/nodes/Default" localonly -append $databasePath UserShell "/bin/bash"
if [ $? != 0 ]; then
echo "Failed to set the UserShell."
return 1
fi
# Create Home directory
if [ -e "/System/Library/User Template/${8}.lproj/" ]; then
/usr/bin/ditto "/System/Library/User Template/${8}.lproj/" "${targetVol}/Users/${3}"
else
/usr/bin/ditto "/System/Library/User Template/English.lproj/" "${targetVol}/Users/${3}"
fi
if [ $? != 0 ]; then
echo "Failed to copy the User Template."
return 1
fi
/usr/sbin/chown -R $i:$i "${targetVol}/Users/${3}"
if [ $? != 0 ]; then
echo "Failed to set ownership on the User folder."
return 1
fi
# Copies a list of files (full paths contained in the file at $1) from source to the path specified in $2
CopyEntriesFromFileToPath()
local theFile="$1"
local theDest="$2"
local opt=""
if [ "${scriptsDebugKey}" == "VERBOSE" -o "${scriptsDebugKey}" == "DEBUG" ]; then
opt="-v"
fi
while read FILE
do
if [ -e "${FILE}" ]; then
local leafName=`basename "${FILE}"`
if [ "${scriptsDebugKey}" == "VERBOSE" -o "${scriptsDebugKey}" == "DEBUG" ]; then
echo "Copying ${FILE}."
fi
/usr/bin/ditto $opt "${FILE}" "${theDest}/${leafName}" || return 1
fi
done < "${theFile}"
return 0
# Copies a list of packages (full path, destination pairs contained in the file at $1) from source to .../System/Installation/Packages/
CopyPackagesWithDestinationsFromFile()
local theFile="$1"
local opt=""
if [ "${scriptsDebugKey}" == "VERBOSE" -o "${scriptsDebugKey}" == "DEBUG" ]; then
opt="-v"
fi
while read FILE
do
if [ -e "${FILE}" ]; then
local leafName=`basename "${FILE}"`
if [ "${scriptsDebugKey}" == "VERBOSE" -o "${scriptsDebugKey}" == "DEBUG" ]; then
echo "Copying ${FILE}."
fi
read SUB_PATH
/usr/bin/ditto $opt "${FILE}" "${mountPoint}/Packages/${SUB_PATH}${leafName}" || return 1
fi
done < "${theFile}"
return 0
# Create an installer package in ${1} wrapping the supplied script ${2}
CreateInstallPackageForScript()
local tempDir="$1"
local scriptPath="$2"
local scriptName=`basename "${scriptPath}"`
local entryDir=`pwd`
local opt=""
if [ "${scriptsDebugKey}" == "VERBOSE" -o "${scriptsDebugKey}" == "DEBUG" ]; then
echo "Create installer for script ${scriptName}"
opt="-v"
fi
# shouldn't exist on entry...
if [ -e "${tempDir}/emptyDir" ]; then
/bin/rm -rf "${tempDir}/emptyDir"
fi
# make some directories to work in
/bin/mkdir $opt -p "${tempDir}/${scriptName}.pkg/Contents/Resources" || return 1
/bin/mkdir $opt "${tempDir}/emptyDir" || return 1
# Create Archive.pax.gz
cd "${tempDir}/emptyDir"
/bin/pax -w -x cpio -f "${tempDir}/${scriptName}.pkg/Contents/Archive.pax" .
/usr/bin/gzip "${tempDir}/${scriptName}.pkg/Contents/Archive.pax"
cd "${entryDir}"
# Create the Archive.bom file
/usr/bin/mkbom "${tempDir}/emptyDir/" "${tempDir}/${scriptName}.pkg/Contents/Archive.bom" || return 1
# Create the Info.plist
/bin/cat > "${tempDir}/${scriptName}.pkg/Contents/Info.plist" << END
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
<plist version="1.0">
<dict>
<key>CFBundleIdentifier</key>
<string>com.apple.SystemImageUtility.${scriptName}</string>
<key>CFBundleShortVersionString</key>
<string>1</string>
<key>IFMajorVersion</key>
<integer>1</integer>
<key>IFMinorVersion</key>
<integer>0</integer>
<key>IFPkgFlagDefaultLocation</key>
<string>/tmp</string>
<key>IFPkgFlagInstallFat</key>
<false/>
<key>IFPkgFlagIsRequired</key>
<false/>
<key>IFPkgFormatVersion</key>
<real>0.10000000149011612</real>
</dict>
</plist>
END
echo "pkmkrpkg1" > "${tempDir}/${scriptName}.pkg/Contents/PkgInfo"
echo "major: 1\nminor: 0" > "${tempDir}/${scriptName}.pkg/Contents/Resources/package_version"
# Copy the script
/bin/cp "$scriptPath" "${tempDir}/${scriptName}.pkg/Contents/Resources/postflight"
# clean up
/bin/rm -r "${tempDir}/emptyDir"
return 0
# Validate or create the requested directory
CreateOrValidatePath()
local targetDir="$1"
if [ ! -d "${targetDir}" ]; then
if [ "${scriptsDebugKey}" == "VERBOSE" -o "${scriptsDebugKey}" == "DEBUG" ]; then
echo "Creating working path at ${targetDir}"
fi
/bin/mkdir -p "${targetDir}" || return 1
fi
# If any exist, apply any user accounts
CreateUserAccounts()
# $1 volume whose local node database to modify
local count="${#userFullName[*]}"
local targetVol="${1}"
if [ $count -gt 0 ]; then
if [ "${scriptsDebugKey}" == "VERBOSE" -o "${scriptsDebugKey}" == "DEBUG" ]; then
echo "Adding $count user account(s) to the image"
fi
for ((index=0; index<$count; index++)); do
if [ "${scriptsDebugKey}" == "VERBOSE" -o "${scriptsDebugKey}" == "DEBUG" ]; then
echo "Adding user ${userFullName[$index]}"
fi
#lay down user here
AddLocalUser "${targetVol}" "${userFullName[$index]}" "${userUnixName[$index]}" "${userIsAdmin[$index]}" "${userPassword[$index]}" "${userPassHint[$index]}" "${userImagePath[$index]}" "${userLanguage[$index]}"
if [ $? != 0 ]; then
echo "Failed to create the User '${userUnixName[$index]}'."
return 1
fi
#suppress the Apple ID request
DisableAppleIDRequestForUser "${targetVol}" "${userUnixName[$index]}"
done
# "touch"
/usr/bin/touch "${targetVol}/private/var/db/.AppleSetupDone"
/usr/bin/touch "${targetVol}/Library/Receipts/.SetupRegComplete"
fi
# retry the hdiutil detach until we either time out or it succeeds
retry_hdiutil_detach()
local mount_point="${1}"
local tries=0
local forceAt=0
local limit=24
local opt=""
forceAt=$(($limit - 1))
while [ $tries -lt $limit ]; do
tries=$(( tries + 1 ))
/bin/sleep 5
echo "Attempting to detach the disk image again..."
/usr/bin/hdiutil detach "${mount_point}" $opt
if [ $? -ne 0 ]; then
# Dump a list of any still open files on the mountPoint
if [ "${scriptsDebugKey}" == "DEBUG" ]; then
/usr/sbin/lsof +fg "${mount_point}"
fi
if [ $tries -eq $forceAt ]; then
echo "Failed to detach disk image at '${mount_point}' normally, adding -force."
opt="-force"
fi
if [ $tries -eq $limit ]; then
echo "Failed to detach disk image at '${mount_point}'."
exit 1
fi
else
tries=$limit
fi
done
# Create the dyld shared cache files
DetachAndRemoveMount()
local theMount="${1}"
local mountLoc=`mount | grep "${theMount}"`
if [ "${scriptsDebugKey}" == "VERBOSE" -o "${scriptsDebugKey}" == "DEBUG" ]; then
echo "Detaching disk image"
# Dump a list of any still open files on the mountPoint
if [ "${scriptsDebugKey}" == "DEBUG" ]; then
/usr/sbin/lsof +fg "${theMount}"
fi
fi
# Finally detach the mount (if it's actually mounted) and dispose the mountPoint directory
if [ "${mountLoc}" != "" ]; then
/usr/bin/hdiutil detach "${theMount}" || retry_hdiutil_detach "${theMount}" || return 1
fi
/bin/rmdir "${theMount}" || return 1
return 0
# Turn off the Apple ID request that happens on first boot after installing the OS
DisableAppleIDRequestForUser()
local targetUserLib="${1}/Users/${2}/Library"
# Only do this if the file doesn't exist
if [ ! -e "${targetUserLib}/Preferences/com.apple.SetupAssistant.plist" ]; then
if [ "${scriptsDebugKey}" == "VERBOSE" -o "${scriptsDebugKey}" == "DEBUG" ]; then
echo "Disabling Apple ID request for user '${2}'"
fi
/usr/libexec/PlistBuddy -c "Add :DidSeeCloudSetup bool 1" "${targetUserLib}/Preferences/com.apple.SetupAssistant.plist" > /dev/null 2>&1
/usr/libexec/PlistBuddy -c "Add :LastSeenCloudProductVersion string 10.8" "${targetUserLib}/Preferences/com.apple.SetupAssistant.plist" > /dev/null 2>&1
fi
return 0
# If the pieces exist, enable remote access for the shell image
EnableRemoteAccess()
local srcVol="${1}"
local opt=""
if [ -e "${srcVol}/usr/lib/pam/pam_serialnumber.so.2" ]; then
if [ "${scriptsDebugKey}" == "VERBOSE" -o "${scriptsDebugKey}" == "DEBUG" ]; then
echo "Enabling shell image remote access support"
opt="-v"
fi
# install some things (again which aren't part of BaseSystem) needed for remote ASR installs
/usr/bin/ditto $opt "${srcVol}/usr/lib/pam/pam_serialnumber.so.2" "${mountPoint}/usr/lib/pam/pam_serialnumber.so.2" || return 1
if [ -e "${srcVol}/usr/sbin/installer" ]; then
/usr/bin/ditto $opt "${srcVol}/usr/sbin/installer" "${mountPoint}/usr/sbin/installer" || return 1
fi
# copy the sshd config and add our keys to the end of it
if [ -e "${srcVol}/etc/sshd_config" ]; then
/bin/cat "${srcVol}/etc/sshd_config" - > "${mountPoint}/etc/sshd_config" << END
HostKey /private/var/tmp/ssh_host_key
HostKey /private/var/tmp/ssh_host_rsa_key
HostKey /private/var/tmp/ssh_host_dsa_key
END
fi
fi
return 0
# If it exists, install the sharing names and/or directory binding support to the install image
HandleNetBootClientHelper()
local tempDir="${1}"
local targetVol="${2}"
local opt=""
if [ "${scriptsDebugKey}" == "VERBOSE" -o "${scriptsDebugKey}" == "DEBUG" ]; then
opt="-v"
fi
if [ -e "${tempDir}/bindingNames.plist" ]; then
if [ "${scriptsDebugKey}" == "VERBOSE" -o "${scriptsDebugKey}" == "DEBUG" ]; then
echo "Installing Directory Service binding information"
fi
/usr/bin/ditto $opt "${tempDir}/bindingNames.plist" "${targetVol}/etc/bindingNames.plist" || return 1
/usr/sbin/chown root:wheel "${targetVol}/etc/bindingNames.plist"
/bin/chmod 644 "${targetVol}/etc/bindingNames.plist"
fi
if [ -e "${tempDir}/sharingNames.plist" ]; then
if [ "${scriptsDebugKey}" == "VERBOSE" -o "${scriptsDebugKey}" == "DEBUG" ]; then
echo "Installing Sharing Names support"
fi
/usr/bin/ditto $opt "${tempDir}/sharingNames.plist" "${targetVol}/etc/sharingNames.plist" || return 1
/usr/sbin/chown root:wheel "${targetVol}/etc/sharingNames.plist"
/bin/chmod 644 "${targetVol}/etc/sharingNames.plist"
fi
if [ -e "${tempDir}/NetBootClientHelper" ]; then
/usr/bin/ditto $opt "${tempDir}/NetBootClientHelper" "${targetVol}/usr/sbin/NetBootClientHelper" || return 1
/usr/sbin/chown root:wheel "${targetVol}/usr/sbin/NetBootClientHelper"
/bin/chmod 555 "${targetVol}/usr/sbin/NetBootClientHelper"
/usr/bin/ditto $opt "${tempDir}/com.apple.NetBootClientHelper.plist" "${targetVol}/System/Library/LaunchDaemons/com.apple.NetBootClientHelper.plist" || return 1
/usr/sbin/chown root:wheel "${targetVol}/System/Library/LaunchDaemons/com.apple.NetBootClientHelper.plist"
/bin/chmod 644 "${targetVol}/System/Library/LaunchDaemons/com.apple.NetBootClientHelper.plist"
# finally, make sure it isn't disabled...
/usr/libexec/PlistBuddy -c "Delete :com.apple.NetBootClientHelper" "${targetVol}/var/db/launchd.db/com.apple.launchd/overrides.plist" > /dev/null 2>&1
fi
return 0
# If any exist, install configuration profiles to the install image
InstallConfigurationProfiles()
local tempDir="${1}"
local targetVol="${2}"
local profilesDir="${targetVol}/var/db/ConfigurationProfiles"
if [ -e "${tempDir}/configProfiles.txt" ]; then
if [ "${scriptsDebugKey}" == "VERBOSE" -o "${scriptsDebugKey}" == "DEBUG" ]; then
echo "Installing Configuration Profiles"
fi
/bin/mkdir -p "${profilesDir}/Setup" || return 1
# Make sure the perms are correct
/usr/sbin/chown root:wheel "${profilesDir}"
/bin/chmod 755 "${profilesDir}"
/usr/sbin/chown root:wheel "${profilesDir}/Setup"
/bin/chmod 755 "${profilesDir}/Setup"
/usr/bin/touch "${profilesDir}/.profilesAreInstalled"
CopyEntriesFromFileToPath "${tempDir}/configProfiles.txt" "${profilesDir}/Setup" || return 1
# Enable MCX debugging
if [ 1 == 1 ]; then
if [ -e "${targetVol}/Library/Preferences/com.apple.MCXDebug.plist" ]; then
/usr/libexec/PlistBuddy -c "Delete :debugOutput" "${targetVol}/Library/Preferences/com.apple.MCXDebug.plist" > /dev/null 2>&1
/usr/libexec/PlistBuddy -c "Delete :collateLogs" "${targetVol}/Library/Preferences/com.apple.MCXDebug.plist" > /dev/null 2>&1
fi
/usr/libexec/PlistBuddy -c "Add :debugOutput string -2" "${targetVol}/Library/Preferences/com.apple.MCXDebug.plist" > /dev/null 2>&1
/usr/libexec/PlistBuddy -c "Add :collateLogs string 1" "${targetVol}/Library/Preferences/com.apple.MCXDebug.plist" > /dev/null 2>&1
fi
fi
# Converts a list of scripts (full paths contained in the file at $1) into packages in $3
InstallScriptsFromFile()
local tempDir="${1}"
local theFile="${2}"
local targetDir="${3}"
local opt=""
if [ "${scriptsDebugKey}" == "VERBOSE" -o "${scriptsDebugKey}" == "DEBUG" ]; then
echo "Converting scripts into install packages"
opt="-v"
fi
while read FILE
do
if [ -e "${FILE}" ]; then
# make an installer package out of the script
CreateInstallPackageForScript "$tempDir" "${FILE}" || return 1
# copy the resulting package to the Packages directory
local leafName=`basename "${FILE}"`
/usr/bin/ditto $opt "${tempDir}/${leafName}.pkg" "${targetDir}/${leafName}.pkg" || return 1
# clean up
/bin/rm -r "${tempDir}/${leafName}.pkg"
fi
done < "${theFile}"
return 0
# Prepare the source by deleting stuff we don't want to copy if sourcing a volume
PostFlightDestination()
local tempDir="${1}"
local destDir="${2}"
local opt=""
if [ "${scriptsDebugKey}" == "VERBOSE" -o "${scriptsDebugKey}" == "DEBUG" ]; then
echo "Performing post install cleanup"
opt="-v"
fi
# delete the DS indices to force reindexing...
if [ -e "${mountPoint}/var/db/dslocal/indices/Default/index" ]; then
/bin/rm $opt "${mountPoint}/var/db/dslocal/indices/Default/index"
fi
# detach the disk and remove the mount folder
DetachAndRemoveMount "${mountPoint}"
if [ $? != 0 ]; then
echo "Failed to detach and clean up the mount at '${mountPoint}'."
return 1
fi
echo "Correcting permissions. ${ownershipInfoKey} $destDir"
/usr/sbin/chown -R "${ownershipInfoKey}" "$destDir"
# Prepare the source by deleting stuff we don't want to copy if sourcing a volume
PreCleanSource()
local srcVol="$1"
local opt=""
if [ "${scriptsDebugKey}" == "VERBOSE" -o "${scriptsDebugKey}" == "DEBUG" ]; then
opt="-v"
fi
if [ -e "$srcVol/private/var/vm/swapfile*" ]; then
if [ "${scriptsDebugKey}" == "VERBOSE" -o "${scriptsDebugKey}" == "DEBUG" ]; then
echo "Removing swapfiles on $1"
fi
/bin/rm $opt "$srcVol/private/var/vm/swapfile*"
fi
if [ -e "$srcVol/private/var/vm/sleepimage" ]; then
if [ "${scriptsDebugKey}" == "VERBOSE" -o "${scriptsDebugKey}" == "DEBUG" ]; then
echo "Removing sleepimage on $1"
fi
/bin/rm $opt "$srcVol/private/var/vm/sleepimage"
fi
if [ -d "$srcVol/private/tmp" ]; then
if [ "${scriptsDebugKey}" == "VERBOSE" -o "${scriptsDebugKey}" == "DEBUG" ]; then
echo "Cleaning out /private/tmp on $1"
fi
/bin/rm -r $opt "$srcVol/private/tmp/*" > /dev/null 2>&1
fi
if [ -d "$srcVol/private/var/tmp" ]; then
if [ "${scriptsDebugKey}" == "VERBOSE" -o "${scriptsDebugKey}" == "DEBUG" ]; then
echo "Cleaning out /private/var/tmp on $1"
fi
/bin/rm -r $opt "$srcVol/private/var/tmp/*" > /dev/null 2>&1
fi
if [ "${scriptsDebugKey}" == "VERBOSE" -o "${scriptsDebugKey}" == "DEBUG" ]; then
echo "Cleaning out devices and volumes on $1"
fi
if [ -d "$srcVol/Volumes" ]; then
/bin/rm -r $opt "$srcVol/Volumes/*" > /dev/null 2>&1
fi
if [ -d "$srcVol/dev" ]; then
/bin/rm $opt "$srcVol/dev/*" > /dev/null 2>&1
fi
if [ -d "$srcVol/private/var/run" ]; then
/bin/rm -r $opt "$srcVol/private/var/run/*" > /dev/null 2>&1
fi
# Copy kernel and build the kext cache on the boot image
PrepareKernelAndKextCache()
local srcDir="$1"
local destDir="$2"
local opt=""
if [ "${scriptsDebugKey}" == "VERBOSE" -o "${scriptsDebugKey}" == "DEBUG" ]; then
echo "Preparing the kernel and kext cache for the boot image"
opt="-v"
fi
# Insure the kext cache on our source volume (the boot shell) is up to date
if [ "${scriptsDebugKey}" == "VERBOSE" -o "${scriptsDebugKey}" == "DEBUG" ]; then
echo "Updating kext cache on source volume"
fi
/usr/sbin/kextcache -update-volume "${srcDir}" || return 1
# Copy the i386 and, if it exists, the x86_64 architecture
if [ "${scriptsDebugKey}" == "VERBOSE" -o "${scriptsDebugKey}" == "DEBUG" ]; then
echo "Installing the kext cache to the boot image"
fi
# make sure this doesn't exist
if [ -e "${destDir}/i386" ]; then
/bin/rm -rf "${destDir}/i386"
fi
# Install kextcaches to the nbi folder
if [ "${scriptsDebugKey}" == "VERBOSE" -o "${scriptsDebugKey}" == "DEBUG" ]; then
echo "Creating a kernelcache for the boot shell"
fi
/bin/mkdir -p $opt "${destDir}/i386/x86_64" || return 1
/usr/sbin/kextcache -arch x86_64 -L -N -S -z -K "${srcDir}/mach_kernel" -c "${destDir}/i386/x86_64/kernelcache" "${srcDir}/System/Library/Extensions" || return 1
# Create the i386 and x86_64 boot loaders on the boot image
PrepareBootLoader()
local srcVol="$1"
local destDir="$2"
local opt=""
if [ "${scriptsDebugKey}" == "VERBOSE" -o "${scriptsDebugKey}" == "DEBUG" ]; then
echo "Preparing boot loader"
opt="-v"
fi
# Copy the boot.efi to the booter shell
if [ -e "${mountPoint}/System/Library/CoreServices/boot.efi" ]; then
/usr/bin/ditto $opt "${mountPoint}/System/Library/CoreServices/boot.efi" "${destDir}/i386/booter" || return 1
else
/usr/bin/ditto $opt "${srcVol}/System/Library/CoreServices/boot.efi" "${destDir}/i386/booter" || return 1
fi
# Unlock the file so we can change its owner later
chflags nouchg "${destDir}/i386/booter"
# Copy the PlatformSupport.plist file
if [ -e "${mountPoint}/System/Library/CoreServices/PlatformSupport.plist" ]; then
/usr/bin/ditto $opt "${mountPoint}/System/Library/CoreServices/PlatformSupport.plist" "${destDir}/i386/PlatformSupport.plist" || return 1
else
/usr/bin/ditto $opt "${srcVol}/System/Library/CoreServices/PlatformSupport.plist" "${destDir}/i386/PlatformSupport.plist" || return 1
fi
# If it exists, install the partitioning application and data onto the install image
ProcessAutoPartition()
local tempDir="$1"
local opt=""
local targetDir=""
if [ -e "$tempDir/PartitionInfo.plist" ]; then
if [ "${scriptsDebugKey}" == "VERBOSE" -o "${scriptsDebugKey}" == "DEBUG" ]; then
opt="-v"
fi
# Determine if this is an install source, or a restore source
if [ -d "${mountPoint}/Packages" ]; then
if [ "${scriptsDebugKey}" == "VERBOSE" -o "${scriptsDebugKey}" == "DEBUG" ]; then
echo "Installing Partitioning application and data to install image"
fi
targetDir="${mountPoint}/Packages"
elif [ -d "${mountPoint}/System/Installation/Packages" ]; then
if [ "${scriptsDebugKey}" == "VERBOSE" -o "${scriptsDebugKey}" == "DEBUG" ]; then
echo "Installing Partitioning application and data to restore image"
fi
targetDir="${mountPoint}/System/Installation/Packages"
else
echo "There doesn't appear to be either an install or restore source mounted at ${mountPoint}"
return 1
fi
# Create the Extras directory if it doesn't exist
if [ ! -d "${targetDir}/Extras" ]; then
/bin/mkdir "${targetDir}/Extras"
fi
targetDir="${targetDir}/Extras"
/usr/bin/ditto $opt "$tempDir/PartitionInfo.plist" "${targetDir}/PartitionInfo.plist" || return 1
/usr/bin/ditto $opt "$tempDir/AutoPartition.app" "${targetDir}/AutoPartition.app" || return 1
fi
return 0
# If it exists, install the minstallconfig.xml onto the install image
ProcessMinInstall()
local tempDir="$1"
local opt=""
local targetDir="${mountPoint}/Packages/Extras"
if [ -e "$tempDir/minstallconfig.xml" ]; then
if [ "${scriptsDebugKey}" == "VERBOSE" -o "${scriptsDebugKey}" == "DEBUG" ]; then
echo "Installing minstallconfig.xml to install image"
opt="-v"
fi
/usr/bin/ditto $opt "$tempDir/minstallconfig.xml" "${targetDir}/minstallconfig.xml" || return 1
/usr/sbin/chown root:wheel "${targetDir}/minstallconfig.xml"
/bin/chmod 644 "${targetDir}/minstallconfig.xml"
fi
return 0
# untar the OSInstall.mpkg so it can be modified
untarOSInstallMpkg()
local tempDir="$1"
local opt=""
# we might have already done this, so check for it first
if [ ! -d "${tempDir}/OSInstall_pkg" ]; then
if [ "${scriptsDebugKey}" == "VERBOSE" -o "${scriptsDebugKey}" == "DEBUG" ]; then
echo "uncompressing OSInstall.mpkg"
opt="-v"
fi
/bin/mkdir "${tempDir}/OSInstall_pkg"
cd "${tempDir}/OSInstall_pkg"
/usr/bin/xar $opt -xf "${mountPoint}/System/Installation/Packages/OSInstall.mpkg"
# make Distribution writeable
/bin/chmod 777 "${tempDir}/OSInstall_pkg"
/bin/chmod 666 "${tempDir}/OSInstall_pkg/Distribution"
fi
# Make a tempdir to mount the image on
mountPoint=`mktemp -d "/tmp/mnt.XXXXXXXX"`
mktemp -d "/tmp/mnt.XXXXXXXX"
++ mktemp -d /tmp/mnt.XXXXXXXX
+ mountPoint=/tmp/mnt.7E4iD6mQ
sourceMount=""
+ sourceMount=
crfsErrExit()
echo "Execution of '`basename \"${0}\"`' failed. Cleaning up."
# detach the disk and remove the mount folder
DetachAndRemoveMount "${mountPoint}"
# detach the mounted source, if necessary
if [ "${sourceMount}" != "" ] ; then
DetachAndRemoveMount "${sourceMount}"
fi
# Remove the items we created
/bin/rm -r "$destPath/i386" > /dev/null 2>&1
/bin/rm "$destPath/$dmgTarget.dmg" > /dev/null 2>&1
/bin/rm "$destPath/System.dmg" > /dev/null 2>&1
# Finally, remove the directory IF empty
/bin/rmdir "$destPath"
exit 1
InstallNetBootClientHelper()
local tempDir="${1}"
local destDir="${mountPoint}/Packages/Extras"
local opt=""
if [ "${scriptsDebugKey}" == "VERBOSE" -o "${scriptsDebugKey}" == "DEBUG" ]; then
opt="-v"
fi
if [ -e "${tempDir}/bindingNames.plist" ]; then
if [ "${scriptsDebugKey}" == "VERBOSE" -o "${scriptsDebugKey}" == "DEBUG" ]; then
echo "Installing Directory Service binding information"
fi
/usr/bin/ditto $opt "${tempDir}/bindingNames.plist" "${destDir}/bindingNames.plist" || return 1
/usr/sbin/chown root:wheel "${destDir}/bindingNames.plist"
/bin/chmod 644 "${destDir}/bindingNames.plist"
fi
if [ -e "${tempDir}/sharingNames.plist" ]; then
if [ "${scriptsDebugKey}" == "VERBOSE" -o "${scriptsDebugKey}" == "DEBUG" ]; then
echo "Installing Sharing Names support"
fi
/usr/bin/ditto $opt "${tempDir}/sharingNames.plist" "${destDir}/sharingNames.plist" || return 1
/usr/sbin/chown root:wheel "${destDir}/sharingNames.plist"
/bin/chmod 644 "${destDir}/sharingNames.plist"
fi
# This is required, make sure it's here
/usr/bin/ditto $opt "${tempDir}/NetBootClientHelper" "${destDir}/NetBootClientHelper" || return 1
/usr/sbin/chown root:wheel "${destDir}/NetBootClientHelper"
/bin/chmod 555 "${destDir}/NetBootClientHelper"
/usr/bin/ditto $opt "${tempDir}/com.apple.NetBootClientHelper.plist" "${destDir}/com.apple.NetBootClientHelper.plist" || return 1
/usr/sbin/chown root:wheel "${destDir}/com.apple.NetBootClientHelper.plist"
/bin/chmod 644 "${destDir}/com.apple.NetBootClientHelper.plist"
/usr/bin/ditto $opt "${tempDir}/installClientHelper.sh" "${mountPoint}/var/tmp/niu/postinstall/installClientHelper.sh" || return 1
/usr/sbin/chown root:wheel "${mountPoint}/var/tmp/niu/postinstall/installClientHelper.sh"
/bin/chmod 555 "${mountPoint}/var/tmp/niu/postinstall/installClientHelper.sh"
return 0
InstallBaseSystemToShell()
local baseSystemDMG="${1}"
local shellMount="${2}"
local tempDir=`/usr/bin/dirname "${1}"`
local opt=""
if [ "${scriptsDebugKey}" == "VERBOSE" -o "${scriptsDebugKey}" == "DEBUG" ] ; then
opt="-v"
echo "Copying Base System bits to the boot shell image"
fi
baseMount=`mktemp -d "/tmp/mnt_bs.XXXXXXXX"`
/usr/bin/hdiutil attach "${baseSystemDMG}" -noverify -owners on -nobrowse -noautoopen -mountpoint "${baseMount}" -quiet || return 1
# Copy the boot.efi and SystemVersion.plist out to the shell dmg
/usr/bin/ditto $opt "${baseMount}/System/Library/CoreServices/boot.efi" "${shellMount}/boot.efi" || return 1
chflags nouchg "${shellMount}/boot.efi"
/bin/mkdir -p "${shellMount}/usr/standalone/i386" || return 1
/bin/ln "${shellMount}/boot.efi" "${shellMount}/usr/standalone/i386/boot.efi" || return 1
/bin/mkdir -p "${shellMount}/System/Library/CoreServices" || return 1
/bin/ln "${shellMount}/boot.efi" "${shellMount}/System/Library/CoreServices/boot.efi" || return 1
/usr/bin/ditto $opt "${baseMount}/System/Library/CoreServices/SystemVersion.plist" "${shellMount}/System/Library/CoreServices/SystemVersion.plist" || return 1
# stash some things we need for later
/usr/bin/ditto $opt "${baseMount}/System/Library/Caches/com.apple.kext.caches/Startup/kernelcache" "${tempDir}/kernelcache" || return 1
/usr/bin/ditto $opt "${baseMount}/System/Library/CoreServices/com.apple.recovery.boot/PlatformSuppo rt.plist" "${tempDir}/PlatformSupport.plist" || return 1
# Clean up
/usr/bin/hdiutil detach "${baseMount}" || retry_hdiutil_detach "${baseMount}" || return 1
/bin/rmdir "${baseMount}"
theDmg=`basename "${baseSystemDMG}"`
if [ "${scriptsDebugKey}" == "VERBOSE" -o "${scriptsDebugKey}" == "DEBUG" ] ; then
echo "Copying ${theDmg} to the boot shell."
fi
/usr/bin/ditto $debug_opt "${baseSystemDMG}" "${shellMount}/${theDmg}"
return 0
# Set up for script debugging
debug_opt=""
+ debug_opt=
if [ "${scriptsDebugKey}" == "VERBOSE" -o "${scriptsDebugKey}" == "DEBUG" ] ; then
debug_opt="-v"
fi
+ '[' DEBUG == VERBOSE -o DEBUG == DEBUG ']'
+ debug_opt=-v
# Prepare the destination
CreateOrValidatePath "${destPath}" || crfsErrExit
+ CreateOrValidatePath '/Users/morgan/Desktop/NetRestore of Macintosh HD_2.nbi'
+ local 'targetDir=/Users/morgan/Desktop/NetRestore of Macintosh HD_2.nbi'
+ '[' '!' -d '/Users/morgan/Desktop/NetRestore of Macintosh HD_2.nbi' ']'
+ '[' DEBUG == VERBOSE -o DEBUG == DEBUG ']'
+ echo 'Creating working path at /Users/morgan/Desktop/NetRestore of Macintosh HD_2.nbi'
Creating working path at /Users/morgan/Desktop/NetRestore of Macintosh HD_2.nbi
+ /bin/mkdir -p '/Users/morgan/Desktop/NetRestore of Macintosh HD_2.nbi'
# Source in our image building commands
. "${1}/buildCommands.sh"
+ . /tmp/niutemp.rDvE48RI/buildCommands.sh
'/System/Library/CoreServices/System Image Utility.app/Contents/Library/Automator/Create Image.action/Contents/Resources/asrFromVolume.sh' "/tmp/niutemp.rDvE48RI" "/Volumes/Macintosh HD" "System" || exit 1
++ '/System/Library/CoreServices/System Image Utility.app/Contents/Library/Automator/Create Image.action/Contents/Resources/asrFromVolume.sh' /tmp/niutemp.rDvE48RI '/Volumes/Macintosh HD' System
progressPrefix="_progress"
++ progressPrefix=_progress
scriptsDebugKey="DEBUG"
++ scriptsDebugKey=DEBUG
imageIsUDIFKey="1"
++ imageIsUDIFKey=1
imageFormatKey="UDZO"
++ imageFormatKey=UDZO
mountPoint=""
++ mountPoint=
ownershipInfoKey="501:20"
++ ownershipInfoKey=501:20
blockCopyDeviceKey="0"
++ blockCopyDeviceKey=0
dmgTarget="NetInstall"
++ dmgTarget=NetInstall
potentialRecoveryDevice="disk4s3"
++ potentialRecoveryDevice=disk4s3
asrSource="ASRInstall.pkg"
++ asrSource=ASRInstall.pkg
destPath="/Users/morgan/Desktop/NetRestore of Macintosh HD_2.nbi"
++ destPath='/Users/morgan/Desktop/NetRestore of Macintosh HD_2.nbi'
skipReorderingKey="0"
++ skipReorderingKey=0
sourceVol="/Volumes/Macintosh HD"
++ sourceVol='/Volumes/Macintosh HD'
postInstallHelperKey="1"
++ postInstallHelperKey=1
# variables we will need
created_dest="NO"
+ created_dest=NO
afvErrExit()
echo "Execution of '`basename \"${0}\"`' failed. Cleaning up."
# detach the disk and remove the mount folder
if [ "${created_dest}" == "YES" ]; then
/bin/rm -r "${destPath}"
fi
exit 1
retrieveBaseSystemDMG()
local tempDir="${1}"
local opt=""
if [ "${potentialRecoveryDevice}" != "" ]; then
if [ "${scriptsDebugKey}" == "VERBOSE" -o "${scriptsDebugKey}" == "DEBUG" ] ; then
echo "Retrieving BaseSystem bits from Recovery HD"
opt="-v"
fi
recoveryMount=`mktemp -d "/tmp/mnt_rp.XXXXXXXX"`
/usr/sbin/diskutil mount readOnly -mountPoint "${recoveryMount}" "${potentialRecoveryDevice}" || return 1
# Now make sure this is what was expected
if [ -e "${recoveryMount}/com.apple.recovery.boot/BaseSystem.dmg" ]; then
/usr/bin/ditto $opt "${recoveryMount}/com.apple.recovery.boot/BaseSystem.dmg" "${tempDir}/BaseSystem.dmg" || return 1
/usr/bin/ditto $opt "${recoveryMount}/com.apple.recovery.boot/BaseSystem.chunklist" "${tempDir}/BaseSystem.chunklist"
fi
/usr/sbin/diskutil unmount "${potentialRecoveryDevice}" || return 1
/bin/rmdir "${recoveryMount}"
fi
return 0
# Insure the working path (dmg destination) exists
if [ ! -d "${destPath}" ]; then
if [ "${scriptsDebugKey}" == "VERBOSE" -o "${scriptsDebugKey}" == "DEBUG" ]; then
echo "Creating working path at ${destPath}"
fi
/bin/mkdir -p "${destPath}" || afvErrExit
created_dest="YES"
fi
+ '[' '!' -d '/Users/morgan/Desktop/NetRestore of Macintosh HD_2.nbi' ']'
# If the volume source is the boot drive we have an asr:// type source
if [ "${2}" == "/" ]; then
# Create an empty image to skip the ASR volume creation
/usr/bin/touch "${destPath}/${3}.dmg"
# Set aside the needed BaseSystem.dmg
retrieveBaseSystemDMG "${1}" || afvErrExit
fi
+ '[' '/Volumes/Macintosh HD' == / ']'
# Look for an existing System.dmg
if [ ! -e "${destPath}/${3}.dmg" ]; then
# Didn't find one, so create it from volume source
${1}/makeNetRestoreFromItem.sh "${1}" "${2}" "${3}" || afvErrExit
fi
+ '[' '!' -e '/Users/morgan/Desktop/NetRestore of Macintosh HD_2.nbi/System.dmg' ']'
+ /tmp/niutemp.rDvE48RI/makeNetRestoreFromItem.sh /tmp/niutemp.rDvE48RI '/Volumes/Macintosh HD' System
progressPrefix="_progress"
++ progressPrefix=_progress
scriptsDebugKey="DEBUG"
++ scriptsDebugKey=DEBUG
imageIsUDIFKey="1"
++ imageIsUDIFKey=1
imageFormatKey="UDZO"
++ imageFormatKey=UDZO
mountPoint=""
++ mountPoint=
ownershipInfoKey="501:20"
++ ownershipInfoKey=501:20
blockCopyDeviceKey="0"
++ blockCopyDeviceKey=0
dmgTarget="NetInstall"
++ dmgTarget=NetInstall
potentialRecoveryDevice="disk4s3"
++ potentialRecoveryDevice=disk4s3
asrSource="ASRInstall.pkg"
++ asrSource=ASRInstall.pkg
destPath="/Users/morgan/Desktop/NetRestore of Macintosh HD_2.nbi"
++ destPath='/Users/morgan/Desktop/NetRestore of Macintosh HD_2.nbi'
skipReorderingKey="0"
++ skipReorderingKey=0
sourceVol="/Volumes/Macintosh HD"
++ sourceVol='/Volumes/Macintosh HD'
postInstallHelperKey="1"
++ postInstallHelperKey=1
. "${1}/createCommon.sh"
+ . /tmp/niutemp.rDvE48RI/createCommon.sh
# createCommon.sh
# Common functionality for the Image creation process.
# sourced in by the various SIU scripts
# Copyright © 2007-2012 Apple Inc. All rights reserved.
# Using dscl, create a user account
AddLocalUser()
# $1 volume whose local node database to modify
# $2 long name
# $3 short name
# $4 isAdminUser key
# $5 password data
# $6 password hint
# $7 user picture path
# $8 Language string
local databasePath="/Local/Default/Users/${3}"
local targetVol="${1}"
# Find a free UID between 501 and 599
for ((i=501; i<600; i++)); do
output=`/usr/bin/dscl -f "${targetVol}/var/db/dslocal/nodes/Default" localonly -search /Local/Default/Users UniqueID $i`
# If there is already an account dscl returns it, so we're looking for an empty return value.
if [ "$output" == "" ]; then
break
fi
done
# Create the user record
/usr/bin/dscl -f "${targetVol}/var/db/dslocal/nodes/Default" localonly -create $databasePath
if [ $? != 0 ]; then
echo "Failed to create '${databasePath}'."
return 1
fi
# Add long name
/usr/bin/dscl -f "${targetVol}/var/db/dslocal/nodes/Default" localonly -append $databasePath RealName "${2}"
if [ $? != 0 ]; then
echo "Failed to set the RealName."
return 1
fi
# Set up the users group information
/usr/bin/dscl -f "${targetVol}/var/db/dslocal/nodes/Default" localonly -append $databasePath PrimaryGroupID 20
if [ $? != 0 ]; then
echo "Failed to set the PrimaryGroupID."
return 1
fi
# Add some additional stuff if the user is an admin
if [ "${4}" == 1 ]; then
/usr/bin/dscl -f "${targetVol}/var/db/dslocal/nodes/Default" localonly -append "/Local/Default/Groups/admin" GroupMembership "${3}"
if [ $? != 0 ]; then
echo "Failed to add the user to the admin group."
return 1
fi
/usr/bin/dscl -f "${targetVol}/var/db/dslocal/nodes/Default" localonly -append "/Local/Default/Groups/_appserveradm" GroupMembership "${3}"
if [ $? != 0 ]; then
echo "Failed to add the user to the _appserveradm group."
return 1
fi
/usr/bin/dscl -f "${targetVol}/var/db/dslocal/nodes/Default" localonly -append "/Local/Default/Groups/_appserverusr" GroupMembership "${3}"
if [ $? != 0 ]; then
echo "Failed to add the user to the _appserverusr group."
return 1
fi
fi
# Add UniqueID
/usr/bin/dscl -f "${targetVol}/var/db/dslocal/nodes/Default" localonly -append $databasePath UniqueID ${i}
if [ $? != 0 ]; then
echo "Failed to set the UniqueID."
return 1
fi
# Add Home Directory entry
/usr/bin/dscl -f "${targetVol}/var/db/dslocal/nodes/Default" localonly -append $databasePath NFSHomeDirectory /Users/${3}
if [ $? != 0 ]; then
echo "Failed to set the NFSHomeDirectory."
fi
if [ "${6}" != "" ]; then
/usr/bin/dscl -f "${targetVol}/var/db/dslocal/nodes/Default" localonly -append $databasePath AuthenticationHint "${6}"
if [ $? != 0 ]; then
echo "Failed to set the AuthenticationHint."
return 1
fi
fi
/usr/bin/dscl -f "${targetVol}/var/db/dslocal/nodes/Default" localonly -append $databasePath picture "${7}"
if [ $? != 0 ]; then
echo "Failed to set the picture."
return 1
fi
/usr/bin/dscl -f "${targetVol}/var/db/dslocal/nodes/Default" localonly -passwd $databasePath "${5}"
if [ $? != 0 ]; then
echo "Failed to set the passwd."
return 1
fi
# Add shell
/usr/bin/dscl -f "${targetVol}/var/db/dslocal/nodes/Default" localonly -append $databasePath UserShell "/bin/bash"
if [ $? != 0 ]; then
echo "Failed to set the UserShell."
return 1
fi
# Create Home directory
if [ -e "/System/Library/User Template/${8}.lproj/" ]; then
/usr/bin/ditto "/System/Library/User Template/${8}.lproj/" "${targetVol}/Users/${3}"
else
/usr/bin/ditto "/System/Library/User Template/English.lproj/" "${targetVol}/Users/${3}"
fi
if [ $? != 0 ]; then
echo "Failed to copy the User Template."
return 1
fi
/usr/sbin/chown -R $i:$i "${targetVol}/Users/${3}"
if [ $? != 0 ]; then
echo "Failed to set ownership on the User folder."
return 1
fi
# Copies a list of files (full paths contained in the file at $1) from source to the path specified in $2
CopyEntriesFromFileToPath()
local theFile="$1"
local theDest="$2"
local opt=""
if [ "${scriptsDebugKey}" == "VERBOSE" -o "${scriptsDebugKey}" == "DEBUG" ]; then
opt="-v"
fi
while read FILE
do
if [ -e "${FILE}" ]; then
local leafName=`basename "${FILE}"`
if [ "${scriptsDebugKey}" == "VERBOSE" -o "${scriptsDebugKey}" == "DEBUG" ]; then
echo "Copying ${FILE}."
fi
/usr/bin/ditto $opt "${FILE}" "${theDest}/${leafName}" || return 1
fi
done < "${theFile}"
return 0
# Copies a list of packages (full path, destination pairs contained in the file at $1) from source to .../System/Installation/Packages/
CopyPackagesWithDestinationsFromFile()
local theFile="$1"
local opt=""
if [ "${scriptsDebugKey}" == "VERBOSE" -o "${scriptsDebugKey}" == "DEBUG" ]; then
opt="-v"
fi
while read FILE
do
if [ -e "${FILE}" ]; then
local leafName=`basename "${FILE}"`
if [ "${scriptsDebugKey}" == "VERBOSE" -o "${scriptsDebugKey}" == "DEBUG" ]; then
echo "Copying ${FILE}."
fi
read SUB_PATH
/usr/bin/ditto $opt "${FILE}" "${mountPoint}/Packages/${SUB_PATH}${leafName}" || return 1
fi
done < "${theFile}"
return 0
# Create an installer package in ${1} wrapping the supplied script ${2}
CreateInstallPackageForScript()
local tempDir="$1"
local scriptPath="$2"
local scriptName=`basename "${scriptPath}"`
local entryDir=`pwd`
local opt=""
if [ "${scriptsDebugKey}" == "VERBOSE" -o "${scriptsDebugKey}" == "DEBUG" ]; then
echo "Create installer for script ${scriptName}"
opt="-v"
fi
# shouldn't exist on entry...
if [ -e "${tempDir}/emptyDir" ]; then
/bin/rm -rf "${tempDir}/emptyDir"
fi
# make some directories to work in
/bin/mkdir $opt -p "${tempDir}/${scriptName}.pkg/Contents/Resources" || return 1
/bin/mkdir $opt "${tempDir}/emptyDir" || return 1
# Create Archive.pax.gz
cd "${tempDir}/emptyDir"
/bin/pax -w -x cpio -f "${tempDir}/${scriptName}.pkg/Contents/Archive.pax" .
/usr/bin/gzip "${tempDir}/${scriptName}.pkg/Contents/Archive.pax"
cd "${entryDir}"
# Create the Archive.bom file
/usr/bin/mkbom "${tempDir}/emptyDir/" "${tempDir}/${scriptName}.pkg/Contents/Archive.bom" || return 1
# Create the Info.plist
/bin/cat > "${tempDir}/${scriptName}.pkg/Contents/Info.plist" << END
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
<plist version="1.0">
<dict>
<key>CFBundleIdentifier</key>
<string>com.apple.SystemImageUtility.${scriptName}</string>
<key>CFBundleShortVersionString</key>
<string>1</string>
<key>IFMajorVersion</key>
<integer>1</integer>
<key>IFMinorVersion</key>
<integer>0</integer>
<key>IFPkgFlagDefaultLocation</key>
<string>/tmp</string>
<key>IFPkgFlagInstallFat</key>
<false/>
<key>IFPkgFlagIsRequired</key>
<false/>
<key>IFPkgFormatVersion</key>
<real>0.10000000149011612</real>
</dict>
</plist>
END
echo "pkmkrpkg1" > "${tempDir}/${scriptName}.pkg/Contents/PkgInfo"
echo "major: 1\nminor: 0" > "${tempDir}/${scriptName}.pkg/Contents/Resources/package_version"
# Copy the script
/bin/cp "$scriptPath" "${tempDir}/${scriptName}.pkg/Contents/Resources/postflight"
# clean up
/bin/rm -r "${tempDir}/emptyDir"
return 0
# Validate or create the requested directory
CreateOrValidatePath()
local targetDir="$1"
if [ ! -d "${targetDir}" ]; then
if [ "${scriptsDebugKey}" == "VERBOSE" -o "${scriptsDebugKey}" == "DEBUG" ]; then
echo "Creating working path at ${targetDir}"
fi
/bin/mkdir -p "${targetDir}" || return 1
fi
# If any exist, apply any user accounts
CreateUserAccounts()
# $1 volume whose local node database to modify
local count="${#userFullName[*]}"
local targetVol="${1}"
if [ $count -gt 0 ]; then
if [ "${scriptsDebugKey}" == "VERBOSE" -o "${scriptsDebugKey}" == "DEBUG" ]; then
echo "Adding $count user account(s) to the image"
fi
for ((index=0; index<$count; index++)); do
if [ "${scriptsDebugKey}" == "VERBOSE" -o "${scriptsDebugKey}" == "DEBUG" ]; then
echo "Adding user ${userFullName[$index]}"
fi
#lay down user here
AddLocalUser "${targetVol}" "${userFullName[$index]}" "${userUnixName[$index]}" "${userIsAdmin[$index]}" "${userPassword[$index]}" "${userPassHint[$index]}" "${userImagePath[$index]}" "${userLanguage[$index]}"
if [ $? != 0 ]; then
echo "Failed to create the User '${userUnixName[$index]}'."
return 1
fi
#suppress the Apple ID request
DisableAppleIDRequestForUser "${targetVol}" "${userUnixName[$index]}"
done
# "touch"
/usr/bin/touch "${targetVol}/private/var/db/.AppleSetupDone"
/usr/bin/touch "${targetVol}/Library/Receipts/.SetupRegComplete"
fi
# retry the hdiutil detach until we either time out or it succeeds
retry_hdiutil_detach()
local mount_point="${1}"
local tries=0
local forceAt=0
local limit=24
local opt=""
forceAt=$(($limit - 1))
while [ $tries -lt $limit ]; do
tries=$(( tries + 1 ))
/bin/sleep 5
echo "Attempting to detach the disk image again..."
/usr/bin/hdiutil detach "${mount_point}" $opt
if [ $? -ne 0 ]; then
# Dump a list of any still open files on the mountPoint
if [ "${scriptsDebugKey}" == "DEBUG" ]; then
/usr/sbin/lsof +fg "${mount_point}"
fi
if [ $tries -eq $forceAt ]; then
echo "Failed to detach disk image at '${mount_point}' normally, adding -force."
opt="-force"
fi
if [ $tries -eq $limit ]; then
echo "Failed to detach disk image at '${mount_point}'."
exit 1
fi
else
tries=$limit
fi
done
# Create the dyld shared cache files
DetachAndRemoveMount()
local theMount="${1}"
local mountLoc=`mount | grep "${theMount}"`
if [ "${scriptsDebugKey}" == "VERBOSE" -o "${scriptsDebugKey}" == "DEBUG" ]; then
echo "Detaching disk image"
# Dump a list of any still open files on the mountPoint
if [ "${scriptsDebugKey}" == "DEBUG" ]; then
/usr/sbin/lsof +fg "${theMount}"
fi
fi
# Finally detach the mount (if it's actually mounted) and dispose the mountPoint directory
if [ "${mountLoc}" != "" ]; then
/usr/bin/hdiutil detach "${theMount}" || retry_hdiutil_detach "${theMount}" || return 1
fi
/bin/rmdir "${theMount}" || return 1
return 0
# Turn off the Apple ID request that happens on first boot after installing the OS
DisableAppleIDRequestForUser()
local targetUserLib="${1}/Users/${2}/Library"
# Only do this if the file doesn't exist
if [ ! -e "${targetUserLib}/Preferences/com.apple.SetupAssistant.plist" ]; then
if [ "${scriptsDebugKey}" == "VERBOSE" -o "${scriptsDebugKey}" == "DEBUG" ]; then
echo "Disabling Apple ID request for user '${2}'"
fi
/usr/libexec/PlistBuddy -c "Add :DidSeeCloudSetup bool 1" "${targetUserLib}/Preferences/com.apple.SetupAssistant.plist" > /dev/null 2>&1
/usr/libexec/PlistBuddy -c "Add :LastSeenCloudProductVersion string 10.8" "${targetUserLib}/Preferences/com.apple.SetupAssistant.plist" > /dev/null 2>&1
fi
return 0
# If the pieces exist, enable remote access for the shell image
EnableRemoteAccess()
local srcVol="${1}"
local opt=""
if [ -e "${srcVol}/usr/lib/pam/pam_serialnumber.so.2" ]; then
if [ "${scriptsDebugKey}" == "VERBOSE" -o "${scriptsDebugKey}" == "DEBUG" ]; then
echo "Enabling shell image remote access support"
opt="-v"
fi
# install some things (again which aren't part of BaseSystem) needed for remote ASR installs
/usr/bin/ditto $opt "${srcVol}/usr/lib/pam/pam_serialnumber.so.2" "${mountPoint}/usr/lib/pam/pam_serialnumber.so.2" || return 1
if [ -e "${srcVol}/usr/sbin/installer" ]; then
/usr/bin/ditto $opt "${srcVol}/usr/sbin/installer" "${mountPoint}/usr/sbin/installer" || return 1
fi
# copy the sshd config and add our keys to the end of it
if [ -e "${srcVol}/etc/sshd_config" ]; then
/bin/cat "${srcVol}/etc/sshd_config" - > "${mountPoint}/etc/sshd_config" << END
HostKey /private/var/tmp/ssh_host_key
HostKey /private/var/tmp/ssh_host_rsa_key
HostKey /private/var/tmp/ssh_host_dsa_key
END
fi
fi
return 0
# If it exists, install the sharing names and/or directory binding support to the install image
HandleNetBootClientHelper()
local tempDir="${1}"
local targetVol="${2}"
local opt=""
if [ "${scriptsDebugKey}" == "VERBOSE" -o "${scriptsDebugKey}" == "DEBUG" ]; then
opt="-v"
fi
if [ -e "${tempDir}/bindingNames.plist" ]; then
if [ "${scriptsDebugKey}" == "VERBOSE" -o "${scriptsDebugKey}" == "DEBUG" ]; then
echo "Installing Directory Service binding information"
fi
/usr/bin/ditto $opt "${tempDir}/bindingNames.plist" "${targetVol}/etc/bindingNames.plist" || return 1
/usr/sbin/chown root:wheel "${targetVol}/etc/bindingNames.plist"
/bin/chmod 644 "${targetVol}/etc/bindingNames.plist"
fi
if [ -e "${tempDir}/sharingNames.plist" ]; then
if [ "${scriptsDebugKey}" == "VERBOSE" -o "${scriptsDebugKey}" == "DEBUG" ]; then
echo "Installing Sharing Names support"
fi
/usr/bin/ditto $opt "${tempDir}/sharingNames.plist" "${targetVol}/etc/sharingNames.plist" || return 1
/usr/sbin/chown root:wheel "${targetVol}/etc/sharingNames.plist"
/bin/chmod 644 "${targetVol}/etc/sharingNames.plist"
fi
if [ -e "${tempDir}/NetBootClientHelper" ]; then
/usr/bin/ditto $opt "${tempDir}/NetBootClientHelper" "${targetVol}/usr/sbin/NetBootClientHelper" || return 1
/usr/sbin/chown root:wheel "${targetVol}/usr/sbin/NetBootClientHelper"
/bin/chmod 555 "${targetVol}/usr/sbin/NetBootClientHelper"
/usr/bin/ditto $opt "${tempDir}/com.apple.NetBootClientHelper.plist" "${targetVol}/System/Library/LaunchDaemons/com.apple.NetBootClientHelper.plist" || return 1
/usr/sbin/chown root:wheel "${targetVol}/System/Library/LaunchDaemons/com.apple.NetBootClientHelper.plist"
/bin/chmod 644 "${targetVol}/System/Library/LaunchDaemons/com.apple.NetBootClientHelper.plist"
# finally, make sure it isn't disabled...
/usr/libexec/PlistBuddy -c "Delete :com.apple.NetBootClientHelper" "${targetVol}/var/db/launchd.db/com.apple.launchd/overrides.plist" > /dev/null 2>&1
fi
return 0
# If any exist, install configuration profiles to the install image
InstallConfigurationProfiles()
local tempDir="${1}"
local targetVol="${2}"
local profilesDir="${targetVol}/var/db/ConfigurationProfiles"
if [ -e "${tempDir}/configProfiles.txt" ]; then
if [ "${scriptsDebugKey}" == "VERBOSE" -o "${scriptsDebugKey}" == "DEBUG" ]; then
echo "Installing Configuration Profiles"
fi
/bin/mkdir -p "${profilesDir}/Setup" || return 1
# Make sure the perms are correct
/usr/sbin/chown root:wheel "${profilesDir}"
/bin/chmod 755 "${profilesDir}"
/usr/sbin/chown root:wheel "${profilesDir}/Setup"
/bin/chmod 755 "${profilesDir}/Setup"
/usr/bin/touch "${profilesDir}/.profilesAreInstalled"
CopyEntriesFromFileToPath "${tempDir}/configProfiles.txt" "${profilesDir}/Setup" || return 1
# Enable MCX debugging
if [ 1 == 1 ]; then
if [ -e "${targetVol}/Library/Preferences/com.apple.MCXDebug.plist" ]; then
/usr/libexec/PlistBuddy -c "Delete :debugOutput" "${targetVol}/Library/Preferences/com.apple.MCXDebug.plist" > /dev/null 2>&1
/usr/libexec/PlistBuddy -c "Delete :collateLogs" "${targetVol}/Library/Preferences/com.apple.MCXDebug.plist" > /dev/null 2>&1
fi
/usr/libexec/PlistBuddy -c "Add :debugOutput string -2" "${targetVol}/Library/Preferences/com.apple.MCXDebug.plist" > /dev/null 2>&1
/usr/libexec/PlistBuddy -c "Add :collateLogs string 1" "${targetVol}/Library/Preferences/com.apple.MCXDebug.plist" > /dev/null 2>&1
fi
fi
# Converts a list of scripts (full paths contained in the file at $1) into packages in $3
InstallScriptsFromFile()
local tempDir="${1}"
local theFile="${2}"
local targetDir="${3}"
local opt=""
if [ "${scriptsDebugKey}" == "VERBOSE" -o "${scriptsDebugKey}" == "DEBUG" ]; then
echo "Converting scripts into install packages"
opt="-v"
fi
while read FILE
do
if [ -e "${FILE}" ]; then
# make an installer package out of the script
CreateInstallPackageForScript "$tempDir" "${FILE}" || return 1
# copy the resulting package to the Packages directory
local leafName=`basename "${FILE}"`
/usr/bin/ditto $opt "${tempDir}/${leafName}.pkg" "${targetDir}/${leafName}.pkg" || return 1
# clean up
/bin/rm -r "${tempDir}/${leafName}.pkg"
fi
done < "${theFile}"
return 0
# Prepare the source by deleting stuff we don't want to copy if sourcing a volume
PostFlightDestination()
local tempDir="${1}"
local destDir="${2}"
local opt=""
if [ "${scriptsDebugKey}" == "VERBOSE" -o "${scriptsDebugKey}" == "DEBUG" ]; then
echo "Performing post install cleanup"
opt="-v"
fi
# delete the DS indices to force reindexing...
if [ -e "${mountPoint}/var/db/dslocal/indices/Default/index" ]; then
/bin/rm $opt "${mountPoint}/var/db/dslocal/indices/Default/index"
fi
# detach the disk and remove the mount folder
DetachAndRemoveMount "${mountPoint}"
if [ $? != 0 ]; then
echo "Failed to detach and clean up the mount at '${mountPoint}'."
return 1
fi
echo "Correcting permissions. ${ownershipInfoKey} $destDir"
/usr/sbin/chown -R "${ownershipInfoKey}" "$destDir"
# Prepare the source by deleting stuff we don't want to copy if sourcing a volume
PreCleanSource()
local srcVol="$1"
local opt=""
if [ "${scriptsDebugKey}" == "VERBOSE" -o "${scriptsDebugKey}" == "DEBUG" ]; then
opt="-v"
fi
if [ -e "$srcVol/private/var/vm/swapfile*" ]; then
if [ "${scriptsDebugKey}" == "VERBOSE" -o "${scriptsDebugKey}" == "DEBUG" ]; then
echo "Removing swapfiles on $1"
fi
/bin/rm $opt "$srcVol/private/var/vm/swapfile*"
fi
if [ -e "$srcVol/private/var/vm/sleepimage" ]; then
if [ "${scriptsDebugKey}" == "VERBOSE" -o "${scriptsDebugKey}" == "DEBUG" ]; then
echo "Removing sleepimage on $1"
fi
/bin/rm $opt "$srcVol/private/var/vm/sleepimage"
fi
if [ -d "$srcVol/private/tmp" ]; then
if [ "${scriptsDebugKey}" == "VERBOSE" -o "${scriptsDebugKey}" == "DEBUG" ]; then
echo "Cleaning out /private/tmp on $1"
fi
/bin/rm -r $opt "$srcVol/private/tmp/*" > /dev/null 2>&1
fi
if [ -d "$srcVol/private/var/tmp" ]; then
if [ "${scriptsDebugKey}" == "VERBOSE" -o "${scriptsDebugKey}" == "DEBUG" ]; then
echo "Cleaning out /private/var/tmp on $1"
fi
/bin/rm -r $opt "$srcVol/private/var/tmp/*" > /dev/null 2>&1
fi
if [ "${scriptsDebugKey}" == "VERBOSE" -o "${scriptsDebugKey}" == "DEBUG" ]; then
echo "Cleaning out devices and volumes on $1"
fi
if [ -d "$srcVol/Volumes" ]; then
/bin/rm -r $opt "$srcVol/Volumes/*" > /dev/null 2>&1
fi
if [ -d "$srcVol/dev" ]; then
/bin/rm $opt "$srcVol/dev/*" > /dev/null 2>&1
fi
if [ -d "$srcVol/private/var/run" ]; then
/bin/rm -r $opt "$srcVol/private/var/run/*" > /dev/null 2>&1
fi
# Copy kernel and build the kext cache on the boot image
PrepareKernelAndKextCache()
local srcDir="$1"
local destDir="$2"
local opt=""
if [ "${scriptsDebugKey}" == "VERBOSE" -o "${scriptsDebugKey}" == "DEBUG" ]; then
echo "Preparing the kernel and kext cache for the boot image"
opt="-v"
fi
# Insure the kext cache on our source volume (the boot shell) is up to date
if [ "${scriptsDebugKey}" == "VERBOSE" -o "${scriptsDebugKey}" == "DEBUG" ]; then
echo "Updating kext cache on source volume"
fi
/usr/sbin/kextcache -update-volume "${srcDir}" || return 1
# Copy the i386 and, if it exists, the x86_64 architecture
if [ "${scriptsDebugKey}" == "VERBOSE" -o "${scriptsDebugKey}" == "DEBUG" ]; then
echo "Installing the kext cache to the boot image"
fi
# make sure this doesn't exist
if [ -e "${destDir}/i386" ]; then
/bin/rm -rf "${destDir}/i386"
fi
# Install kextcaches to the nbi folderAfter running your command, and using the mounted image as my source for creating the NetRestore image, SIU was able to complete the first two steps, but failed on the rest. It was able to complete "Creating Image From Source", and "Preparing Image For Restore", but it fails on "Creating Bootable System".
I've copied and pasted the end of the error log. Any idea what caused the Bootable System from successfully being created?
PERCENT:-1.000000
Finalizing disk image.
created: /Users/morgan/Desktop/30sept.nbi/System.dmg
# Set aside the needed BaseSystem.dmg
retrieveBaseSystemDMG "${1}" || mnrfiErrExit
+ retrieveBaseSystemDMG /tmp/niutemp.3PZq4yzF
+ local tempDir=/tmp/niutemp.3PZq4yzF
+ local opt=
+ '[' disk2s3 '!=' '' ']'
+ '[' DEBUG == VERBOSE -o DEBUG == DEBUG ']'
+ opt=-v
+ echo 'Retrieving BaseSystem bits from Recovery HD'
Retrieving BaseSystem bits from Recovery HD
mktemp -d "/tmp/mnt_rp.XXXXXXXX"
++ mktemp -d /tmp/mnt_rp.XXXXXXXX
+ recoveryMount=/tmp/mnt_rp.75pVTRHs
+ /usr/sbin/diskutil mount readOnly -mountPoint /tmp/mnt_rp.75pVTRHs disk2s3
Volume Recovery HD on disk2s3 mounted
+ '[' -e /tmp/mnt_rp.75pVTRHs/com.apple.recovery.boot/BaseSystem.dmg ']'
+ /usr/sbin/diskutil unmount disk2s3
Volume Recovery HD on disk2s3 unmounted
+ /bin/rmdir /tmp/mnt_rp.75pVTRHs
+ return 0
# update progress information
echo "${progressPrefix}_preparingASR_"
+ echo _progress_preparingASR_
# "Scan the image for restore"
asr_opt=""
+ asr_opt=
if [ "${skipReorderingKey}" == 1 ] ; then
asr_opt="--nostream"
if [ "${scriptsDebugKey}" == "VERBOSE" -o "${scriptsDebugKey}" == "DEBUG" ] ; then
echo "Preparing image for restore without multicast reordering"
fi
else
if [ "${scriptsDebugKey}" == "VERBOSE" -o "${scriptsDebugKey}" == "DEBUG" ] ; then
echo "Preparing image for restore"
fi
fi
+ '[' 0 == 1 ']'
+ '[' DEBUG == VERBOSE -o DEBUG == DEBUG ']'
+ echo 'Preparing image for restore'
Preparing image for restore
/usr/sbin/asr imagescan --source "${destPath}/${dmgContainer}.dmg" $asr_opt || mnrfiErrExit
+ /usr/sbin/asr imagescan --source /Users/morgan/Desktop/30sept.nbi/System.dmg
Checksumming partition of size 63 blocks...done
Block checksum: ....10....20....30....40....50....60....70....80....90....100
Reordering: ....10....20....30....40....50....60....70....80....90....100asr: successfully scanned image "/Users/morgan/Desktop/30sept.nbi/System.dmg"
# update progress information
echo "${progressPrefix}_creatingInstallSystem_"
+ echo _progress_creatingInstallSystem_
restoreSource="${sourceVol}"
+ restoreSource='/Volumes/Macintosh HD'
# If this is a restore from install media, mount that as our source
if [ "${restoreSource}" == "(installMedia)" ] ; then
sourceMount=`mktemp -d "/tmp/mnt_src.XXXXXXXX"`
/usr/bin/hdiutil attach "${destPath}/System.dmg" -noverify -owners on -nobrowse -noautoopen -mountpoint "${sourceMount}" -quiet || crfsErrExit
restoreSource="${sourceMount}"
fi
+ '[' '/Volumes/Macintosh HD' == '(installMedia)' ']'
# If we don't have a BaseSystem.dmg available to us fail now.
if [ ! -e "${1}/BaseSystem.dmg" ]; then
echo "There is no BaseSystem.dmg (Recovery HD) associated with the source ${restoreSource}."
crfsErrExit
fi
+ '[' '!' -e /tmp/niutemp.3PZq4yzF/BaseSystem.dmg ']'
+ echo 'There is no BaseSystem.dmg (Recovery HD) associated with the source /Volumes/Macintosh HD.'
There is no BaseSystem.dmg (Recovery HD) associated with the source /Volumes/Macintosh HD.
+ crfsErrExit
basename "${0}"
++ basename '/System/Library/CoreServices/System Image Utility.app/Contents/Library/Automator/Create Image.action/Contents/Resources/createRestoreFromSources.sh'
+ echo 'Execution of '\''createRestoreFromSources.sh'\'' failed. Cleaning up.'
Execution of 'createRestoreFromSources.sh' failed. Cleaning up.
+ DetachAndRemoveMount /tmp/mnt.nfN5nVgM
+ local theMount=/tmp/mnt.nfN5nVgM
mount | grep "${theMount}"
++ mount
++ grep /tmp/mnt.nfN5nVgM
+ local mountLoc=
+ '[' DEBUG == VERBOSE -o DEBUG == DEBUG ']'
+ echo 'Detaching disk image'
Detaching disk image
+ '[' DEBUG == DEBUG ']'
+ /usr/sbin/lsof +fg /tmp/mnt.nfN5nVgM
+ '[' '' '!=' '' ']'
+ /bin/rmdir /tmp/mnt.nfN5nVgM
+ return 0
+ '[' '' '!=' '' ']'
+ /bin/rm -r /Users/morgan/Desktop/30sept.nbi/i386
+ /bin/rm /Users/morgan/Desktop/30sept.nbi/NetInstall.dmg
+ /bin/rm /Users/morgan/Desktop/30sept.nbi/System.dmg
+ /bin/rmdir /Users/morgan/Desktop/30sept.nbi
+ exit 1
Script is done.
Bridge exited with status 256
Failed to create image from restore source.
An unknown error has occurred.
An unknown error has occurred.
Image creation process finished...
Stopping image creation.
Image creation failed.
Thanks. -
After installing 10.4.6 my USB devices fail to mount. No icons on desktop.
If I go to Apple menu/ Apple system Profiler/ more info/ USB, they show up OK with all correct information.
If I go to applications/ utilities/ disk utility, they do not show up so I can mount them. In fact, disk utility spins forever. Removing the USB devices, disk utlity works OK.
Another post suggested to reset-nvram, then reset-all. Things happened, but it did not help.
These worked fine before the update.
I have tried each device through a hub and directly to the computer. Still no good.
The devices are a Dazzle compact flash reader and a Nikon camera.
Any help would be appriciated.
G4 Mac OS X (10.4.6)
G4 Mac OS X (10.4.6)
G4 Mac OS X (10.4.6)Have you tried plugging in the devices one at a time to see if the problem is with just one of them?
If so, you may need to contact the manufacturer & see if they say it is compatible with 10.4.6 as is, or may need a firmware update, which hopefully they can provide.
Note: when I Googled "Dazzle compact flash reader OS X" I got several hits suggesting at least one model with this description isn't very compatible with OS X, like this one. -
Tiger 10.4.11 update install reads disk image fails to mount
i've been trying to download the tiger 10.4.11 upgrade and when i go to open i get the following disc images failed to mount and a reason of item not recognized. i'm at a lose considering ti've downloaded the update several times with my slow dial up and tried disc utilty to correct it, all i want to do is use my new ipod nano but need to upgrade my itunes which means i need to upgrade my software please help pretty frustrated.
Would the same error occur if the update being downloaded is for an intel based computer and not the PPC, which is what is needed?
Here's the page for the 10.4.11 combo PPC download
http://www.apple.com/support/downloads/macosx10411comboupdateppc.html
Depending also what level of 10.4 you are presently at, downloading smaller combos/increments, may seem time consuming, but actually work better with dial up service. I was once dial up myself, and went through the same difficulty. Also with doing it this way, you would have to repair permissions with each download, and reboot if any were repaired. There would also be numerous security downloads, too. -
Correct Lens Profile Not Available for Exported/Imported Image Files
Any help with this would be appreciated. I just noticed yesterday that when I have RAW (DNG) files in my LR5.2 library, I can select the correct lens profile to apply. When I take three of those files and merge them together in Photomatix Pro they come back as a single TIFF file. Now LR only has one lens profile available, and it is the wrong one.
This is happening with my Sony NEX-7 and Tamron 18-200mm f/3.5-6.3 XR DI-III VC. With the RAW files, I have a list of Tamron lenses from which to choose, and the correct one is available. For the merged TIFF file, however, only a single Tamron lens is available for selection, and it is not the lens I used.
If anyone has any ideas about this and can get me past it, I would greatly appreciate it.
Thanks,
~SteveHere's my workflow for this particular situation: After importing the original RAW files, I apply lens correction using the correct profile. I export to another application that creates a new (TIFF) file that comes back into LR. Even though I already applied the correction to the original files, I can see that there is a difference in distortion between the original files and the new TIFF.
If your other application is opening the Raw file directly, it will likely be disregarding either most, or all, Lightroom adjustments even if they are somehow communicated to it. It will come down to whatever independent Raw support is built into the other application.
The other application would still need to (a) "understand" about Adobe lens profiles etc, (b) "know" where to find the appropriate Adobe profile on disk, and (c) be equipped to do the specific and proprietary processing that they refer to. The same applies for all the other Adobe-proprietary processing instructions. The only software I am aware of which can do all this reliably, in partnership with LR, is Adobe Camera Raw plus Photoshop.
I've trained myself that whenever a new file is created in an application outside of LR (including PS), I always re-apply lens correction upon first returning to LR. If I'm interpreting the above responses correctly, I shouldn't need to re-apply lens correction if I applied it to the original files. But again, it's not my observation that this is the case.
If your particular workflow is failing to reflect the first application of lens corrections (as well as perhaps, other specific adjustments) - then what returns to LR will not have undergone those kinds of corrections yet.
I'm also hearing that I may need to download a lens profile for this lens for a TIFF file format. I've never needed to do that before, so perhaps I'll give that a shot.
As I understand it, Photomatix can also accept converted TIFFs or JPGs from LR - instead of Raw fles. I am skeptical that you will realise any "clear water" advantage from sending Raws rather than TIFF (or even, high quality JPG in many cases) from LR into Photomatix - assuming the LR conversion is already optimising the images for the required purpose. You would be doing that step in an interactive environment rather than blindly via a generic converter. Such intermediate bitmaps are in my experience perfectly good candidates for HDR processing, or for exposure fusion (which I prefer - though I don't use Photomatix in particular).
Any workflow which causes LR to in effect Export suitable bitmaps that incorporate all current adjustments, will embody lens corrections as part of that. By the way, the workflow into Photoshop HDR is similarly done by way of converted bitmaps - though in that case it is ACR rather than LR which achieves these converted bitmaps, and into memory rather than into separately saved files, but the outcome is effectively the same.
The only downside is the "cleanup" is to get rid of intermediate TIFFS or JPGs afterwards. I usually put the completed "merged" image at the top of a "stack" containing the component exposures, and collapse the stack down. But the (disposable) intermediates don't get imported to LR, and by setting these to occur in a subfolder or with a distinctive name suffix, they are easily found and deleted in due course.
RP -
Disk Imag Failed to mount Reason: No such file or directory
Hello,
I've been trying to download firefox and msn messenger for my mac!
Everytime i try to launch the .dmg it says 'Failed to mount' and the 'reason' is 'No such file or directory'
This happens with everything i download!
I dn't know what to do!
I've searched it, found some soloutions but nothing works!
Thanks SteveI've had this happen before, if I remember correctly it's just because of a corrupt download. Try downloading the .dmg files again and they should work. The other problem is it may be a permissions error. Where are the files located that you're trying to mount? Try putting them in your home directory. My first guess would be a corrupt download though.
I was suprised to find no information in the support database, or on google for this erorr with disk images.
Hope this helps. -
[SOLVED]dual boot-Failed to mount real root device
Hello,
Here is my drives partition info:
/dev/sda1 2,949,122,048 3,907,028,991 957,906,944 7 NTFS / exFAT / HPFS
/dev/sda2 2,048 901,117,951 901,115,904 83 Linux
/dev/sda3 * 901,117,952 1,925,115,903 1,023,997,952 f W95 Extended (LBA)
/dev/sda5 901,120,000 901,439,487 319,488 83 Linux
/dev/sda6 901,441,536 905,648,127 4,206,592 82 Linux swap / Solaris
/dev/sda7 905,650,176 1,925,115,903 1,019,465,728 83 Linux
/dev/sda4 1,925,115,904 2,949,122,047 1,024,006,144 7 NTFS / exFAT / HPFS
/dev/sdb1 2,048 2,099,199 2,097,152 83 Linux
/dev/sdb2 2,099,200 53,299,199 51,200,000 83 Linux
/dev/sdb3 53,299,200 73,779,199 20,480,000 83 Linux
/dev/sdb4 73,779,200 224,673,791 150,894,592 7 NTFS / exFAT / HPFS
I installed Opensuse 12.1 on /dev/sda5. It is booting with Grub, working with no problems. The computer boots directly to Grub menu.
THEN, I installed Arch linux (last release) on both sda and sdb following these mounting points:
/dev/sdb1 mounted as /boot Ext2
/dev/sdb2 mounted as / BTRFS
/dev/sdb3 mounted as /usr BTRFS
/dev/sda2 mounted as /home BTRFS
Intstallation went smooth until the end. Installed the bootloader.
Now, I am trying to configure GRUB to boot Arch.
Here is what I added on /boot/grub/menu.lst, in sda5 under Opensuse:
title Arch Linux [/boot/vmlinuz-linux]
root (hd1,0)
kernel /vmlinuz-linux root=/dev/sdb1 ro
initrd /initramfs-linux.img
In Opensuse, i can check that vmlinux and grub/menu.lst are indeed in /dev/sdb1
My /etc/fstab is on /dev/sdb2
=============================== sdb2/etc/fstab: ==========
# /etc/fstab: static file system information
# <file system> <dir> <type> <options> <dump> <pass>
tmpfs /tmp tmpfs nodev,nosuid 0 0
/dev/sda2 /home btrfs defaults 0 1
/dev/sdb1 /boot ext2 defaults 0 1
/dev/sdb2 / btrfs defaults 0 1
/dev/sdb3 /usr btrfs defaults 0 1
With this parameters, i got an message error when booting Arch:
Mounting /dev/sdb1 on /new_root failed: no such device.
Error : failed to mount the real root device.
So, at busybox prompt, I tried this command line :
ramfs # mount -t ext2 /dev/sdb1
Got an error : Can't read /etc/fstab
I tried too to give a uuid adress to sdb1 in my menu.lst file, but it didn't change anything, so I am sure partition number is correct.
It seems to me in fact that GRUB can't find fstab.
Two questions :
-Would it be better in fact to use only 1 GRUB file for both systems? If yes, shall I keep only the grub config from Opensuse?
-What do I wrong with Arch booting? Why can't I boot Arch?
EDIT :1- just realised there is no BOOT flag in my partiton table on /dev/sdb.
2- root is on /dev/sdb2, not sdb1.
1-I toggled my first partition bootable using fdisk
2-changed root to point to /dev/sdb2
Now booting into Arch login
Last edited by gabx (2011-11-22 22:33:09)It was a very simple problem. I used the wrong uuid for my /
Correct entry in 40_custom is:
#!/bin/sh
exec tail -n +3 $0
# This file provides an easy way to add custom menu entries. Simply type the
# menu entries you want to add after this comment. Be careful not to change
# the 'exec tail' line above.
menuentry "Arch Linux uuid" {
insmod part_msdos
insmod ext2
search --fs-uuid --no-floppy --set=root 8516fa60-0d45-4f33-b269-817c5290f6cc
linux /vmlinuz26 root=/dev/disk/by-uuid/9f32e668-2548-4ed4-a10b-3fbea66a6d95 ro vga=775
initrd /kernel26.img
Now the boot is working great. Next thing was that my /home and swap was not detected.
That was simply because /etc/fstab was still using /dev/sda etc naming. changing that to uuid solved that part as well.
To use uuid all the way and of cause the correct one solved everything
/Christer
Last edited by agkbill (2011-07-15 16:00:30) -
Disk images failed to mount - codec overrun
Hi,
So after searching through the related posts I have been unable to correct my probelm, which is:
I am unable to open some .dmg files. I have tried to open three different .dmg files from a variety of sources and they all return the same error:
disk images failed to mount - codec overrun
However, I was able to update my system to 10.4.7 using the updater. This did not solve the problem. I then tried load the combo version of 10.4.7 as suggested in a different post and while it didn't load (I accidentally grabbed the powerPC version) it was able to open the .dmg and look in them.
Disk Utility is unable to attach the three that won't open. The first two Disk Utility was unable to verify or repair. The last (a cars game demo) was successfully verified but still came up with the codec overrun error when I tried to attach it. Finally I have tried removing the following two files and then restarting, to no effect.
/System/Library/Extension.kextcache
/System/Library/Caches/com.apple.kernalcaches/
I'd appreciate any help offered. A search on codec overrun was of no use. I searched for "mount failed disk images" and variations of that to find what I have already tried.
Thanks
PeteI am havin the same problems. codec overrun
I am trying to download stuffit from their site so I can open a program for school.
I tried to download the dmg file from the apple site but was given the same error. Codec overrun
Also I attempted to get the updates from the Apple site.......same error.
So far this computer will not download much of anything without some kind of an error. Essentially this Imac is a $2000 jukebox. It does play music wonderfully.
My roommate was able to downlad easily from the same internet connection with no problem the windows version of the program from te same site.
This is a brand new out of the box iMac. 20" 1 gig 250 GB machine. First Mac for me and it is turning into a real headache.
Any help with the codec overrun would be appreciated.
Maybe you are looking for
-
How can I disable backup password from I tune?
how can Idisable backup password from Itune ?
-
How to automate the adding of check-box along with each numbered item in Framemaker file ?
I tried using the wingdings font as check-box. But I don't want to use it manually every time. I want to have it as a style part of my procedure style (numbering style). I need the check-box along with each numbered item. Whenever I apply my number
-
Font Smoothing CE 6.0 Thin Clients
We need to handle Font Smoothing on HP Thin Clients. This is supported on newer Thin Clients with RDP7 and Font Smoothing settings. Older Win CE 6.0 do not appear to support Font Smoothing. Is there a way to set up Font Smoothothing or can these thin
-
XDO Log shows - java.io.UTFDataFormatException: Invalid UTF8 encoding
We have a XDO Region in our OA Page - that calls XML Publisher Report taking as input a XML File generated from a concurrent program. The concurrent program calls a PL/SQL Program to generate the XML File. The XML File has the encoding fetched from s
-
Payments to Vendors Ageing Report query
Hi - Require a report that for each vendor, calculates the total payments made to them but split into aged columns. Example is total payments made to the vendor in the last month, in the last 3 months, 6 months, 9 months and the last year. There see