- This topic has 3 replies, 3 voices, and was last updated 15 years, 4 months ago by
Chris George.
-
AuthorPosts
-
May 19, 2011 at 5:20 pm #380740
themacdweeb
ParticipantHey gang,
Coming along nicely with my scripting and packaging with instaDMG and instaUp2Date, so I’d really like to thank to Walt, Alister, Larkost and the others who’ve blazed an awesome trail and continue to actively post here. Thanks, y’all.
Where I’m at: after testing each component of my postflight and firstboot scripts on other machines to confirm syntax and proper functioning, I’ve got everything ACCEPT the PlistBuddy calls working. Can’t figure out why so I’m asking for your input here. Also seeing that some but not all of the packages I’ve got in the instaUp2Date cue are laying down (but I’ll save that for another thread).
Here’s what I got so far. Perhaps this will be helpful to others in some way. I’m sure I’m missing something silly like a quote or a bracket or something… so you UNIX masters, please do chime in, won’t’cha?
Many thanks,
David[code]#——————-
# Definitions
#——————-# — services —
defaults=”/usr/bin/defaults”
plist=”/usr/libexec/PlistBuddy”# — plists —
labels=”com.apple.labels”
finder=”com.apple.finder”
sidebar=”com.apple.sidebarlists.plist”
getty=”edu.getty.firstboot”# — directories —
ROOT=”$3/”
PKG_DIR=”$1/Contents/Resources”
SCRIPTS_DIR=”$3/Library/Scripts/Getty”
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”
CURRENT_USER=`ls -l /dev/console | awk ‘{ print $3 }’`# — utilities —
DYLD=”$3/usr/bin/update_dyld_shared_cache”#——————-
# Installations
#——————-# INITIAL SETUP: creates scripts directory, copy firstboot script there, set launchd properly.
mkdir “${SCRIPTS_DIR}”
cp “${PKG_DIR}/firstboot.sh” “${SCRIPTS_DIR}”
$defaults write “${LAUNCHD_DIR}/${getty}” Label edu.getty.firstboot
$defaults write “${LAUNCHD_DIR}/${getty}” ProgramArguments -array
$plist -c “Add :ProgramArguments:Item\ 1 string /Library/Scripts/Getty/firstboot.sh” “${LAUNCHD_DIR}/${getty}.plist”
$defaults write “${LAUNCHD_DIR}/${getty}” RunAtLoad -bool YES
chown root:wheel “${LAUNCHD_DIR}/${getty}.plist”
chmod 644 “${LAUNCHD_DIR}/${getty}.plist”#——————————————————————-
# Modifications
#
# No users are created, so we can only modify the user template
# for use with all future user accounts created
#——————————————————————-# Update dynamic libraries
$DYLD -universal_boot -root $ROOT# DESKTOP PREFS: show all media & servers, arranged by “kind”
$defaults write “${USERPREFS_DIR}/${finder}” ShowMountedServersOnDesktop 1
$defaults write “${USERPREFS_DIR}/${finder}” ShowRemovableMediaOnDesktop 1
$defaults write “${USERPREFS_DIR}/${finder}” ShowExternalHardDrivesOnDesktop 1
$defaults write “${USERPREFS_DIR}/${finder}” ShowHardDrivesOnDesktop 1
$plist -c “Set :StandardViewSettings:IconViewSettings:arrangeBy kind” “${USERPREFS_DIR}/${finder}.plist”# SIDEBAR PREFS: Show all sidebar icons except back to my mac & bonjour
$plist -c “Set :networkbrowser:CustomListProperties:com.apple.NetworkBrowser.bonjourEnabled 0” “${USERPREFS_DIR}/${sidebar}”
$plist -c “Set :networkbrowser:CustomListProperties:com.apple.NetworkBrowser.backToMyMacEnabled 0” “${USERPREFS_DIR}/${sidebar}”
$plist -c “Set :networkbrowser:CustomListProperties:com.apple.NetworkBrowser.connectedEnabled 1” “${USERPREFS_DIR}/${sidebar}”
$plist -c “Set :systemitems:ShowEjectables 1” “${USERPREFS_DIR}/${sidebar}”
$plist -c “Set :systemitems:ShowHardDisks 1” “${USERPREFS_DIR}/${sidebar}”
$plist -c “Set :systemitems:ShowRemovable 1” “${USERPREFS_DIR}/${sidebar}”
$plist -c “Set :systemitems:ShowServers 1” “${USERPREFS_DIR}/${sidebar}”# LOGIN WINDOW PREFS: show blank username/password fields & custom welcome text
$defaults write “${PREFS_DIR}/com.apple.loginwindow” SHOWFULLNAME -bool YES
$defaults write “${PREFS_DIR}/com.apple.loginwindow” LoginwindowText “Welcome to the J. Paul Getty Network”# FINDER LABEL PREFS: set to have funny names
$defaults write “${USERPREFS_DIR}/${labels}” Label_Name_6 These
$defaults write “${USERPREFS_DIR}/${labels}” Label_Name_7 Are
$defaults write “${USERPREFS_DIR}/${labels}” Label_Name_5 The
$defaults write “${USERPREFS_DIR}/${labels}” Label_Name_2 Colors
$defaults write “${USERPREFS_DIR}/${labels}” Label_Name_4 That
$defaults write “${USERPREFS_DIR}/${labels}” Label_Name_3 You
$defaults write “${USERPREFS_DIR}/${labels}” Label_Name_1 Crave# DIALOG BOX PREFS: set “Save as” & “print” boxes to expanded view
$defaults write -g “${USERPREFS_DIR}/${finder}” NSNavPanelExpandedStateForSaveMode -bool YES
$defaults write “${PREFS_DIR}/.GlobalPreferences” PMPrintingExpandedStateForPrint -bool TRUE# SAFARI PREFS: set homepage and show status bar
$defaults write “${USERPREFS_DIR}/com.apple.Safari” HomePage go/
$defaults write “${USERPREFS_DIR}/com.apple.Safari” ShowStatusBar -bool YES# NETWORK PREFS: disable .ds-store files on Network Shares
$defaults write “${PREFS_DIR}/com.apple.desktopservices” DSDontWriteNetworkStores true# MICE PREFS: set Apple Mice to have both right/left buttons
$defaults write “${USERPREFS_DIR}/com.apple.driver.AppleHIDMouse” Button1 -integer 1
$defaults write “${USERPREFS_DIR}/com.apple.driver.AppleHIDMouse” Button2 -integer 2
$defaults write “${USERPREFS_DIR}/com.apple.driver.AppleBluetoothMultitouch.mouse” MouseButtonMode TwoButtonexit 0[/code]
May 19, 2011 at 6:03 pm #380741Allister Banks
ParticipantHey David,
Right back atcha!
Sorry to not directly answer your question at first, but I’d recommend moving as much of this as you can towards being managed via MCX(local or from a central directory service) – it clears up having to dip into the userTemplate, even though many folks make similar adjustments with a loginHook. I’d also think the dyld_shared_chache command is unnecessary. Logging or simply echoing to stdout would help you get to the bottom of things. Also, many people are dropping wholly-formed launchd plists instead of building the line-by-line.Allister
May 19, 2011 at 6:35 pm #380743themacdweeb
Participantalister:
right on.
for a variety of reasons, we’re not using MCX centrally at this point. we will soon i hope and, until then, i get to practice my unix and injecting schtuff into the user template. but i hear you, trust me. as for creating whole plists, I’ve been experimenting with that over the past 24 hours. in essence, i’m tailoring what i have, snapshotting via casper’s composer app (love that thing) and then dropping the pkgs into the instaUp2Date build. we’ll see how that works as i’ve now captured things like: sidebar plists and others.
i’ll check out your idea of echoing to stdout but, again, i’m assuming i’m missing something small in my syntax… usually the case.
d
May 21, 2011 at 11:47 pm #380753Chris George
Participant[QUOTE][u]Quote by: themacdweeb[/u][p]alister:
right on.
for a variety of reasons, we’re not using MCX centrally at this point. we will soon i hope and, until then, i get to practice my unix and injecting schtuff into the user template. but i hear you, trust me. as for creating whole plists, I’ve been experimenting with that over the past 24 hours. in essence, i’m tailoring what i have, snapshotting via casper’s composer app (love that thing) and then dropping the pkgs into the instaUp2Date build. we’ll see how that works as i’ve now captured things like: sidebar plists and others.
i’ll check out your idea of echoing to stdout but, again, i’m assuming i’m missing something small in my syntax… usually the case.
d[/p][/QUOTE]You can still do local MCX, on a per-machine basis. The functionality is the same, it’s just the MCX settings are all stored on each individual machine instead of a central directory service. Here’s a page that describes the process:
[url]http://managingosx.wordpress.com/2008/02/07/mcx-dslocal-and-leopard/[/url]And Utah has prepared a presentation that shows the same:
[url]http://www.macos.utah.edu/documentation/administration/local_mcx.html[/url] -
AuthorPosts
- You must be logged in to reply to this topic.
Comments are closed