Skip to main content
Solved

High Sierra Imaging: How-To

  • February 2, 2018
  • 40 replies
  • 130 views

Show first post

40 replies

Forum|alt.badge.img+1
  • New Contributor
  • June 15, 2018

Hey Chris,

First of all...thanks for this resource! Now, for the newbie question. I'm new to Jamf and unfamiliar with their imaging process. I used Deploystudio in the past.

So I have mostly iMacs from Late 2013 to present. Most are running Fusion drives, but a few have mechanical drives. So no SSDs. I just want to wipe the iMacs and get them to a fresh copy of 10.13 and get picked up by the Jamf server via Apple's School Manager, that way they get enrolled and ready to deploy the Jamf configurations/policies. Does your method here work for that? ;)

Thanks for any assistance you can offer.


chrisdaggett
Forum|alt.badge.img+7
  • Author
  • Valued Contributor
  • June 19, 2018

@pfrancois That is a situation! Normally I would use the startos --eraseinstall command but that only works for APFS and only once you are already on 10.13.4+

In your case I THINK the best bet is to use AutoDMG. This will give you your clean install of 10.13 and if you are using DEP/ASM for enrollment anyway you don't need anything packaged for that. https://github.com/MagerValp/AutoDMG Obviously that isn't 100% automated since you will have to click through the User creation and enrollment, but it sounds like what you are looking for.


Forum|alt.badge.img+1
  • New Contributor
  • June 19, 2018

@chrisdaggett That does sound best. Do you think once I drag the High Sierra installer in AutoDMG and build it, I can upload to Deploystudio and push it from there?


chrisdaggett
Forum|alt.badge.img+7
  • Author
  • Valued Contributor
  • June 21, 2018

@pfrancois Absolutely, should be no issues at all there.


chrisdaggett
Forum|alt.badge.img+7
  • Author
  • Valued Contributor
  • July 16, 2018

Reminder - do not compress images or it will not work. I have made images through 10.13.6 with no issues. Apple has made it so you can not resize partitions using disk util for APFS drives, so you must use:

diskutil apfs resize Container disk2s2 30g

This assumes Disk2s2 is the APFS contrainer you want to resize and 30g is the smallest you can make it, obviously YMMV.


FutureFacinLuke
Forum|alt.badge.img+9
#!/bin/sh

@pfrancois We're in a similar position to you, a mix of Fusion, HDD and SSD devices that need flattening for this years Lab Builds.

I built the installer package containing the installer .app renamed without the version number in Composer. This can be deployed and scripted either Via JAMF or to follow a 10.12 install done with DeployStudio, this method means I can effectively Image to 10.13.6 with DeployStudio

For Fusion Macs:

#!/bin/bash

# Bless Boot Drive
bless -mount /Volumes/"$2" -setBoot #Reduces the incidence of Kernel Panics during Fusion Upgrades.

# install-macOS
/Applications/Install macOS High Sierra.app/Contents/Resources/startosinstall --applicationpath /Applications/Install macOS High Sierra.app --agreetolicense --nointeraction --converttoapfs NO

$2 needs to be replaced with the Volume name your Mac will have when this runs, I use ${DS_COMPUTERNAME} in DeployStudioafter renaming the boot-drive the the Computer name.

For SSD or HDD Macs:

#!/bin/bash
# install-macOS
/Applications/Install macOS High Sierra.app/Contents/Resources/startosinstall --applicationpath /Applications/Install macOS High Sierra.app --agreetolicense --nointeraction --converttoapfs YES

I've made these available to staff as Self Service policies. For Lab Macs we now have an APFS work around for Fusion Macs.


Forum|alt.badge.img+4
  • Contributor
  • August 2, 2018

Why do I have no 'postinstall_action' directory inside of my FirmwareUpdate.pkg? Did Apple change something?


Forum|alt.badge.img+3
  • New Contributor
  • September 6, 2018

Hello @chrisdaggett ,

First off THANK YOU for putting this thing together. This is going to be a huge help, and a great solution, while we are trying to build out our thin imaging solution.

That being said I am running into the same issue as @jmcmahon1 where I am getting an error in the script that says "cp: /tmp/FirmwareUpdate/Scripts/postinstall_actions/update: No such file or directory"

Here is the whole thing if it helps:

Mounting High Sierra ESD disk image...
/dev/disk2              GUID_partition_scheme           
/dev/disk2s1            EFI                             
/dev/disk2s2            Apple_HFS                       /Volumes/InstallESD
Expanding FirmwareUpdate.pkg
Ejecting disk image...
"disk2" unmounted.
"disk2" ejected.
Copying package resources...
cp: /tmp/FirmwareUpdate/Scripts/postinstall_actions/update: No such file or directory
Building standalone package...
pkgbuild: Adding top-level postinstall script
pkgbuild: Wrote package to /tmp/FirmwareUpdateStandalone/FirmwareUpdateStandalone.pkg

It appears that the pkg is created without issue, however I just wanted to make sure that this is not something that we need to be concerned about.


chrisdaggett
Forum|alt.badge.img+7
  • Author
  • Valued Contributor
  • September 20, 2018

@Austin.Hicks I apologize I just saw your post. I just tried it again and I do not get any errors.

Mounting High Sierra ESD disk image...
expected   CRC32 $1D0A7164
/dev/disk4              GUID_partition_scheme           
/dev/disk4s1            EFI                             
/dev/disk4s2            Apple_HFS                       /Volumes/InstallESD
Expanding FirmwareUpdate.pkg
Ejecting disk image...
"disk4" unmounted.
"disk4" ejected.
Copying package resources...
Building standalone package...
pkgbuild: Adding top-level postinstall script
pkgbuild: Wrote package to /tmp/FirmwareUpdateStandalone/FirmwareUpdateStandalone.pkg

Using. My current test was on 10.13.6 machine (my machine) using a 10.13.3 Install App.

I will try it again with a 10.13.6 fresh download and see if I get any errors.

#!/bin/sh
# Based on investigations and work by Pepijn Bruienne
# Expects a single /Applications/Install macOS High Sierra*.app on disk

IDENTIFIER="com.foo.FirmwareUpdateStandalone"
VERSION=1.0

# find the Install macOS High Sierra.app and mount the embedded InstallESD disk image
echo "Mounting High Sierra ESD disk image..."
/usr/bin/hdiutil mount /Applications/Install macOS High Sierra*.app/Contents/SharedSupport/InstallESD.dmg

# expand the FirmwareUpdate.pkg so we can copy resources from it
echo "Expanding FirmwareUpdate.pkg"
/usr/sbin/pkgutil --expand /Volumes/InstallESD/Packages/FirmwareUpdate.pkg /tmp/FirmwareUpdate

# we don't need the disk image any more
echo "Ejecting disk image..."
/usr/bin/hdiutil eject /Volumes/InstallESD

# make a place to stage our pkg resources
/bin/mkdir -p /tmp/FirmwareUpdateStandalone/scripts

# copy the needed resources
echo "Copying package resources..."
/bin/cp /tmp/FirmwareUpdate/Scripts/postinstall_actions/update /tmp/FirmwareUpdateStandalone/scripts/postinstall
# add an exit 0 at the end of the script
echo "" >> /tmp/FirmwareUpdateStandalone/scripts/postinstall
echo "" >> /tmp/FirmwareUpdateStandalone/scripts/postinstall
echo "exit 0" >> /tmp/FirmwareUpdateStandalone/scripts/postinstall
/bin/cp -R /tmp/FirmwareUpdate/Scripts/Tools /tmp/FirmwareUpdateStandalone/scripts/

# build the package
echo "Building standalone package..."
/usr/bin/pkgbuild --nopayload --scripts /tmp/FirmwareUpdateStandalone/scripts --identifier "$IDENTIFIER" --version "$VERSION" /tmp/FirmwareUpdateStandalone/FirmwareUpdateStandalone.pkg

# clean up
/bin/rm -r /tmp/FirmwareUpdate
/bin/rm -r /tmp/FirmwareUpdateStandalone/scripts

chrisdaggett
Forum|alt.badge.img+7
  • Author
  • Valued Contributor
  • September 20, 2018

@Austin.Hicks @jmcmahon1 Confirmed the Script to build the firmware package does get an error with anything above 10.13.3 (same time Imaging stopped working as well. Seems obvious apple is trying to botch this method IMO)

So you need a 10.13.0-10.13.3 Install App to use that script.

I am going to look at it when I get back from a meeting and see if it is possible to update the script to work with newer installer apps.


Forum|alt.badge.img+4
  • Contributor
  • October 10, 2018

I was also having the same issue where the postinstall_actions folder doesn't exist. Are we able to just use the "/tmp/FirmwareUpdate/Scripts/Postintall" instead? Whats the difference between the root postinstall and the postinstall_actions subfolder? Also what happens if we just run the Firmware Package straight out of the InstallESD file instead of going through the extra steps?


Forum|alt.badge.img+2
  • New Contributor
  • Answer
  • March 2, 2019

Thanks for this

can you upload your image again


chrisdaggett
Forum|alt.badge.img+7
  • Author
  • Valued Contributor
  • May 7, 2019

@cruncx Link fixed! Sorry about that. https://tinyurl.com/APFSimager


chrisdaggett
Forum|alt.badge.img+7
  • Author
  • Valued Contributor
  • May 7, 2019

I have begun creating a Mojave 10.14.4 imager. So far it APPEARS 10.14.4 will make an image OF and Image 10.14.4 just fine. Lot of testing to do though. So far it is looking positive.

Once I have fully tested and had success I will make a new, similar, post with the link to a full imager as well as instructions for those who want to modify/create/etc..


chrisdaggett
Forum|alt.badge.img+7
  • Author
  • Valued Contributor
  • May 8, 2019

New thread created for imaging with Mojave. Shorter and to the point with out all the original how-to/etc.. After testing there is no reason to create a new imager, as it still works great with 10.14.4 based images. One new step is to create the image FROM 10.14.4.

https://www.jamf.com/jamf-nation/discussions/31932/how-to-imaging-mojave-10-14