running software update post image script

tlarkin
Honored Contributor

So

Due to my infrastructure and due to this flat package bug on the Apple side, I cannot add certain updates into my compiled image. I also do not have SUS servers set up anywhere, again because of my set up. I don't have the HD space locally and across the WAN from one single point to 6,000+ clients is just not gonna happened, I know because I already tried it.

So, I have a one liner that runs software update, and there are like 10 to 12 updates that I cannot fit into the compiled, they never install due to some bug I am told with flat packages. So, I just simply add this line in my script...

/usr/sbin/softwareupdate -d -i -a

Which should download and install all available updates. Well if I run this command manually from the command line after I image a mac, it works just fine, but if I run it as part of a script it does not take.

After that I have a reboot command that reboots the client after software update is ran from the command line.

Any thoughts on why this will not work?

4 REPLIES 4

tlarkin
Honored Contributor

Ugggg

After reading the manual page on the apple developer site, it seems if there is no user present you want to use a different environment switch to the command. Super face palm right now as I have spent all day working on this, and am testing it out now

/usr/sbin/softwareupdate COMMAND_LINE_INSTALL -i -a

Testing it out on my script right now

winkelhe
New Contributor

what does the system.log say about it?? what about converting the OS dmg to r/w, mounting it, download all the updates, use installer -pkg /path/to/update -target /path/to/mountedImage to update the image and then convert it back to read only? you can change the dmg name slightly and test prior to adding to a config and recompiling or even apply the updates right to the compiled config. might take a little longer on your end but saves time during imaging.

eric winkelhake
mundocomww
office 312 220 1669
cell 312 504 5155

tlarkin
Honored Contributor

My understanding that is the bug, because that is what the compiled does right? It just adds the installs do a disk image of the OS right? There is some bug where the new packages are now flat packages or something? They do not install on the disk image.

Unfortunately this part of the script flushes the logs so there are no logs, I will have to turn that part off I guess to help troubleshoot it.

tlarkin
Honored Contributor

OK so I popped open the console app once it logged in (I had to write a quick apple script to make a user log in during the process, don't ask why and there is no reason other than piece of mind for a co-worker) and you must disable scheduling for auto checks for software update, because if it auto checks during your command, it will kill your process. So here is the software update of my script

# log in as local admin to run software update tool

/usr/bin/osascript <<EndOfMyScript & tell application "System Events" keystroke "$admin1_short" keystroke return delay 3.0 keystroke "$admin1_passwd" delay 3.0 keystroke tab keystroke return keystroke return end tell EndOfMyScript

done

# now run software update to bypass known isntaller bugs in compiled images

/usr/sbin/softwareupdate --schedule off

/usr/sbin/softwareupdate COMMAND_LINE_INSTALL -a -i

Basically if you see a client sitting at the log in screen it has finished. I got a co-worker that did not like the idea of the machines sitting there at the log in screen doing nothing while running update. So, now if the machine is logged in, it is still updating, if it sits at the log in screen, it is done. Even though I enforced a reboot in the script as well. Some people I guess require visual tools when working.

So far this works as coded, so FYI if anyone was reading...I am still testing it out as we speak though

-Tom