Home Forums Software InstaDMG Firstboot package causing network printing issues

Viewing 1 post (of 1 total)
  • Author
    Posts
  • #381676
    bw38
    Participant

    I’m having an issue with my Snow Leopard image where the firstboot package somehow breaks network printing. It is very strange. Print job will never actually send. Print queue gets as far as “Copying Print Job…” and then “Connected to Printer” but the job never gets sent.
    I’ve isolated it to that one package after a bunch of troubleshooting. Tried recreating it and commenting out potential culprits. But I’m not having any luck. The Snow Leopard image at this point only contains the Apple updates, the firstboot package, clearReg.pkg, and CreateUser.pkg. The last two aren’t the issue. Here’s the kicker: this package does not seem to affect my OS X Lion image at all.

    Here is what I have for the postflight:

    [code]#!/bin/sh

    # Standard settings for images.
    # Script is meant to be run as a postflight script in a .pkg file. Also installs startup settings script as a Launchd item which is inside the package /Contents/Resources directory.

    ##### Begin Declare Variables Used by Script #####

    # Declare ‘defaults’and ‘PlistBuddy’.

    defaults=”/usr/bin/defaults”
    PlistBuddy=”/usr/libexec/PlistBuddy”

    # Declare directory variables.

    PKG_DIR=”$1/Contents/Resources”
    SCRIPTS_DIR=”$3/Library/Scripts/CompanyName”
    LAUNCHD_DIR=”$3/Library/LaunchDaemons”
    PRIVETC_DIR=”$3/private/etc”
    PREFS_DIR=”$3/Library/Preferences”
    USERPREFS_DIR=”$3/System/Library/User Template/English.lproj/Library/Preferences”
    NONLOC_USERPREFS_DIR=”$3/System/Library/User Template/Non_localized/Library/Preferences”
    ROOT=”$3/”
    UPDATE_DYLD=”$3/usr/bin/update_dyld_shared_cache” # Set variable to location of update_dyld_shared_cache command on target volume.

    ##### End Declare Variables Used by Script #####

    ##### Begin Preference Setting #####

    # These settings can be set on the target volume before startup.

    # Run update_dyld_shared_cache
    $UPDATE_DYLD -universal_boot -root $ROOT

    # Display login window as Name and Password.
    $defaults write “${PREFS_DIR}/com.apple.loginwindow” SHOWFULLNAME -bool YES

    #Starts the Flurry screensaver over the login window when idle for 60 seconds
    $defaults write “${PREFS_DIR}/com.apple.screensaver” loginWindowIdleTime -int 60
    $defaults write “${PREFS_DIR}/com.apple.screensaver” loginWindowModulePath “/System/Library/Screen Savers/Flurry.saver”

    # Sets autologout to 60 minutes and enables it
    #$defaults write “${PREFS_DIR}/.GlobalPreferences” com.apple.autologout.AutoLogOutDelay -int 3600

    # Use encrypted virtual memory.
    $defaults write “${PREFS_DIR}/com.apple.virtualMemory” UseEncryptedSwap -bool Yes

    # Set Safari Preferences.
    $defaults write “${USERPREFS_DIR}/com.apple.Safari” HomePage “http://www.school.edu/”
    $defaults write “${USERPREFS_DIR}/com.apple.Safari” ShowStatusBar -bool YES

    # Set Finder Prefereces.
    $defaults write “${USERPREFS_DIR}/com.apple.finder” ShowMountedServersOnDesktop -bool YES

    # Enables Double Click Title bar to Minimize Window
    $defaults write “${NONLOC_USERPREFS_DIR}/.GlobalPreferences” AppleMiniaturizeOnDoubleClick -bool TRUE

    # No .ds-store files on Network Shares
    $defaults write “${PREFS_DIR}/com.apple.desktopservices” DSDontWriteNetworkStores true

    # Globally Set Expanded Print Dialouge Box.
    #$defaults write “${PREFS_DIR}/.GlobalPreferences” PMPrintingExpandedStateForPrint -bool TRUE

    # Use short-name for logging into Network Shares
    $defaults write “${PREFS_DIR}/com.apple.NetworkAuthorization” UseDefaultName -bool NO
    $defaults write “${PREFS_DIR}/com.apple.NetworkAuthorization” UseShortName -bool YES

    # Set Apple Mouse button 1 to Primary click and button 2 to Secondary click.
    $defaults write “${USERPREFS_DIR}/com.apple.driver.AppleHIDMouse” Button1 -integer 1
    $defaults write “${USERPREFS_DIR}/com.apple.driver.AppleHIDMouse” Button2 -integer 2

    # Set Apple Magic Mouse button 1 to Primary click and button 2 to Secondary click.
    $defaults write “${USERPREFS_DIR}/com.apple.driver.AppleBluetoothMultitouch.mouse” MouseButtonMode -string TwoButton

    # Set Apple Magic Mouse inertia scroll mode.
    $defaults write “${USERPREFS_DIR}/com.apple.driver.AppleBluetoothMultitouch.mouse” MouseMomentumScroll -bool YES

    # Disable Mouse reverse scrolling.
    #$defaults write “${USERPREFS_DIR}/.GlobalPreferences” com.apple.swipescrolldirection -bool false

    # Disable Time Machine Offers.
    $defaults write “${PREFS_DIR}/com.apple.TimeMachine” DoNotOfferNewDisksForBackup -bool YES

    # Disable Time Machine AutoBackup
    $defaults write “${PREFS_DIR}/com.apple.TimeMachine” AutoBackup 0

    # Enables SSH
    #$PlistBuddy -c “Delete Disabled” $3/System/Library/LaunchDaemons/ssh.plist

    # Allows any user to set dvd region
    #$PlistBuddy -c “Set :rights:system.device.dvd.setregion.initial:class allow” “$3″/etc/authorization

    # Firewall Settings | 0 = Off | 1 = On For Specific Services | 2 = On For Essential Services
    $defaults write “${PREFS_DIR}/com.apple.alf” globalstate -int 0

    # Activate “Require a password to unlock each System Preferences pane”
    $PlistBuddy -c “Set :rights:system.preferences:shared false” /private/etc/authorization

    ##### End Preferences Setting #####

    exit 0[/code]

    Here is what I have for the firstboot.sh:
    [code]#!/bin/sh

    ###
    # First Boot script that is used along with a launchd item. Delets both itself and the launchd item after completion.
    ###

    # Define ‘kickstart’ and’systemsetup’ variables, built in OS X script that activates and sets options for ARD.
    # Define ‘networksetup’.
    # Defines the location of the generic.ppd in OS X 10.6

    kickstart=”/System/Library/CoreServices/RemoteManagement/ARDAgent.app/Contents/Resources/kickstart”
    systemsetup=”/usr/sbin/systemsetup”
    networksetup=”/usr/sbin/networksetup”
    genericppd=”/System/Library/Frameworks/ApplicationServices.framework/Versions/A/Frameworks/PrintCore.framework/Versions/A/Resources/Generic.ppd”
    scutil=”/usr/sbin/scutil”
    diskutil=”/usr/sbin/diskutil”

    # determine the disk size
    #MYDISK=`df -H | awk ‘{print $2}’ | sed -n ‘2p’`
    # Set the name for the boot volume accordingly
    #$diskutil renameVolume / “Mac”$MYDISK”B”

    # Delete iMovie (Previous Version) Directory if it exists, because we don’t need it. Use when installing iLife using the original installers with InstaDMG.
    rm -R /Applications/iMovie\ \(previous\ version\).localized/

    # Check for network interfaces (on some models you might end up with no network connection otherwise)
    $networksetup -detectnewhardware

    # ARD Configuration
    #Enable ARD for localadmin
    #$kickstart -configure -allowAccessFor -specifiedUsers
    #$kickstart -activate -configure -access -on -users “localadmin” -privs -all -restart -agent

    # Set time zone and time server.
    $systemsetup -setusingnetworktime on
    $systemsetup -settimezone America/New_York -setnetworktimeserver time.apple.com

    # Allow user to set DVD region once upon first insertion of disc
    “$3″/usr/libexec/PlistBuddy -c “Set :rights:system.device.dvd.setregion.initial:class allow” “$3″/etc/authorization

    #Update NTP
    ntpdate -bvs time.apple.com

    # turn ipv6 off for both Ethernet and Airport – if MacPro, service names are different(since that is required form of option for -setipv6off flag)
    #$networksetup -setv6off Ethernet
    #$networksetup -setv6off Ethernet\ 1
    #$networksetup -setv6off Ethernet\ 2
    #$networksetup -setv6off Airport# ensure AirPort is turned off – if this is a MacBookAir or (non-CTO) MacPro, this will have no effect, since its specifying ‘hardware port’ or BSD device (not service name) en1
    #$networksetup -setairportpower en1 off

    #Disable Airport, another version
    # $networksetup -setnetworkserviceenabled AirPort off
    #OR disable airport only in a specific model. In this case on any iMac
    #if [ “`/usr/sbin/ioreg | grep iMac`” != “” ]; then
    # $networksetup -setnetworkserviceenabled AirPort off
    #fi

    # make FireWire networking inactive
    #$networksetup -setnetworkserviceenabled FireWire off

    # Activate WakeOnLAN.
    #$systemsetup -setwakeonnetworkaccess on

    #Kerberos-Enabled SSH Authentication. Also specifies which specific groups are allowed to ssh.
    #echo KerberosAuthentication yes >> /etc/sshd_config
    #echo KerberosOrLocalPasswd yes >> /etc/sshd_config
    #echo AllowGroups domaingroup admin >> /etc/sshd_config

    #Firewall Settings | 0 = Off | 1 = On For Specific Services | 2 = On For Essential Services
    #defaults write /Library/Preferences/com.apple.alf globalstate -int 0

    #Set System Sleep Preferences | 0 = Off | 15 = 15 Min | 20 = 20 Min | etc |
    pmset sleep 30

    # set bonjour, host and sharing names based on patch level and en0 (ethernet) mac address
    #LAST6_ENETADDY=`ifconfig en0 | grep ether | awk ‘{print $2}’ | sed ‘s/://g’ | cut -c 7-12 | tr [:lower:] [:upper:]`
    #PATCHLVL=`/usr/bin/defaults read “/System/Library/CoreServices/SystemVersion” ProductVersion | sed ‘s/[.]/-/g’`
    #$scutil –set LocalHostName “Imaged-$PATCHLVL-$LAST6_ENETADDY.local”
    #$scutil –set ComputerName “Imaged-$PATCHLVL-$LAST6_ENETADDY”
    #$scutil –set HostName “Imaged-$PATCHLVL-$LAST6_ENETADDY”

    # IF DeployStudio Sets HostName+LocalHostName, all you need is:
    $scutil –set HostName $(scutil –get LocalHostName)

    # Adds Printers
    #lpadmin -p “Printer Name” -L “Printer Location” -D “Printer Description” -E -v lpd://server/printqueue -P $genericppd -o printer-is-shared=false

    # Removes Time Machine from the menu
    defaults write com.apple.TimeMachine DoNotOfferNewDisksForBackup 1

    # Creating a new local account with guest properties but different name.
    # The user gets a warning that his data will be deleted on log out
    #dscl . -create /Users/visitor
    #dscl . -create /Users/visitor UserShell /bin/bash
    #dscl . -create /Users/visitor RealName “Visitor”
    #dscl . -create /Users/visitor UniqueID 201
    #dscl . -create /Users/visitor PrimaryGroupID 201
    #dscl . -create /Users/visitor NFSHomeDirectory /Users/Visitor
    #dscl . -create /Users/visitor RecordType dsRecTypeStandard:Users
    #dscl . -create /Users/visitor dsAttrTypeNative:_defaultLanguage en
    #dscl . -create /Users/visitor dsAttrTypeNative:_guest true
    #dscl . -create /Users/visitor dsAttrTypeNative:_writers__defaultLanguage visitor
    #dscl . -create /Users/visitor dsAttrTypeNative:_writers_jpegphoto visitor
    #dscl . -create /Users/visitor dsAttrTypeNative:_writers_LinkedIdentity visitor
    #dscl . -create /Users/visitor dsAttrTypeNative:_writers_picture visitor
    #dscl . -create /Users/visitor dsAttrTypeNative:_writers_UserCertificate visitor
    #dscl . -passwd /Users/visitor ”

    # Hide users with a UID below 500 from User Accounts under System Preferences.
    defaults write /Library/Preferences/com.apple.loginwindow Hide500Users -bool TRUE

    # Disables iCloud pop-up on first login for Macs running 10.7.2 or higher.
    #defaults write /System/Library/User\ Template/Non_localized/Library/Preferences/com.apple.SetupAssistant DidSeeCloudSetup -bool TRUE

    # Reboot in 1 minute
    #sleep 60
    #reboot

    # Delete the script and the launchd item.
    srm /Library/LaunchDaemons/edu.school.firstboot.plist
    srm “$0″[/code]

    With the exception of hiding UID below 500 and disabling iCloud, I got the rest from the osxdeployment wiki page on firstboot options. The package used to work fine once upon a time. Any assistance would be greatly appreciated.

Viewing 1 post (of 1 total)
  • You must be logged in to reply to this topic.

Comments are closed