Skip to main content
Question

Get Erase-install.sh working

  • August 15, 2022
  • 14 replies
  • 138 views

binjali
Forum|alt.badge.img+7

So, i'm trying to use https://github.com/grahampugh/erase-install and I'm having a VERY hard time understanding the steps to make it work.

I added the package to Jamf Cloud, and pushed it out to my test computers by policy.

How doi I get the various switches into the install? I thought i could make separate polices that included scripts that talk to the installed package. Is this the correct usage?

14 replies

sdagley
Forum|alt.badge.img+25
  • Jamf Heroes
  • August 15, 2022

@binjali Did you review the Jamf Pro section in the erase-install Wiki? https://github.com/grahampugh/erase-install/wiki/8.-Use-in-Jamf-Pro

 


Forum|alt.badge.img+21
  • Valued Contributor
  • August 15, 2022

I have a Self Service policy that installs the package and then runs the following command using the 'Files and Processes' payload:

 

/Library/Management/erase-install/erase-install.sh --reinstall --os=12 --update --min-drive-space=35 --current-user --check-power --no-fs --depnotify --cleanup-after-use

 

Obviously you can change the --update flag if you want to do an erase and install.


binjali
Forum|alt.badge.img+7
  • Author
  • Contributor
  • September 6, 2022

So, i used the erase-install.sh script, pushed and activated by policy, and pushed it out to my two current test machines.  They ran the updates as requested, but I lost the JamfConnect login window.   The update polic isn't registering as completed, the test machines are just sitting in pending, and when I tired to push out an auth-changer policy, it is also sitting in pending, with no progress being made.  I need help with this.


SMR1
Forum|alt.badge.img+13
  • Valued Contributor
  • October 5, 2022

Trying this package for the first time. I have the package install and setup the file and process set to

/Library/Management/erase-install/erase-install.sh --reinstall --update --min-drive-space=35 --current-user --check-power --no-fs --cleanup-after-use, but it errors because it can't obtain valid installer. Cannot continue.

 

Build 21G115 selected. Downloading #27...

Making empty sparseimage...

[run_installinstallmacos] Error obtaining valid installer. Cannot continue.

[erase-install] attempting to terminate the 'caffeinate' process - Termination message indicates success /Library/Management/erase-install/erase-install.sh: line 1078: 36060 Terminated: 15 /usr/bin/caffeinate -dimsu -w $$

[erase-install] attempting to terminate the 'jamfHelper' process - Termination message indicates success /Library/Management/erase-install/erase-install.sh: line 1078: 36083 Terminated: 15 "$jamfHelper" -windowType hud -windowPosition ul -title "${!dialog_dl_title}" -alignHeading center -alignDescription left -description "${!dialog_dl_desc}" -lockHUD -icon "$dialog_dl_icon" -iconSize 100


sdagley
Forum|alt.badge.img+25
  • Jamf Heroes
  • October 5, 2022

Trying this package for the first time. I have the package install and setup the file and process set to

/Library/Management/erase-install/erase-install.sh --reinstall --update --min-drive-space=35 --current-user --check-power --no-fs --cleanup-after-use, but it errors because it can't obtain valid installer. Cannot continue.

 

Build 21G115 selected. Downloading #27...

Making empty sparseimage...

[run_installinstallmacos] Error obtaining valid installer. Cannot continue.

[erase-install] attempting to terminate the 'caffeinate' process - Termination message indicates success /Library/Management/erase-install/erase-install.sh: line 1078: 36060 Terminated: 15 /usr/bin/caffeinate -dimsu -w $$

[erase-install] attempting to terminate the 'jamfHelper' process - Termination message indicates success /Library/Management/erase-install/erase-install.sh: line 1078: 36083 Terminated: 15 "$jamfHelper" -windowType hud -windowPosition ul -title "${!dialog_dl_title}" -alignHeading center -alignDescription left -description "${!dialog_dl_desc}" -lockHUD -icon "$dialog_dl_icon" -iconSize 100


@SMR1 Try adding the "--pkg" option to have erase-install download the installer as a .pkg instead of build one.

I'd also suggest adding the option "--build=21G115" if you specifically want 12.6 to be installed.


SMR1
Forum|alt.badge.img+13
  • Valued Contributor
  • October 5, 2022

@SMR1 Try adding the "--pkg" option to have erase-install download the installer as a .pkg instead of build one.

I'd also suggest adding the option "--build=21G115" if you specifically want 12.6 to be installed.


Thanks. I had to use the --pkg option,because we use DLP and it was blocking the saving of the .dmg, but when I used the --pkg option it worked.


SMR1
Forum|alt.badge.img+13
  • Valued Contributor
  • October 6, 2022

For M1's, if we utilize bootstrap tokens, will it bypass the user prompt to enter password? 


sdagley
Forum|alt.badge.img+25
  • Jamf Heroes
  • October 6, 2022

For M1's, if we utilize bootstrap tokens, will it bypass the user prompt to enter password? 


@SMR1 The bootstrap token will allow Jamf Pro to trigger an update via an MDM command, but it cannot be used for a scripted update such as erase-install.


SMR1
Forum|alt.badge.img+13
  • Valued Contributor
  • October 6, 2022

@SMR1 The bootstrap token will allow Jamf Pro to trigger an update via an MDM command, but it cannot be used for a scripted update such as erase-install.


That's what I thought, but thought I would check. Thanks for the assistance.


Forum|alt.badge.img+1
  • New Contributor
  • May 25, 2023

So, i used the erase-install.sh script, pushed and activated by policy, and pushed it out to my two current test machines.  They ran the updates as requested, but I lost the JamfConnect login window.   The update polic isn't registering as completed, the test machines are just sitting in pending, and when I tired to push out an auth-changer policy, it is also sitting in pending, with no progress being made.  I need help with this.


Did you ever get to the bottom of this?


binjali
Forum|alt.badge.img+7
  • Author
  • Contributor
  • May 25, 2023

Did you ever get to the bottom of this?


Eh, not really. Got pulled off by a series of cascading fires and haven't been able to get back.  Maybe i'll get to understand this one day.


Forum|alt.badge.img+5
  • New Contributor
  • July 25, 2023

So, i used the erase-install.sh script, pushed and activated by policy, and pushed it out to my two current test machines.  They ran the updates as requested, but I lost the JamfConnect login window.   The update polic isn't registering as completed, the test machines are just sitting in pending, and when I tired to push out an auth-changer policy, it is also sitting in pending, with no progress being made.  I need help with this.


It seems like any Major OS upgrade will cause the Jamf Connect window to disappear. 

What I did to resolve this was create a policy that runs the a script to reset authchanger on login.
I actually have this ongoing, since the JC window likes to disappear on me for unknown reasons besides the upgrade.

Script to run

 

authchanger -reset -JamfConnect

 

 This could likely also be run from the Execute Command field in Files & Processes.

After they login for first time without the JC window it should come back.
There may be other solutions to this issue but this works for me.


Forum|alt.badge.img+9
  • Contributor
  • September 27, 2023

Eh, not really. Got pulled off by a series of cascading fires and haven't been able to get back.  Maybe i'll get to understand this one day.


I'm now facing this same scenario. I'm wondering if adding

authchanger -reset -JamfConnect

to the beginning of the script wouldn't do the trick. I'll test it out and let you know.


Forum|alt.badge.img+9
  • Contributor
  • September 27, 2023

I'm now facing this same scenario. I'm wondering if adding

authchanger -reset -JamfConnect

to the beginning of the script wouldn't do the trick. I'll test it out and let you know.


This approach seems to work