Home Forums Software InstaDMG firstboot.pkg / iceberg / casper

Viewing 15 posts - 1 through 15 (of 25 total)
  • Author
    Posts
  • #379292
    nobrainer
    Participant

    I’m was reading the deployment guide (http://www.osxdeployment.info/wiki/InstaUp2Date_Guide) and was trying to do a firstboot pkg (launchd, firstboot.sh and postflight.sh) to help alleviate some of the problems I’m having with scripts. I think I have the scripts and plists and stuff down that it asks for, but I don’t know how to get it packaged back up. I have iceberg and casper at my disposal, but iceberg seems a bit too complicated, and casper doesn’t allow me to create the pkg.

    Okay, so as I was typing this, I came across this link…https://www.afp548.com/forum/viewtopic.php?showtopic=19312
    ——

    Create a new “Package” project. Tip open the disclosure triangle and select “Scripts” (there seems to be a GUI issue, you may need to select “Settings” and then “Scripts” before the available “Installation Scripts” appears correctly). Under “Installation Scripts”, check “postflight” and “Choose…” your script. Keep an eye on exactly what your shell script assumes about the environment it’s running in–even though Installer is targeting /Volumes/Instadmg_Target, postflights run with a root of “/”. To rewrite the scripts appropriately, see the variables listed at “Some information is passed by the installer to these scripts when they are launched” here:

    ————–

    Which is info I need, but it doesn’t mention the launchd or firstboot.sh scripts…. any suggestions how I would go about doing those in Iceberg? What I would select under “scripts” and where I would put in the launchd item?

    Following that, do I put that into instadmg catalog or do I deploy that via the workflow through casper when I image a machine?

    #379293
    Allister Banks
    Participant

    Hey nobrainer,

    Mr. Kevin White has to gloss over a few details in his Peachpit Deployment book, but he doesn’t skimp on the instructions for using Apple’s Packagemaker, and it really has become more capable over the years(and is free). I can’t speak to Iceberg even though the dev is very helpful and has an ancillary project “Packages” which may be of interest to you as well. The new Composer is pretty slick, but I wish they solved all my Adobe problems for me! Got to give them a break since its so inexpensive though, and I think, although I’ve only used the newest version for a couple minutes, is very straightforward and friendly.

    Having said all that, you probably want to punt and just use a pre-made payload free package from Mr. Greg Neagle:

    Payload-free package template

    Zooming back in on your specific questions, /Library/LaunchAgents are considered better practice for repeating admin-created scripts, but I use a LaunchDaemon for my first-boot since I want it to be root and it self-removes so it doesn’t cause trouble. My payload-free package has a postflight script, which runs while instadmg installs the package, and cp’s the launchd.plist and firstboot.sh files from the resources folder of the package to $3/Library/Scripts/Admin-Added and $3/Library/LaunchDaemons, which automatically gets the plist loaded into launchctl on boot.

    Does that clarify these three moving parts a little more? Nate’s guide is great, but if you have feedback you should definitely let us know so we can all benefit from your learning process. Thanks,

    Allister

    #379294
    nobrainer
    Participant

    [QUOTE][u]Quote by: Allister[/u][p]Hey nobrainer,

    Mr. Kevin White has to gloss over a few details in his Peachpit Deployment book, but he doesn’t skimp on the instructions for using Apple’s Packagemaker, and it really has become more capable over the years(and is free). I can’t speak to Iceberg even though the dev is very helpful and has an ancillary project “Packages” which may be of interest to you as well. The new Composer is pretty slick, but I wish they solved all my Adobe problems for me! Got to give them a break since its so inexpensive though, and I think, although I’ve only used the newest version for a couple minutes, is very straightforward and friendly.

    Having said all that, you probably want to punt and just use a pre-made payload free package from Mr. Greg Neagle:

    Payload-free package template

    Zooming back in on your specific questions, /Library/LaunchAgents are considered better practice for repeating admin-created scripts, but I use a LaunchDaemon for my first-boot since I want it to be root and it self-removes so it doesn’t cause trouble. My payload-free package has a postflight script, which runs while instadmg installs the package, and cp’s the launchd.plist and firstboot.sh files from the resources folder of the package to $3/Library/Scripts/Admin-Added and $3/Library/LaunchDaemons, which automatically gets the plist loaded into launchctl on boot.

    Does that clarify these three moving parts a little more? Nate’s guide is great, but if you have feedback you should definitely let us know so we can all benefit from your learning process. Thanks,

    Allister [/p][/QUOTE]

    Thank you for getting back to me so quickly!

    I tried to get PackageMaker – but I don’t have a developer account handy and I heard iceberg was as good or better – and more importantly I could acquire it πŸ™‚

    I checked out the template, that seemed to be what i needed- I didn’t see anything about the firstboot script or plist – so i just added the cp command to copy to the postflight script sending the files to the folders you mentioned. guess I will see if that works. Theoretically – if I push the pkg to a system, it should run it, just to see if it works before it gets bundled.

    #379296
    dead2sin
    Participant

    That is a good resource that Allister linked there. I use Greg Negle’s blog for reference a lot due to his great documentation on the various issues that we all run into eventually. That Packagemaker template will work quite well if you can get the postflights figured out. I’ll write up a Composer Guide for the firstboot package when I have time (Beginning of the semester rush right now, so things are rather hectic).

    I prefer Composer personally, but as Allister said PackagerMaker has become more then capable with the last couple of updates and Packages looks very promising as well. InstallEASE also has a free packaing app if I am not mistaken. The only reason I chose to mention Composer in that guide was because its my main go-to Packaging App simply because I’ve used it for the past 2 years and don’t feel like learning PackageMaker πŸ˜€

    Let us know if you get the firstboot package working or if you have issues getting it going.

    Nate

    #379299
    nobrainer
    Participant

    [QUOTE][u]Quote by: dead2sin[/u][p]That is a good resource that Allister linked there. I use Greg Negle’s blog for reference a lot due to his great documentation on the various issues that we all run into eventually. That Packagemaker template will work quite well if you can get the postflights figured out. I’ll write up a Composer Guide for the firstboot package when I have time (Beginning of the semester rush right now, so things are rather hectic).

    I prefer Composer personally, but as Allister said PackagerMaker has become more then capable with the last couple of updates and Packages looks very promising as well. InstallEASE also has a free packaing app if I am not mistaken. The only reason I chose to mention Composer in that guide was because its my main go-to Packaging App simply because I’ve used it for the past 2 years and don’t feel like learning PackageMaker πŸ˜€

    Let us know if you get the firstboot package working or if you have issues getting it going.

    Nate[/p][/QUOTE]

    I don’t think it worked… well, it sort of worked…. it didn’t do teh firstboot.sh or the launchd…. here’s the info from where it failed from the instadmg debug log.

    PHASE:Writing files…
    %8.398202
    PackageKit: Shoving /private/tmp/InstaDMG_temp_folder.0ytAaf/mount_point.f8eT5k/.PKInstallSandbox-tmp/Root (1 items) to /tmp/InstaDMG_temp_folder.0ytAaf/mount_point.f8eT5k
    PackageKit: Executing script “./postflight” in /Users/macadmin/instadmg/InstallerFiles/InstaUp2DatePackages/payload-free.pkg/Contents/Resources
    ./postflight: cp: firstboot.sh: No such file or directory
    ./postflight: cp: com.shc.firstboot.plist: No such file or directory
    Installed “payload-free” ()
    PackageKit: —– End install —–

    I modified the pkg’s postflight.sh script with the following…

    cp firstboot.sh $3/Library/Scripts/Admin-Added
    cp com.shc.firstboot.plist $3/Library/LaunchDaemons

    my understanding was that if I copy the stuff to the folder, it would launch automatically the next time the system booted.

    #379300
    dead2sin
    Participant

    This is in rough form, but here is a basic guide for customizing a Firstboot.pkg:

    [url]http://www.osxdeployment.info/wiki/Firstboot_Package_Guide[/url]

    Nate

    #379309
    nobrainer
    Participant

    [QUOTE][u]Quote by: dead2sin[/u][p]This is in rough form, but here is a basic guide for customizing a Firstboot.pkg:

    [url]http://www.osxdeployment.info/wiki/Firstboot_Package_Guide[/url]

    Nate[/p][/QUOTE]

    Thank you for the info! I’ve been trying to download the PackageMaker thing all flippin morning, download keeps bombing out @ 2gig… i’ve tried from machines here at our office, our Chicago branch and our NY branch, all of them bomb out. (Mac’s and PCs). Finally flipped over to our ‘guest’ network and lo and behold it’s past the 2 gig mark… but it’s going @ around 200k / second…. soooo slooowwww….

    While I wait for that to download, I’m gonna post another question re: kickstart and VNC πŸ™‚

    Thank you again for all your help!

    #379316
    nobrainer
    Participant

    The more I work on this, the more questions I have, thank you for your continued patience with me!

    ——————————-

    These catalogs are all set up and ready to go. Using the include-file: part of the catalogs chains them all together. When we call Snowleopard.catalog with InstaUp2Date, it will process them in the following order:
    10.6_Vanilla.catalog –> Common.catalog –> Base.catalog –> Snowleopard.catalog

    This ensures that everything gets installed in the correct order throughout the process.
    [edit]

    ——————————-

    I’m workin through the tutorial on this, and I was wondering if there is any benefit to do it this way vs just modifying the 1 catalog for 10.6_Vanilla?

    I’m not loading iLife, or anything like that…basically, I have it running the Updates from instaup2date + clearreg, 2 admin accounts… and now this firstboot….

    Would it behoove me to layer stuff as recommended via catalogs?

    Would it make sense to put the firstboot.pkg separate from InstaDMG and do it as part of the Casper workflow? My thinking is then I can have a firstboot that will set the proper timezone for where the machine will ultimately be located (PST, MST, CST, or EST)?

    #379317
    dead2sin
    Participant

    If you ever intend upon doing more then one image, I would highly suggest seperating stuff out from the beginning with future images in mind (so it would need to be a logical seperation, stuff that you know ALL images will get goes in common.catalog, etc).

    If you only have one image and will always have only one image, then you could definitely put it in to one catalog and not worry about it. At the very least, I would leave 10.6_vanilla alone and make your image.catalog include 10.6_vanilla. That way, you can grab an updated vanilla from the instadmg google code site and not have to sieve through the changes and figure out what needs to be updated and what doesn’t, etc.

    So at the least, 10.6_vanilla.catalog –> MyImage.catalog and at the most (and for multiple images) I would do 10.6_vanilla–>Common.catalog–>BaseLab.catalog (Shared between several lab images for instance)–>SpecificImage.catalog (Specific software beyond the base.catalog).

    Again, that is my preference. I’m always looking for ways to make it less painful for myself in the future and I find that splitting things out in a smart manner saves a bunch of cutting and pasting between catalogs down the road.

    Nate

    #379318
    nobrainer
    Participant

    [QUOTE][u]Quote by: dead2sin[/u][p]If you ever intend upon doing more then one image, I would highly suggest seperating stuff out from the beginning with future images in mind (so it would need to be a logical seperation, stuff that you know ALL images will get goes in common.catalog, etc).

    If you only have one image and will always have only one image, then you could definitely put it in to one catalog and not worry about it. At the very least, I would leave 10.6_vanilla alone and make your image.catalog include 10.6_vanilla. That way, you can grab an updated vanilla from the instadmg google code site and not have to sieve through the changes and figure out what needs to be updated and what doesn’t, etc.

    So at the least, 10.6_vanilla.catalog –> MyImage.catalog and at the most (and for multiple images) I would do 10.6_vanilla–>Common.catalog–>BaseLab.catalog (Shared between several lab images for instance)–>SpecificImage.catalog (Specific software beyond the base.catalog).

    Again, that is my preference. I’m always looking for ways to make it less painful for myself in the future and I find that splitting things out in a smart manner saves a bunch of cutting and pasting between catalogs down the road.

    Nate[/p][/QUOTE]

    Oh, makes sense. We do have 2 images… 10.5 for PPCs and 10.6.x for Intel. I wasn’t sure if the multiple catalog files was due to the the extra pkg files, or if the img needed to be closed and opened in between (like a reboot type thing), and for just my general knowledge (if I know why I’m doing something, it’s easier for me to process in my mind).

    #379330
    nobrainer
    Participant

    Okay, so I followed precisely the instructions ([url]http://www.osxdeployment.info/wiki/InstaUp2Date_Guide[/url]) (and created the 3 catalog files), and I don’t think the firstboot ran. It didn’t enable the remote desktop (ARD / VNC), time server wasn’t set (because we ship all over, I left the timezone out), IPV6 is still enabled, etc.

    I added it to instadmg, which said the pkg was loaded successfully, and there was no errors in the build logs or anything that I could tell…

    What am I missing? I’m so close I can taste it! Oh wait… that was leftover from lunch.

    #379331
    dead2sin
    Participant

    [QUOTE][u]Quote by: nobrainer[/u][p]Okay, so I followed precisely the instructions ([url]http://www.osxdeployment.info/wiki/InstaUp2Date_Guide[/url]) (and created the 3 catalog files), and I don’t think the firstboot ran. It didn’t enable the remote desktop (ARD / VNC), time server wasn’t set (because we ship all over, I left the timezone out), IPV6 is still enabled, etc.

    I added it to instadmg, which said the pkg was loaded successfully, and there was no errors in the build logs or anything that I could tell…

    What am I missing? I’m so close I can taste it! Oh wait… that was leftover from lunch.

    [/p][/QUOTE]

    Check your system.log for errors. If any of the commands didn’t work, many times you can find a hint of what went wrong there. It sounds to me like the firstboot files didn’t get put there at all, or perhaps the permissions on the launchd item were incorrect and it didn’t run.

    Nate

    #379335
    nobrainer
    Participant

    [QUOTE][u]Quote by: dead2sin[/u][p][QUOTE][u]Quote by: nobrainer[/u][p]Okay, so I followed precisely the instructions ([url]http://www.osxdeployment.info/wiki/InstaUp2Date_Guide[/url]) (and created the 3 catalog files), and I don’t think the firstboot ran. It didn’t enable the remote desktop (ARD / VNC), time server wasn’t set (because we ship all over, I left the timezone out), IPV6 is still enabled, etc.

    I added it to instadmg, which said the pkg was loaded successfully, and there was no errors in the build logs or anything that I could tell…

    What am I missing? I’m so close I can taste it! Oh wait… that was leftover from lunch.

    [/p][/QUOTE]

    Check your system.log for errors. If any of the commands didn’t work, many times you can find a hint of what went wrong there. It sounds to me like the firstboot files didn’t get put there at all, or perhaps the permissions on the launchd item were incorrect and it didn’t run.

    Nate[/p][/QUOTE]

    Permissions? I didn’t change any, I set the scripts to +x but didn’t change anything else…

    I looked through any log I thought might have something to do with it, and all I could find was was that the pkg was installed… nothing (successful or unsuccessful) about actually running the firstboot or scripts or anything. I did find the time server was off, but that was supposed to be taken care of via the script….

    #379336
    dead2sin
    Participant

    [QUOTE][u]Quote by: nobrainer[/u][p][QUOTE][u]Quote by: dead2sin[/u][p][QUOTE][u]Quote by: nobrainer[/u][p]Okay, so I followed precisely the instructions ([url]http://www.osxdeployment.info/wiki/InstaUp2Date_Guide[/url]) (and created the 3 catalog files), and I don’t think the firstboot ran. It didn’t enable the remote desktop (ARD / VNC), time server wasn’t set (because we ship all over, I left the timezone out), IPV6 is still enabled, etc.

    I added it to instadmg, which said the pkg was loaded successfully, and there was no errors in the build logs or anything that I could tell…

    What am I missing? I’m so close I can taste it! Oh wait… that was leftover from lunch.

    [/p][/QUOTE]

    Check your system.log for errors. If any of the commands didn’t work, many times you can find a hint of what went wrong there. It sounds to me like the firstboot files didn’t get put there at all, or perhaps the permissions on the launchd item were incorrect and it didn’t run.

    Nate[/p][/QUOTE]

    Permissions? I didn’t change any, I set the scripts to +x but didn’t change anything else…

    I looked through any log I thought might have something to do with it, and all I could find was was that the pkg was installed… nothing (successful or unsuccessful) about actually running the firstboot or scripts or anything. I did find the time server was off, but that was supposed to be taken care of via the script….
    [/p][/QUOTE]

    Permissions are set per item within packagemaker. You can decide what permissions the file will have once they are delivered. It looks like I might of messed up the permissions on the launchd item itself (com.company.firstboot.plist). In PackageMaker, under Contents, try changing the permissions for the item to owner Root group Wheel and make sure it has RW, R, R permissions at the bottom (Read, Write for owner, Read for Groups and Read for Others.).

    I’ll fix it and repost a fixed version in a bit, but go ahead and try that and see if it helps. As far as system.log is concerned, once you’ve applied the image, it should show on the system you’ve deployed it to in the system.log file if it did run or if there was an error that prevented it from running.

    Nate

    #379338
    nobrainer
    Participant

    I think that was it!

    Seems like it’s working now! Thank you so much! I’ve manage to deploy it across the intel based machines we have w/o issue and all the settings seem to be working properly!

    Thank you so much!

Viewing 15 posts - 1 through 15 (of 25 total)
  • You must be logged in to reply to this topic.

Comments are closed