Netrestore images in 10.8

Hi all,
I am trying to create a new image on my server (10.8 server) to use for installing on clients over the network. The ones I have are 10.6 and I usually follow the guide at http://support.apple.com/kb/TA21133?viewlocale=en_US but for Mountain Lion it doesnt work as the step that creates the booter file:
# cp /Volumes/image/usr/standalone/ppc/bootx.bootinfo booter
above doesnt work as I obviously substitute i386 for ppc, but there is no file called bootx.bootinfo on any of the images I have tried in 10.8. I have tried it using the bootcaches.plist from within the standalone folder and by trying boot.efi from within the i386 folder but all of these induce kernel panic on any machine I try.
I have spent two days googling this and cannot find anything that relates to Mountain Lion so am wondering if documentation doesnt exist for this?
Also, just to be clear I am trying to create a custom image to use for machines to install from, the standard generic volume that you can create from the System Image Utility isnt quite good enough as I want to customise the images depending on the client. Also I have the .dmg of the system I want to use and the mach.macosx.mkext which I assume I still need.
Can anyone see where I am going wrong?
Thanks
Rob

The process for creating bootable images has changed signficantly since 10.3. Intel machines use boot.efi, not bootx.bootinfo. mkexts were deprecated in favor of kernelcaches many releases ago.
If you want to know how things work these days, dig around in the scripts in System Image Utility. Most of what you need to know can be found in these scripts.
Otherwise, the workflow you are describing sounds somewhat like the one used by DeployStudio. You might look into using that.

Similar Messages

  • Snow Leopard client for NetRestore image not being recognized in Mountain Lion Server

    I target firewired a MacBook Pro running Snow Leopard and ran System Imaging Utility and the machine does not show up as an option. Does Mountain Lion Server support Snow Leopard NetRestore images or am I doing something wrong?

    I'm actually trying to figure that out as well. We have 10.5, 10.6, 10.7, and 10.8 Images we wanted to put together for our netrestore images on our server, but can only do 10.8 images currently.
    We also have the AppleCare Helpdesk diagnostic kit which includes hardware tests, we were only able to get the newer mid-2012 and late-2012 Diagnostic utilities to netboot but none of the older ones.
    So do we need a server running the older OS to get these or is there a better alternative? i mean really shouldnt be a problem considering theyre running inside of an image and dont rely heavily on the server resources other than to say "Yep, goto this file/directory".
    I'd like to know more as well....

  • Having trouble creating NetRestore images.

    I am pulling out what little hair I have on this one, so any help is greatly appreciated.
    I am creating a NetRestore image of a 10.8.2 laptop, connected (firewaire) to a server running 10.8.2. System Image Utility does it's thing, says it's done. I can make it availlable.
    This is where the hilarity ensues.
    It ends up being a NetBoot image. No matter what settings I check, whether I use the "custom" option or not, every image I have made that should have ended up a NetRestore image, boots the laptops I am trying to image with the very same image, but only as a NetBoot.
    I even attempted to make a NetInstall image from my Mountain Lion installer, and it does the same exact thing and it ends up making a NetBoot image.
    All created images end up in a .nbi folder, all in the correct folder to be served from.
    Please tell me I am missing something simple, I cannot keep creating an image of the same computer expecting a different result. Isn't that the definition of insanity?
    Help?

    I'm fumbling through this process as well and find it incredible that there is practically nothing from Apple which documents the full process that is required of us.  All I have been able to find are a few paragraphs which tell me that I want NETBOOT images for getting my computers up to the point of being imaged and that I want NETRESTORE images for cloning of these machines.  Apart from that I feel as though I'm left on my own to figure out HOW I'm supposed to make it work.
    That being said, I can't tell you what is wrong in your specific case but I can offer two suggestions:
    1)  I was told on 3/1/13 by a senior apple enterprise guy that you can't perform the IMAGE creation on the server if the two machines have different hardware.  Lets say you have your laptop connected to an imac running the server app...you can't boot your laptop into TARGET DISK MODE (TDM) with firewire/thunderbolt to the imac and run the SYSTEM IMAGE UTILITY and expect the process to give you what you desire.  I've proven to myself that you can do it but I was told flat out that this won't work because the machine that runs the SIU will build an image for that type of hardware and you can't then push the image out to a different machine.  So in this case you end up with an imac image that you couldn't deploy to your laptops, even though the source image came from a laptop.
    Apparently you will need to use a 2nd laptop in this scenario to run the SIU; or you can boot the machine onto another volume and run the SIU from that volume against the source volume.  You could do this by booting the machine into recovery mode using R at startup and use the restore options to put a clean O/S onto an external drive-then boot to that drive and run SIU against your source.
    2) I've found something called the PENN STATE MACADMINS
    http://macadmins.psu.edu
    they have published lengthy videos and associated PDFs of those presentations which are supposed to help folks like us.  The problem that I'm running into with what is currently posted is that it is for 10.7, not 10.8.  I'm currently wading through it and trying my best to work out the differences myself.
    -good luck

  • Creating NetRestore Image of OS X Yosemite (10.10) from Mac Mini Server Running Mavericks (10.9)

    Hello all,
    We are attempting to create a NetRestore image of a Macbook Pro running Yosemite (10.10) from a Mavericks (10.9) Mac Mini running OS X Server. Previously we connected a Macbook Pro in target mode to our Mac Mini (both running Mavericks) using System Image Utility to create a NetRestore SP0 from which we could deploy to all of the computers in our lab running Mavericks. We did this as a method to update the applications on each iMac locally from the hosted NetRestore image we created. We are now receiving several new iMacs and Mac Pros running Yosemite (10.10) native and we wish to use the same process to update these machines from our Mac Mini (Mavericks) running OS X Server.
    We are now trying create a NetRestore image from a native Yosemite Macbook Pro using System Image Utility on our Mac Mini (running Mavericks) however when the Yosemite Macbook Pro is connected in target mode, System Image Utility does not recognize the volume although it is recognized by our Mac mini (e.g., the yellow-orange image icon is displayed on the Mac Mini's desktop). Some of our lab computers are still running Mavericks, and my understanding is that Mavericks NetRestore Images cannot be created from a Mac Mini with OS X Server running Yosemite.
    Must we upgrade our Mac mini from Mavericks to Yosemite for System Image Utility to recognize our Yosemite Macbook Pro (connected in target mode) in order to create a Yosemite NetRestore Image?
    Note: We know there are better alternatives (e.g., Munki) to deploy updates to our machines via server and are working to establish a more convenient process, but this is the method we have been comfortable using before running into the above issue.
    Thanks all!

    You could use DeployStudio to 'serve' both Yosemite and Mavericks images from your Mac mini which can still run Mavericks. You would also use DeployStudio to make an image of the MacBook once it has been loaded and then this image can be restored to multiple machines.
    See http://www.deploystudio.com

  • NetBoot from NetRestore Image hangs at 0% progress

    I've setup an OS X 10.6.5 machine with all of the user accounts and software that I'd like on all of the clients. I used the SIU on our 10.6.5 OS X Server to create a NetRestore image from that machine. I have configured the NetBoot service on the server to use that image.
    I have followed the steps in the book +Beginning Mac OS X Snow Leopard Server+ to get to this point.
    When I try to boot the client from the network, I see the connection in the NetBoot service logs:
    Dec 1 10:16:12 myserver bootpd[33093]: server starting
    Dec 1 10:16:12 myserver bootpd[33093]: server name myserver.example.net
    Dec 1 10:16:12 myserver bootpd[33093]: interface en0: ip 172.16.2.218 mask 255.255.255.0
    Dec 1 10:16:12 myserver bootpd[33093]: interface en1: ip 172.16.2.217 mask 255.255.255.0
    Dec 1 10:16:12 myserver bootpd[33093]: bsdpd: re-reading configuration
    Dec 1 10:16:12 myserver bootpd[33093]: bsdpd: shadow file size will be set to 48 megabytes
    Dec 1 10:16:12 myserver bootpd[33093]: bsdpd: age time 00:15:00
    Dec 1 10:16:12 myserver bootpd[33093]: service time 0.000020 seconds
    Dec 1 10:16:27 myserver bootpd[33093]: BSDP DISCOVER [en0] 1,d4:9a:20:c5:5d:be NetBoot001 arch=i386 sysid=iMac10,1
    Dec 1 10:16:27 myserver bootpd[33093]: replyfile /private/tftpboot/NetBoot/NetBootSP0/Pairing Station NetRestor.nbi/i386/booter
    Dec 1 10:16:27 myserver bootpd[33093]: replying to 0.0.0.0
    Dec 1 10:16:27 myserver bootpd[33093]: BSDP OFFER sent [1,d4:9a:20:c5:5d:be] pktsize 370
    Dec 1 10:16:27 myserver bootpd[33093]: service time 0.001017 seconds
    Dec 1 10:16:27 myserver bootpd[33093]: service time 0.000012 seconds
    Dec 1 10:16:27 myserver bootpd[33093]: service time 0.000025 seconds
    Dec 1 10:16:27 myserver bootpd[33093]: service time 0.000012 seconds
    Dec 1 10:16:29 myserver bootpd[33093]: service time 0.000032 seconds
    Dec 1 10:16:29 myserver bootpd[33093]: service time 0.000011 seconds
    Dec 1 10:16:40 myserver bootpd[33093]: service time 0.000026 seconds
    Dec 1 10:16:40 myserver bootpd[33093]: service time 0.000012 seconds
    At this point the ServerAdmin interface shows that the client is connected (see image below), but that it's stuck in the NetInstall stage and at 0%. This continues for a couple of hours and then the client connection drops.
    http://dl.dropbox.com/u/5424014/Screen%20shot%202010-12-01%20at%2010.19.18%20AM. png

    What happens on the client? Does it boot into the installer? Does it error out before booting?
    If it gets to the installer, hit Cmd-L to bring up the log, and Cmd-3 to display all messages. If it fails here, there should be something in the log.

  • System image utility set to create NetRestore Image, creates Netboot Disk instead

    Hi, I'm trying to create some OS X 10.10.1 netrestore images and no matter what I do with selecting options SIU makes the image a netboot image instead of a netrestore image. Has anyone any suggestions?
    As a workaround I've created my image and used the .dmg with an old working netrestore image.

    Hi Patrick,
    If you are having issues creating a NetRestore image in System Image Utility, you may find the following articles helpful (apologies if you have already seen them):
    OS X Server: System Image Utility requires Recovery HD partition to create a NetRestore image - Apple Support
    OS X Server: Creating a single NetBoot, NetInstall or NetRestore image for multiple Mac computers - Apple Support
    Regards,
    - Brenden

  • How To Create A Mountain Lion NetRestore Image

    In previous versions of OS X this was not an issue. In Apple's atempt to "simplify" things it has become more difficult. I have a NetBoot server set up with OS X 10.8.2. I created a custom image on a MacBook Air. I booted to the recovery partition and used disk utility to capture the image of the custom machine. When I try to use System Image Utility on the OS X server to prepare my image for NetRestore, it is greyed out with red next to is stating it has to have a recovery partition. I even used Apple's Recovery Disk Assistant to create a recovery partition on the same disk that holds the custom image but it doesn't reccognize that. Has anyone else been able to do this with no problems?

    You will need to either connect to the MacBookAir with an ethernet adapter, or create your image on an external drive. The recovery partition is created during the OS installation process, is required to create a netwok image, and is not preserved via the method you used.

  • HT4178 Updating NetRestore Images for New Hardware?

    Good Afternoon,
    I've just taken over Mac Imaging from a colleague who's moved in to another department, we have 2 Mavericks images now, 1 for schools and 1 for corporate. They are easy to create (we build the users and software then capture the image with NetRestore on Mavericks Server) but everytime we get a new MacBook with updated hardware the image fails to go on the new machine (it is backward compatible with no issues).
    I come from a Windows backgroud where we use SysPrep to make sure all images are hardware independent - there doesn't seem to be a tool which will do this for Mac, not easily anyway.
    My colleague used to create 2 new images completely from scratch every time hardware changed, this to me seems like a waste of time, I would if possible like to see if we could just update the images (via a combo update or something?), run software updates and then recapture it, saving literally a days work every time a new piece of hardware comes out.
    Has anyone done this effectively? I know their are 3rd party tools availible that may be able to help but if possible I would like to do it whilst still using NetRestore (our deployment team are familiar with this method).
    Kind Regards,
    Jon Roberts

    Yes, your process as described seems appropriate. Have you tried this on an example? Have you run into any issues?
    Regards,
    Brandon V.
    Applications Engineer
    National Instruments 

  • Update NetRestore Images (New Hardware)

    Good Afternoon,
    I've just taken over Mac Imaging from a colleague who's moved in to another department, we have 2 Mavericks images now, 1 for schools and 1 for corporate. They are easy to create (we build the users and software then capture the image with NetRestore on Mavericks Server) but everytime we get a new MacBook with updated hardware the image fails to go on the new machine (it is backward compatible with no issues).
    I come from a Windows backgroud where we use SysPrep to make sure all images are hardware independent - there doesn't seem to be a tool which will do this for Mac, not easily anyway.
    My colleague used to create 2 new images completely from scratch every time hardware changed, this to me seems like a waste of time, I would if possible like to see if we could just update the images (via a combo update or something?), run software updates and then recapture it, saving literally a days work every time a new piece of hardware comes out.
    Has anyone done this effectively? I know their are 3rd party tools availible that may be able to help but if possible I would like to do it whilst still using NetRestore (our deployment team are familiar with this method).
    Kind Regards,
    Jon Roberts

    We have had some success building images entirely from media. We have an SIU worflow that makes an image directly from the latest OSX installer as downloaded from the App store. Plus a long list of application packages like Office and Adobe CS. So when we get a new version of OSX and/or an application package we just rerun the workflow. We do not install all this stuff over and over again on a "golden" machine du jour.
    The (non-tirvial) cost of this approach is that we have to re-package all our apps for non-interactive installation. Most commercial applications are distributed in a manner assuming interactive installation on one Mac at a time. The benefit is that we get clean installs, reproducible results and fewer surprises. We have found the Composer tool from JAMF to be invaluable for creating these application packages.
    Also, you can speed up SIU builds dramatically using solid state disk.  

  • Server 10.6.2: NetRestore image of 10.6.2 not appearing in startup disk..

    So I made a 10.6.2 image of an iMac, and have created the image, which now sits on the NetBoot service on the list. But when I go to another mac (workstation), the image is not appearing in the list of startup disk items. PLEASE HELP!

    Is the NetBoot service running? Do you have MAC address filtering in place on the server?
    Do a 'showmount -e' in the terminal on the server. Does the returned path properly reflect the location of the image(s)? Can you actually mount that volume in the finder from a client?
    Another simple thing to try is: 'sudo killall -HUP bootpd'. This will force bootpd to re-read its configuration file.

  • (NetRestore images) licensing iWorks in Old Computers

    i have a question
    actually in the company when i work, we have a Mac mini server with the net install service works, for create the images we take a iMac (21.5 Inch, Late 2013) with iWorks (free) apps Include (https://www.apple.com/la/creativity-apps/mac/up-to-date/ ),
    According the update program the computers bought after of Octuber 01, 2013 can install iwokrs free,
    if we like deployment the image in older computers bought before of Octuber 01, 2013, we would have licensing problems on that computers ?

    nfsd is enabled and running.  both exports and showmount show the same volumes but there is a slight difference; I had changed the name of the volume the netinstalls were on because it had a space in the name initially (I read somewhere that may be an issue) - both exports and showmount show the new name and the old name but showmount states that the old name is offline.  Both, however, do reference the new name - so I think this is alright.
    I've tried network booting a client again and it, once again, sees the image but never gets further than the spinning gear and apple logo.
    Really wondering if this whole image-from-a-reference-build IS true.  Seems silly, though - from 10.3 to 10.6 I was always able to make images from combo-updated boxes - don't know why that'd change so dramatically now.

  • 10.10 Server, SIU NetRestore will not capture image

    So I am currently attempting to capture an image of Yosemite off a Mac Air using target mode.
    The server is also running Yosemite with the latest version of Server.
    Every time I try to use SIU to capture a NetRestore image for deployment it breaks during the "Coping Source Image" portion.
    I have renamed the mounted Target drive to something other than Macintosh HD and several other things.
    Any one else having this issue? recommendations?

    It sounds like you may be running into the problem described in this thread.

  • How to Create lion os x Image for netrestore in mountain lion server

    i have a problem with the create a lion os x image for netrestore in mountain lion server, i have a macbook pro with all software that i like for the customize deployment but when i connect the macbook pro to macmini server in target mode,but  the system image utility don't added to sources for create a netrestore image, this only pass with lion os x because with mountain lion os x works correctly, please help me

    System Image Utility only makes images of the system it ships with.
    In order to make Lion images, you'll need to install the Server Admin Tools for Lion onto a Lion system. You will then find the appropriate System Image Utility in /Applications/Server/.

  • What's the best way for me to set up an image server for my college?

    Here's the deal:
    I have a graduate fellowship at this university in the film and media department and the old server admin left. We have a handful of labs that each have their own software configuration, so we have an image for the undergrad lab, one for the grad lab, etc.
    For the past 2 years we've been imaging computers by hand on external drives and laptops, but it's super inefficient. I would really like to be able to throw these images on a server and just do it that way ... all at once.
    I tried this on a non OSX Server computer (downloaded the apps from Apple) and it didn't work. I suppose I need a real OSX Server, which we have somewhere.
    I've watched a few tutorials but they don't seem to give me quite what I need, which isn't to do a fresh install of an OSX, but to be able to "deploy" (?) specific images to specific computers on the network. Any help would be amazing, and you'd be helping a bunch of college students out...
    Thanks,
    G

    If your "server" is new enough to run Mountain Lion, you can purchase the OS X Server app from the Mac App store and you'll have everything you need to host a NetInstall (NetBoot) server.
    If your machine does not support Mountain Lion, you'll need to purchase the appropriate Mac OS X Server software (i.e. Lion Server or Snow Leopard Server)
    From there you can host NetInstall or NetRestore images, depending on your preferred workflow, which can be created using System Image Utility.
    As Richard points out you can also use Deploy Studio which, again depending on your preferred workflow, might simplify things.

  • System image utility fails "Unknown error has occurred"

    Hi,
    I can create disk images from 10.8.3 clients but when i'm putting them through system utility on the 10.8 server it fails after hours of running.
    The log is set to debug and shows the image creates upto 83% then jumps to 100% and later shows unknown errors and failed to create image from restore souce.
    I've created several disk images and saved them to different locations on the server as the source and final image.
    Below i've put in the debug log. Someone please help!!
    Workflow Started (2012-01-02 13:56:58 +0000)
    OS X Server 10.8.3 (12D78), 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="disk3s3"
    ++ potentialRecoveryDevice=disk3s3
    asrSource="ASRInstall.pkg"
    ++ asrSource=ASRInstall.pkg
    destPath="/Volumes/Macintosh HD/Library/NetBoot/NetBootSP0/NetRestore of Macintosh 10-8_2.nbi"
    ++ destPath='/Volumes/Macintosh HD/Library/NetBoot/NetBootSP0/NetRestore of Macintosh 10-8_2.nbi'
    skipReorderingKey="0"
    ++ skipReorderingKey=0
    sourceVol="/Volumes/Macintosh HD 1"
    ++ sourceVol='/Volumes/Macintosh HD 1'
    postInstallHelperKey="1"
    ++ postInstallHelperKey=1
    . "${1}/createCommon.sh"
    + . /tmp/niutemp.YPRmigsL/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

    I am seeing a very similar output trying to make a netrestore image of a 10.8.4 Macbook Air on a 10.8.4 Mac Mini running OSX Server.  Gets to 84% and then shows the -1 progress and then just hangs until I cancel it (I haven't tried leaving it over night but left it that way for hours).
    Did you ever figure out what was going on or have a workaround to create an image?
    Thanks!

Maybe you are looking for

  • Multiple routers on one computer

    I need a little help if someone can help me.  Currently I have my Linksys WRT54GS wireless hooked up to share the internet with 2 computers.  My problem is that I also have Vonage that uses a VoIP router and a D-link router for my Sorensen video phon

  • How can I add a attachment field to my new form list

    I have the setting checked yes for attachments. Then I click on the edit tab above then attach file, once I attach the file, it disappears and I cant see it after the record is saved. So how would I add a attachment to a record?

  • Image icons in Finder

    When I copy a lot of images into a folder, the icons in Finder aren't always created correctly. Can anyone tell me why or how to update them once they have been created? Here is a sample:

  • Do I need to reinstall my network card drivers?

    I just got off the phone with a second level tech from Adelphia. I called because webpages are taking a long time to load (among other things). All the tests he ran checked out fine. He said that I needed to contact Apple and have them help me uninst

  • Ad-hoc AIR app installation, without UDIDs

    I am currently building an AIR app for iOS, targeting iPad, with Flash CS5.5. I realize Flash gives me the option to build and deploy the app as an ad-hoc deployment which is fine. But what I'd really like to do is replicate the process here: http://