Home Forums Software InstaDMG First Boot issues

Viewing 15 posts - 1 through 15 (of 21 total)
  • Author
    Posts
  • #379861
    mgb123
    Participant

    I’m experiencing issues with the Firstboot package and was hoping to reach out for assistance.

    To the best of my understanding – the Firstboot package carries out the following:
    -Package installs
    *Installs firstboot.plist in Library/Launchd
    *Installs firstboot.sh in Library/Scripts/(Insert your company/institution name here)
    -Package Runs postflight on image being created
    *Sets a number of ‘pre-boot’ settings which are baked into the image

    As a result the image will have a number of settings that are set into the image, and a number of settings that are dormant but will be implemented on the first successful boot of the machine.

    I’ve used the info at the OS X Deployment Wiki – including the Firstboot template.

    I’ve noticed the following:
    -The firstboot.sh script isn’t proceeded by #!/bin/sh ([b]should[/b] it be?)
    -There’s no mention of how to set the permissions on the /Library/Scripts/(insert your compnay/institution name here) directory. As a result, though I’ve ensured proper permissions on the script itself, I’m unsure of how to so for the directory. Currently my scripts directory is shows as ‘no access’.
    -The firsboot.sh script doesn’t run at startup, or delete itself afterwards. Most of the postflight settings don’t seem to have applied either.

    I’m happy to post my actual scripts, and would appreciate any feedback.

    #379866
    dead2sin
    Participant

    1. Yes, #!/bin/bash at the beginning of the script is desired. It indicates what type of script it is. This is common across all bash scripts.
    2. Permissions are in step 6 towards the very end of the guide. Some others have run into this problem so I corrected the guide about a week ago with this info as follows:
    [quote]Check the permissions on each item. Click each item on the left and select the contents section. The launchd item MUST be set to owner: root and group: wheel, permissions set to 644. If they are not set to this, the launchditem will never load the firstboot script. There are some issues with this and PackageMaker, so be 100% the permissions are set correctly and being applied correctly
    [/quote]

    3. If the firstboot script runs, it will apply settings and then delete itself. If it isn’t deleted, the the permissions are most likely wrong and it never ran. If it is not present and the settings are not set, I’d check InstaDMG logs to confirm it was installed correctly (Or you can mount the image that was created and check for the presence of the script, this is probably the easiest way to go about it).

    If you still have issues, feel free to post the script here to have people look over it or hop on ##osx-server on irc.freenode.net. There are always people around that are willing to help 🙂

    Nate

    #379868
    mgb123
    Participant

    I checked my permissions, they seem fine- one followup question then is, how do I set the permissions for the folder that I’m putting the script in?

    For instance, if I tell Packagemaker that I want the script in /Library/Scripts/The_greatest_company_ever/firstboot.sh – by selecting the firstboot file and then listing /Library/Scripts/The_greatest_company_ever/ as the destination, my firstboot.sh permissions are fine, but the folder The_greatest_company_ever is marked as no access.

    I thought perhaps the best way to deal with this would be to put the folder itself in the package, and then mark the permissions as 644 (which is drw-r–r– right?) but this didn’t seem to work either.

    I’m doing another test image right now, I’ll post my progress. Thanks very much for the response!

    #379869
    mgb123
    Participant

    Nate,

    I checked my permissions, everything seems to be in order- any chance that the 10.6.5 update hosed something with regards to Launchd?

    #379872
    dead2sin
    Participant

    I’ll have to double check, but I just build an image this morning and tested it, everything in the firstboot seemed to run just fine.

    Does the firstboot.sh script exist if you just mount the image and go to /Library/LaunchDaemons/ ?

    Are any of the settings actually set that are present in the firstboot.sh script?

    Nate

    #379875
    mgb123
    Participant

    Nate- first off thanks very much for your time on this.

    The script and the plist both exist. The error that I was getting in console is: Permission Denied, so chmod’ed the permissions to 644 – then I tried to run the script from the command line and got the following error: command not found – which was Odd, since I was looking at the firstboot.sh script.

    One last attempt prior to calling it a night – sudo sh./firstboot.sh – and BAM everythign ran, and the machine rebooted. The changes implemented in the script have applied.

    As a side note, the script deleted the .plist file, but the script didn’t self destruct- it’s still there in the directory.

    So – I’m guessing that I’ve missed something in my plist – maybe?

    #379876
    dead2sin
    Participant

    Post your launchd item and your script and I’ll take a gander.

    Nate

    #379882
    mgb123
    Participant

    [code]

    Label
    com.mycompanyisbetterthanyourcompay.firstboot
    ProgramArguments

    /Library/Scripts/firstboot.sh

    QueueDirectories

    RunAtLoad
    WatchPaths

    [/code]

    #379883
    dead2sin
    Participant

    That looks right. How about the script itself? Just clean up any sensitive info first 🙂

    Nate

    #379885
    mgb123
    Participant

    I tried to post my code, but it’s getting flagged as spam- any ideas.

    #379886
    dead2sin
    Participant

    I like [url]http://pastebin.com/[/url]. You can set it to automatically expire after X amount of time.

    Nate

    #379892
    mgb123
    Participant

    I tried posting my code but it doesn’t seem to work – append this to the end of the pastebin dot com site name /pB25VVjU

    #379896
    dead2sin
    Participant

    I’m getting pretty sick of this spam detected feature. I can’t even respond to what you are saying without it saying its spam.

    Open this: [url]http://pastebin.com/K4GGU1bc[/url]

    Nate

    #379897
    mgb123
    Participant

    Nate – Got the note – just to be clear, though my permissions are correct, the script doesn’t run at all unless I run it manually after booting. All settings are Running the script manually is odd too – – the script won’t run with the plain ‘ole ./firstboot.sh – it requires that I specify sh./firstboot.sh – is that normal?

    I’m going to make the change to the running of the script in the .plist and see if that will resolve the running- I’m curious as to why my script requires this but no one else seems to have encountered it.

    I’ll make the adjustments to the reboot/kill sequence that you specify.

    Thanks for your help on this!

    #379898
    dead2sin
    Participant

    [QUOTE][u]Quote by: mgb123[/u][p]Nate – Got the note – just to be clear, though my permissions are correct, the script doesn’t run at all unless I run it manually after booting. All settings are Running the script manually is odd too – – the script won’t run with the plain ‘ole ./firstboot.sh – it requires that I specify sh./firstboot.sh – is that normal?

    I’m going to make the change to the running of the script in the .plist and see if that will resolve the running- I’m curious as to why my script requires this but no one else seems to have encountered it.

    I’ll make the adjustments to the reboot/kill sequence that you specify.

    Thanks for your help on this![/p][/QUOTE]

    Ahhh, yea. You shouldn’t have to do sh ./firstboot.sh. Try doing chmod +x on it to make it executable and see what happens. I wonder if that is why it is not running. Try the chmod +x then reboot the machine. If it runs and deletes itself, you know what the issue is.

    Nate

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

Comments are closed