Git Product home page Git Product logo

grahampugh / erase-install Goto Github PK

View Code? Open in Web Editor NEW
826.0 64.0 131.0 16.33 MB

A script that automates downloading macOS installers, and optionally erasing or upgrading macOS in a single process. Watch the video!

Home Page: https://grahamrpugh.com/2023/05/14/macaduk-presentation-eraseinstall.html

License: Apache License 2.0

Shell 97.87% Makefile 2.13%
apple erase mac macos operating-system reinstall upgrade

erase-install's Introduction

Currently most active projects πŸ§‘πŸΌβ€πŸ’»

My most popular and demanding project is πŸ—‚οΈ erase-install, a zsh script for upgrading, reinstalling and erasing macOS. This was updated significantly in 2022 to use mist-cli and swiftDialog, and has to keep pace with changes to those projects as well as changes to macOS itself.

My other most used project is JamfUploader. This is a collection of python processors for use with AutoPkg which is the dominant method for integrating AutoPkg with Jamf Pro. 2023 saw significant updates to the JamfPackageUploader processor, after Jamf provided a new version of their Cloud Distribution Service (JCDS 2.0) and provided an official package upload API endpoint/method for the first time.

These processors are also mirrored in my AutoPkg recipes repo, grahampugh-recipes, along with a large collection of recipes and examples of how to write .jamf recipes.

Other notable projects πŸ“

For those interested in an easy script for setting up AutoPkg on a fresh machine, including (optionally) configuring JamfUploader, check out AutoPkgSetup.

If you need a signed package to add to your MDM to install Rosetta 2 at enrollment, check out Rosetta-2-install.

If you want a tool that is somewhat like a lightweight Nudge, which doesn't require any configuration changes with time, check out Nice Updater 2. Note that this is a highly altered fork of the original project by Ryan Ball, which you can check out at ryangball/nice-updater.

If you need to convert PLIST files to YAML, or vice versa, check out plist-yaml-plist.

Deprecations ☠️

The projects based on python-jss that I inherited from Shea Craig, namely JSSImporter, Spruce, jss_helper, JSSRecipeCreator, and python-jss itself, are all now deprecated. You can still find the code in the JSSImporter organisation.

erase-install's People

Contributors

ahousseini avatar amadotejada avatar andredb90 avatar anewhouse avatar aschwanb avatar bmacphail avatar boberito avatar christopherdietrich avatar cvgs avatar dan-snelson avatar darkomen78 avatar grahampugh avatar hooleahn avatar joe1981al avatar julienvs avatar liubkkkko avatar phantomphixer avatar popaprozac avatar ryangball avatar scottborcherdt avatar sgmills avatar sphen13 avatar teddi avatar tsparr avatar wartz avatar wegotoeleven avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

erase-install's Issues

Not working on M1 Mac mini

Not sure if this is expected, and I realized I tried the dev branch 17.3, but I tried to run it to reload on a lab M1 Mac mini and it did fail with an error obtaining installer.

` Script result:
[erase-install] v0.17.3 script execution started: Tue Jan 19 08:45:44 PST 2021
[erase-install] Caffeinating this script (pid=27150)
[erase-install] Looking for existing installer
[find_existing_installer] No valid installer found.
[get_user_details] macadmin has Secure Token
[check_password] Success: the password entered is the correct login password for macadmin.
[erase-install] Starting download process
[erase-install] Opening jamfHelper download message (language=en)
[get_installinstallmacos] Making working directory at /Library/Management/erase-install
[get_installinstallmacos] Downloading installinstallmacos.py...
[get_installinstallmacos] installinstallmacos.py is in /Library/Management/erase-install
[run_installinstallmacos] Getting current production version

[run_installinstallmacos] This command is now being run:

installinstallmacos.py --workdir=/Library/Management/erase-install --ignore-cache --raw --auto
Could not replicate http://swcdn.apple.com/content/downloads/59/18/001-15219-A_EE9FN7UHJA/efuz3h0zlmx4qlinf4bxlguigo9jvhcr55/InstallAssistantAuto.smd: Command '[u'/usr/bin/curl', u'-sfL', u'--create-dirs', u'-o', u'/Library/Management/erase-install/content/downloads/59/18/001-15219-A_EE9FN7UHJA/efuz3h0zlmx4qlinf4bxlguigo9jvhcr55/InstallAssistantAuto.smd', u'--compressed', 'http://swcdn.apple.com/content/downloads/59/18/001-15219-A_EE9FN7UHJA/efuz3h0zlmx4qlinf4bxlguigo9jvhcr55/InstallAssistantAuto.smd']' returned non-zero exit status 55
Could not replicate https://swdist.apple.com/content/downloads/59/18/001-15219-A_EE9FN7UHJA/efuz3h0zlmx4qlinf4bxlguigo9jvhcr55/001-15219.English.dist: Command '[u'/usr/bin/curl', u'-sfL', u'--create-dirs', u'-o', u'/Library/Management/erase-install/content/downloads/59/18/001-15219-A_EE9FN7UHJA/efuz3h0zlmx4qlinf4bxlguigo9jvhcr55/001-15219.English.dist', u'--compressed', 'https://swdist.apple.com/content/downloads/59/18/001-15219-A_EE9FN7UHJA/efuz3h0zlmx4qlinf4bxlguigo9jvhcr55/001-15219.English.dist']' returned non-zero exit status 16
Could not replicate http://swcdn.apple.com/content/downloads/61/24/001-57224/0o1xetys5n505gocjsil5qo0p4kg939elb/InstallAssistantAuto.smd: Command '[u'/usr/bin/curl', u'-sfL', u'--create-dirs', u'-o', u'/Library/Management/erase-install/content/downloads/61/24/001-57224/0o1xetys5n505gocjsil5qo0p4kg939elb/InstallAssistantAuto.smd', u'--compressed', 'http://swcdn.apple.com/content/downloads/61/24/001-57224/0o1xetys5n505gocjsil5qo0p4kg939elb/InstallAssistantAuto.smd']' returned non-zero exit status 55
Could not replicate http://swcdn.apple.com/content/downloads/01/28/061-86291-A_JPEIWIOZES/enpozvvbmj3mj2dhulhevlt8b429qd5kw0/InstallAssistantAuto.smd: Command '[u'/usr/bin/curl', u'-sfL', u'--create-dirs', u'-o', u'/Library/Management/erase-install/content/downloads/01/28/061-86291-A_JPEIWIOZES/enpozvvbmj3mj2dhulhevlt8b429qd5kw0/InstallAssistantAuto.smd', u'--compressed', 'http://swcdn.apple.com/content/downloads/01/28/061-86291-A_JPEIWIOZES/enpozvvbmj3mj2dhulhevlt8b429qd5kw0/InstallAssistantAuto.smd']' returned non-zero exit status 55
Could not replicate http://swcdn.apple.com/content/downloads/10/06/001-36801-A_9MBEQ97Z9M/672a1q4u8978ize3s15ygivp2dqwmk10qb/InstallAssistantAuto.smd: Command '[u'/usr/bin/curl', u'-sfL', u'--create-dirs', u'-o', u'/Library/Management/erase-install/content/downloads/10/06/001-36801-A_9MBEQ97Z9M/672a1q4u8978ize3s15ygivp2dqwmk10qb/InstallAssistantAuto.smd', u'--compressed', 'http://swcdn.apple.com/content/downloads/10/06/001-36801-A_9MBEQ97Z9M/672a1q4u8978ize3s15ygivp2dqwmk10qb/InstallAssistantAuto.smd']' returned non-zero exit status 55
Could not replicate https://swdist.apple.com/content/downloads/00/55/001-86606-A_9SF1TL01U7/5duug9lar1gypwunjfl96dza0upa854qgg/001-86606.English.dist: Command '[u'/usr/bin/curl', u'-sfL', u'--create-dirs', u'-o', u'/Library/Management/erase-install/content/downloads/00/55/001-86606-A_9SF1TL01U7/5duug9lar1gypwunjfl96dza0upa854qgg/001-86606.English.dist', u'--compressed', 'https://swdist.apple.com/content/downloads/00/55/001-86606-A_9SF1TL01U7/5duug9lar1gypwunjfl96dza0upa854qgg/001-86606.English.dist']' returned non-zero exit status 35

installinstallmacos.py - get macOS installers from the Apple software catalog

This Mac:
Model Identifier : Macmini9,1

Device ID : J274AP
OS Version : 11.1
Build ID : 20C69

ProductID Version Build Post Date Title

Traceback (most recent call last):
File "/Library/Management/erase-install/installinstallmacos.py", line 1299, in
main()
File "/Library/Management/erase-install/installinstallmacos.py", line 931, in main
elif device_id and product_info[product_id]["DeviceIDs"]:
KeyError: u'DeviceIDs'
[run_installinstallmacos] Error obtaining valid installer. Cannot continue.
[erase-install] 'jamfHelper' ended `

Apple M1

Hi,
Have a M1 (model identifier MacbookPro17,1)
Should all the commands also work for these new models ? - seems no valid build exist for this hardware according to error message when trying to run a eraes-install.sh --samos

startosinstall Arg Suggestions & Notes

I am working on a script to be used with macOS refurbishment, and your startosinstall argument was an invaluable reference. I wanted to share back the related work that I did.

Instead of using OS version checks in my code to determine supported startosinstall arguments, I wanted to use the output of startosinstall --usage. Sadly, I found that startosinstall --usage can take a VERY long time so I went about finding another similar solution. I landed on grepping the binary contents to check for supported arguments. This feels a bit unconventional but its effective and MUCH faster than loading the --usage.

Checking the Darwin major version, as erase-install is doing, is a perfectly valid solution but I thought this alternate solution may interest you.

Also, while I was working on this, I noticed that you have CORRECT code but an INCORRECT comment at

# macOS 11 (Darwin 20) and above requires the --allowremoval option

This comment is incorrect, although the code correctly only adds the --allowremoval argument on macOS 10.15 Catalina. You can see my comments in the included code for more info on this argument (which also reference your blog post about it).

And lastly, I see that your code in erase-install only sets --stdinpass and --user when running on Apple Silicon. This does not sync with my findings during my own testing. I found that Big Sur requires --stdinpass or --passprompt when on Intel Macs as well. I believe an error is returned stating that specifying form of authentication is required. And if not running as an admin user the --user argument is required to specify which admin to authenticate with (or else it will try to authenticate with the currently running non-admin and fail). I can double-check these findings though since most of my testing was on a non-admin account as well as a T2 Mac which may have had its own requirements separate from non-T2 Intel Macs.

Here is my startosinstall code with the intelligent argument selection based around grepping the startosinstall binary:

startosinstall_args=( '--nointeraction' ) # The "nointeraction" argument is undocumented, but is supported on ALL versions of "startosinstall" (which is OS X 10.11 El Capitan and newer).

# NOTE: Instead of using version checks to determine supported "startosinstall" arguments, I wanted to use the output of "startosinstall --usage" instead.
# But, I found that "startosinstall --usage" can take a VERY long time. Grepping the binary contents to check for supported arguments is unconventional but effective and MUCH faster!
# The part of the binary contents that have the actual usage strings all end with a ", " so it is included in the greps to not match other error messages, etc.
# To retrieve/verify all the strings referencing arguments within a "startosinstall" binary, run: strings "${path_to_installer_app}/Contents/Resources/startosinstall" | grep -e '--'

if grep -qU -e '--agreetolicense, ' "${startosinstall_path}"; then
    # The "agreetolicense" argument is supported on macOS 10.12 Sierra and newer.
    # Although, installations of OS X 10.11 El Capitan and older should still be silent because of the "nointeraction" argument.
    startosinstall_args+=( '--agreetolicense' )
fi

if grep -qU -e '--applicationpath, ' "${startosinstall_path}"; then
    # The "applicationpath" argument is only supported on macOS 10.13 High Sierra and older.
    # I believe "applicationpath" is actually only required for macOS 10.12 Sierra and older, but macOS 10.13 High Sierra still supports it.
    startosinstall_args+=( '--applicationpath' "${startosinstall_path%.app/*}.app" )
fi

if grep -qU -e '--installpackage, ' "${startosinstall_path}"; then
    # The "installpackage" argument is supported on macOS 10.13 High Sierra and newer.
    did_add_installpackage=false
    if [[ -n "${installpackage_paths}" ]]; then
        IFS=$'\n'
        for this_installpackage_path in $installpackage_paths; do
            if [[ -n "${this_installpackage_path}" && -f "${this_installpackage_path}" && "${this_installpackage_path}" == *'.pkg' ]]; then
                startosinstall_args+=( '--installpackage' "${this_installpackage_path}" )
                did_add_installpackage=true
            fi
        done
        unset IFS
    fi

    if ! $did_add_installpackage; then
        echo -e '    WARNING: PERFORMING *CLEAN INSTALL* SINCE NO PACKAGES PROVIDED\n'
    fi
else
    echo -e '    WARNING: PERFORMING *CLEAN INSTALL* SINCE "installpackage" IS NOT SUPPORTED\n'
fi

if grep -qU -e '--forcequitapps, ' "${startosinstall_path}"; then
    # The "forcequitapps" argument is supported on macOS 10.15 Catalina and newer.
    # This should not be necessary IN RECOVERY OS, but doesn't hurt and is useful IN FULL OS.
    startosinstall_args+=( '--forcequitapps' )
fi

if [[ -n "${caffeinate_pid}" ]] && grep -qU -e '--pidtosignal, ' "${startosinstall_path}"; then
    # The "pidtosignal" argument (to terminate the specified PID when the prepare phase is complete) is supported on macOS 10.12 Sierra and newer.
    startosinstall_args+=( '--pidtosignal' "${caffeinate_pid}" )
fi

can_run_startosinstall=false

if $IS_RECOVERY_OS && grep -qU -e '--volume, ' "${startosinstall_path}"; then # Double check this even though it should be redundant if we got this far.
    # The "volume" argument is supported IN RECOVERY OS on ALL versions of "startosinstall" (which is OS X 10.11 El Capitan and newer).
    # The "volume" argument can also be used IN FULL OS when SIP is disabled, but that is not useful or necessary for our usage.
    startosinstall_args+=( '--volume' "${install_volume_path}" )
    can_run_startosinstall=true
elif ! $IS_RECOVERY_OS && grep -qU -e '--eraseinstall, ' "${startosinstall_path}"; then
    # The "eraseinstall" AND "newvolumename" arguments are supported IN FULL OS on macOS 10.13 High Sierra and newer. Also, "eraseinstall" is only supported when booted into an APFS volume.
    # If attemped to run on a non-APFS volume, macOS 10.14 Mojave and newer return "Error: Erase installs are supported only on APFS disks." and macOS 10.13 High Sierra returns "Error: 801".
    startosinstall_args+=( '--eraseinstall' )

    if grep -qU -e '--newvolumename, ' "${startosinstall_path}"; then
        startosinstall_args+=( '--newvolumename' "${install_volume_name}" )
    fi

    if grep -qU 'add --allowremoval.' "${startosinstall_path}"; then
        # The undocumented "allowremoval" argument is only supported for macOS 10.15 Catalina and there is a note in the macOS 11 Big Sur installer that it is ignored and should be removed.
        # NOTICE: Since this argument is undocumented, it is grepped for at the end of a sentence rather than from the usage like all other greps.
        # This specified string will not exist in the macOS 11 Big Sur installer, so it properly won't get added on macOS 11 Big Sur.
        # More Info: https://grahamrpugh.com/2020/06/09/startosinstall-undocumented-options.html#allowremoval
        startosinstall_args+=( '--allowremoval' )
    fi

    if grep -qU -e '--passprompt, ' "${startosinstall_path}"; then
        # The "passprompt" argument (to specify the form of authentication) is required on macOS 11 Big Sur when using the "agreetolicense" argument. Previous versions would just do a GUI prompt when needed.
        # This argument will do a command line prompt on macOS 11 Big Sur. The other authentication option is "stdinpass" which is not useful or necessary for our usage.
        # If "agreetolicense" is used without "passprompt" or "stdinpass" then "Error: A method of password entry is required." will be returned.
        startosinstall_args+=( '--passprompt' )

        if grep -qU -e '--user, ' "${startosinstall_path}"; then
            # The "user" argument must also be included along with "passprompt" (if not running as admin).
            # If not running as admin and no "user" argument is specified, then will always fail with "Error: could not get authorization..." since the current user cannot authorize.
            # Including the username even if running as admin doesn't hurt and needs to be specified if not fully logged in and running via "su" (but without "sudo").
            admin_username="$(id -un)" # We will use the current username as authorizing admin user if it is and admin and has a Secure Token.
            all_admin_usernames="$(dscl . -read /Groups/admin GroupMembership | cut -c 18- | xargs)"
            if [[ " ${all_admin_usernames} " != *" ${admin_username} "* || "$(sysadminctl -secureTokenStatus "${admin_username}" 2>&1)" != *'is ENABLED for'* ]]; then
                IFS=' '
                for this_admin_username in $all_admin_usernames; do
                    if [[ "${this_admin_username}" != 'root' ]]; then
                        if [[ "$(sysadminctl -secureTokenStatus "${this_admin_username}" 2>&1)" == *'is ENABLED for'* ]]; then
                            # If current user was not admin or did not have a Secure Token,
                            # check all admin users for Secure Tokens and use the first admin with a Secure Token.
                            admin_username="${this_admin_username}"
                            break
                        elif [[ " ${all_admin_usernames} " != *" ${admin_username} "* ]]; then
                            # If no admins have a Secure Token because not booted to APFS volume, the "eraseinstall" will exit with an error
                            # because it can only be done on APFS volumes, but still want to use the correct admin username regardless.
                            # So in this case we will fallback to using the first admin or the current user if they are admin.
                            admin_username="${this_admin_username}"
                        fi
                    fi
                done
                unset IFS
            fi

            startosinstall_args+=( '--user' "${admin_username}" ) 

            # Let the technician know which admin password is required since the installer prompt does not specify it.
            echo -e "    NOTICE: You will be prompted for ${admin_username}'s administrator password...\n"
        fi
    fi

    can_run_startosinstall=true
fi

if $can_run_startosinstall; then
    echo -e "    DEBUG startosinstall_args: ${startosinstall_args[*]}\n"
    read -rp '    DEBUG - PRESS ENTER TO RUN startosinstall: '

    "${startosinstall_path}" "${startosinstall_args[@]}"
else
    # Should never get here, but handle it with an error and show usage just in case.

    missing_required_argument='volume'
    if ! $IS_RECOVERY_OS && grep -qU -e '--eraseinstall, ' "${startosinstall_path}"; then missing_required_argument='eraseinstall'; fi
    
    echo -e "\n  ERROR: THIS \"startosinstall\" DOES NOT SUPPORT THE REQUIRED \"${missing_required_argument}\" ARGUMENT\n"
    "${startosinstall_path}" --usage
fi

Running with --erase option does not work in v0.6.0

Running erase-install script v0.6.0 with --erase option produces the following output:

Print: Entry, "AppleLanguages:0", Does Not Exist

   [erase-install] Script execution started: Wed Jul  3 13:38:36 EDT 2019
   [erase-install] Looking for existing installer
   [find_existing_installer] Installer found at /Applications/Install macOS Mojave.app.
   [find_existing_installer] 10.14.5 >= 10.14.5 so valid.

   [erase-install] WARNING! Running /Applications/Install macOS Mojave.app with eraseinstall option

   [erase-install] Opening jamfHelper full screen message (language=en)
startosinstall: An extraneous argument was specified with option 'eraseinstall' 

Usage: startosinstall

Arguments
--license, prints the user license agreement only.
--agreetolicense, agree to the license you printed with --license.
--rebootdelay, how long to delay the reboot at the end of preparing. This delay is in seconds and has a maximum of 300 (5 minutes).
--pidtosignal, Specify a PID to which to send SIGUSR1 upon completion of the prepare phase. To bypass "rebootdelay" send SIGUSR1 back to startosinstall.
--installpackage, the path of a package (built with productbuild(1)) to install after the OS installation is complete; this option can be specified multiple times.
--eraseinstall, (Requires APFS) Erase all volumes and install to a new one. Optionally specify the name of the new volume with --newvolumename.
--newvolumename, the name of the volume to be created with --eraseinstall.
--preservecontainer, preserves other volumes in your APFS container when using --eraseinstall.
--usage, prints this message.

Example: startosinstall

add option to call jamf policy

I've got some locations that are behind proxies and restricted firewalls and I tried to run the 0.11.1 script on a machine there, and basically it can't get out to pull the swscan URLs to pull the OS versions. However, we have the OS in a DMG on our jamf distribution points and a policy on a custom trigger.

If the script 1) can't find the installer locally 2) wasn't able to download directly from apple, then can it try a 3rd attempt to call a policy?

We'd need multiple policies I guess depending on the OS installer to cache, but still would be doable.

Add a breakout if an error is detected

In testing on an iMac with a Fusion Drive (already converted to APFS, when it went to do the erase, it resulted in errors in ~/Library/Logs/JAMF/selfservice_debug.log

\nError: You may not install on this volume because it is not a supported APFS configuration.\nPlease backup this drive and erase it to install.\nBy using the agreetolicense option, you are agreeing that you have run this tool with the license only option and have read and agreed to the terms.\nIf you do not agree, press CTRL-C and cancel this process immediately.\n\n";

and...
[2018-09-20 10:46:06] Item Failed: Erase and Install

but still triggered the screen lock and pretended it was doing stuff.

also in ~/Library/Logs/JAMF/selfservice.log

[2018-09-20 10:46:06] Item Failed: Erase and Install

in the regular /var/log/install.log there was

2018-09-20 10:46:03-05 ushofml301383 osinstallersetupd[95241]: Preparing erase install
2018-09-20 10:46:03-05 ushofml301383 osinstallersetupd[95241]: Is solid state disk returned: -69808
2018-09-20 10:46:03-05 ushofml301383 osinstallersetupd[95241]: Disk disk3s2 is not suitable because DMError: -69837
2018-09-20 10:46:03-05 ushofml301383 osinstallersetupd[95241]: Target is not convertible to APFS: You may not install to this volume because it can not be converted to Apple File System.
2018-09-20 10:46:03-05 ushofml301383 osinstallersetupd[95241]: isConvertableToAPFS: was called on a APFS disk.
2018-09-20 10:46:03-05 ushofml301383 osinstallersetupd[95241]: Target is not convertible to APFS: This volume is not formatted as Mac OS Extended (Journaled).
2018-09-20 10:46:03-05 ushofml301383 osinstallersetupd[95241]: Started ensurePrebootVolumeForDisk:
2018-09-20 10:46:03-05 ushofml301383 osinstallersetupd[95241]: ensurePrebootVolumeForDisk: Preparing to add APFS Volume to APFS Container disk2
2018-09-20 10:46:03-05 ushofml301383 osinstallersetupd[95241]: ensurePrebootVolumeForDisk: Creating APFS Volume
2018-09-20 10:46:03-05 ushofml301383 osinstallersetupd[95241]: Is solid state disk returned: -69808
2018-09-20 10:46:03-05 ushofml301383 osinstallersetupd[95241]: Disk disk4s2 is not suitable because DMError: -69837
2018-09-20 10:46:03-05 ushofml301383 osinstallersetupd[95241]: Target is not convertible to APFS: You may not install to this volume because it can not be converted to Apple File System.
2018-09-20 10:46:04-05 ushofml301383 osinstallersetupd[95241]: ensurePrebootVolumeForDisk: Created new APFS Volume disk2s5
2018-09-20 10:46:04-05 ushofml301383 osinstallersetupd[95241]: ensurePrebootVolumeForDisk: Mounting APFS Volume
2018-09-20 10:46:04-05 ushofml301383 osinstallersetupd[95241]: ensurePrebootVolumeForDisk: Setting volume permissions
2018-09-20 10:46:04-05 ushofml301383 osinstallersetupd[95241]: Successfully created erase install target: /Volumes/Macintosh HD 1
2018-09-20 10:46:04-05 ushofml301383 osinstallersetupd[95241]: The requested target is not valid because: Error Domain=com.apple.OSInstallerSetup.error Code=242 "You may not install on this volume because it is not a supported APFS configuration.
Please backup this drive and erase it to install." UserInfo={NSLocalizedDescription=You may not install on this volume because it is not a supported APFS configuration.
Please backup this drive and erase it to install.}

Fetch Full Installer doesn't work on Big Sur

The flag --fetch-full-installer doesn't work when running this script in Big Sur.

The logic in line 1049 expects os_minor_version to be greater than or equal to 15 (Catalina) but the code to get that version has a hardcoded "10" it replaces, so line 986 actually returns "11" (and not the actual minor version like 2 for 11.2.3). Either way 11 or 2 are both lesser than 15, so FFI is not attempted.

Line 1049: if [[ $ffi && $os_minor_version -ge 15 ]]; then

Line 986: os_minor_version=$( echo "$os_version" | sed 's|^10\.||' | sed 's|\..*||' )

As explained by Scripting OSX here there are multiple ways to fix this. Simplest being just adding a 'os_major_version' and comparing that first.

majorVersion=$(sw_vers -productVersion | awk -F. '{ print $1; }')
minorVersion=$(sw_vers -productVersion | awk -F. '{ print $2; }')

if [[ $majorVersion -ge 11 || $minorVersion -ge 14 ]]; then
  echo "Mojave or higher"
fi

OS security patch update issue

Hi ,

I am looking forward to updating the current OS either Mojave, Catalina , big sur, as up to date..........

when I'm trying this upgrading the OS and with download full installed.

if not wrong is this only to get download the full installer OS.

is not having the option to do security patch update /install.

attaching file if its full installed its working fine. if its security patch update is not the right one.
can you pls suggest?

Screenshot 2021-02-22 at 5 06 55 PM

Screenshot 2021-02-22 at 5 06 38 PM

installer_app_name undefined?

Install macOS High Sierra.app is in the Applications folder, the script finds the App starts Jamf Helper with the full screen message but doesn't execute the script due to and undefined path to the installer?

Valid installer found. No need to download.
WARNING! Running /Applications/ with eraseinstall option

So it doesn't see the install app in the /Applications folder or it is not being phrased

Incorrect exit code on line 635?

Lines 633 to 635; as this condition of the if statement occurs when a disk image hasn't been downloaded by installinstallmacos, shouldn't it technically be considered an error and therefore error out with an exit code of > 0 on line 635?

Basically, I'm seeing a few macOS upgrade policies that use erase-install finish with a "Complete" status, rather than "Failed" status, when the Mac doesn't upgrade due to a failed installer.app download.

Error: failed to authorize for installation. Provide a password with --stdinpass or --passprompt.

Environment: M1 MacBook Pro running macOS 11.1

Download of the OS completes, but it looks like maybe the "--erase" switch requires a password now, even if run as an administrator.

This is the error returned:
Error: failed to authorize for installation. Provide a password with --stdinpass or --passprompt.

Usage for startosinstall under 11.2:

Usage: startosinstall

Arguments
--license, prints the user license agreement only.
--agreetolicense, agree to the license you printed with --license.
--rebootdelay, how long to delay the reboot at the end of preparing. This delay is in seconds and has a maximum of 300 (5 minutes).
--pidtosignal, Specify a PID to which to send SIGUSR1 upon completion of the prepare phase. To bypass "rebootdelay" send SIGUSR1 back to startosinstall.
--installpackage, the path of a package (built with productbuild(1)) to install after the OS installation is complete; this option can be specified multiple times.
--eraseinstall, (Requires APFS) Erase all volumes and install to a new one. Optionally specify the name of the new volume with --newvolumename.
--newvolumename, the name of the volume to be created with --eraseinstall.
--preservecontainer, preserves other volumes in your APFS container when using --eraseinstall.
--forcequitapps, on restart applications are forcefully quit. This is the default if no users are logged in.
--usage, prints this message.
--user, an admin user to authorize installation.
--passprompt, collect a password for authorization with an interactive prompt.
--stdinpass, collect a password from stdin without interaction.
--reducedsecurity, configure target volume's security policy as Reduced Security (will prompt for authorization after reboot).
--cloneuser, Copy account settings for the owner provided with --user when installing to a new volume.

ERROR! The startosinstall binary requires a user to be logged in.

Not sure if this is an issue with this software or something new that Apple introduced, but when we run this via SSH we're now getting:

Product downloaded and installed to /Library/Management/erase-install/Install_macOS_10.15.1-19B88.sparseimage
   [run_installinstallmacos] Mounting sparse disk image to identify installer app.
/dev/disk2          	GUID_partition_scheme          	
/dev/disk2s1        	EFI                            	
/dev/disk2s2        	Apple_HFS                      	/Volumes/Install_macOS_10.15.1-19B88

   [erase-install] WARNING! Running /Volumes/Install_macOS_10.15.1-19B88/Applications/Install macOS Catalina.app with eraseinstall option

    [erase-install] ERROR! The startosinstall binary requires a user to be logged in.

Remove `installinstallmacos` after/before script runs

Hey. I've experienced an issue involving a machine that connected to a VPN that restricted access to Github. This restriction essentially prohibited the erase-install script from downloading the installinstallmacos.py script, and in it's place, was a blank file. From that point onward, every time the erase-install script was run, even when not connected to the restrictive VPN, the blank file persisted, and the script failed. I needed to manually delete the installinstallmacos.py script, at which point the erase-install script correctly downloaded the installinstallmacos.py script, and everything worked as it should.

Tl;dr; can we delete the installinstallmacos script before/after each run?

OS Version selection no longer "automatic"

From 0.16b2 onwards, if I run the script through a Jamf policy (or by hand), it no longer selects the OS Version to download in installinstallosx.py automatically. The script is waiting on an input from the user on which Version to select, so it hangs indefinitely.
Tested on a stock macOS 11. 0.16b1 does work, though.

Bye, Fridolin.

New caffeinate feature hangs script

We've tried this on several different Mac models today and all of them hang at this point:

[erase-install] Script execution started: Thu Sep 26 16:17:38 CDT 2019
[erase-install] Caffeinating this script (pid=24304)

I can provide any additional details as needed.

Script not downloading OS

Unsure of where to look for what's causing this issue, but I'm seeing a large number of devices, run the script cache the installer but never actually download anything. Their logs look like the following:

   [erase-install] v0.17.4 script execution started: Wed Mar 10 15:40:48 AEDT 2021
   [erase-install] Caffeinating this script (pid=12873)
   [erase-install] Looking for existing installer
   [find_existing_installer] No valid installer found.
   [erase-install] Starting download process
   [get_installinstallmacos] Downloading installinstallmacos.py...
   [get_installinstallmacos] installinstallmacos.py is in /Library/Management/erase-install
   [run_installinstallmacos] Getting current production version

   [run_installinstallmacos] This command is now being run:

   installinstallmacos.py --workdir=/Library/Management/erase-install --ignore-cache --raw --auto 
   [run_installinstallmacos] No disk image found. I guess nothing got downloaded. 

Currently running with the --move & --update flags as this is a policy to cache the installer only.

update failed

Hi When I'm used the conjunction/Parameter not getting Updating the OS from 10.14.6 to 10.15.7
either validation not correct or something issue with the process

I used Parameter
sudo bash erase-install.sh --update --version=10.15.7

issue 1:

--update --version=10.15.7 issue update will not be happening from Mojave to Catalin 10.14.6 to 10.15.7 either validation not correct or something issue with the process ,

failed


Product downloaded and installed to /Library/Management/erase-install/Install_macOS_10.15.7-19H15.sparseimage
Polite unmount failed: hdiutil: couldn't unmount "disk3" - Resource busy

Attempting to force unmount /private/tmp/dmg.dHssV4
"disk3" ejected.
   [run_installinstallmacos] Mounting sparse disk image to identify installer app.
/dev/disk3          	GUID_partition_scheme          	
/dev/disk3s1        	EFI                            	
/dev/disk3s2        	Apple_HFS                      	/Volumes/Install_macOS_10.15.7-19H15
   [erase-install] Installer is at: /Volumes/Install_macOS_10.15.7-19H15/Applications/Install macOS Catalina.app
   [erase-install] Mounted installer will be unmounted: /Volumes/Install_macOS_10.15.7-19H15/Applications/Install macOS Catalina.app
Volume Install_macOS_10.15.7-19H15 on disk3s2 force-unmounted
   [erase-install] Cleaning working directory '/Library/Management/erase-install/content'
   [erase-install] 'caffeinate' ended**_

issue2:

--update --version=10.15.7 tried a second time but getting downloading the Catalin again without calling the --overwrite Parameter

[check_newer_available] 19H15 > 19H11
[erase-install] Newer installer found so overwriting existing installer
[overwrite_existing_installer] Overwrite option selected. Deleting existing version.

issue3:

for update 10.14.5 to 10.14.7 or 10.15.5 to 10.15.7 not required to download the entire OS my suggestion
any specific reason.

kindly assist find the below log for your reference:

*_*Last login: Thu Mar 11 15:35:14 on ttys000
NTS203642MC:~ localad$ cd ~/De
-bash: cd: /Users/localad/De: No such file or directory
NTS203642MC:~ localad$ cd ~/Desktop/
NTS203642MC:Desktop localad$ chmod +x ~/Desktop/erase-install.sh 
NTS203642MC:Desktop localad$ sudo bash erase-install.sh --update --version=10.15.7
Password:

   [erase-install] v0.17.3 script execution started: Thu Mar 11 15:44:28 IST 2021
   [erase-install] Caffeinating this script (pid=24138)
   [erase-install] Looking for existing installer
   [find_existing_installer] Installer found at /Applications/Install macOS Catalina.app.
   [check_installer_is_valid] Checking validity of /Applications/Install macOS Catalina.app.
   [check_installer_is_valid] Using DTSDKBuild value from Info.plist
   [check_installer_is_valid] Installer: 19G2007 ; System: 18G6020 : valid build.
   [erase-install] Checking for newer installer
   [get_installinstallmacos] Making working directory at /Library/Management/erase-install
   [get_installinstallmacos] Downloading installinstallmacos.py...
   [get_installinstallmacos] installinstallmacos.py is in /Library/Management/erase-install
Running this script from /Users/localad/Desktop may not work as expected. If this does not run as expected, please run again from somewhere else, such as /Users/Shared.
   [check_newer_available] 19H15 > 19G2007
   [erase-install] Newer installer found so overwriting existing installer
   [overwrite_existing_installer] Overwrite option selected. Deleting existing version.
   [erase-install] Starting download process
   [get_installinstallmacos] installinstallmacos.py is in /Library/Management/erase-install
   [run_installinstallmacos] Checking that selected version 10.15.7 is available

   [run_installinstallmacos] This command is now being run:

   installinstallmacos.py --workdir=/Library/Management/erase-install --ignore-cache --raw --version=10.15.7 

installinstallmacos.py - get macOS installers from the Apple software catalog

This Mac:
Model Identifier : iMac17,1

Board ID         : Mac-DB15BD556843C820
OS Version       : 10.14.6
Build ID         : 18G6020

Running this script from /Users/localad/Desktop may not work as expected. If this does not run as expected, please run again from somewhere else, such as /Users/Shared.
 #  ProductID       Version    Build    Post Date   Title                          
 1  001-68446       10.15.7    19H15    2020-11-11  macOS Catalina                 
 2  001-04366       10.15.4    19E2269  2020-05-04  macOS Catalina                 
 3  071-08935       11.2.2     20D80    2021-03-01  macOS Big Sur                  
 4  061-86291       10.15.3    19D2064  2020-03-23  macOS Catalina                 
 5  041-91758       10.13.6    17G66    2019-10-19  macOS High Sierra              
 6  001-57224       10.15.7    19H4     2020-10-27  macOS Catalina                 
 7  071-14766       11.2.3     20D91    2021-03-08  macOS Big Sur                  
 8  061-26589       10.14.6    18G103   2019-10-14  macOS Mojave                   
 9  071-05432       11.2.1     20D75    2021-02-15  macOS Big Sur                  
10  001-51042       10.15.7    19H2     2020-09-24  macOS Catalina                 
11  001-36735       10.15.6    19G2006  2020-08-06  macOS Catalina                 
12  041-88800       10.14.4    18E2034  2019-10-23  macOS Mojave                   
13  041-90855       10.13.5    17F66a   2019-10-23  Install macOS High Sierra Beta 
14  061-26578       10.14.5    18F2059  2019-10-14  macOS Mojave                   
15  001-36801       10.15.6    19G2021  2020-08-12  macOS Catalina                 

Build 19H15 selected. Downloading #1...

  % Total    % Received % Xferd  Average Speed   Time    Time     Time  Current
                                 Dload  Upload   Total   Spent    Left  Speed
100  475M  100  475M    0     0  11.4M      0  0:00:41  0:00:41 --:--:-- 9239k
  % Total    % Received % Xferd  Average Speed   Time    Time     Time  Current
                                 Dload  Upload   Total   Spent    Left  Speed
100   412  100   412    0     0    793      0 --:--:-- --:--:-- --:--:--   793
  % Total    % Received % Xferd  Average Speed   Time    Time     Time  Current
                                 Dload  Upload   Total   Spent    Left  Speed
100   328  100   328    0     0   1186      0 --:--:-- --:--:-- --:--:--  1188
  % Total    % Received % Xferd  Average Speed   Time    Time     Time  Current
                                 Dload  Upload   Total   Spent    Left  Speed
100 3073k  100 3073k    0     0  1313k      0  0:00:02  0:00:02 --:--:-- 1313k
  % Total    % Received % Xferd  Average Speed   Time    Time     Time  Current
                                 Dload  Upload   Total   Spent    Left  Speed
100 25290  100 25290    0     0  60299      0 --:--:-- --:--:-- --:--:-- 60357
  % Total    % Received % Xferd  Average Speed   Time    Time     Time  Current
                                 Dload  Upload   Total   Spent    Left  Speed
100  780k    0  780k    0     0   533k      0 --:--:--  0:00:01 --:--:--  533k
  % Total    % Received % Xferd  Average Speed   Time    Time     Time  Current
                                 Dload  Upload   Total   Spent    Left  Speed
100 1860k  100 1860k    0     0  1233k      0  0:00:01  0:00:01 --:--:-- 1234k
  % Total    % Received % Xferd  Average Speed   Time    Time     Time  Current
                                 Dload  Upload   Total   Spent    Left  Speed
100  477M  100  477M    0     0   9.9M      0  0:00:47  0:00:47 --:--:-- 8691k
  % Total    % Received % Xferd  Average Speed   Time    Time     Time  Current
                                 Dload  Upload   Total   Spent    Left  Speed
100  1976  100  1976    0     0   3748      0 --:--:-- --:--:-- --:--:--  3749
  % Total    % Received % Xferd  Average Speed   Time    Time     Time  Current
                                 Dload  Upload   Total   Spent    Left  Speed
100 10.2M  100 10.2M    0     0  3534k      0  0:00:02  0:00:02 --:--:-- 3533k
  % Total    % Received % Xferd  Average Speed   Time    Time     Time  Current
                                 Dload  Upload   Total   Spent    Left  Speed
100 7379M  100 7379M    0     0  6033k      0  0:20:52  0:20:52 --:--:-- 7910k
Making empty sparseimage...
installer: Package name is macOS Catalina
installer: Installing at base path /private/tmp/dmg.dHssV4
installer: The install was successful.
*********************************************************
*** Working around a very dumb Apple bug in a package ***
*** postinstall script that fails to correctly target ***
*** the Install macOS.app when installed to a volume  ***
*** other than the current boot volume.               ***
***       Please file feedback with Apple!            ***
*********************************************************
Product downloaded and installed to /Library/Management/erase-install/Install_macOS_10.15.7-19H15.sparseimage
Polite unmount failed: hdiutil: couldn't unmount "disk3" - Resource busy

Attempting to force unmount /private/tmp/dmg.dHssV4
"disk3" ejected.
   [run_installinstallmacos] Mounting sparse disk image to identify installer app.
/dev/disk3          	GUID_partition_scheme          	
/dev/disk3s1        	EFI                            	
/dev/disk3s2        	Apple_HFS                      	/Volumes/Install_macOS_10.15.7-19H15
   [erase-install] Installer is at: /Volumes/Install_macOS_10.15.7-19H15/Applications/Install macOS Catalina.app
   [erase-install] Mounted installer will be unmounted: /Volumes/Install_macOS_10.15.7-19H15/Applications/Install macOS Catalina.app
Volume Install_macOS_10.15.7-19H15 on disk3s2 force-unmounted
   [erase-install] Cleaning working directory '/Library/Management/erase-install/content'
   [erase-install] 'caffeinate' ended**_

Trier second time :

_NTS203642MC:Desktop localad$ sudo bash erase-install.sh --update --version=10.15.7
Password:

   [erase-install] v0.18.0 script execution started: Thu Mar 11 16:15:22 IST 2021
   [erase-install] Caffeinating this script (pid=33720)
   [erase-install] Looking for existing installer
   [find_existing_installer] Installer sparse image found at /Library/Management/erase-install/Install_macOS_10.15.7-19H15.sparseimage.
/dev/disk3          	GUID_partition_scheme          	
/dev/disk3s1        	EFI                            	
/dev/disk3s2        	Apple_HFS                      	/Volumes/Install_macOS_10.15.7-19H15
   [check_installer_is_valid] Checking validity of /Volumes/Install_macOS_10.15.7-19H15/Applications/Install macOS Catalina.app.
   [check_installer_is_valid] Using DTSDKBuild value from Info.plist
   [check_installer_is_valid] Installer: 19H11 ; System: 18G6020 : valid build.
   [erase-install] Checking for newer installer
   [get_installinstallmacos] installinstallmacos.py is in /Library/Management/erase-install
Running this script from /Users/localad/Desktop may not work as expected. If this does not run as expected, please run again from somewhere else, such as /Users/Shared.
   [check_newer_available] 19H15 > 19H11
   [erase-install] Newer installer found so overwriting existing installer
   [overwrite_existing_installer] Overwrite option selected. Deleting existing version.
   [erase-install] Mounted installer will be unmounted: /Volumes/Install_macOS_10.15.7-19H15/Applications/Install macOS Catalina.app
Volume Install_macOS_10.15.7-19H15 on disk3s2 force-unmounted
   [erase-install] Starting download process
   [get_installinstallmacos] installinstallmacos.py is in /Library/Management/erase-install
   [run_installinstallmacos] Checking that selected version 10.15.7 is available

   [run_installinstallmacos] This command is now being run:

   installinstallmacos.py --workdir=/Library/Management/erase-install --ignore-cache --raw --version=10.15.7 

installinstallmacos.py - get macOS installers from the Apple software catalog

This Mac:
Model Identifier : iMac17,1

Board ID         : Mac-DB15BD556843C820
OS Version       : 10.14.6
Build ID         : 18G6020

Running this script from /Users/localad/Desktop may not work as expected. If this does not run as expected, please run again from somewhere else, such as /Users/Shared.
 #  ProductID       Version    Build    Post Date   Title                          
 1  001-68446       10.15.7    19H15    2020-11-11  macOS Catalina                 
 2  001-04366       10.15.4    19E2269  2020-05-04  macOS Catalina                 
 3  071-08935       11.2.2     20D80    2021-03-01  macOS Big Sur                  
 4  061-86291       10.15.3    19D2064  2020-03-23  macOS Catalina                 
 5  041-91758       10.13.6    17G66    2019-10-19  macOS High Sierra              
 6  001-57224       10.15.7    19H4     2020-10-27  macOS Catalina                 
 7  071-14766       11.2.3     20D91    2021-03-08  macOS Big Sur                  
 8  061-26589       10.14.6    18G103   2019-10-14  macOS Mojave                   
 9  071-05432       11.2.1     20D75    2021-02-15  macOS Big Sur                  
10  001-51042       10.15.7    19H2     2020-09-24  macOS Catalina                 
11  001-36735       10.15.6    19G2006  2020-08-06  macOS Catalina                 
12  041-88800       10.14.4    18E2034  2019-10-23  macOS Mojave                   
13  041-90855       10.13.5    17F66a   2019-10-23  Install macOS High Sierra Beta 
14  061-26578       10.14.5    18F2059  2019-10-14  macOS Mojave                   
15  001-36801       10.15.6    19G2021  2020-08-12  macOS Catalina                 

Build 19H15 selected. Downloading #1...

  % Total    % Received % Xferd  Average Speed   Time    Time     Time  Current
                                 Dload  Upload   Total   Spent    Left  Speed
100  475M  100  475M    0     0  8651k      0  0:00:56  0:00:56 --:--:-- 9207k
  % Total    % Received % Xferd  Average Speed   Time    Time     Time  Current
                                 Dload  Upload   Total   Spent    Left  Speed
100   412  100   412    0     0    774      0 --:--:-- --:--:-- --:--:--   774
  % Total    % Received % Xferd  Average Speed   Time    Time     Time  Current
                                 Dload  Upload   Total   Spent    Left  Speed
100   328  100   328    0     0   1154      0 --:--:-- --:--:-- --:--:--  1150
  % Total    % Received % Xferd  Average Speed   Time    Time     Time  Current
                                 Dload  Upload   Total   Spent    Left  Speed
100 3073k  100 3073k    0     0  1805k      0  0:00:01  0:00:01 --:--:-- 1805k
  % Total    % Received % Xferd  Average Speed   Time    Time     Time  Current
                                 Dload  Upload   Total   Spent    Left  Speed
100 25290  100 25290    0     0  61019      0 --:--:-- --:--:-- --:--:-- 60939
  % Total    % Received % Xferd  Average Speed   Time    Time     Time  Current
                                 Dload  Upload   Total   Spent    Left  Speed
100  780k    0  780k    0     0   648k      0 --:--:--  0:00:01 --:--:--  648k
  % Total    % Received % Xferd  Average Speed   Time    Time     Time  Current
                                 Dload  Upload   Total   Spent    Left  Speed
100 1860k  100 1860k    0     0   737k      0  0:00:02  0:00:02 --:--:--  737k
  % Total    % Received % Xferd  Average Speed   Time    Time     Time  Current
                                 Dload  Upload   Total   Spent    Left  Speed
100  477M  100  477M    0     0  7109k      0  0:01:08  0:01:08 --:--:-- 6825k
  % Total    % Received % Xferd  Average Speed   Time    Time     Time  Current
                                 Dload  Upload   Total   Spent    Left  Speed
100  1976  100  1976    0     0   3744      0 --:--:-- --:--:-- --:--:--  3749
  % Total    % Received % Xferd  Average Speed   Time    Time     Time  Current
                                 Dload  Upload   Total   Spent    Left  Speed
100 10.2M  100 10.2M    0     0  4664k      0  0:00:02  0:00:02 --:--:-- 4662k
  % Total    % Received % Xferd  Average Speed   Time    Time     Time  Current
                                 Dload  Upload   Total   Spent    Left  Speed
  1 7379M    1 82.7M    0     0  5973k      0  0:21:05  0:00:14  0:20:51 6856k_

find_existing_installer check OS

When running with the --fetch-full-installer and specifying the --version, if an installer like Install macOS Catalina.app already exists it will proceed with validating and running through the rest of the options.

The problem though is if I specify the --version to 11.2.3, if I already happen to have a 10.15.7 installer in the Applications folder, it will use that and not even attempt to download 11.2.3.

UnicodeDecodeError: 'ascii' codec can't decode byte 0xe2 in position 121: ordinal not in range(128)

installinstallmacos.py - get macOS installers from the Apple software catalog

This Mac:
Model Identifier : iMac18,2
Bridge ID        : None
Board ID         : Mac-77F17D7DA9285301
OS Version       : 10.13.4
Build ID         : 17E202

Traceback (most recent call last):
  File "installinstallmacos.py", line 1186, in <module>
    main()
  File "installinstallmacos.py", line 827, in main
    catalog, args.workdir, ignore_cache=args.ignore_cache
  File "installinstallmacos.py", line 590, in os_installer_product_info
    board_ids = get_board_ids(dist_path)
  File "installinstallmacos.py", line 486, in get_board_ids
    if "boardIds" in line:
UnicodeDecodeError: 'ascii' codec can't decode byte 0xe2 in position 121: ordinal not in range(128)

(--overwrite) macOS installer not appearing in Applications

Using Autopkg and Jamf Pro for testing.

I see the script complete and can verify that the sparse image has been downloaded however it does not seem to move the .app into the proper folder.

I will continue trying with --move as well but curious if I am missing something. Thank you!

Restart fails with "The operation couldn't be completed. (Cocoa error 132001.)

Testing erase-install from the self-service app and I receive the error:
Restart fails with "The operation couldn't be completed. (Cocoa error 132001.)

I believe this is related to quitting the Self Service app. If I wait before clicking OK I see the following message on the screen:

Your Mac hasn't restarted because "Self Service" failed to quit. To continue restarting, quit "Self Service".

Clicking OK on the Cocoa message and clicking Try Again on the "hasn't restarted" message results in the machine restarting with the installer.

OS install issue

Hi Getting error while initiate the OS install.

sudo bash erase-install.sh --erase β€”confirm --version=10.15.7 --overwrite
sudo bash erase-install.sh

tried all getting some error in "installinstallmacos.py"

Screenshot 2021-01-22 at 5 59 13 PM

Screenshot 2021-01-22 at 5 57 35 PM

erase-install doesn't seem to install

Hey Graham, I'm playing around with erase-install and running into a weird issue where it doesn't seem to actually install the OS (trying to upgrade a VM running 10.15.7 to 11.0.1). The Script runs fine from Jamf initially when used to cache the installer onto the system but then when running a followup policy with the --reinstall flag no JamfHelper and no install proceeded :(.

This is the output that I get from running the script (identical whether I run via a Self Service Policy or via the script on the VM itself.

admin@AppTesting ~ % sudo bash /Library/Management/erase-install/erase-install.sh --reinstall
Password:

   [erase-install] Script execution started: Mon 30 Nov 2020 15:51:03 AEDT
   [erase-install] Caffeinating this script (pid=5037)
   [erase-install] Looking for existing installer
   [find_existing_installer] Installer found at /Applications/Install macOS Big Sur.app.
   [check_installer_is_valid] Checking validity of /Applications/Install macOS Big Sur.app.
   [check_installer_is_valid] 20B31 >= 19H2 so valid.

   [erase-install] WARNING! Running /Applications/Install macOS Big Sur.app with reinstall option

   [free_space_check] OK - 38898428 KB free disk space detected
   [erase-install] Opening jamfHelper full screen message (language=en)
WARNING: "--allowremoval" is ignored in macOS 11.0 and greater. Please remove it from your invocation.
/Library/Management/erase-install/erase-install.sh: line 731:  5067 Killed: 9               "$installmacOSApp/Contents/Resources/startosinstall" "${install_args[@]}" --agreetolicense --nointeraction "${install_package_list[@]}"
   [erase-install] 'jamfHelper' ended

Add progress indicator?

Is it possible to add a progress indicator when downloading by chance so users can feel more reassured that something is happening?

Extra packages function fails when there are no packages in the default directory

Tried the script on a machine running 10.13.6, with --erase and --os=10.13.6

OS downloaded fine, then it looks for extra packages at $workdir (default in my case)/extras/*.pkg, but then the script fails with "Error: specified package could not be found".

Interestingly, I am actually not trying to include any extra packages. The extras directory doesn't even exist at all as a matter of fact. It should be returning an empty list; However it seems to be returning enough back to the MacOS Installer that it tries to find them and then chokes.

Erase to the same OS results in build valid check error? (10.15)

Hey Graham,

I'm attempting to erase a workstation running 10.15.7 to the same OS (10.15.x) via the param --os=10.15. Running the command as below the following output is received where it stops at '[check_installer_is_valid]' because the build number no longer matches.

sudo /Library/Management/erase-install/erase-install.sh --erase --os=10.15 --test-run

Following installinstallmacos.py which downloads build 19H15 (expected)....

   [erase-install] v0.17.2 script execution started: Tue Jan 12 11:13:51 GMT 2021
   [erase-install] Caffeinating this script (pid=10596)
   [erase-install] Looking for existing installer
   [find_existing_installer] Installer sparse image found at /Library/Management/erase-install/Install_macOS_10.15.7-19H15.sparseimage.
/dev/disk3              GUID_partition_scheme          
/dev/disk3s1            EFI                            
/dev/disk3s2            Apple_HFS                       /Volumes/Install_macOS_10.15.7-19H15
   [check_installer_is_valid] Checking validity of /Volumes/Install_macOS_10.15.7-19H15/Applications/Install macOS Catalina.app.
Unmount failed for /Volumes/Shared Support
   [check_installer_is_valid] 19H11 < 19H15 so not valid.
   [erase-install] Installer is at: /Volumes/Install_macOS_10.15.7-19H15/Applications/Install macOS Catalina.app
   [erase-install] Mounted installer will be unmounted: /Volumes/Install_macOS_10.15.7-19H15/Applications/Install macOS Catalina.app
Volume Install_macOS_10.15.7-19H15 on disk3s2 force-unmounted
   [erase-install] Cleaning working directory '/Library/Management/erase-install/content'
   [erase-install] 'caffeinate' ended

I've also tried caching the .dmg to /Library/Management/erase-install which results in the same error. I'm unsure why 'Unmount failed for /Volumes/Shared Support' is received. I presume [check_install_is_valid] assumed the current OS build is ahead of what can be downloaded.

erase-install.sh 0.17.2

Add power source check, move space check forward

Hi number of proactive requests

issue 1: Battery percentage, adapter connected or not, and disk space check, and add the retrying an option

kindly make it before getting download the OS.

last minute saying your mac not having sufficient space or system shutdown sue to poser failur.

because downloading the OS it pain around 8 to 12 GB of data

Screenshot 2021-02-19 at 1 50 18 PM

:

issue 2

pls add one more option for the OS validation even --overwrite to avoid the spending download and internet.

for example, downloaded the OS in as its path and rerunning the same command it should take the existing OS because it downloaded as success without any issue

is that you have validated and kept the file and use it again instant of --0verrwide

issue 3: once the specification checked it should retry because selected the --0verrwide again I need to spend time and the internet to get it to download.
getting failed due to space issue there is no option for the retry and validate the space again.

Screenshot 2021-02-19 at 1 59 02 PM

pls, advise if it wrong.

Error while using the script

Find the error πŸ‘ This Mac:

cript result:
[erase-install] Script execution started: Fri Dec 11 12:09:50 IST 2020
[erase-install] Caffeinating this script (pid=48095)
[erase-install] Looking for existing installer
[find_existing_installer] Installer found at /Applications/Install macOS Mojave.app.
[check_installer_is_valid] Checking validity of /Applications/Install macOS Mojave.app.
[check_installer_is_valid] 18C49 >= 17G11023 so valid.
[overwrite_existing_installer] Overwrite option selected. Deleting existing version.
[erase-install] Starting download process
[erase-install] Opening jamfHelper download message (language=en)
[run_installinstallmacos] Making working directory at /Library/Management/erase-install
[run_installinstallmacos] Downloading installinstallmacos.py to /Library/Management/erase-install
[run_installinstallmacos] Checking that selected version 10.15.7 is available
% Total % Received % Xferd Average Speed Time Time Time Current
Dload Upload Total Spent Left Speed

0 0 0 0 0 0 0 0 --:--:-- --:--:-- --:--:-- 0
100 2020 100 2020 0 0 6998 0 --:--:-- --:--:-- --:--:-- 7013
% Total % Received % Xferd Average Speed Time Time Time Current
Dload Upload Total Spent Left Speed

0 0 0 0 0 0 0 0 --:--:-- --:--:-- --:--:-- 0
0 475M 0 45678 0 0 117k 0 1:09:00 --:--:-- 1:09:00 117k
0 475M 0 944k 0 0 696k 0 0:11:38 0:00:01 0:11:37 696k

99 475M 99 473M 0 0 1073k 0 0:07:33 0:07:31 0:00:02 1047k
99 475M 99 474M 0 0 1073k 0 0:07:33 0:07:32 0:00:01 1036k
100 475M 100 475M 0 0 1074k 0 0:07:33 0:07:33 --:--:-- 1232k
% Total % Received % Xferd Average Speed Time Time Time Current
Dload Upload Total Spent Left Speed

0 0 0 0 0 0 0 0 --:--:-- --:--:-- --:--:-- 0
0 0 0 0 0 0 0 0 --:--:-- --:--:-- --:--:-- 0
100 328 100 328 0 0 446 0 --:--:-- --:--:-- --:--:-- 446
% Total % Received % Xferd Average Speed Time Time Time Current
Dload Upload Total Spent Left Speed

0 0 0 0 0 0 0 0 --:--:-- --:--:-- --:--:-- 0
0 0 0 0 0 0 0 0 --:--:-- --:--:-- --:--:-- 0
curl: (52) Empty reply from server
Could not replicate http://swcdn.apple.com/content/downloads/26/37/001-68446/r1dbqtmf3mtpikjnd04cq31p4jk91dceh8/InstallESDDmg.pkg: Command '[u'/usr/bin/curl', u'-fL', u'--create-dirs', u'-o', u'/Library/Management/erase-install/content/downloads/26/37/001-68446/r1dbqtmf3mtpikjnd04cq31p4jk91dceh8/InstallESDDmg.pkg', u'--compressed', 'http://swcdn.apple.com/content/downloads/26/37/001-68446/r1dbqtmf3mtpikjnd04cq31p4jk91dceh8/InstallESDDmg.pkg']' returned non-zero exit status 52

installinstallmacos.py - get macOS installers from the Apple software catalog

This Mac:
Model Identifier : MacBookPro14,1

Bridge ID : None
Board ID : Mac-B4831CEBD52A0C4C
OS Version : 10.13.6
Build ID : 17G11023

ProductID Version Build Post Date Title Notes/Warnings

1 001-68446 10.15.7 19H15 2020-11-11 macOS Catalina
2 041-91741 10.13.6 17G2208 2019-10-13 macOS High Sierra
3 001-04366 10.15.4 19E2269 2020-05-04 macOS Catalina
4 061-86291 10.15.3 19D2064 2020-03-23 macOS Catalina
5 041-91758 10.13.6 17G66 2019-10-19 macOS High Sierra
6 001-57224 10.15.7 19H4 2020-10-27 macOS Catalina
7 041-90860 17E199 2019-10-22 macOS High Sierra
8 061-26589 10.14.6 18G103 2019-10-14 macOS Mojave
9 001-51042 10.15.7 19H2 2020-09-24 macOS Catalina
10 001-36735 10.15.6 19G2006 2020-08-06 macOS Catalina
11 001-83532 11.0.1 20B50 2020-11-19 macOS Big Sur
12 041-88800 10.14.4 18E2034 2019-10-23 macOS Mojave
13 041-90855 10.13.5 17F66a 2019-10-23 Install macOS High Sierra Beta Unsupported macOS version
14 061-26578 10.14.5 18F2059 2019-10-14 macOS Mojave
15 001-36801 10.15.6 19G2021 2020-08-12 macOS Catalina

Build 19H15 selected. Downloading #1...

[run_installinstallmacos] No disk image found. I guess nothing got downloaded.
[erase-install] 'jamfHelper' ended

Signature verification of the os installer

If we install using installinstallmacos.py, there is a possibility that an incorrect OS will be installed, for example, if the catalog has been modified.
This is why we believe that we should check the signature of the binary and application.

This is the same idea as Gatekeeper for macOS.

Is it possible to add this feature?

syntax error: invalid arithmetic operator (error token is ".4")

There is an error on line 87 at the if statement.

Line 85 gives me 14:

installer_version=$( /usr/bin/defaults read "$installer_app/Contents/Info.plist" DTPlatformVersion | sed 's|10\.||')

Line 86 gives me 14.4:

installed_version=$( /usr/bin/sw_vers | grep ProductVersion | awk '{ print $NF }' | sed 's|10\.||')

Download issue

Now all doing work from home and having limited network per day 2 GB

In that situation to be sending the 8GB data to download the MAC OS, it's difficult to force to download.

here can we do the initiation to download the data like pause and download per day 1 GB and next day after 24hr can download the other 1 GB as like

can help to change this option on this script.

how to define the jamf parameter

how to define the jamf parameters as like erase install and update or reinstall ect can help me to create the policy with the different parameters.

  1. i have hight sierra to catalina specifyed version 10.15.6
    2)just to download the catalina to the application folder and specifyed version 10.15.6
    3)erase and install with specifyed version catalina 10.15.6, mojave 10.14.6

can pls share me the steps how to creat the policy for those and setup the paramets

Installation fails to proceed if Volume Name contains no spaces.

The script doesn't work if the disk's name doesn't contain a space. E.g. it works on 'test
1' but not on 'test1'. The same also happens with the 'erase-install.sh' script from your
website.

It downloads the installer without any problems then there's shortly a screen displayed
with the info that the OS is being upgraded and then it goes back to the normal OS desktop
with the user still logged in.

If I run the script from the command line then I get the following error message:

Error: could not find target...  

and then:

[erase-install] 'jamfHelper' ended

I've tried this with different disk names and both with encrypted and unencrypted disks.
The computer is running the latest version of High Sierra with all updates applied, it's a
13" MacBook Pro from September 2015.
Do you have an idea what's going wrong?

Which version of Install macOS High Sierra.app to download?

There are currently three different macOS High Sierra installers available, due to multiple forked builds. This makes life very difficult for this script to determine which one to get. I decided to add some logic to the script to attempt to grab the oldest one, which will cover the most Macs.

But perhaps I should check for the version currently installed on this computer and download this if available, as you really need to run the startosinstall using an installer of the same version as is currently installed.

confirm not working on 0.17.3

--confirm is presenting the dialog box, but clicking Yes or Cancel both result in a failure:

[erase-install] User FAILED to confirm erase/install

--os=X.Y not respected

I've been trying to update the scripts to the current versions, and it seems it's not respecting --os=10.14 nor --version=10.14.6

Screen Shot 2020-10-22 at 2 23 17 PM

Script result: [erase-install] Script execution started: Thu Oct 22 14:20:38 CDT 2020 [erase-install] Caffeinating this script (pid=20591) [erase-install] Looking for existing installer [find_existing_installer] Installer found at /Applications/Install macOS Mojave.app. [check_installer_is_valid] Checking validity of /Applications/Install macOS Mojave.app. [check_installer_is_valid] 18G101 < 19H2 so not valid. [erase-install] ERROR: Invalid installer is present. Run with --overwrite option to ensure that a valid installer is obtained.

Error No such file or directory

Awesome script, just an FYI when testing today.

Doesn't do an erase install, stops at

./erase-install.sh: line 294: /Contents/Resources/startosinstall: No such file or directory

Thinking there is an issue with path stated in the variable, but I am unsure...

"$installmacOSApp/Contents/Resources/startosinstall" --applicationpath "$installmacOSApp" --eraseinstall --agreetolicense --nointeraction

Support for VMs?

Is it possible to get this to work for VMware Fusion VM's? Here is my current output. It seems as though Unsupported Board ID is the issue.

`Script result:
[erase-install] Script execution started: Tue Oct 16 11:38:44 EDT 2018
[erase-install] Looking for existing installer
[find_existing_installer] No valid installer found.
[erase-install] Starting download process
[run_installinstallmacos] Downloading installinstallmacos.py to /Library/Management/erase-install
/Library/Application Support/JAMF/tmp/eraseInstall.sh: line 120: 8575 Killed: 9 "$jamfHelper" -windowType hud -windowPosition ul -title "Downloading macOS" -alignHeading center -alignDescription left -description "We need to download the macOS installer to your computer; this will take several minutes." -lockHUD -icon "/System/Library/CoreServices/CoreTypes.bundle/Contents/Resources/SidebarDownloadsFolder.icns" -iconSize 100
[run_installinstallmacos] Checking that selected version 10.14 is available

installinstallmacos.py - get macOS installers from the Apple software catalog

This Mac:
Model Identifier : MacBook10,1
Board ID : latform
OS Version : 10.14
Build ID : 18A391

ProductID Version Build Post Date Title Notes

1 041-08708 10.14 18A391 2018-09-24 macOS Mojave Unsupported Board ID
2 091-95774 10.13.6 17G2208 2018-07-30 macOS High Sierra Unsupported Board ID
3 091-94326 10.13.6 17G65 2018-07-11 macOS High Sierra Unsupported Board ID
4 041-03369 10.14 18A384a 2018-09-12 macOS Mojave Beta Unsupported Board ID
Traceback (most recent call last):
File "/Library/Management/erase-install/installinstallmacos.py", line 710, in
main()
File "/Library/Management/erase-install/installinstallmacos.py", line 641, in main
'to select a valid build to download.\n' % answer)
UnboundLocalError: local variable 'answer' referenced before assignment
hdiutil: attach: cannot convert "" to URL
hdiutil: attach failed - Invalid argument

[main] WARNING! Running with eraseinstall option

[erase-install] Opening jamfHelper full screen message
/Library/Application Support/JAMF/tmp/eraseInstall.sh: line 243: /Contents/Resources/startosinstall: No such file or directory`

Multiple error downloading the OS

Getting multiple errors on:

Used parameter : sudo bash erase-install.sh --reinstall --version=10.15.7 --overwrite

Error 1: from machine 1:
OS version : 10.14.6

Script result: 
   [erase-install] v0.6.1 script execution started: Tue Mar 30 15:43:06 IST 2021
   [erase-install] Caffeinating this script (pid=91511)
   [erase-install] Looking for existing installer
   [find_existing_installer] No valid installer found.
   [erase-install] Starting download process
   [erase-install] Opening jamfHelper download message (language=en)
   [get_installinstallmacos] Making working directory at /Library/Management/erase-install
   [get_installinstallmacos] Downloading installinstallmacos.py...
   [get_installinstallmacos] installinstallmacos.py is in /Library/Management/erase-install
   [run_installinstallmacos] Checking that selected version 10.15.7 is available

   [run_installinstallmacos] This command is now being run:

   installinstallmacos.py --workdir=/Library/Management/erase-install --ignore-cache --raw --version=10.15.7 --validate 
  % Total    % Received % Xferd  Average Speed   Time    Time     Time  Current
                                 Dload  Upload   Total   Spent    Left  Speed

  0     0    0     0    0     0      0      0 --:--:-- --:--:-- --:--:--     0
  6  780k    6 52755    0     0   138k      0  0:00:05 --:--:--  0:00:05  138k
100  780k  100  780k    0     0   765k      0  0:00:01  0:00:01 --:--:--  766k
  % Total    % Received % Xferd  Average Speed   Time    Time     Time  Current
                                 Dload  Upload   Total   Spent    Left  Speed
  0     0    0     0    0     0      0      0 --:--:-- --:--:-- --:--:--     0
  3 10.2M    3  397k    0     0   676k      0  0:00:15 --:--:--  0:00:15  675k
 16 10.2M   16 1740k    0     0  1095k      0  0:00:09  0:00:01  0:00:08 1095k
 33 10.2M   33 3470k    0     0  1339k      0  0:00:07  0:00:02  0:00:05 1339k
 41 10.2M   41 4368k    0     0  1217k      0  0:00:08  0:00:03  0:00:05 1217k
 50 10.2M   50 5272k    0     0  1149k      0  0:00:09  0:00:04  0:00:05 1149k
 69 10.2M   69 7270k    0     0  1300k      0  0:00:08  0:00:05  0:00:03 1374k
 86 10.2M   86 9030k    0     0  1370k      0  0:00:07  0:00:06  0:00:01 1458k
100 10.2M  100 10.2M    0     0  1407k      0  0:00:07  0:00:07 --:--:-- 1443k
---------------------------------------------------------------------------
99  475M   99  474M    0     0  1427k      0  0:05:41  0:05:40  0:00:01 1291k
100  475M  100  475M    0     0  1427k      0  0:05:41  0:05:41 --:--:-- 1296k
  % Total    % Received % Xferd  Average Speed   Time    Time     Time  Current
                                 Dload  Upload   Total   Spent    Left  Speed

  0     0    0     0    0     0      0      0 --:--:-- --:--:-- --:--:--     0curl: (6) Could not resolve host: swcdn.apple.com
Could not replicate http://swcdn.apple.com/content/downloads/26/37/001-68446/r1dbqtmf3mtpikjnd04cq31p4jk91dceh8/AppleDiagnostics.dmg: Command '[u'/usr/bin/curl', u'-fL', u'--create-dirs', u'-o', u'/Library/Management/erase-install/content/downloads/26/37/001-68446/r1dbqtmf3mtpikjnd04cq31p4jk91dceh8/AppleDiagnostics.dmg', u'-w', u'%{http_code}', u'--compressed', 'http://swcdn.apple.com/content/downloads/26/37/001-68446/r1dbqtmf3mtpikjnd04cq31p4jk91dceh8/AppleDiagnostics.dmg']' returned non-zero exit status 6

installinstallmacos.py - get macOS installers from the Apple software catalog

This Mac:
Model Identifier : MacBookPro15,1

Bridge ID        : J680AP
Board ID         : Mac-937A206F2EE63C01
OS Version       : 10.14.6
Build ID         : 18G1012

 #  ProductID       Version    Build    Post Date   Title                          
 1  001-68446       10.15.7    19H15    2020-11-11  macOS Catalina                 
 2  001-04366       10.15.4    19E2269  2020-05-04  macOS Catalina                 
 3  071-08935       11.2.2     20D80    2021-03-01  macOS Big Sur                  
 4  061-86291       10.15.3    19D2064  2020-03-23  macOS Catalina                 
 5  041-91758       10.13.6    17G66    2019-10-19  macOS High Sierra              
 6  001-57224       10.15.7    19H4     2020-10-27  macOS Catalina                 
 7  071-14766       11.2.3     20D91    2021-03-08  macOS Big Sur                  
 8  061-26589       10.14.6    18G103   2019-10-14  macOS Mojave                   
 9  071-05432       11.2.1     20D75    2021-02-15  macOS Big Sur                  
10  001-51042       10.15.7    19H2     2020-09-24  macOS Catalina                 
11  001-36735       10.15.6    19G2006  2020-08-06  macOS Catalina                 
12  041-88800       10.14.4    18E2034  2019-10-23  macOS Mojave                   
13  041-90855       10.13.5    17F66a   2019-10-23  Install macOS High Sierra Beta 
14  061-26578       10.14.5    18F2059  2019-10-14  macOS Mojave                   
15  001-36801       10.15.6    19G2021  2020-08-12  macOS Catalina                 

Build 19H15 selected. Downloading #1...

   [run_installinstallmacos] Error obtaining valid installer. Cannot continue.
   [erase-install] 'jamfHelper' ended

Error 2: from machine 2

OS version : 13.6

Script result: 
   [erase-install] v0.18.0 script execution started: Wed Mar 31 19:07:07 IST 2021
   [erase-install] Caffeinating this script (pid=23103)
45000000
   [free_space_check] OK - 183549816 KB free disk space detected
   [erase-install] Looking for existing installer
   [find_existing_installer] No valid installer found.
   [erase-install] Starting download process
   [erase-install] Opening jamfHelper download message (language=en)
   [get_installinstallmacos] installinstallmacos.py is in /Library/Management/erase-install
   [run_installinstallmacos] Checking that selected version 10.15.7 is available

   [run_installinstallmacos] This command is now being run:

   installinstallmacos.py --workdir=/Library/Management/erase-install --ignore-cache --raw --version=10.15.7 --validate 
   [run_installinstallmacos] No disk image found. I guess nothing got downloaded.
   [erase-install] 'jamfHelper' ended

Failing to Detect Big Sur 11.2.1 (20D74)

This looks like it is potentially an issue with installinstallmacos.py. However, I noticed that erase-install.sh appears to have the --fetch-full-installer flag disabled.

Error log for reference:

Script result:
[erase-install] v0.17.3 script execution started: Thu Feb 11 11:23:20 CST 2021
[erase-install] Caffeinating this script (pid=3925)
[erase-install] Looking for existing installer
[find_existing_installer] No valid installer found.
[erase-install] Starting download process
[erase-install] Opening jamfHelper download message (language=en)
/Library/Application Support/JAMF/tmp/erase-install.sh: line 853: [: 11.2.1: integer expression expected
[get_installinstallmacos] Making working directory at /Library/Management/erase-install
[get_installinstallmacos] Downloading installinstallmacos.py...
[get_installinstallmacos] installinstallmacos.py is in /Library/Management/erase-install
[run_installinstallmacos] Getting current production version

[run_installinstallmacos] This command is now being run:

installinstallmacos.py --workdir=/Library/Management/erase-install --ignore-cache --raw --auto

installinstallmacos.py - get macOS installers from the Apple software catalog

This Mac:
Model Identifier : MacPro6,1

Board ID : Mac-F60DEB81FF30ACF6
OS Version : 11.2.1
Build ID : 20D74

ProductID Version Build Post Date Title

1 001-15219 10.15.5 19F2200 2020-06-15 macOS Catalina
2 001-68446 10.15.7 19H15 2020-11-11 macOS Catalina
3 001-04366 10.15.4 19E2269 2020-05-04 macOS Catalina
4 001-36801 10.15.6 19G2021 2020-08-12 macOS Catalina
5 061-86291 10.15.3 19D2064 2020-03-23 macOS Catalina
6 041-91758 10.13.6 17G66 2019-10-19 macOS High Sierra
7 001-57224 10.15.7 19H4 2020-10-27 macOS Catalina
8 061-26589 10.14.6 18G103 2019-10-14 macOS Mojave
9 001-51042 10.15.7 19H2 2020-09-24 macOS Catalina
10 001-36735 10.15.6 19G2006 2020-08-06 macOS Catalina
11 041-88800 10.14.4 18E2034 2019-10-23 macOS Mojave
12 041-90855 10.13.5 17F66a 2019-10-23 Install macOS High Sierra Beta
13 061-26578 10.14.5 18F2059 2019-10-14 macOS Mojave
14 071-00838 11.2 20D64 2021-02-01 macOS Big Sur
No valid build found for this hardware
[run_installinstallmacos] No disk image found. I guess nothing got downloaded.
[erase-install] 'jamfHelper' ended

Inadvertently saving two copies of the installer?

I'm trying to use the erase-install script through Jamf to download and cache a copy of the Big Sur installer. I'm using the --move argument when calling the script, and it works as it should -- in the end, I have a copy of the Install macOS Big Sur.app in the Applications folder. However, while the installer app is about 12GB in size, I've noticed that my available hard drive space has decreased by closer to 25GB. It seems to me like another copy of the installer is being left somewhere, but I'm not sure where -- I looked in /Library/Management/erase-install, and am only finding the .py script in there. Am I doing something wrong, or is there another way to ensure that the .app in the Applications folder is the only one left on the machine? (We have some MacBooks with smaller drives, and I fear that the extra space being taken up might be enough to dip them below the free space required during the Big Sur install.)

UPDATE: I've done some more testing, and I'm wondering if this might be related to APFS. On a test computer, before running erase-install --move I had 66.2GB of free space. After running it, it's down to 42.3GB. But running a disk map tool like GrandPerspective only shows one file that's 12GB in size, the installer .app in Applications. Could what I'm seeing be related to the APFS snapshot of the temporary files the script downloaded?

Where the log will stores

Hi Pls have an option to store the activity log in the user machine

like checking conditions and output or error info

pls make it will be helpful full to.

Feature Request - Prompt for which version?

I had a couple feature requests, I'm not sure of the effort required...

  1. I saw on the wiki that it's possible to prompt for user info on the m1s, is it possible to prompt for OS as well so the techs can choose which version (eliminate the need of maintaining multiple versions of the policy for different OS options)

  2. If a curl command fails (some of our locations restrict it while others do not), is it possible that if it times out that it can then call a JAMF Policy to cache the installer?

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    πŸ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. πŸ“ŠπŸ“ˆπŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❀️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.